Commit 4b2c6c5a authored by hongguangwu's avatar hongguangwu

MVP1.7.8-hgw(判断简档详档)

parent 753e849c
......@@ -46,12 +46,17 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
List<TAttaInfo> getAttaByApplyId(@Param("applyId")String applyId);
void deleteByDomainId(@Param("domainId") String domainId);
// 详档变简档,删除身份证、其他附件、签名之外的附件
void deleteByDomainIdExceptionCard(@Param("domainId") String domainId);
void deleteByDomainIdAndType(@Param("domainId") String domainId, @Param("relationType") String relationType);
// 删除学历与职业资格之外的附件
void deleteByDomainIdAndOther(@Param("domainId") String domainId);
// 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文)
void deleteByDomainIdCard(@Param("domainId") String domainId);
List<TAttaInfoVo> getAttInfoByParam(@Param("departNo")String departNo, @Param("startDate")String startDate, @Param("endDate")String endDate);
int getAttInfoCountByParam(@Param("departNo")String departNo, @Param("startDate")String startDate, @Param("endDate")String endDate);
......
......@@ -80,8 +80,19 @@ public interface TAttaInfoService extends IService<TAttaInfo> {
**/
void deleteByDomainId(String domainId);
/**
* @Description: 详档变简档,删除身份证、其他附件、签名之外的附件
* @Author: hgw
* @Date: 2025/3/21 17:06
* @return: void
**/
void deleteByDomainIdExceptionCard(String domainId);
void deleteByDomainIdAndOther(String domainId);
// 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文)
void deleteByDomainIdCard(String domainId);
void deleteByDomainIdAndType(String domainId, int relationType);
List<TAttaInfoVo> getAttInfoByParam(String departNo, String startDate, String endDate);
......
......@@ -135,11 +135,21 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo
baseMapper.deleteByDomainId(domainId);
}
@Override
public void deleteByDomainIdExceptionCard(String domainId) {
baseMapper.deleteByDomainIdExceptionCard(domainId);
}
@Override
public void deleteByDomainIdAndOther(String domainId) {
baseMapper.deleteByDomainIdAndOther(domainId);
}
@Override
public void deleteByDomainIdCard(String domainId) {
baseMapper.deleteByDomainIdCard(domainId);
}
@Override
public void deleteByDomainIdAndType(String domainId, int relationType) {
// 学历
......
......@@ -213,7 +213,15 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 类型1详档2简档
String isSimple = registrationPreService.judgeIsSimple(empIdCard, deptId);
TPreEmpDeclaration declaration;
// 是否为详档,true 是,否则不创建多余的附属信息
boolean isDetailBoo = true;
// 详变简,再清空预入职信息
boolean isDetailToSimple = false;
if (CommonConstants.TWO_STRING.equals(isSimple)) {
isDetailBoo = false;
if (main == null || Common.isEmpty(main.getIsSimple()) || CommonConstants.ONE_STRING.equals(main.getIsSimple())) {
isDetailToSimple = true;
}
declaration = tPreEmpDeclarationService.getById(CommonConstants.TWO_STRING);
} else {
declaration = tPreEmpDeclarationService.getTPreEmpDeclarationList();
......@@ -227,23 +235,64 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TEmployeeProject project = tEmployeeProjectService.getByEmpIdCardAndDeptId(empIdCard, deptId);
PreEmpMainDetailVo vo = new PreEmpMainDetailVo();
YifuUser user = getNewYifuUser();
if (main != null && CommonConstants.FIVE_STRING.equals(main.getStatus())) {
if (main != null) {
// 清空信息
if (Common.isNotNull(main.getId())) {
if (CommonConstants.FIVE_STRING.equals(main.getStatus())) {
if (Common.isNotNull(main.getId())) {
baseMapper.deleteBadByMainId(main.getId());
baseMapper.deleteContactByMainId(main.getId());
baseMapper.deleteDisabilityByMainId(main.getId());
baseMapper.deleteEducationByMainId(main.getId());
baseMapper.deleteFamilyByMainId(main.getId());
baseMapper.deleteEmployeeByMainId(main.getId());
baseMapper.deleteProjectByMainId(main.getId());
tPreEmpWorkRecordingService.deleteByMainId(main.getId());
tPreEmpProfessionalService.deleteProfessionalByMainId(main.getId());
tPreEmpOtherFileService.deleteOtherFileByMainId(main.getId());
tAttaInfoService.deleteByDomainId(main.getId());
}
baseMapper.deleteById(main);
main = null;
}
// 1.7.8 2025-3-21 16:58:56 详档变简档,清空部分信息
if (main != null && isDetailToSimple) {
TPreEmployeeInfo emp = tPreEmployeeInfoService.getTPreEmployeeInfoList(main.getId());
// 先删除档案,然后保留部分信息(项目档案不用,因为都是项目信息等)
baseMapper.deleteEmployeeByMainId(main.getId());
TPreEmployeeInfo newEmp = new TPreEmployeeInfo();
newEmp.setOldId(emp.getOldId());
newEmp.setPreMainId(main.getId());
newEmp.setEmpName(emp.getEmpName());
newEmp.setEmpIdcard(emp.getEmpIdcard());
newEmp.setEmpPhone(emp.getEmpPhone());
newEmp.setContactAddress(emp.getContactAddress());
newEmp.setContactProvince(emp.getContactProvince());
newEmp.setContactCity(emp.getContactCity());
newEmp.setContactTown(emp.getContactTown());
this.setBaseSexInfo(newEmp);
newEmp.setBankProvince(emp.getBankProvince());
newEmp.setBankCity(emp.getBankCity());
newEmp.setBankName(emp.getBankName());
newEmp.setBankSubName(emp.getBankSubName());
newEmp.setBankNo(emp.getBankNo());
newEmp.setCreateBy(user.getId());
newEmp.setCreateName(user.getNickname());
newEmp.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.save(newEmp);
vo.setTpreEmployeeInfo(newEmp);
// 全部保留
// baseMapper.deleteContactByMainId(main.getId())
// tPreEmpOtherFileService.deleteOtherFileByMainId(main.getId())
// 删除
baseMapper.deleteBadByMainId(main.getId());
baseMapper.deleteContactByMainId(main.getId());
baseMapper.deleteDisabilityByMainId(main.getId());
baseMapper.deleteEducationByMainId(main.getId());
baseMapper.deleteFamilyByMainId(main.getId());
baseMapper.deleteEmployeeByMainId(main.getId());
baseMapper.deleteProjectByMainId(main.getId());
tPreEmpWorkRecordingService.deleteByMainId(main.getId());
tPreEmpProfessionalService.deleteProfessionalByMainId(main.getId());
tPreEmpOtherFileService.deleteOtherFileByMainId(main.getId());
tAttaInfoService.deleteByDomainId(main.getId());
// 删除附件,保留身份证、其他附件、签名
tAttaInfoService.deleteByDomainIdExceptionCard(main.getId());
}
baseMapper.deleteById(main);
main = null;
}
// 审核通过并且有在项,取在项
boolean empFirst = false;
......@@ -416,39 +465,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (vo.getTpreEmpDeclaration() == null) {
vo.setTpreEmpDeclaration(declaration);
}
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = tPreEmpBadRecordService.getTPreEmpBadRecordList(id);
if (tPreEmpBadRecord == null || empFirst) {
String preId = null;
if (tPreEmpBadRecord != null) {
preId = tPreEmpBadRecord.getId();
}
tPreEmpBadRecord = new TPreEmpBadRecord();
tPreEmpBadRecord.setId(preId);
if (Common.isNotNull(empId)) {
TEmpBadRecord info = tEmpBadRecordService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpBadRecord, ID);
if (Common.isEmpty(preId) && empFirst) {
tPreEmpBadRecord.setId(info.getId());
}
tPreEmpBadRecord.setEmpId(empId);
tPreEmpBadRecord.setOldId(info.getId());
}
}
tPreEmpBadRecord.setPreMainId(id);
tPreEmpBadRecord.setSettleDomain(deptId);
tPreEmpBadRecord.setProject(dept.getDepartName());
tPreEmpBadRecord.setProjectCode(dept.getDepartNo());
tPreEmpBadRecord.setEmpIdcard(empIdCard);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tPreEmpBadRecord.getId())) {
tPreEmpBadRecordService.save(tPreEmpBadRecord);
}
}
vo.setTpreEmpBadRecord(tPreEmpBadRecord);
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = tPreEmpContactInfoService.getTPreEmpContactInfoList(id);
if (tPreEmpContactInfo == null || empFirst) {
......@@ -478,192 +495,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
vo.setTpreEmpContactInfo(tPreEmpContactInfo);
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = tPreEmpDisabilityInfoService.getTPreEmpDisabilityInfoList(id);
if (tPreEmpDisabilityInfo == null || empFirst) {
String preId = null;
if (tPreEmpDisabilityInfo != null) {
preId = tPreEmpDisabilityInfo.getId();
}
tPreEmpDisabilityInfo = new TPreEmpDisabilityInfo();
tPreEmpDisabilityInfo.setId(preId);
if (Common.isNotNull(empId)) {
TEmpDisabilityInfo info = tEmpDisabilityInfoService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpDisabilityInfo, ID);
if (Common.isEmpty(preId) && !empFirst) {
tPreEmpDisabilityInfo.setId(info.getId());
}
tPreEmpDisabilityInfo.setEmpId(empId);
tPreEmpDisabilityInfo.setOldId(info.getId());
}
}
tPreEmpDisabilityInfo.setPreMainId(id);
tPreEmpDisabilityInfo.setSettleDomain(deptId);
if (employee != null) {
tPreEmpDisabilityInfo.setEmpId(employee.getId());
tPreEmpDisabilityInfo.setEmpName(employee.getEmpName());
tPreEmpDisabilityInfo.setEmpCode(employee.getEmpCode());
}
tPreEmpDisabilityInfo.setEmpIdcard(empIdCard);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateName(user.getNickname());
tPreEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tPreEmpDisabilityInfo.getId())) {
tPreEmpDisabilityInfoService.save(tPreEmpDisabilityInfo);
}
}
vo.setTpreEmpDisabilityInfo(tPreEmpDisabilityInfo);
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = tPreEmpEducationService.getTPreEmpEducationList(id);
if (tPreEmpEducation == null || empFirst) {
String preId = null;
if (tPreEmpEducation != null) {
preId = tPreEmpEducation.getId();
}
tPreEmpEducation = new TPreEmpEducation();
tPreEmpEducation.setId(preId);
if (Common.isNotNull(empId)) {
TEmpEducation info = tEmpEducationService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpEducation, ID);
if (Common.isEmpty(preId) && !empFirst) {
tPreEmpEducation.setId(info.getId());
}
tPreEmpEducation.setEmpId(empId);
tPreEmpEducation.setOldId(info.getId());
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
}
tPreEmpEducation.setPreMainId(id);
tPreEmpEducation.setSettleDomain(deptId);
if (employee != null) {
tPreEmpEducation.setEmpId(employee.getId());
tPreEmpEducation.setEmpName(employee.getEmpName());
tPreEmpEducation.setEmpCode(employee.getEmpCode());
}
tPreEmpEducation.setEmpIdcard(empIdCard);
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducation.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tPreEmpEducation.getId())) {
tPreEmpEducationService.save(tPreEmpEducation);
}
} else {
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(tPreEmpEducation.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
vo.setTpreEmpEducation(tPreEmpEducation);
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = tPreEmpFamilyService.getTPreEmpFamilyList(id);
if (tPreEmpFamilyList == null || tPreEmpFamilyList.isEmpty()) {
tPreEmpFamilyList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpFamily> infoList = tEmpFamilyService.getListByEmpId(empId);
if (infoList != null && !infoList.isEmpty()) {
TPreEmpFamily record;
for (TEmpFamily info : infoList) {
record = new TPreEmpFamily();
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpFamilyList.add(record);
}
tPreEmpFamilyService.saveBatch(tPreEmpFamilyList);
}
}
if (tPreEmpFamilyList.isEmpty()) {
TPreEmpFamily record = new TPreEmpFamily();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyService.save(record);
tPreEmpFamilyList.add(record);
}
} else if (empFirst) {
tPreEmpFamilyList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpFamily> infoList = tEmpFamilyService.getListByEmpId(empId);
if (infoList != null && !infoList.isEmpty()) {
TPreEmpFamily record;
for (TEmpFamily info : infoList) {
record = new TPreEmpFamily();
BeanUtil.copyProperties(info, record);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpFamilyList.add(record);
}
}
}
if (tPreEmpFamilyList.isEmpty()) {
TPreEmpFamily record = new TPreEmpFamily();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyList.add(record);
}
}
vo.setTpreEmpFamilyList(tPreEmpFamilyList);
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo;
if (vo.getTpreEmployeeInfo() == null) {
......@@ -723,137 +555,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalService.getTPreEmpProfessionalQualificationList(id);
if (tPreEmpProfessionalQualificationList == null || tPreEmpProfessionalQualificationList.isEmpty()) {
tPreEmpProfessionalQualificationList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpProfessionalQualification> infoList = tEmpProfessionalService.getListByEmpId(empId);
TPreEmpProfessionalQualification record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpProfessionalQualification info : infoList) {
record = new TPreEmpProfessionalQualification();
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
record.setAttaList(attaInfoList);
record.setPreMainId(id);
record.setEmpIdcard(empIdCard);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpProfessionalQualificationList.add(record);
}
tPreEmpProfessionalService.saveBatch(tPreEmpProfessionalQualificationList);
}
}
if (tPreEmpProfessionalQualificationList.isEmpty()) {
TPreEmpProfessionalQualification record = new TPreEmpProfessionalQualification();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setAttaList(new ArrayList<>());
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalService.save(record);
tPreEmpProfessionalQualificationList.add(record);
}
} else if (empFirst) {
tPreEmpProfessionalQualificationList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpProfessionalQualification> infoList = tEmpProfessionalService.getListByEmpId(empId);
TPreEmpProfessionalQualification record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpProfessionalQualification info : infoList) {
record = new TPreEmpProfessionalQualification();
BeanUtil.copyProperties(info, record);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
record.setAttaList(attaInfoList);
record.setPreMainId(id);
record.setEmpIdcard(empIdCard);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpProfessionalQualificationList.add(record);
}
}
}
if (tPreEmpProfessionalQualificationList.isEmpty()) {
TPreEmpProfessionalQualification record = new TPreEmpProfessionalQualification();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setAttaList(new ArrayList<>());
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalQualificationList.add(record);
}
} else {
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualificationList) {
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
info.setAttaList(attaInfoList);
}
}
vo.setTpreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
// 预入职-其他附件
List<TPreEmpOtherFile> tPreEmpOtherFileList = tPreEmpOtherFileService.getTPreEmpOtherFileList(id);
if (tPreEmpOtherFileList == null || tPreEmpOtherFileList.isEmpty()) {
......@@ -951,112 +652,472 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
vo.setTpreEmpOtherFileList(tPreEmpOtherFileList);
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = tPreEmpWorkRecordingService.getTPreEmpWorkRecordingList(id);
if (tPreEmpWorkRecordingList == null || tPreEmpWorkRecordingList.isEmpty()) {
tPreEmpWorkRecordingList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpWorkRecording> infoList = tEmpWorkRecordingService.getListByEmpId(empId);
TPreEmpWorkRecording record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpWorkRecording info : infoList) {
record = new TPreEmpWorkRecording();
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
// 预入职-附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> allAttaList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
if ((allAttaList == null || allAttaList.isEmpty() || empFirst) && Common.isNotNull(empId)) {
allAttaList = tAttaInfoService.getTAttaInfoListByDoMainId(empId);
}
if (allAttaList != null && !allAttaList.isEmpty()) {
URL url;
for (TAttaInfo atta : allAttaList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
vo.setAttaInfoList(allAttaList);
// 以下为详档所有,简档不具有:
if (isDetailBoo) {
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = tPreEmpBadRecordService.getTPreEmpBadRecordList(id);
if (tPreEmpBadRecord == null || empFirst) {
String preId = null;
if (tPreEmpBadRecord != null) {
preId = tPreEmpBadRecord.getId();
}
tPreEmpBadRecord = new TPreEmpBadRecord();
tPreEmpBadRecord.setId(preId);
if (Common.isNotNull(empId)) {
TEmpBadRecord info = tEmpBadRecordService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpBadRecord, ID);
if (Common.isEmpty(preId) && empFirst) {
tPreEmpBadRecord.setId(info.getId());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpBadRecord.setEmpId(empId);
tPreEmpBadRecord.setOldId(info.getId());
}
}
tPreEmpBadRecord.setPreMainId(id);
tPreEmpBadRecord.setSettleDomain(deptId);
tPreEmpBadRecord.setProject(dept.getDepartName());
tPreEmpBadRecord.setProjectCode(dept.getDepartNo());
tPreEmpBadRecord.setEmpIdcard(empIdCard);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tPreEmpBadRecord.getId())) {
tPreEmpBadRecordService.save(tPreEmpBadRecord);
}
}
vo.setTpreEmpBadRecord(tPreEmpBadRecord);
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = tPreEmpDisabilityInfoService.getTPreEmpDisabilityInfoList(id);
if (tPreEmpDisabilityInfo == null || empFirst) {
String preId = null;
if (tPreEmpDisabilityInfo != null) {
preId = tPreEmpDisabilityInfo.getId();
}
tPreEmpDisabilityInfo = new TPreEmpDisabilityInfo();
tPreEmpDisabilityInfo.setId(preId);
if (Common.isNotNull(empId)) {
TEmpDisabilityInfo info = tEmpDisabilityInfoService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpDisabilityInfo, ID);
if (Common.isEmpty(preId) && !empFirst) {
tPreEmpDisabilityInfo.setId(info.getId());
}
tPreEmpWorkRecordingList.add(record);
tPreEmpDisabilityInfo.setEmpId(empId);
tPreEmpDisabilityInfo.setOldId(info.getId());
}
tPreEmpWorkRecordingService.saveBatch(tPreEmpWorkRecordingList);
}
tPreEmpDisabilityInfo.setPreMainId(id);
tPreEmpDisabilityInfo.setSettleDomain(deptId);
if (employee != null) {
tPreEmpDisabilityInfo.setEmpId(employee.getId());
tPreEmpDisabilityInfo.setEmpName(employee.getEmpName());
tPreEmpDisabilityInfo.setEmpCode(employee.getEmpCode());
}
tPreEmpDisabilityInfo.setEmpIdcard(empIdCard);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateName(user.getNickname());
tPreEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tPreEmpDisabilityInfo.getId())) {
tPreEmpDisabilityInfoService.save(tPreEmpDisabilityInfo);
}
}
if (tPreEmpWorkRecordingList.isEmpty()) {
TPreEmpWorkRecording record = new TPreEmpWorkRecording();
record.setSettleDomain(deptId);
vo.setTpreEmpDisabilityInfo(tPreEmpDisabilityInfo);
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = tPreEmpEducationService.getTPreEmpEducationList(id);
if (tPreEmpEducation == null || empFirst) {
String preId = null;
if (tPreEmpEducation != null) {
preId = tPreEmpEducation.getId();
}
tPreEmpEducation = new TPreEmpEducation();
tPreEmpEducation.setId(preId);
if (Common.isNotNull(empId)) {
TEmpEducation info = tEmpEducationService.getByEmpId(empId);
if (info != null) {
BeanUtil.copyProperties(info, tPreEmpEducation, ID);
if (Common.isEmpty(preId) && !empFirst) {
tPreEmpEducation.setId(info.getId());
}
tPreEmpEducation.setEmpId(empId);
tPreEmpEducation.setOldId(info.getId());
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
}
tPreEmpEducation.setPreMainId(id);
tPreEmpEducation.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
tPreEmpEducation.setEmpId(employee.getId());
tPreEmpEducation.setEmpName(employee.getEmpName());
tPreEmpEducation.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecordingService.save(record);
tPreEmpWorkRecordingList.add(record);
tPreEmpEducation.setEmpIdcard(empIdCard);
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducation.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tPreEmpEducation.getId())) {
tPreEmpEducationService.save(tPreEmpEducation);
}
} else {
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(tPreEmpEducation.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
} else if (empFirst) {
tPreEmpWorkRecordingList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpWorkRecording> infoList = tEmpWorkRecordingService.getListByEmpId(empId);
TPreEmpWorkRecording record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpWorkRecording info : infoList) {
record = new TPreEmpWorkRecording();
BeanUtil.copyProperties(info, record);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
vo.setTpreEmpEducation(tPreEmpEducation);
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = tPreEmpFamilyService.getTPreEmpFamilyList(id);
if (tPreEmpFamilyList == null || tPreEmpFamilyList.isEmpty()) {
tPreEmpFamilyList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpFamily> infoList = tEmpFamilyService.getListByEmpId(empId);
if (infoList != null && !infoList.isEmpty()) {
TPreEmpFamily record;
for (TEmpFamily info : infoList) {
record = new TPreEmpFamily();
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpFamilyList.add(record);
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyService.saveBatch(tPreEmpFamilyList);
}
}
if (tPreEmpFamilyList.isEmpty()) {
TPreEmpFamily record = new TPreEmpFamily();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyService.save(record);
tPreEmpFamilyList.add(record);
}
} else if (empFirst) {
tPreEmpFamilyList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpFamily> infoList = tEmpFamilyService.getListByEmpId(empId);
if (infoList != null && !infoList.isEmpty()) {
TPreEmpFamily record;
for (TEmpFamily info : infoList) {
record = new TPreEmpFamily();
BeanUtil.copyProperties(info, record);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpFamilyList.add(record);
}
tPreEmpWorkRecordingList.add(record);
}
}
if (tPreEmpFamilyList.isEmpty()) {
TPreEmpFamily record = new TPreEmpFamily();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpFamilyList.add(record);
}
}
if (tPreEmpWorkRecordingList.isEmpty()) {
TPreEmpWorkRecording record = new TPreEmpWorkRecording();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
vo.setTpreEmpFamilyList(tPreEmpFamilyList);
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalService.getTPreEmpProfessionalQualificationList(id);
if (tPreEmpProfessionalQualificationList == null || tPreEmpProfessionalQualificationList.isEmpty()) {
tPreEmpProfessionalQualificationList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpProfessionalQualification> infoList = tEmpProfessionalService.getListByEmpId(empId);
TPreEmpProfessionalQualification record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpProfessionalQualification info : infoList) {
record = new TPreEmpProfessionalQualification();
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
record.setAttaList(attaInfoList);
record.setPreMainId(id);
record.setEmpIdcard(empIdCard);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpProfessionalQualificationList.add(record);
}
tPreEmpProfessionalService.saveBatch(tPreEmpProfessionalQualificationList);
}
}
if (tPreEmpProfessionalQualificationList.isEmpty()) {
TPreEmpProfessionalQualification record = new TPreEmpProfessionalQualification();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setAttaList(new ArrayList<>());
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalService.save(record);
tPreEmpProfessionalQualificationList.add(record);
}
} else if (empFirst) {
tPreEmpProfessionalQualificationList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpProfessionalQualification> infoList = tEmpProfessionalService.getListByEmpId(empId);
TPreEmpProfessionalQualification record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpProfessionalQualification info : infoList) {
record = new TPreEmpProfessionalQualification();
BeanUtil.copyProperties(info, record);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
record.setAttaList(attaInfoList);
record.setPreMainId(id);
record.setEmpIdcard(empIdCard);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpProfessionalQualificationList.add(record);
}
}
}
if (tPreEmpProfessionalQualificationList.isEmpty()) {
TPreEmpProfessionalQualification record = new TPreEmpProfessionalQualification();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setAttaList(new ArrayList<>());
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpProfessionalQualificationList.add(record);
}
} else {
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualificationList) {
// 附件
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(info.getId());
if (attaInfoList != null) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
}
}
info.setAttaList(attaInfoList);
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecordingList.add(record);
}
}
vo.setTpreEmpWorkRecordingList(tPreEmpWorkRecordingList);
vo.setTpreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
// 预入职-附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
if ((attaInfoList == null || attaInfoList.isEmpty() || empFirst) && Common.isNotNull(empId)) {
attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(empId);
}
if (attaInfoList != null && !attaInfoList.isEmpty()) {
URL url;
for (TAttaInfo atta : attaInfoList) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(String.valueOf(url));
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = tPreEmpWorkRecordingService.getTPreEmpWorkRecordingList(id);
if (tPreEmpWorkRecordingList == null || tPreEmpWorkRecordingList.isEmpty()) {
tPreEmpWorkRecordingList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpWorkRecording> infoList = tEmpWorkRecordingService.getListByEmpId(empId);
TPreEmpWorkRecording record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpWorkRecording info : infoList) {
record = new TPreEmpWorkRecording();
BeanUtil.copyProperties(info, record, ID);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpWorkRecordingList.add(record);
}
tPreEmpWorkRecordingService.saveBatch(tPreEmpWorkRecordingList);
}
}
if (tPreEmpWorkRecordingList.isEmpty()) {
TPreEmpWorkRecording record = new TPreEmpWorkRecording();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecordingService.save(record);
tPreEmpWorkRecordingList.add(record);
}
} else if (empFirst) {
tPreEmpWorkRecordingList = new ArrayList<>();
if (Common.isNotNull(empId)) {
List<TEmpWorkRecording> infoList = tEmpWorkRecordingService.getListByEmpId(empId);
TPreEmpWorkRecording record;
if (infoList != null && !infoList.isEmpty()) {
for (TEmpWorkRecording info : infoList) {
record = new TPreEmpWorkRecording();
BeanUtil.copyProperties(info, record);
record.setEmpId(empId);
record.setOldId(info.getId());
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
if (Common.isEmpty(record.getCreateBy())) {
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
}
tPreEmpWorkRecordingList.add(record);
}
}
}
if (tPreEmpWorkRecordingList.isEmpty()) {
TPreEmpWorkRecording record = new TPreEmpWorkRecording();
record.setSettleDomain(deptId);
if (employee != null) {
record.setEmpId(employee.getId());
record.setEmpName(employee.getEmpName());
record.setEmpCode(employee.getEmpCode());
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
record.setCreateTime(LocalDateTime.now());
tPreEmpWorkRecordingList.add(record);
}
}
vo.setTpreEmpWorkRecordingList(tPreEmpWorkRecordingList);
}
vo.setAttaInfoList(attaInfoList);
return R.ok(vo);
}
......@@ -1497,17 +1558,17 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
}
// 如果是简档,将清空多余信息
// 如果是简档,将清空多余信息(在获取里清空过了)
boolean isSimpleBoo = false;
if (CommonConstants.TWO_STRING.equals(isSimple)) {
// TODO - 删除多余
isSimpleBoo = true;
}
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
// 预入职-人员档案表
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())) {
// 转到更新档案去
return updateToEmployeeByPre(vo);
return updateToEmployeeByPre(vo, isSimpleBoo);
} else {
return R.failed("档案原ID不可为空!");
}
......@@ -1515,6 +1576,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 有信息,就跳转到待审核
if (pre != null && Common.isNotNull(pre.getId()) && CommonConstants.ONE_STRING.equals(status)) {
main.setStatus(CommonConstants.TWO_STRING);
if (isSimpleBoo) {
main.setStatus(CommonConstants.FOUR_STRING);
// 审核日志
TPreEmpMainLog auditLog = new TPreEmpMainLog();
auditLog.setAuditId(user.getId());
auditLog.setAuditName(user.getNickname());
auditLog.setAuditTime(new Date());
auditLog.setAuditRemark("简档自动审核通过");
auditLog.setMainId(main.getId());
auditLog.setAuditResult(status);
tPreEmpMainLogService.save(auditLog);
updateToEmployeeByPre(vo, isSimpleBoo);
}
}
main.setStatus(status);
main.setCreateBy(user.getId());
......@@ -1785,12 +1859,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
/**
* @param isSimpleBoo true 简档,仅更新部分信息
* @Description: 执行复制到档案的操作
* @Author: hgw
* @Date: 2024/6/18 19:35
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private R<String> updateToEmployeeByPre(PreEmpMainDetailVo vo) {
private R<String> updateToEmployeeByPre(PreEmpMainDetailVo vo, boolean isSimpleBoo) {
YifuUser user = SecurityUtils.getUser();
if (user == null) {
user = getNewYifuUser();
......@@ -1848,7 +1923,29 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (emp != null) {
// 生成性别年龄等:
this.setBaseSexInfo(tPreEmployeeInfo);
BeanUtil.copyProperties(tPreEmployeeInfo, emp, ID);
if (isSimpleBoo) {
// 简档,仅重置部分信息:
emp.setEmpName(tPreEmployeeInfo.getEmpName());
emp.setEmpIdcard(tPreEmployeeInfo.getEmpIdcard());
emp.setEmpPhone(tPreEmployeeInfo.getEmpPhone());
emp.setContactAddress(tPreEmployeeInfo.getContactAddress());
emp.setContactProvince(tPreEmployeeInfo.getContactProvince());
emp.setContactCity(tPreEmployeeInfo.getContactCity());
emp.setContactTown(tPreEmployeeInfo.getContactTown());
emp.setEmpBirthday(tPreEmployeeInfo.getEmpBirthday());
emp.setEmpSex(tPreEmployeeInfo.getEmpSex());
emp.setEmpAge(tPreEmployeeInfo.getEmpAge());
emp.setBankProvince(tPreEmployeeInfo.getBankProvince());
emp.setBankCity(tPreEmployeeInfo.getBankCity());
emp.setBankName(tPreEmployeeInfo.getBankName());
emp.setBankSubName(tPreEmployeeInfo.getBankSubName());
emp.setBankNo(tPreEmployeeInfo.getBankNo());
emp.setCreateBy(user.getId());
emp.setCreateName(user.getNickname());
emp.setCreateTime(LocalDateTime.now());
} else {
BeanUtil.copyProperties(tPreEmployeeInfo, emp, ID);
}
if (CommonConstants.ONE_INT == emp.getFileStatus()) {
emp.setCreateTime(LocalDateTime.now());
emp.setFileStatus(CommonConstants.ZERO_INT);
......@@ -1966,88 +2063,90 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 预入职-员工职业资格信息表
// 最高学历
if (tPreEmpEducation != null) {
TEmpEducation tEmpEducation = null;
if (Common.isNotNull(tPreEmpEducation.getOldId())) {
tEmpEducation = tEmpEducationService.getById(tPreEmpEducation.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpEducation = tEmpEducationService.getByEmpId(empId);
}
if (tEmpEducation == null) {
tEmpEducation = new TEmpEducation();
} else {
// 已存在的学历信息(如果不一致,要更新档案的最高学历)
if (Common.isEmpty(tEmpEducation.getEducationName())
|| !tEmpEducation.getEducationName().equals(tPreEmpEducation.getEducationName())) {
emp.setHignEducation(tPreEmpEducation.getEducationName());
tEmployeeInfoService.updateById(emp);
}
}
BeanUtil.copyProperties(tPreEmpEducation, tEmpEducation, ID);
if (Common.isEmpty(tEmpEducation.getEmpCode())) {
tEmpEducation.setEmpCode(emp.getEmpCode());
}
if (Common.isEmpty(tEmpEducation.getEmpName())) {
tEmpEducation.setEmpName(emp.getEmpName());
}
if (Common.isEmpty(tEmpEducation.getCreateTime())) {
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducation.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpEducation.setEmpId(empId);
if (Common.isNotNull(empIdCard)) {
tEmpEducationService.updateEducationToNoByIdCard(empIdCard);
}
if (Common.isEmpty(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
tEmpEducation.setCreateName(user.getNickname());
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducationService.saveOrUpdate(tEmpEducation);
String attaId = tPreEmpEducation.getOldId();
tAttaInfoService.deleteByDomainIdAndType(attaId, 0);
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) {
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
BeanUtil.copyProperties(atta, newEmpAtta, ID);
newEmpAtta.setDomainId(tEmpEducation.getId());
if (Common.isEmpty(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
tEmpEducation.setCreateName(user.getNickname());
tEmpEducation.setCreateTime(LocalDateTime.now());
if (!isSimpleBoo) {
if (tPreEmpEducation != null) {
TEmpEducation tEmpEducation = null;
if (Common.isNotNull(tPreEmpEducation.getOldId())) {
tEmpEducation = tEmpEducationService.getById(tPreEmpEducation.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpEducation = tEmpEducationService.getByEmpId(empId);
}
if (tEmpEducation == null) {
tEmpEducation = new TEmpEducation();
} else {
// 已存在的学历信息(如果不一致,要更新档案的最高学历)
if (Common.isEmpty(tEmpEducation.getEducationName())
|| !tEmpEducation.getEducationName().equals(tPreEmpEducation.getEducationName())) {
emp.setHignEducation(tPreEmpEducation.getEducationName());
tEmployeeInfoService.updateById(emp);
}
}
BeanUtil.copyProperties(tPreEmpEducation, tEmpEducation, ID);
if (Common.isEmpty(tEmpEducation.getEmpCode())) {
tEmpEducation.setEmpCode(emp.getEmpCode());
}
if (Common.isEmpty(tEmpEducation.getEmpName())) {
tEmpEducation.setEmpName(emp.getEmpName());
}
if (Common.isEmpty(tEmpEducation.getCreateTime())) {
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducation.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpEducation.setEmpId(empId);
if (Common.isNotNull(empIdCard)) {
tEmpEducationService.updateEducationToNoByIdCard(empIdCard);
}
if (Common.isEmpty(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
tEmpEducation.setCreateName(user.getNickname());
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducationService.saveOrUpdate(tEmpEducation);
String attaId = tPreEmpEducation.getOldId();
tAttaInfoService.deleteByDomainIdAndType(attaId, 0);
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) {
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
BeanUtil.copyProperties(atta, newEmpAtta, ID);
newEmpAtta.setDomainId(tEmpEducation.getId());
if (Common.isEmpty(tEmpEducation.getCreateBy())) {
tEmpEducation.setCreateBy(user.getId());
tEmpEducation.setCreateName(user.getNickname());
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdate(newEmpAtta);
}
tAttaInfoService.saveOrUpdate(newEmpAtta);
}
}
}
}
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
TEmpBadRecord tEmpBadRecord = null;
if (Common.isNotNull(tPreEmpBadRecord.getOldId())) {
tEmpBadRecord = tEmpBadRecordService.getById(tPreEmpBadRecord.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpBadRecord = tEmpBadRecordService.getByEmpId(empId);
}
if (tEmpBadRecord == null) {
tEmpBadRecord = new TEmpBadRecord();
}
BeanUtil.copyProperties(tPreEmpBadRecord, tEmpBadRecord, ID);
tEmpBadRecord.setEmpId(empId);
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
TEmpBadRecord tEmpBadRecord = null;
if (Common.isNotNull(tPreEmpBadRecord.getOldId())) {
tEmpBadRecord = tEmpBadRecordService.getById(tPreEmpBadRecord.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpBadRecord = tEmpBadRecordService.getByEmpId(empId);
}
if (tEmpBadRecord == null) {
tEmpBadRecord = new TEmpBadRecord();
}
BeanUtil.copyProperties(tPreEmpBadRecord, tEmpBadRecord, ID);
tEmpBadRecord.setEmpId(empId);
if (Common.isEmpty(tEmpBadRecord.getCreateBy())) {
tEmpBadRecord.setCreateBy(user.getId());
tEmpBadRecord.setCreateName(user.getNickname());
tEmpBadRecord.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tEmpBadRecord.getCreateBy())) {
tEmpBadRecord.setCreateBy(user.getId());
tEmpBadRecord.setCreateName(user.getNickname());
tEmpBadRecord.setCreateTime(LocalDateTime.now());
}
tEmpBadRecordService.saveOrUpdate(tEmpBadRecord);
}
tEmpBadRecordService.saveOrUpdate(tEmpBadRecord);
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
......@@ -2077,109 +2176,111 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
if (tPreEmpDisabilityInfo != null) {
TEmpDisabilityInfo tEmpDisabilityInfo = null;
if (Common.isNotNull(tPreEmpDisabilityInfo.getOldId())) {
tEmpDisabilityInfo = tEmpDisabilityInfoService.getById(tPreEmpDisabilityInfo.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpDisabilityInfo = tEmpDisabilityInfoService.getByEmpId(empId);
}
if (tEmpDisabilityInfo == null) {
tEmpDisabilityInfo = new TEmpDisabilityInfo();
}
BeanUtil.copyProperties(tPreEmpDisabilityInfo, tEmpDisabilityInfo, ID);
tEmpDisabilityInfo.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpDisabilityInfo.setEmpId(empId);
if (Common.isEmpty(tEmpDisabilityInfo.getEmpCode())) {
tEmpDisabilityInfo.setEmpCode(emp.getEmpCode());
}
if (Common.isEmpty(tEmpDisabilityInfo.getEmpName())) {
tEmpDisabilityInfo.setEmpName(emp.getEmpName());
}
if (!isSimpleBoo) {
if (tPreEmpDisabilityInfo != null) {
TEmpDisabilityInfo tEmpDisabilityInfo = null;
if (Common.isNotNull(tPreEmpDisabilityInfo.getOldId())) {
tEmpDisabilityInfo = tEmpDisabilityInfoService.getById(tPreEmpDisabilityInfo.getOldId());
} else {
// 测试金龙弟建议查询信息后更新,不新增额外的一条 2024-10-24 16:23:47 hgw修改
tEmpDisabilityInfo = tEmpDisabilityInfoService.getByEmpId(empId);
}
if (tEmpDisabilityInfo == null) {
tEmpDisabilityInfo = new TEmpDisabilityInfo();
}
BeanUtil.copyProperties(tPreEmpDisabilityInfo, tEmpDisabilityInfo, ID);
tEmpDisabilityInfo.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpDisabilityInfo.setEmpId(empId);
if (Common.isEmpty(tEmpDisabilityInfo.getEmpCode())) {
tEmpDisabilityInfo.setEmpCode(emp.getEmpCode());
}
if (Common.isEmpty(tEmpDisabilityInfo.getEmpName())) {
tEmpDisabilityInfo.setEmpName(emp.getEmpName());
}
if (Common.isEmpty(tEmpDisabilityInfo.getCreateBy())) {
tEmpDisabilityInfo.setCreateBy(user.getId());
tEmpDisabilityInfo.setCreateName(user.getNickname());
tEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tEmpDisabilityInfo.getCreateBy())) {
tEmpDisabilityInfo.setCreateBy(user.getId());
tEmpDisabilityInfo.setCreateName(user.getNickname());
tEmpDisabilityInfo.setCreateTime(LocalDateTime.now());
}
tEmpDisabilityInfoService.saveOrUpdate(tEmpDisabilityInfo);
}
tEmpDisabilityInfoService.saveOrUpdate(tEmpDisabilityInfo);
}
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = vo.getTpreEmpFamilyList();
if (tPreEmpFamilyList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpId(empId);
TEmpFamily tEmpFamily;
for (TPreEmpFamily tPreEmpFamily : tPreEmpFamilyList) {
tEmpFamily = new TEmpFamily();
BeanUtil.copyProperties(tPreEmpFamily, tEmpFamily, ID);
tEmpFamily.setEmpId(empId);
tEmpFamily.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpFamily.setEmpCode(emp.getEmpCode());
tEmpFamily.setEmpName(emp.getEmpName());
tEmpFamily.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(tPreEmpFamily.getOldId())) {
tEmpFamily.setId(tPreEmpFamily.getOldId());
}
if (Common.isEmpty(tEmpFamily.getCreateBy())) {
tEmpFamily.setCreateBy(user.getId());
tEmpFamily.setCreateName(user.getNickname());
tEmpFamily.setCreateTime(LocalDateTime.now());
}
tEmpFamilyService.save(tEmpFamily);
}
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTpreEmpProfessionalQualificationList();
// 先删除其他信息
tEmpProfessionalService.deleteProfessionalByEmpId(empId);
if (tPreEmpProfessionalQualificationList != null
&& (Common.isEmpty(emp.getHaveQualification()) || CommonConstants.ZERO_STRING.equals(emp.getHaveQualification()))) {
TEmpProfessionalQualification info;
for (TPreEmpProfessionalQualification preInfo : tPreEmpProfessionalQualificationList) {
info = new TEmpProfessionalQualification();
BeanUtil.copyProperties(preInfo, info, ID);
info.setDeleteFlag(CommonConstants.STATUS_NORMAL);
info.setEmpId(empId);
info.setEmpCode(emp.getEmpCode());
info.setEmpName(emp.getEmpName());
info.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId());
}
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = vo.getTpreEmpFamilyList();
if (tPreEmpFamilyList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpId(empId);
TEmpFamily tEmpFamily;
for (TPreEmpFamily tPreEmpFamily : tPreEmpFamilyList) {
tEmpFamily = new TEmpFamily();
BeanUtil.copyProperties(tPreEmpFamily, tEmpFamily, ID);
tEmpFamily.setEmpId(empId);
tEmpFamily.setDeleteFlag(CommonConstants.STATUS_NORMAL);
tEmpFamily.setEmpCode(emp.getEmpCode());
tEmpFamily.setEmpName(emp.getEmpName());
tEmpFamily.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(tPreEmpFamily.getOldId())) {
tEmpFamily.setId(tPreEmpFamily.getOldId());
}
if (Common.isEmpty(info.getCreateBy())) {
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(tEmpFamily.getCreateBy())) {
tEmpFamily.setCreateBy(user.getId());
tEmpFamily.setCreateName(user.getNickname());
tEmpFamily.setCreateTime(LocalDateTime.now());
}
tEmpFamilyService.save(tEmpFamily);
}
tEmpProfessionalService.save(info);
if (preInfo.getAttaList() != null && !preInfo.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = preInfo.getAttaList();
if (attaList != null) {
String attaId = preInfo.getOldId();
tAttaInfoService.deleteByDomainIdAndType(attaId, 1);
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
BeanUtil.copyProperties(atta, newEmpAtta, ID);
newEmpAtta.setDomainId(info.getId());
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTpreEmpProfessionalQualificationList();
// 先删除其他信息
tEmpProfessionalService.deleteProfessionalByEmpId(empId);
if (tPreEmpProfessionalQualificationList != null
&& (Common.isEmpty(emp.getHaveQualification()) || CommonConstants.ZERO_STRING.equals(emp.getHaveQualification()))) {
TEmpProfessionalQualification info;
for (TPreEmpProfessionalQualification preInfo : tPreEmpProfessionalQualificationList) {
info = new TEmpProfessionalQualification();
BeanUtil.copyProperties(preInfo, info, ID);
info.setDeleteFlag(CommonConstants.STATUS_NORMAL);
info.setEmpId(empId);
info.setEmpCode(emp.getEmpCode());
info.setEmpName(emp.getEmpName());
info.setEmpIdcard(emp.getEmpIdcard());
if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId());
}
if (Common.isEmpty(atta.getCreateBy())) {
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
if (Common.isEmpty(info.getCreateBy())) {
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
tEmpProfessionalService.save(info);
if (preInfo.getAttaList() != null && !preInfo.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = preInfo.getAttaList();
if (attaList != null) {
String attaId = preInfo.getOldId();
tAttaInfoService.deleteByDomainIdAndType(attaId, 1);
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
BeanUtil.copyProperties(atta, newEmpAtta, ID);
newEmpAtta.setDomainId(info.getId());
if (Common.isEmpty(atta.getCreateBy())) {
atta.setCreateBy(user.getId());
atta.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now());
}
tAttaInfoService.saveOrUpdate(newEmpAtta);
}
tAttaInfoService.saveOrUpdate(newEmpAtta);
}
}
}
}
}
}
// 预入职-其他附件
List<TPreEmpOtherFile> preEmpOtherFileList = vo.getTpreEmpOtherFileList();
// 先删除其他信息
......@@ -2216,36 +2317,43 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTpreEmpWorkRecordingList();
// 先删除其他信息
tEmpWorkRecordingService.deleteWorkRecordByEmpId(empId);
if (tPreEmpWorkRecordingList != null && (Common.isEmpty(emp.getFirstWorkFlag()) || CommonConstants.ONE_STRING.equals(emp.getFirstWorkFlag()))) {
TEmpWorkRecording info;
for (TPreEmpWorkRecording preInfo : tPreEmpWorkRecordingList) {
info = new TEmpWorkRecording();
BeanUtil.copyProperties(preInfo, info, ID);
info.setDeleteFlag(CommonConstants.STATUS_NORMAL);
info.setEmpId(empId);
info.setEmpCode(emp.getEmpCode());
info.setEmpName(emp.getEmpName());
info.setEmpIdcard(emp.getEmpIdcard());
if (Common.isEmpty(info.getCreateBy())) {
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId());
if (!isSimpleBoo) {
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTpreEmpWorkRecordingList();
// 先删除其他信息
tEmpWorkRecordingService.deleteWorkRecordByEmpId(empId);
if (tPreEmpWorkRecordingList != null && (Common.isEmpty(emp.getFirstWorkFlag()) || CommonConstants.ONE_STRING.equals(emp.getFirstWorkFlag()))) {
TEmpWorkRecording info;
for (TPreEmpWorkRecording preInfo : tPreEmpWorkRecordingList) {
info = new TEmpWorkRecording();
BeanUtil.copyProperties(preInfo, info, ID);
info.setDeleteFlag(CommonConstants.STATUS_NORMAL);
info.setEmpId(empId);
info.setEmpCode(emp.getEmpCode());
info.setEmpName(emp.getEmpName());
info.setEmpIdcard(emp.getEmpIdcard());
if (Common.isEmpty(info.getCreateBy())) {
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
}
if (Common.isNotNull(preInfo.getOldId())) {
info.setId(preInfo.getOldId());
}
tEmpWorkRecordingService.save(info);
}
tEmpWorkRecordingService.save(info);
}
}
// 预入职-附件
List<TAttaInfo> attaList = vo.getAttaInfoList();
if (attaList != null) {
// 先删除其他信息
tAttaInfoService.deleteByDomainIdAndOther(empId);
if (!isSimpleBoo) {
tAttaInfoService.deleteByDomainIdAndOther(empId);
} else {
// 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文)
tAttaInfoService.deleteByDomainIdCard(empId);
}
TAttaInfo attaEmp;
List<TAttaInfo> attaEmpList = new ArrayList<>();
for (TAttaInfo atta : attaList) {
......@@ -2731,7 +2839,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpMainLogService.save(auditLog);
this.updateById(preEmpMain);
if (CommonConstants.FOUR_STRING.equals(status)) {
return updateToEmployeeByPre(vo);
// true 简档
boolean isSimpleBoo = false;
if (Common.isNotNull(preEmpMain.getIsSimple()) && CommonConstants.TWO_STRING.equals(preEmpMain.getIsSimple())) {
isSimpleBoo = true;
}
return updateToEmployeeByPre(vo, isSimpleBoo);
} else {
return R.ok("已审核");
}
......@@ -2803,7 +2916,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
this.updateById(preEmpMain);
tPreEmpMainLogService.save(auditLog);
if (CommonConstants.FOUR_STRING.equals(status)) {
updateToEmployeeByPre(vo);
// true 简档
boolean isSimpleBoo = false;
if (Common.isNotNull(preEmpMain.getIsSimple()) && CommonConstants.TWO_STRING.equals(preEmpMain.getIsSimple())) {
isSimpleBoo = true;
}
updateToEmployeeByPre(vo, isSimpleBoo);
}
}
}
......
......@@ -127,6 +127,11 @@
delete from t_atta_info where domain_id=#{domainId}
</delete>
<!-- 详档变简档,删除身份证、其他附件、签名之外的附件 -->
<delete id="deleteByDomainIdExceptionCard">
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('9','24','27','21','22')
</delete>
<delete id="deleteByDomainIdAndType">
delete from t_atta_info where domain_id=#{domainId} and relation_type = #{relationType}
</delete>
......@@ -134,6 +139,12 @@
<delete id="deleteByDomainIdAndOther">
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('0','2','26','27')
</delete>
<!-- 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文) -->
<delete id="deleteByDomainIdCard">
delete from t_atta_info where domain_id=#{domainId} and relation_type in ('9','24','21','22','23')
</delete>
<select id="getAttInfoByParam" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TAttaInfoVo">
SELECT
b.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