Commit 8bd38009 authored by hongguangwu's avatar hongguangwu

MVP1.7.0 更新附件

parent cbf55a66
......@@ -572,4 +572,21 @@ public class TEmployeeInfo extends BaseEntity {
@TableField(exist = false)
private List<TAttaInfo> attaList;
// 档案编辑的其他附件之外的附件,例如:身份证正反面,户口本2页、员工声明、员工确认
// 身份证
@TableField(exist = false)
private TAttaInfo attaIdCardOne;
@TableField(exist = false)
private TAttaInfo attaIdCardTwo;
// 户口本
@TableField(exist = false)
private TAttaInfo attaRegistrationOne;
@TableField(exist = false)
private TAttaInfo attaRegistrationTwo;
// 员工声明
@TableField(exist = false)
private TAttaInfo attaDeclearOne;
@TableField(exist = false)
private TAttaInfo attaDeclearTwo;
}
......@@ -277,7 +277,7 @@ public class TPreEmpMain extends BaseEntity {
@TableField(exist = false)
private String firstWorkFlag;
@TableField(exist = false)
private String haveQualification;
private String HaveQualification;
/**
* 其他附件
......@@ -285,7 +285,7 @@ public class TPreEmpMain extends BaseEntity {
@TableField(exist = false)
private List<TPreEmpOtherFile> otherFiles;
// 档案编辑的其他附件之外的附件,例如:身份证正反面,户口本2页、员工声明、员工确认
// 档案编辑的其他附件之外的附件,例如:身份证正反面,户口本2页、学历学信、员工声明、员工确认
@TableField(exist = false)
private List<TAttaInfo> attaList;
......
......@@ -258,13 +258,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employeeInfo.setOtherFiles(null);
}
// 更新附件信息 hgw 2024-10-15
if (updateAtta(employeeInfo)){
// 获取最新附件信息
getEmpAttaInfo(employeeInfo);
} else{
old.setAttaList(null);
employeeInfo.setAttaList(null);
}
updateAtta(employeeInfo, old);
// 更新成功或失败,都清空list,日志分在每个对象里了 hgw 2024-10-16
old.setAttaList(null);
employeeInfo.setAttaList(null);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], old.getId(), "", old, employeeInfo);
return R.ok(this.updateById(employeeInfo));
......@@ -311,7 +308,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 仿写房工更新附件
private boolean updateAtta(TEmployeeInfo employeeInfo) {
private boolean updateAtta(TEmployeeInfo employeeInfo, TEmployeeInfo old) {
List<TAttaInfo> attaInfos = employeeInfo.getAttaList();
boolean flag = false;
if (Common.isNotNull(attaInfos)){
......@@ -319,11 +316,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
List<TAttaInfo> adds = new ArrayList<>();
for (TAttaInfo attaInfo : attaInfos){
if (CommonConstants.ZERO_STRING.equals(attaInfo.getHandleType())){
setAttaLogByRelationType(employeeInfo, attaInfo);
adds.add(attaInfo);
}
if (CommonConstants.TWO_STRING.equals(attaInfo.getHandleType())){
setAttaLogByRelationType(old, attaInfo);
deleteIds.add(attaInfo.getId());
}
if (CommonConstants.ONE_STRING.equals(attaInfo.getHandleType())
|| CommonConstants.THREE_STRING.equals(attaInfo.getHandleType())){
setAttaLogByRelationType(employeeInfo, attaInfo);
setAttaLogByRelationType(old, attaInfo);
}
}
if (Common.isNotNull(deleteIds)){
attaInfoService.removeBatchByIds(deleteIds);
......@@ -337,6 +341,31 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return flag;
}
/**
* @param employeeInfo
* @param attaInfo
* @Description: 根据类型塞附件,记录变更日志使用的
* @Author: hgw
* @Date: 2024/10/16 10:34
* @return: void
**/
private void setAttaLogByRelationType(TEmployeeInfo employeeInfo, TAttaInfo attaInfo) {
/**
* 关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本
* ;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽
* 25 户口本本人页26学信27预入职其他附件
*/
switch (attaInfo.getRelationType()) {
case "9": employeeInfo.setAttaIdCardOne(attaInfo); break;
case "24": employeeInfo.setAttaIdCardTwo(attaInfo); break;
case "10": employeeInfo.setAttaRegistrationOne(attaInfo); break;
case "25": employeeInfo.setAttaRegistrationTwo(attaInfo); break;
case "21": employeeInfo.setAttaDeclearOne(attaInfo); break;
case "22": employeeInfo.setAttaDeclearTwo(attaInfo); break;
default:break;
}
}
private boolean handleOtherFile(TEmpOtherFile otherFile) {
boolean flag =false;
// 新增时先增加 empOtherFile
......@@ -348,7 +377,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
info.setDomainId(otherFile.getId());
}
}
// 更新
// 更新
}if (CommonConstants.ONE_STRING.equals(otherFile.getHandleType())){
flag = true;
if (Common.isNotNull(otherFile.getId())){
......@@ -361,15 +390,15 @@ 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());
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());
flag = true;
}
......@@ -2452,7 +2481,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* @Date 19:30 2022/8/1
* @Param
* @return
**/
**/
@Override
public Boolean updateEmpInfo(UpdateEmpVo vo) {
if (Common.isNotNull(vo)){
......@@ -2857,7 +2886,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* @Author fxj
* @Description 每年1月1号刷新在职和离职人员的年龄信息 公式:当前年-出生年
* @Date 17:30 2024/8/21
**/
**/
@Override
public void updateEmployeeAgeTask() {
baseMapper.updateEmployeeAgeTask();
......@@ -2887,7 +2916,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* @Date 11:13 2024/9/10
* @Param
* @return
**/
**/
@Override
public void exportEmployeeFile(String id, HttpServletResponse response) throws Exception{
if (Common.isEmpty(id)){
......
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