Commit 4ad4b75f authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.10' into MVP1.6.10

parents 7c3071e4 ebd711ef
...@@ -81,7 +81,7 @@ public class TAttaInfo extends BaseEntity { ...@@ -81,7 +81,7 @@ public class TAttaInfo extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String attaUrl; private String attaUrl;
/** /**
* 附件变更类型:0 增加 1 减少。 档案编辑附件时需要告知后端是增加还是减少 * 附件变更类型:0 新增 1 更新 2 删除 3 不变 档案编辑附件时需要告知后端是增加还是减少
*/ */
@TableField(exist = false) @TableField(exist = false)
private String handleType; private String handleType;
......
...@@ -78,7 +78,7 @@ public class TEmpOtherFile { ...@@ -78,7 +78,7 @@ public class TEmpOtherFile {
@TableField(exist = false) @TableField(exist = false)
private List<TAttaInfo> attaList; private List<TAttaInfo> attaList;
/** /**
* 档案编辑其他附件分租信息处理类型 0 新增 1 更新 2 删除 * 档案编辑其他附件分租信息处理类型 0 新增 1 更新 2 删除 3 不变
*/ */
@TableField(exist = false) @TableField(exist = false)
private String handleType; private String handleType;
......
...@@ -249,22 +249,32 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -249,22 +249,32 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
this.doUpdateEducationCore(education, employeeInfo); this.doUpdateEducationCore(education, employeeInfo);
// 更新附件信息 fxj 2024-09-09 // 更新附件信息 fxj 2024-09-09
updateOtherAtta(employeeInfo); if (updateOtherAtta(employeeInfo)){
// 获取最新附件信息 fxj 2024-09-09 // 获取最新附件信息 fxj 2024-09-09
getAttaInfo(employeeInfo); getAttaInfo(employeeInfo);
} else{
old.setOtherFiles(null);
employeeInfo.setOtherFiles(null);
}
// 记录变更日志 // 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], old.getId(), "", old, employeeInfo); tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], old.getId(), "", old, employeeInfo);
return R.ok(this.updateById(employeeInfo)); return R.ok(this.updateById(employeeInfo));
} }
private void updateOtherAtta(TEmployeeInfo employeeInfo) { private boolean updateOtherAtta(TEmployeeInfo employeeInfo) {
List<TEmpOtherFile> otherFileList = employeeInfo.getOtherFiles(); List<TEmpOtherFile> otherFileList = employeeInfo.getOtherFiles();
boolean flag = false;
if (Common.isNotNull(otherFileList)){ if (Common.isNotNull(otherFileList)){
List<TAttaInfo> attaInfos = new ArrayList<>(); List<TAttaInfo> attaInfos = new ArrayList<>();
for (TEmpOtherFile otherFile:otherFileList){ for (TEmpOtherFile otherFile:otherFileList){
//处理新增或删除其他附件分租的逻辑 //处理新增或删除其他附件分租的逻辑
if (!flag){
flag = handleOtherFile(otherFile);
}else {
handleOtherFile(otherFile); handleOtherFile(otherFile);
}
if (Common.isNotNull(otherFile.getAttaList())){ if (Common.isNotNull(otherFile.getAttaList())){
attaInfos.addAll(otherFile.getAttaList()); attaInfos.addAll(otherFile.getAttaList());
} }
...@@ -276,27 +286,29 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -276,27 +286,29 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (CommonConstants.ZERO_STRING.equals(attaInfo.getHandleType())){ if (CommonConstants.ZERO_STRING.equals(attaInfo.getHandleType())){
adds.add(attaInfo); adds.add(attaInfo);
} }
if (CommonConstants.ONE_STRING.equals(attaInfo.getHandleType())){
adds.add(attaInfo);
}
if (CommonConstants.TWO_STRING.equals(attaInfo.getHandleType())){ if (CommonConstants.TWO_STRING.equals(attaInfo.getHandleType())){
deleteIds.add(attaInfo.getId()); deleteIds.add(attaInfo.getId());
} }
} }
if (Common.isNotNull(deleteIds)){ if (Common.isNotNull(deleteIds)){
attaInfoService.removeBatchByIds(deleteIds); attaInfoService.removeBatchByIds(deleteIds);
flag =true;
} }
if (Common.isNotNull(adds)){ if (Common.isNotNull(adds)){
attaInfoService.updateBatchById(adds); attaInfoService.updateBatchById(adds);
flag =true;
} }
} }
} }
return flag;
} }
private void handleOtherFile(TEmpOtherFile otherFile) { private boolean handleOtherFile(TEmpOtherFile otherFile) {
boolean flag =false;
// 新增时先增加 empOtherFile // 新增时先增加 empOtherFile
if (CommonConstants.ZERO_STRING.equals(otherFile.getHandleType())){ if (CommonConstants.ZERO_STRING.equals(otherFile.getHandleType())){
empOtherFileService.save(otherFile); empOtherFileService.save(otherFile);
flag = true;
if (Common.isNotNull(otherFile.getAttaList())){ if (Common.isNotNull(otherFile.getAttaList())){
for (TAttaInfo info: otherFile.getAttaList()){ for (TAttaInfo info: otherFile.getAttaList()){
info.setDomainId(otherFile.getId()); info.setDomainId(otherFile.getId());
...@@ -304,6 +316,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -304,6 +316,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 更新 // 更新
}if (CommonConstants.ONE_STRING.equals(otherFile.getHandleType())){ }if (CommonConstants.ONE_STRING.equals(otherFile.getHandleType())){
flag = true;
if (Common.isNotNull(otherFile.getId())){ if (Common.isNotNull(otherFile.getId())){
empOtherFileService.updateById(otherFile); empOtherFileService.updateById(otherFile);
if (Common.isNotNull(otherFile.getAttaList())){ if (Common.isNotNull(otherFile.getAttaList())){
...@@ -313,9 +326,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -313,9 +326,20 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
// 删除时 // 删除时
}if (CommonConstants.THREE_STRING.equals(otherFile.getHandleType())){
if (Common.isNotNull(otherFile.getId())){
if (Common.isNotNull(otherFile.getAttaList())){
for (TAttaInfo info: otherFile.getAttaList()){
info.setDomainId(otherFile.getId());
}
}
}
// 删除时
}else if (CommonConstants.TWO_STRING.equals(otherFile.getHandleType())){ }else if (CommonConstants.TWO_STRING.equals(otherFile.getHandleType())){
empOtherFileService.removeById(otherFile.getId()); empOtherFileService.removeById(otherFile.getId());
flag = true;
} }
return flag;
} }
private void getAttaInfo(TEmployeeInfo emp) { private void getAttaInfo(TEmployeeInfo emp) {
......
...@@ -1447,7 +1447,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1447,7 +1447,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
employee.setEmpPhone(vo.getMobile()); employee.setEmpPhone(vo.getMobile());
} }
if(Common.isEmpty(vo.getFlag())){ if(Common.isEmpty(vo.getFlag())){
employee.setIsCollege(CommonConstants.ZERO_INT);
if (Common.isNotNull(vo.getHighEducation())) { if (Common.isNotNull(vo.getHighEducation())) {
employee.setHignEducation(vo.getHighEducation()); employee.setHignEducation(vo.getHighEducation());
if ("5".equals(employee.getHignEducation()) if ("5".equals(employee.getHignEducation())
......
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