|
|
|
@ -121,11 +121,10 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int updateComp(Map<String, Object> params) {
|
|
|
|
|
System.out.println(params);
|
|
|
|
|
CompSearchParam param = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
|
|
|
|
|
System.out.println(param);
|
|
|
|
|
|
|
|
|
|
// TODO 更新主表数据
|
|
|
|
|
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
|
|
|
|
|
// 更新主表数据
|
|
|
|
|
CompPO compPO = CompBO.convertParamToPO(searchParam, (long) user.getUID());
|
|
|
|
|
int updateBaseComp = getCompMapper().updateBaseComp(compPO);
|
|
|
|
|
|
|
|
|
|
// 获取分部明细表的所有拓展列
|
|
|
|
|
String tableName = "JCL_ORG_COMPEXT_DT1";
|
|
|
|
@ -133,8 +132,8 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
List<String> dtFields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> insertList = new ArrayList<>();
|
|
|
|
|
System.out.println(dtFields);
|
|
|
|
|
// TODO 删除明细表数据
|
|
|
|
|
// 删除明细表数据
|
|
|
|
|
getCompExtDTMapper().deleteByMainID(tableName, compPO.getId());
|
|
|
|
|
// 处理明细表数据
|
|
|
|
|
int rowNum = Util.getIntValue((String) params.get("rownum"));
|
|
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
|
@ -142,11 +141,19 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
for (String dtField : dtFields) {
|
|
|
|
|
map.put(dtField, params.get(dtField + "_" + i));
|
|
|
|
|
}
|
|
|
|
|
map.put("mainid", compPO.getId());
|
|
|
|
|
map.put("creator", compPO.getCreator());
|
|
|
|
|
map.put("delete_type", compPO.getDeleteType());
|
|
|
|
|
map.put("create_time", compPO.getCreateTime());
|
|
|
|
|
map.put("update_time", compPO.getUpdateTime());
|
|
|
|
|
insertList.add(map);
|
|
|
|
|
}
|
|
|
|
|
System.out.println(insertList);
|
|
|
|
|
// 更新拓展表数据
|
|
|
|
|
for (Map<String, Object> map : insertList) {
|
|
|
|
|
getCompExtDTMapper().insertCompExtDT(tableName, map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
return updateBaseComp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -239,8 +246,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|
|
|
|
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
// 编号
|
|
|
|
|
SearchConditionItem compNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "compNo");
|
|
|
|
|
compNoItem.setRules("required|string");
|
|
|
|
|
SearchConditionItem compNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "编号", "compNo");
|
|
|
|
|
// 名称
|
|
|
|
|
SearchConditionItem compNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "compName");
|
|
|
|
|
compNameItem.setRules("required|string");
|
|
|
|
|