Commit fb44737d authored by hongguangwu's avatar hongguangwu

优化

parent ac851803
......@@ -124,13 +124,18 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
if (Common.isEmpty(hold.getId())){
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());
if (Common.isEmpty(holdInfo)){
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())
&& baseSetInfoMapper.selectCount(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, holdInfo.getType())
......@@ -144,18 +149,18 @@ public class SysHouseHoldInfoServiceImpl extends ServiceImpl<SysHouseHoldInfoMap
}
int res = baseMapper.updateById(hold);
if (res >= 0){
// 新老数据审核人办理人不同,先删除,再添加
if (Common.isNotNull(holdInfo.getAuditUser()) && !holdInfo.getAuditUser().equals(hold.getAuditUser())) {
tSocialfundHouseResService.deleteAuditUser(holdInfo);
if (isEdit) {
// 新老数据审核人办理人不同,先删除,再添加
if (Common.isNotNull(holdInfo.getAuditUser()) && !holdInfo.getAuditUser().equals(hold.getAuditUser())) {
tSocialfundHouseResService.deleteAuditUser(holdInfo);
}
if (Common.isNotNull(holdInfo.getHandleUser()) && !holdInfo.getHandleUser().equals(hold.getHandleUser())) {
tSocialfundHouseResService.deleteHandleUser(holdInfo);
}
// 同步审核权限、办理权限
this.saveAuditUserOrHandleUser(hold, CommonConstants.ZERO_STRING);
this.saveAuditUserOrHandleUser(hold, CommonConstants.ONE_STRING);
}
if (Common.isNotNull(holdInfo.getHandleUser()) && !holdInfo.getHandleUser().equals(hold.getHandleUser())) {
tSocialfundHouseResService.deleteHandleUser(holdInfo);
}
// 同步审核权限、办理权限
this.saveAuditUserOrHandleUser(hold, CommonConstants.ZERO_STRING);
this.saveAuditUserOrHandleUser(hold, CommonConstants.ONE_STRING);
return R.ok();
}else {
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