Commit b69335d0 authored by hongguangwu's avatar hongguangwu

MVP1.6.7-薪资导入相关

parent 0c66d60f
...@@ -923,153 +923,72 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -923,153 +923,72 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
private R<String> saveBase(PreEmpMainDetailVo vo, String status) { private R<String> saveBase(PreEmpMainDetailVo vo, String status) {
YifuUser user = getNewYifuUser();
TPreEmpMain main = vo.getMain(); TPreEmpMain main = vo.getMain();
String idCard = main.getEmpIdcard(); try {
if (Common.isNotNull(idCard)) { YifuUser user = getNewYifuUser();
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject(); String idCard = main.getEmpIdcard();
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) { if (Common.isNotNull(idCard)) {
// 预入职-人员档案表 TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo(); if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())) { // 预入职-人员档案表
// 转到更新档案去 TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
return updateToEmployeeByPre(vo); if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())) {
// 转到更新档案去
return updateToEmployeeByPre(vo);
} else {
return R.failed("档案原ID不可为空!");
}
} else { } else {
return R.failed("档案原ID不可为空!"); main.setStatus(status);
} main.setCreateBy(user.getId());
} else { main.setCreateName(user.getNickname());
main.setStatus(status); main.setCreateTime(LocalDateTime.now());
main.setCreateBy(user.getId()); this.saveOrUpdate(main);
main.setCreateName(user.getNickname()); String mainId = main.getId();
main.setCreateTime(LocalDateTime.now());
this.saveOrUpdate(main); // 预入职-员工不良记录表
String mainId = main.getId(); TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
// 预入职-员工不良记录表 tPreEmpBadRecord.setPreMainId(mainId);
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord(); tPreEmpBadRecord.setCreateBy(user.getId());
if (tPreEmpBadRecord != null) { tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setPreMainId(mainId); tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
tPreEmpBadRecord.setCreateBy(user.getId()); tPreEmpBadRecordService.saveOrUpdate(tPreEmpBadRecord);
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
tPreEmpBadRecordService.saveOrUpdate(tPreEmpBadRecord);
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
if (tPreEmpContactInfo != null) {
tPreEmpContactInfo.setPreMainId(mainId);
tPreEmpContactInfo.setCreateBy(user.getId());
tPreEmpContactInfo.setCreateName(user.getNickname());
tPreEmpContactInfo.setCreateTime(LocalDateTime.now());
tPreEmpContactInfoService.saveOrUpdate(tPreEmpContactInfo);
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
if (tPreEmpDisabilityInfo != null) {
tPreEmpDisabilityInfo.setPreMainId(mainId);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateName(user.getNickname());
tPreEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
tPreEmpDisabilityInfoService.saveOrUpdate(tPreEmpDisabilityInfo);
}
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
if (tPreEmpEducation != null) {
tPreEmpEducation.setPreMainId(mainId);
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducation.setCreateTime(LocalDateTime.now());
tPreEmpEducationService.saveOrUpdate(tPreEmpEducation);
// 附件
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) {
tAttaInfoService.deleteByDomainIdAndType(tPreEmpEducation.getId(),0);
for (TAttaInfo atta : attaList) {
atta.setId(null);
atta.setDomainId(tPreEmpEducation.getId());
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveBatch(attaList);
}
} }
} // 预入职-紧急联络人
// 预入职-员工家庭信息表 TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
List<TPreEmpFamily> tPreEmpFamily = vo.getTpreEmpFamilyList(); if (tPreEmpContactInfo != null) {
if (tPreEmpFamily != null) { tPreEmpContactInfo.setPreMainId(mainId);
tPreEmpFamilyService.deleteFamilyByMainId(mainId); tPreEmpContactInfo.setCreateBy(user.getId());
for (TPreEmpFamily info : tPreEmpFamily) { tPreEmpContactInfo.setCreateName(user.getNickname());
info.setEmpIdcard(idCard); tPreEmpContactInfo.setCreateTime(LocalDateTime.now());
info.setPreMainId(mainId); tPreEmpContactInfoService.saveOrUpdate(tPreEmpContactInfo);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
} }
tPreEmpFamilyService.saveOrUpdateBatch(tPreEmpFamily); // 预入职-员工伤残信息表
} TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
// 预入职-人员档案表 if (tPreEmpDisabilityInfo != null) {
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo(); tPreEmpDisabilityInfo.setPreMainId(mainId);
if (tPreEmployeeInfo != null) { tPreEmpDisabilityInfo.setCreateBy(user.getId());
if (tPreEmpEducation != null) { tPreEmpDisabilityInfo.setCreateName(user.getNickname());
if (Common.isNotNull(tPreEmpEducation.getEducationName())) { tPreEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
// 5大专 6本科 7硕士 8博士 tPreEmpDisabilityInfoService.saveOrUpdate(tPreEmpDisabilityInfo);
if ("5".equals(tPreEmpEducation.getEducationName())
|| "6".equals(tPreEmpEducation.getEducationName())
|| "7".equals(tPreEmpEducation.getEducationName())
|| "8".equals(tPreEmpEducation.getEducationName())) {
tPreEmployeeInfo.setIsCollege(CommonConstants.ONE_INT);
} else {
tPreEmployeeInfo.setIsCollege(CommonConstants.ZERO_INT);
}
tPreEmployeeInfo.setHignEducation(tPreEmpEducation.getEducationName());
}
tPreEmployeeInfo.setSchool(tPreEmpEducation.getSchool());
tPreEmployeeInfo.setMajor(tPreEmpEducation.getMajor());
tPreEmployeeInfo.setAdmissionDate(tPreEmpEducation.getEntryDate());
tPreEmployeeInfo.setGradutionDate(tPreEmpEducation.getGradutionDate());
} }
// 生成性别年龄等: // 预入职-员工学历信息表
this.setBaseSexInfo(tPreEmployeeInfo); TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
tPreEmployeeInfo.setPreMainId(mainId); if (tPreEmpEducation != null) {
tPreEmployeeInfo.setCreateBy(user.getId()); tPreEmpEducation.setPreMainId(mainId);
tPreEmployeeInfo.setCreateName(user.getNickname()); tPreEmpEducation.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now()); tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducation.setCreateTime(LocalDateTime.now());
// 塞计税月份标志 tPreEmpEducationService.saveOrUpdate(tPreEmpEducation);
this.setTaxMonthAndFlag(status, tPreEmployeeInfo);
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
}
// 预入职-项目档案表
if (tPreEmployeeProject != null) {
tPreEmployeeProject.setPreMainId(mainId);
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProject.setCreateTime(LocalDateTime.now());
tPreEmployeeProjectService.saveOrUpdate(tPreEmployeeProject);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTpreEmpProfessionalQualificationList();
if (tPreEmpProfessionalQualification != null) {
// 先删除后增加
tPreEmpProfessionalService.deleteProfessionalByMainId(mainId);
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) {
info.setEmpIdcard(idCard);
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalService.saveOrUpdate(info);
// 附件 // 附件
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) { if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = info.getAttaList(); List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) { if (attaList != null) {
tAttaInfoService.deleteByDomainIdAndType(info.getId(),1); tAttaInfoService.deleteByDomainIdAndType(tPreEmpEducation.getId(), 0);
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
atta.setId(null); atta.setId(null);
atta.setDomainId(info.getId()); atta.setDomainId(tPreEmpEducation.getId());
atta.setCreateBy(user.getId()); atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname()); atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now()); atta.setCreateTime(LocalDateTime.now());
...@@ -1078,65 +997,151 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1078,65 +997,151 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
} }
} }
} // 预入职-员工家庭信息表
// 预入职-其他附件 List<TPreEmpFamily> tPreEmpFamily = vo.getTpreEmpFamilyList();
List<TPreEmpOtherFile> tPreOtherFileList = vo.getTpreEmpOtherFileList(); if (tPreEmpFamily != null) {
if (tPreOtherFileList != null) { tPreEmpFamilyService.deleteFamilyByMainId(mainId);
// 先删除后增加 for (TPreEmpFamily info : tPreEmpFamily) {
tPreEmpOtherFileService.deleteOtherFileByMainId(mainId); info.setEmpIdcard(idCard);
for (TPreEmpOtherFile info : tPreOtherFileList) { info.setPreMainId(mainId);
info.setPreMainId(mainId); info.setCreateBy(user.getId());
info.setCreateTime(LocalDateTime.now()); info.setCreateName(user.getNickname());
tPreEmpOtherFileService.saveOrUpdate(info); info.setCreateTime(LocalDateTime.now());
// 附件 }
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) { tPreEmpFamilyService.saveOrUpdateBatch(tPreEmpFamily);
List<TAttaInfo> attaList = info.getAttaList(); }
if (attaList != null) { // 预入职-人员档案表
tAttaInfoService.deleteByDomainIdAndType(info.getId(),2); TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
for (TAttaInfo atta : attaList) { if (tPreEmployeeInfo != null) {
atta.setId(null); if (tPreEmpEducation != null) {
atta.setDomainId(info.getId()); if (Common.isNotNull(tPreEmpEducation.getEducationName())) {
atta.setCreateBy(user.getId()); // 5大专 6本科 7硕士 8博士
atta.setCreateName(user.getNickname()); if ("5".equals(tPreEmpEducation.getEducationName())
atta.setCreateTime(LocalDateTime.now()); || "6".equals(tPreEmpEducation.getEducationName())
|| "7".equals(tPreEmpEducation.getEducationName())
|| "8".equals(tPreEmpEducation.getEducationName())) {
tPreEmployeeInfo.setIsCollege(CommonConstants.ONE_INT);
} else {
tPreEmployeeInfo.setIsCollege(CommonConstants.ZERO_INT);
} }
tAttaInfoService.saveBatch(attaList); tPreEmployeeInfo.setHignEducation(tPreEmpEducation.getEducationName());
} }
tPreEmployeeInfo.setSchool(tPreEmpEducation.getSchool());
tPreEmployeeInfo.setMajor(tPreEmpEducation.getMajor());
tPreEmployeeInfo.setAdmissionDate(tPreEmpEducation.getEntryDate());
tPreEmployeeInfo.setGradutionDate(tPreEmpEducation.getGradutionDate());
} }
// 生成性别年龄等:
this.setBaseSexInfo(tPreEmployeeInfo);
tPreEmployeeInfo.setPreMainId(mainId);
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
// 塞计税月份标志
this.setTaxMonthAndFlag(status, tPreEmployeeInfo);
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
} }
} // 预入职-项目档案表
// 预入职-员工工作履历信息表 if (tPreEmployeeProject != null) {
List<TPreEmpWorkRecording> tPreEmpWorkRecording = vo.getTpreEmpWorkRecordingList(); tPreEmployeeProject.setPreMainId(mainId);
if (tPreEmpWorkRecording != null) { tPreEmployeeProject.setCreateBy(user.getId());
// 先删除后增加 tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmpWorkRecordingService.deleteByMainId(mainId); tPreEmployeeProject.setCreateTime(LocalDateTime.now());
for (TPreEmpWorkRecording info : tPreEmpWorkRecording) { tPreEmployeeProjectService.saveOrUpdate(tPreEmployeeProject);
info.setEmpIdcard(idCard);
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
} }
tPreEmpWorkRecordingService.saveOrUpdateBatch(tPreEmpWorkRecording); // 预入职-员工职业资格信息表
} List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTpreEmpProfessionalQualificationList();
// 预入职-附件 if (tPreEmpProfessionalQualification != null) {
List<TAttaInfo> attaInfoList = vo.getAttaInfoList(); // 先删除后增加
if (attaInfoList != null) { tPreEmpProfessionalService.deleteProfessionalByMainId(mainId);
// 先删除后增加 for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) {
tAttaInfoService.deleteByDomainId(mainId); info.setEmpIdcard(idCard);
for (TAttaInfo info : attaInfoList) { info.setPreMainId(mainId);
info.setId(null); info.setCreateBy(user.getId());
info.setDomainId(mainId); info.setCreateName(user.getNickname());
info.setCreateBy(user.getId()); info.setCreateTime(LocalDateTime.now());
info.setCreateName(user.getNickname()); tPreEmpProfessionalService.saveOrUpdate(info);
info.setCreateTime(LocalDateTime.now()); // 附件
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = info.getAttaList();
if (attaList != null) {
tAttaInfoService.deleteByDomainIdAndType(info.getId(), 1);
for (TAttaInfo atta : attaList) {
atta.setId(null);
atta.setDomainId(info.getId());
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveBatch(attaList);
}
}
}
}
// 预入职-其他附件
List<TPreEmpOtherFile> tPreOtherFileList = vo.getTpreEmpOtherFileList();
if (tPreOtherFileList != null) {
// 先删除后增加
tPreEmpOtherFileService.deleteOtherFileByMainId(mainId);
for (TPreEmpOtherFile info : tPreOtherFileList) {
info.setPreMainId(mainId);
info.setCreateTime(LocalDateTime.now());
tPreEmpOtherFileService.saveOrUpdate(info);
// 附件
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = info.getAttaList();
if (attaList != null) {
tAttaInfoService.deleteByDomainIdAndType(info.getId(), 2);
for (TAttaInfo atta : attaList) {
atta.setId(null);
atta.setDomainId(info.getId());
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveBatch(attaList);
}
}
}
}
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecording = vo.getTpreEmpWorkRecordingList();
if (tPreEmpWorkRecording != null) {
// 先删除后增加
tPreEmpWorkRecordingService.deleteByMainId(mainId);
for (TPreEmpWorkRecording info : tPreEmpWorkRecording) {
info.setEmpIdcard(idCard);
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tPreEmpWorkRecordingService.saveOrUpdateBatch(tPreEmpWorkRecording);
}
// 预入职-附件
List<TAttaInfo> attaInfoList = vo.getAttaInfoList();
if (attaInfoList != null) {
// 先删除后增加
tAttaInfoService.deleteByDomainId(mainId);
for (TAttaInfo info : attaInfoList) {
info.setId(null);
info.setDomainId(mainId);
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveBatch(attaInfoList);
} }
tAttaInfoService.saveBatch(attaInfoList);
} }
return R.ok("成功");
} else {
return R.failed("身份证不可为空!");
} }
return R.ok("成功"); } catch (Exception e) {
} else { log.error("档案预入职C端保存异常:", e);
return R.failed("身份证不可为空!"); throw new RuntimeException("保存失败,请联系管理员!!主键【" + main.getId() +"】详细信息:"+ e.getMessage());
} }
} }
...@@ -1675,7 +1680,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1675,7 +1680,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
isNew = true; isNew = true;
emp = new TEmployeeInfo(); emp = new TEmployeeInfo();
} }
BeanUtil.copyProperties(tPreEmployeeInfo, emp, ID); String[] ignoreProperties = new String[]{"id", "empCode"};
BeanUtil.copyProperties(tPreEmployeeInfo, emp, ignoreProperties);
if (isNew) { if (isNew) {
// 新员工塞基本属性 // 新员工塞基本属性
this.setNewEmpBaseData(emp, user); this.setNewEmpBaseData(emp, user);
...@@ -2027,49 +2033,54 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2027,49 +2033,54 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return R.failed("id、status不可为空!"); return R.failed("id、status不可为空!");
} }
TPreEmpMain preEmpMain = this.getById(id); TPreEmpMain preEmpMain = this.getById(id);
if (preEmpMain == null || Common.isEmpty(preEmpMain.getStatus()) || !CommonConstants.TWO_STRING.equals(preEmpMain.getStatus())) { try {
return R.failed("请确认ID与状态!"); if (preEmpMain == null || Common.isEmpty(preEmpMain.getStatus()) || !CommonConstants.TWO_STRING.equals(preEmpMain.getStatus())) {
} return R.failed("请确认ID与状态!");
if (!CommonConstants.THREE_STRING.equals(status) && !CommonConstants.FOUR_STRING.equals(status)) { }
return R.failed("审核状态不对!"); if (!CommonConstants.THREE_STRING.equals(status) && !CommonConstants.FOUR_STRING.equals(status)) {
} return R.failed("审核状态不对!");
if (CommonConstants.THREE_STRING.equals(status) && Common.isEmpty(auditRemark)) { }
return R.failed("审核不通过,原因必填!"); if (CommonConstants.THREE_STRING.equals(status) && Common.isEmpty(auditRemark)) {
} return R.failed("审核不通过,原因必填!");
YifuUser user = SecurityUtils.getUser(); }
if (user == null || Common.isEmpty(user.getId())) { YifuUser user = SecurityUtils.getUser();
return R.failed("未找到登录信息!"); if (user == null || Common.isEmpty(user.getId())) {
} return R.failed("未找到登录信息!");
preEmpMain.setStatus(status); }
preEmpMain.setAuditId(user.getId()); preEmpMain.setStatus(status);
preEmpMain.setAuditRemark(auditRemark); preEmpMain.setAuditId(user.getId());
preEmpMain.setAuditName(user.getNickname()); preEmpMain.setAuditRemark(auditRemark);
if (CommonConstants.FOUR_STRING.equals(status)) { preEmpMain.setAuditName(user.getNickname());
preEmpMain.setAuditTime(new Date());
}
// 审核日志
TPreEmpMainLog auditLog = new TPreEmpMainLog();
auditLog.setAuditId(user.getId());
auditLog.setAuditName(user.getNickname());
auditLog.setAuditTime(new Date());
auditLog.setAuditRemark(auditRemark);
auditLog.setMainId(preEmpMain.getId());
auditLog.setAuditResult(status);
R<PreEmpMainDetailVo> voR = this.getInfoById(id);
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去
PreEmpMainDetailVo vo = voR.getData();
tPreEmpMainLogService.save(auditLog);
this.updateById(preEmpMain);
if (CommonConstants.FOUR_STRING.equals(status)) { if (CommonConstants.FOUR_STRING.equals(status)) {
return updateToEmployeeByPre(vo); preEmpMain.setAuditTime(new Date());
}
// 审核日志
TPreEmpMainLog auditLog = new TPreEmpMainLog();
auditLog.setAuditId(user.getId());
auditLog.setAuditName(user.getNickname());
auditLog.setAuditTime(new Date());
auditLog.setAuditRemark(auditRemark);
auditLog.setMainId(preEmpMain.getId());
auditLog.setAuditResult(status);
R<PreEmpMainDetailVo> voR = this.getInfoById(id);
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去
PreEmpMainDetailVo vo = voR.getData();
tPreEmpMainLogService.save(auditLog);
this.updateById(preEmpMain);
if (CommonConstants.FOUR_STRING.equals(status)) {
return updateToEmployeeByPre(vo);
} else {
return R.ok("已审核");
}
} else { } else {
return R.ok("已审核"); return R.failed("未找到信息,未审核!");
} }
} else { } catch (Exception e) {
return R.failed("未找到信息,未审核!"); log.error("档案预入职审核异常:", e);
throw new RuntimeException("保存失败,请联系管理员!!主键【" + preEmpMain.getId() +"】详细信息:"+ e.getMessage());
} }
} }
......
...@@ -58,13 +58,13 @@ public class TSalaryEmpModLog extends BaseEntity { ...@@ -58,13 +58,13 @@ public class TSalaryEmpModLog extends BaseEntity {
@Schema(description = "content") @Schema(description = "content")
private String content; private String content;
/** /**
* 0编辑、1批量更新、2EKP变更银行卡号;3预入职更新 * 0编辑、1批量更新、2EKP变更银行卡号;3预入职更新;4导入更新银行信息
*/ */
@ExcelAttribute(name = "0编辑、1批量更新、2EKP变更银行卡号", isNotEmpty = true, errorInfo = "0编辑、1批量更新、2EKP变更银行卡号不能为空", maxLength = 1) @ExcelAttribute(name = "类型", isNotEmpty = true, errorInfo = "类型不能为空", maxLength = 1)
@NotBlank(message = "0编辑、1批量更新、2EKP变更银行卡号不能为空") @NotBlank(message = "类型不能为空")
@Length(max = 1, message = "0编辑、1批量更新、2EKP变更银行卡号不能超过1个字符") @Length(max = 1, message = "类型不能超过1个字符")
@ExcelProperty("0编辑、1批量更新、2EKP变更银行卡号") @ExcelProperty("类型")
@Schema(description = "0编辑、1批量更新、2EKP变更银行卡号;3预入职更新") @Schema(description = "0编辑、1批量更新、2EKP变更银行卡号;3预入职更新;4导入更新银行信息")
private String type; private String type;
/** /**
......
...@@ -45,4 +45,6 @@ public interface TSalaryEmpModLogService extends IService<TSalaryEmpModLog> { ...@@ -45,4 +45,6 @@ public interface TSalaryEmpModLogService extends IService<TSalaryEmpModLog> {
List<TSalaryEmpModLog> noPageDiy(TSalaryEmpModLogSearchVo searchVo); List<TSalaryEmpModLog> noPageDiy(TSalaryEmpModLogSearchVo searchVo);
void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util); void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util);
TSalaryEmpModLog checkEditToLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util);
} }
...@@ -73,6 +73,14 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> { ...@@ -73,6 +73,14 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
**/ **/
String saveNewEmployeeList(List<TSalaryEmployee> saveNewEmpList, List<ErrorMessage> errorList); String saveNewEmployeeList(List<TSalaryEmployee> saveNewEmpList, List<ErrorMessage> errorList);
/**
* @Description: 更新卡号等信息
* @Author: hgw
* @Date: 2024/7/22 10:27
* @return: java.lang.String
**/
String updateEmployeeBankList(List<TSalaryEmployee> updateEmpBankList, Map<String, TSalaryEmployee> updateEmpBankMap, List<ErrorMessage> errorList);
/** /**
* @param inputStream * @param inputStream
* @Description: 批量更新-薪资人员信息 * @Description: 批量更新-薪资人员信息
......
...@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esotericsoftware.minlog.Log;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
...@@ -77,8 +76,22 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap ...@@ -77,8 +76,22 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap
**/ **/
@Override @Override
public void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type,String userName,ExcelUtil<TSalaryEmployee> util) { public void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type,String userName,ExcelUtil<TSalaryEmployee> util) {
TSalaryEmpModLog log = doCheckModCore(newEntity, oldEntity, type, userName, util);
if (log != null && Common.isNotNull(log.getContent())){
baseMapper.insert(log);
}
}
@Override
public TSalaryEmpModLog checkEditToLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type,String userName
, ExcelUtil<TSalaryEmployee> util) {
return doCheckModCore(newEntity, oldEntity, type, userName, util);
}
private TSalaryEmpModLog doCheckModCore(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util) {
TSalaryEmpModLog log = null;
if (Common.isNotNull(newEntity) && Common.isNotNull(oldEntity)){ if (Common.isNotNull(newEntity) && Common.isNotNull(oldEntity)){
TSalaryEmpModLog log = new TSalaryEmpModLog(); log = new TSalaryEmpModLog();
log.setIdNum(newEntity.getEmpIdcard()); log.setIdNum(newEntity.getEmpIdcard());
log.setParentId(newEntity.getId()); log.setParentId(newEntity.getId());
log.setType(type); log.setType(type);
...@@ -102,26 +115,23 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap ...@@ -102,26 +115,23 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap
if (Common.isNotNull(newEntity.getBankProvince()) if (Common.isNotNull(newEntity.getBankProvince())
&& Common.isNotNull(oldEntity.getBankProvince()) && !oldEntity.getBankProvince().equals(newEntity.getBankProvince())){ && Common.isNotNull(oldEntity.getBankProvince()) && !oldEntity.getBankProvince().equals(newEntity.getBankProvince())){
str.append("开户行省:"); str.append("开户行省:");
str.append(Common.isEmpty(oldEntity.getBankProvince())?"":util.getAreaLabelPublic(oldEntity.getBankProvince())); str.append(Common.isEmpty(oldEntity.getBankProvince())?"": util.getAreaLabelPublic(oldEntity.getBankProvince()));
str.append("->"); str.append("->");
str.append(Common.isEmpty(newEntity.getBankProvince())?"":util.getAreaLabelPublic(newEntity.getBankProvince())); str.append(Common.isEmpty(newEntity.getBankProvince())?"": util.getAreaLabelPublic(newEntity.getBankProvince()));
str.append(" "); str.append(" ");
} }
//开户行市 //开户行市
if (Common.isNotNull(newEntity.getBankCity()) if (Common.isNotNull(newEntity.getBankCity())
&& Common.isNotNull(oldEntity.getBankCity()) && !oldEntity.getBankCity().equals(newEntity.getBankCity())){ && Common.isNotNull(oldEntity.getBankCity()) && !oldEntity.getBankCity().equals(newEntity.getBankCity())){
str.append("开户行市:"); str.append("开户行市:");
str.append(Common.isEmpty(oldEntity.getBankCity())?"":util.getAreaLabelPublic(oldEntity.getBankCity())); str.append(Common.isEmpty(oldEntity.getBankCity())?"": util.getAreaLabelPublic(oldEntity.getBankCity()));
str.append("->"); str.append("->");
str.append(Common.isEmpty(newEntity.getBankCity())?"":util.getAreaLabelPublic(newEntity.getBankCity())); str.append(Common.isEmpty(newEntity.getBankCity())?"": util.getAreaLabelPublic(newEntity.getBankCity()));
str.append(" "); str.append(" ");
} }
log.setContent(str.toString()); log.setContent(str.toString());
Log.error("薪资人员变更记录表:"+str.toString());
if (Common.isNotNull(log.getContent())){
baseMapper.insert(log);
}
} }
return log;
} }
private void extracted(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, StringBuilder str) { private void extracted(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, StringBuilder str) {
......
...@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; ...@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmpModLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper;
...@@ -386,6 +387,100 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe ...@@ -386,6 +387,100 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
return null; return null;
} }
@Override
public String updateEmployeeBankList(List<TSalaryEmployee> updateEmployeeBankList
, Map<String, TSalaryEmployee> updateEmpBankMap, List<ErrorMessage> errorList) {
if (updateEmployeeBankList != null && !updateEmployeeBankList.isEmpty()) {
// 银行卡
List<TCheckBankNo> bankList = new ArrayList<>();
TCheckBankNo checkBankNo;
for (TSalaryEmployee employee : updateEmployeeBankList) {
if (Common.isNotNull(employee.getBankNo())
&& (Common.isEmpty(employee.getIssueStatus()) || employee.getIssueStatus().equals(CommonConstants.ZERO_INT))) {
checkBankNo = new TCheckBankNo();
checkBankNo.setName(employee.getEmpName());
checkBankNo.setBankNo(employee.getBankNo());
bankList.add(checkBankNo);
}
}
// 批量校验 卡号与手机号
Map<String, Boolean> bankMap = new HashMap<>();
if (!bankList.isEmpty()) {
R<CheckBatchVo> checkListR = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckbankno/inner/checkBankNoBatch", bankList, CheckBatchVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
bankMap = checkListR.getData().getCheckMap();
}
}
boolean isFalse = false;
String areaProvince;
String areaCity;
TSalaryEmployee oldEmp;
ExcelUtil<TSalaryEmployee> util = new ExcelUtil<>(TSalaryEmployee.class);
TSalaryEmpModLog log;
List<TSalaryEmpModLog> saveLogList = new ArrayList<>();
for (TSalaryEmployee employee : updateEmployeeBankList) {
if (Common.isNotNull(employee.getBankNo())
&& (Common.isEmpty(employee.getIssueStatus()) || employee.getIssueStatus().equals(CommonConstants.ZERO_INT))) {
oldEmp = updateEmpBankMap.get(employee.getEmpIdcard());
if (oldEmp != null) {
// 有变更才更新
if ( (Common.isNotNull(employee.getBankNo()) && !employee.getBankNo().equals(oldEmp.getBankNo()))
|| (Common.isNotNull(employee.getBankProvince()) && !employee.getBankProvince().equals(oldEmp.getBankProvince()))
|| (Common.isNotNull(employee.getBankCity()) && !employee.getBankCity().equals(oldEmp.getBankCity()))
|| (Common.isNotNull(employee.getBankName()) && !employee.getBankName().equals(oldEmp.getBankName()))
|| (Common.isNotNull(employee.getBankSubName()) && !employee.getBankSubName().equals(oldEmp.getBankSubName()))
) {
if (bankMap.get(employee.getBankNo()) != null) {
if (Boolean.FALSE.equals(bankMap.get(employee.getBankNo()))) {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【姓名与卡号验证:认证不一致】"));
isFalse = true;
}
} else {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【姓名与卡号验证:" + SalaryConstants.CHECK_NO_RESPONSE + "】"));
isFalse = true;
}
if (Common.isNotNull(employee.getBankProvince())) {
areaProvince = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankProvince().trim());
if (Common.isNotNull(areaProvince)) {
if (Common.isNotNull(employee.getBankCity())) {
areaCity = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + employee.getBankProvince().trim());
if (Common.isNotNull(areaCity)) {
employee.setBankCity(areaCity);
} else {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【" + SalaryConstants.CITY_ERROR + "】"));
isFalse = true;
}
}
employee.setBankProvince(areaProvince);
} else {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【" + SalaryConstants.PROVINCE_ERROR + "】"));
isFalse = true;
}
}
if (!isFalse) {
log = logService.checkEditToLog(employee,oldEmp,CommonConstants.FOUR_STRING,employee.getCreateName(), util);
if (log != null) {
saveLogList.add(log);
}
}
}
}
}
}
if (isFalse) {
return null;
}
// 更新人员
this.updateBatchById(updateEmployeeBankList);
// 新增日志
logService.saveBatch(saveLogList);
}
return null;
}
/** /**
* @param employee * @param employee
* @Description: 校验卡号与手机号 * @Description: 校验卡号与手机号
......
package com.yifu.cloud.plus.v1.yifu.salary.util; package com.yifu.cloud.plus.v1.yifu.salary.util;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -142,6 +143,11 @@ public class SalaryAccountUtil implements Serializable { ...@@ -142,6 +143,11 @@ public class SalaryAccountUtil implements Serializable {
boolean notLabour = !CommonConstants.THREE_STRING.equals(salaryType); boolean notLabour = !CommonConstants.THREE_STRING.equals(salaryType);
// 连接查询的数据集合 // 连接查询的数据集合
List<TSalaryEmployee> updateEmpList = new ArrayList<>(); List<TSalaryEmployee> updateEmpList = new ArrayList<>();
// 2024-7-22 10:16:42 hgw 更新卡号等信息
List<TSalaryEmployee> updateEmpBankList = new ArrayList<>();
// 2024-7-22 10:16:42 hgw 更新卡号等信息,存储旧人员信息,以增加更新记录使用
Map<String, TSalaryEmployee> updateEmpBankMap = new HashMap<>();
List<TSalaryEmployee> checkBankInfoEmpList = new ArrayList<>(); List<TSalaryEmployee> checkBankInfoEmpList = new ArrayList<>();
List<TSalaryEmployee> newEmpList = new ArrayList<>(); List<TSalaryEmployee> newEmpList = new ArrayList<>();
Map<String, TSalaryAccountVo> entityMap = new HashMap<>(); Map<String, TSalaryAccountVo> entityMap = new HashMap<>();
...@@ -477,7 +483,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -477,7 +483,8 @@ public class SalaryAccountUtil implements Serializable {
// newEmpUpdateFlag = CommonConstants.ZERO_STRING // newEmpUpdateFlag = CommonConstants.ZERO_STRING
if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList
, entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle , entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle
, nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap, newEmpUpdateFlag)) , nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap
, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap))
continue; continue;
} }
if (saiList != null && !saiList.isEmpty()) { if (saiList != null && !saiList.isEmpty()) {
...@@ -575,7 +582,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -575,7 +582,8 @@ public class SalaryAccountUtil implements Serializable {
, CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime()) , CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime())
, CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee()) , CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee())
, otherEmp.getEmpName(), entity.getSalaryStyle() , otherEmp.getEmpName(), entity.getSalaryStyle()
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow, bankMap, newEmpUpdateFlag)) { , nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow
, bankMap, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap)) {
isContinue = false; isContinue = false;
} }
} }
...@@ -603,9 +611,32 @@ public class SalaryAccountUtil implements Serializable { ...@@ -603,9 +611,32 @@ public class SalaryAccountUtil implements Serializable {
} }
} }
} }
if (!updateEmpBankList.isEmpty()) {
TSalaryEmployee saveNewEmp;
for (int i = 0; i < updateEmpBankList.size(); i++) {
saveNewEmp = updateEmpBankList.get(i);
// 新员工校验计税月
if (!"3".equals(salaryType) && !"4".equals(salaryType)) {
entity = entityMap.get(saveNewEmp.getEmpIdcard());
minTaxMonth = minTaxMonthMap.get(saveNewEmp.getEmpIdcard());
if (Common.isNotNull(minTaxMonth)
&& !minTaxMonth.equals(entity.getTaxMonth())) {
error = "第" + (saveNewEmp.getLineNums() + dataRow) + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage((saveNewEmp.getLineNums() + dataRow), error));
canSave = false;
}
}
}
}
if (canSave) { if (canSave) {
// 新增 // 新增
tSalaryEmployeeService.saveNewEmployeeList(saveNewEmpList, errorList); if (!saveNewEmpList.isEmpty()) {
tSalaryEmployeeService.saveNewEmployeeList(saveNewEmpList, errorList);
}
// 更新人员信息
if (!updateEmpBankList.isEmpty()) {
tSalaryEmployeeService.updateEmployeeBankList(updateEmpBankList, updateEmpBankMap, errorList);
}
} }
} }
} }
...@@ -618,14 +649,25 @@ public class SalaryAccountUtil implements Serializable { ...@@ -618,14 +649,25 @@ public class SalaryAccountUtil implements Serializable {
this.setErrorInfo(errorList); this.setErrorInfo(errorList);
} }
// updateEmpBankList hgw 2024-7-22 10:18:02 更新开户行卡号等信息,以表导入为准
private boolean setEntityByEmpInfo(TSettleDomainSelectVo dept, Map<String, Integer> ownEmployeeMap private boolean setEntityByEmpInfo(TSettleDomainSelectVo dept, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, String salaryType, Integer isIssue, List<ErrorMessage> errorList , Map<String, Integer> ownDeptMap, String salaryType, Integer isIssue, List<ErrorMessage> errorList
, TSalaryAccountVo entity, TSalaryEmployee emp, List<TSalaryAccountItemVo> saiList , TSalaryAccountVo entity, TSalaryEmployee emp, List<TSalaryAccountItemVo> saiList
, boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth , boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth
, List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i , List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i
, Map<String, String> bankMap, String newEmpUpdateFlag) { , Map<String, String> bankMap, String newEmpUpdateFlag, List<TSalaryEmployee> updateEmpBankList
, Map<String, TSalaryEmployee> updateEmpBankMap) {
TSalaryAccountItemVo sai; TSalaryAccountItemVo sai;
String error; String error;
emp.setLineNums(i);
if (dept != null && dept.getId() != null && !dept.getId().equals(emp.getDeptId())) {
emp.setDeptId(dept.getId());
emp.setDeptName(dept.getDepartName());
emp.setDeptNo(dept.getDepartNo());
emp.setUnitId(dept.getCustomerId());
emp.setUnitNo(dept.getCustomerNo());
emp.setUnitName(dept.getCustomerName());
}
if (Common.isEmpty(emp.getEmpName())) { if (Common.isEmpty(emp.getEmpName())) {
error = "第" + i + "行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!"; error = "第" + i + "行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
...@@ -696,9 +738,12 @@ public class SalaryAccountUtil implements Serializable { ...@@ -696,9 +738,12 @@ public class SalaryAccountUtil implements Serializable {
// hgs 2024-7-19 09:33:29 新增按照页面开关与新员工字段,来更新员工信息: // hgs 2024-7-19 09:33:29 新增按照页面开关与新员工字段,来更新员工信息:
if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle)) { if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle)) {
if (CommonConstants.ONE_STRING.equals(newEmpUpdateFlag) && isNewEmployee) { if (CommonConstants.ONE_STRING.equals(newEmpUpdateFlag) && isNewEmployee) {
TSalaryEmployee oldEmp = new TSalaryEmployee();
BeanUtil.copyProperties(emp,oldEmp);
updateEmpBankMap.put(emp.getEmpIdcard(), oldEmp);
if (Common.isEmpty(entity.getBankName())) { if (Common.isEmpty(entity.getBankName())) {
if (Common.isEmpty(emp.getBankName())) { if (Common.isEmpty(emp.getBankName())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -709,7 +754,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -709,7 +754,7 @@ public class SalaryAccountUtil implements Serializable {
} }
if (Common.isEmpty(entity.getBankNo())) { if (Common.isEmpty(entity.getBankNo())) {
if (Common.isEmpty(emp.getBankNo())) { if (Common.isEmpty(emp.getBankNo())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -720,7 +765,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -720,7 +765,7 @@ public class SalaryAccountUtil implements Serializable {
} }
if (Common.isEmpty(entity.getBankProvince())) { if (Common.isEmpty(entity.getBankProvince())) {
if (Common.isEmpty(emp.getBankProvince())) { if (Common.isEmpty(emp.getBankProvince())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -731,7 +776,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -731,7 +776,7 @@ public class SalaryAccountUtil implements Serializable {
} }
if (Common.isEmpty(emp.getBankCity())) { if (Common.isEmpty(emp.getBankCity())) {
if (Common.isEmpty(emp.getBankCity())) { if (Common.isEmpty(emp.getBankCity())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -740,6 +785,22 @@ public class SalaryAccountUtil implements Serializable { ...@@ -740,6 +785,22 @@ public class SalaryAccountUtil implements Serializable {
} else { } else {
emp.setBankCity(entity.getBankCity()); emp.setBankCity(entity.getBankCity());
} }
if (Common.isNotNull(emp.getBankProvince())) {
String areaInt = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + emp.getBankProvince().trim());
if (Common.isNotNull(areaInt)) {
entity.setBankProvince(areaInt);
}
String areaCityInt = null;
if (Common.isNotNull(emp.getBankCity())) {
areaCityInt = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + emp.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + emp.getBankProvince().trim());
if (Common.isNotNull(areaCityInt)) {
entity.setBankCity(areaCityInt);
}
}
}
if (Common.isEmpty(entity.getBankSubName()) ){ if (Common.isEmpty(entity.getBankSubName()) ){
if (Common.isNotNull(emp.getBankSubName())) { if (Common.isNotNull(emp.getBankSubName())) {
entity.setBankSubName(emp.getBankSubName()); entity.setBankSubName(emp.getBankSubName());
...@@ -748,11 +809,11 @@ public class SalaryAccountUtil implements Serializable { ...@@ -748,11 +809,11 @@ public class SalaryAccountUtil implements Serializable {
emp.setBankSubName(entity.getBankSubName()); emp.setBankSubName(entity.getBankSubName());
} }
if (bankMap.get(entity.getBankName()) == null) { if (bankMap.get(entity.getBankName()) == null) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} }
updateEmpList.add(emp); updateEmpBankList.add(emp);
} else if (salaryGiveTimeFlag) { } else if (salaryGiveTimeFlag) {
if (Common.isEmpty(emp.getBankName())) { if (Common.isEmpty(emp.getBankName())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!";
......
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