|
@@ -175,7 +175,9 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
|
|
long newFiled = Long.parseLong(substring) + 1;
|
|
long newFiled = Long.parseLong(substring) + 1;
|
|
String substring1 = "key_" + newFiled;
|
|
String substring1 = "key_" + newFiled;
|
|
wbsFormElement.setEKey(substring1);
|
|
wbsFormElement.setEKey(substring1);
|
|
-
|
|
|
|
|
|
+ if (wbsFormElement.getEType() == 4) {
|
|
|
|
+ wbsFormElement.setELength(0);
|
|
|
|
+ }
|
|
int insert = baseMapper.insert(wbsFormElement);
|
|
int insert = baseMapper.insert(wbsFormElement);
|
|
if (insert > 0) {
|
|
if (insert > 0) {
|
|
String newName = wbsFormElement.getEKey();
|
|
String newName = wbsFormElement.getEKey();
|
|
@@ -189,7 +191,7 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
|
|
} else if ("decimal".equals(fieldType)) {
|
|
} else if ("decimal".equals(fieldType)) {
|
|
sbr1.append(" " + fieldType + "(" + wbsFormElement.getELength() + ")");
|
|
sbr1.append(" " + fieldType + "(" + wbsFormElement.getELength() + ")");
|
|
} else if ("datetime".equals(fieldType)) {
|
|
} else if ("datetime".equals(fieldType)) {
|
|
- sbr1.append(" " + fieldType + "(" + wbsFormElement.getELength() + ")");
|
|
|
|
|
|
+ sbr1.append(" " + fieldType + "(" + 0 + ")");
|
|
}
|
|
}
|
|
String sql = newName + " " + sbr1;
|
|
String sql = newName + " " + sbr1;
|
|
baseMapper.alterAddFiled(sql, tableName);
|
|
baseMapper.alterAddFiled(sql, tableName);
|
|
@@ -208,19 +210,19 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean updateAndSyn(List<WbsFormElement> wbsFormElementList,String initTableName) {
|
|
|
|
|
|
+ public boolean updateAndSyn(List<WbsFormElement> wbsFormElementList, String initTableName) {
|
|
QueryWrapper<WbsFormElement> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<WbsFormElement> queryWrapper = new QueryWrapper<>();
|
|
String fId = "";
|
|
String fId = "";
|
|
for (WbsFormElement wbsFormElement : wbsFormElementList) {
|
|
for (WbsFormElement wbsFormElement : wbsFormElementList) {
|
|
fId = wbsFormElement.getFId();
|
|
fId = wbsFormElement.getFId();
|
|
}
|
|
}
|
|
- queryWrapper.eq("f_id",fId);
|
|
|
|
|
|
+ queryWrapper.eq("f_id", fId);
|
|
List<WbsFormElement> wbsFormElements = baseMapper.selectList(queryWrapper);
|
|
List<WbsFormElement> wbsFormElements = baseMapper.selectList(queryWrapper);
|
|
for (WbsFormElement wbsFormElement : wbsFormElements) {
|
|
for (WbsFormElement wbsFormElement : wbsFormElements) {
|
|
String eKey = wbsFormElement.getEKey();
|
|
String eKey = wbsFormElement.getEKey();
|
|
Integer eLength = wbsFormElement.getELength();
|
|
Integer eLength = wbsFormElement.getELength();
|
|
String eType = judgeDataType(wbsFormElement.getEType());
|
|
String eType = judgeDataType(wbsFormElement.getEType());
|
|
- baseMapper.updateFiledType(initTableName,eKey,eType,eLength);
|
|
|
|
|
|
+ baseMapper.updateFiledType(initTableName, eKey, eType, eLength);
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|