Commit fb44737d authored by hongguangwu's avatar hongguangwu

优化

parent ac851803
...@@ -124,13 +124,18 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -124,13 +124,18 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if (Common.isEmpty(hold.getId())){ if (Common.isEmpty(hold.getId())){
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
if (Common.isEmpty(hold.getAuditUser()) || Common.isEmpty(hold.getHandleUser())) {
return R.failed("审核人或办理人必填!");
}
SysHouseHoldInfo holdInfo = baseMapper.selectById(hold.getId()); SysHouseHoldInfo holdInfo = baseMapper.selectById(hold.getId());
if (Common.isEmpty(holdInfo)){ if (Common.isEmpty(holdInfo)){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
// 编辑标志 true:编辑;false:启用禁用(说明不需要拦截其他必填项)
boolean isEdit = true;
if (Common.isEmpty(hold.getType()) && Common.isNotNull(hold.getDelFlag())) {
isEdit = false;
}
if (isEdit && (Common.isEmpty(hold.getAuditUser()) || Common.isEmpty(hold.getHandleUser()))) {
return R.failed("审核人或办理人必填!");
}
if (CommonConstants.ONE_STRING.equals(hold.getDelFlag()) if (CommonConstants.ONE_STRING.equals(hold.getDelFlag())
&& baseSetInfoMapper.selectCount(Wrappers.<SysBaseSetInfo>query().lambda() && baseSetInfoMapper.selectCount(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, holdInfo.getType()) .eq(SysBaseSetInfo::getBaseType, holdInfo.getType())
...@@ -144,7 +149,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -144,7 +149,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
} }
int res = baseMapper.updateById(hold); int res = baseMapper.updateById(hold);
if (res >= 0){ if (res >= 0){
if (isEdit) {
// 新老数据审核人办理人不同,先删除,再添加 // 新老数据审核人办理人不同,先删除,再添加
if (Common.isNotNull(holdInfo.getAuditUser()) && !holdInfo.getAuditUser().equals(hold.getAuditUser())) { if (Common.isNotNull(holdInfo.getAuditUser()) && !holdInfo.getAuditUser().equals(hold.getAuditUser())) {
tSocialfundHouseResService.deleteAuditUser(holdInfo); tSocialfundHouseResService.deleteAuditUser(holdInfo);
...@@ -155,7 +160,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap ...@@ -155,7 +160,7 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
// 同步审核权限、办理权限 // 同步审核权限、办理权限
this.saveAuditUserOrHandleUser(hold, CommonConstants.ZERO_STRING); this.saveAuditUserOrHandleUser(hold, CommonConstants.ZERO_STRING);
this.saveAuditUserOrHandleUser(hold, CommonConstants.ONE_STRING); this.saveAuditUserOrHandleUser(hold, CommonConstants.ONE_STRING);
}
return R.ok(); return R.ok();
}else { }else {
return R.failed(CommonConstants.SAVE_FAILED); return R.failed(CommonConstants.SAVE_FAILED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment