Commit 8621e550 authored by hongguangwu's avatar hongguangwu

MVP1.6.6-预入职相关

parent 3769cd54
......@@ -162,10 +162,10 @@ public class TPreEmpDisabilityInfo extends BaseEntity {
private String settleDomain;
/**
* 0删除作废1正常
* 0正常1删除作废
*/
@TableLogic
@Schema(description ="0删除作废1正常")
@Schema(description ="0正常1删除作废")
private String deleteFlag;
/**
......
......@@ -36,25 +36,25 @@ public class PreEmpMainDetailVo implements Serializable {
// 主表
private TPreEmpMain main;
// 预入职-员工不良记录表
private TPreEmpBadRecord tPreEmpBadRecord;
private TPreEmpBadRecord tpreEmpBadRecord;
// 预入职-紧急联络人
private TPreEmpContactInfo tPreEmpContactInfo;
private TPreEmpContactInfo tpreEmpContactInfo;
// 预入职-员工申明
private TPreEmpDeclaration tPreEmpDeclaration;
private TPreEmpDeclaration tpreEmpDeclaration;
// 预入职-员工伤残信息表
private TPreEmpDisabilityInfo tPreEmpDisabilityInfo;
private TPreEmpDisabilityInfo tpreEmpDisabilityInfo;
// 预入职-员工学历信息表
private TPreEmpEducation tPreEmpEducation;
private TPreEmpEducation tpreEmpEducation;
// 预入职-员工家庭信息表
private List<TPreEmpFamily> tPreEmpFamilyList;
private List<TPreEmpFamily> tpreEmpFamilyList;
// 预入职-人员档案表
private TPreEmployeeInfo tPreEmployeeInfo;
private TPreEmployeeInfo tpreEmployeeInfo;
// 预入职-项目档案表
private TPreEmployeeProject tPreEmployeeProject;
private TPreEmployeeProject tpreEmployeeProject;
// 预入职-员工职业资格信息表
private List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList;
private List<TPreEmpProfessionalQualification> tpreEmpProfessionalQualificationList;
// 预入职-员工工作履历信息表
private List<TPreEmpWorkRecording> tPreEmpWorkRecordingList;
private List<TPreEmpWorkRecording> tpreEmpWorkRecordingList;
// 预入职-9身份证 10 户口本;附件 21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
private List<TAttaInfo> attaInfoList;
......
......@@ -6,13 +6,17 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.QrCodeUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
......@@ -20,6 +24,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@Service
@RequiredArgsConstructor
......@@ -64,6 +71,19 @@ public class FileUploadServiceImpl implements FileUploadService {
attaInfo.setRelationType(String.valueOf(type));
try {
attaInfo.setDomainId(domain);
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", "预入职扫码",
"预入职扫码", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
attaInfo.setCreateBy(user.getId());
attaInfo.setCreateName(user.getNickname());
attaInfo = tAttaInfoService.add(attaInfo);
} catch (Exception e) {
log.error("OSS文件上传异常:" + e.getMessage());
......
......@@ -36,6 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -44,19 +45,19 @@ import io.netty.util.internal.StringUtil;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.*;
/**
* 预入职-主表
......@@ -145,6 +146,16 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
String empId = null;
TEmployeeProject project;
PreEmpMainDetailVo vo = new PreEmpMainDetailVo();
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", "预入职扫码",
"预入职扫码", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
if (main != null) {
if (CommonConstants.FOUR_STRING.equals(main.getStatus())) {
return R.failed("信息已填写,请勿重复操作!");
......@@ -152,19 +163,21 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(main.getId());
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getId())) {
empId = tPreEmployeeInfo.getId();
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
} else {
tPreEmployeeInfo = new TPreEmployeeInfo();
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setEmpName(main.getEmpName());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfoService.save(tPreEmployeeInfo);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
}
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(main.getId());
// 预入职-项目档案表
if (tPreEmployeeProject != null) {
vo.setTPreEmployeeProject(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
} else {
tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
......@@ -173,8 +186,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProjectService.save(tPreEmployeeProject);
vo.setTPreEmployeeProject(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
} else {
main = new TPreEmpMain();
......@@ -196,7 +211,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} else {
tPreEmpDeclaration = tPreEmpDeclarationService.getTPreEmpDeclarationList();
}
vo.setTPreEmpDeclaration(tPreEmpDeclaration);
vo.setTpreEmpDeclaration(tPreEmpDeclaration);
main.setDeclarationId(tPreEmpDeclaration.getId());
this.save(main);
// 查询档案信息
......@@ -209,31 +224,43 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
BeanUtil.copyProperties(employee, tPreEmployeeInfo);
tPreEmployeeInfo.setOldId(employee.getId());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfoService.save(tPreEmployeeInfo);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
// TODO - 要记得去掉out
System.out.println("空的能有id?:"+tPreEmployeeInfo.getId());
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
project = tEmployeeProjectService.getByEmpIdAndDeptId(empId, deptId);
if (project != null) {
tPreEmployeeProject = new TPreEmployeeProject();
BeanUtil.copyProperties(project, tPreEmployeeProject);
tPreEmployeeProject.setOldId(project.getId());
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProjectService.save(tPreEmployeeProject);
vo.setTPreEmployeeProject(tPreEmployeeProject);
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProjectService.saveOrUpdate(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
} else {
tPreEmployeeInfo = new TPreEmployeeInfo();
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateName(user.getNickname());
tPreEmployeeInfoService.save(tPreEmployeeInfo);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setDeptId(main.getDeptId());
tPreEmployeeProject.setDeptName(main.getDeptName());
tPreEmployeeProject.setDeptNo(main.getDeptNo());
tPreEmployeeProject.setPreMainId(main.getId());
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateName(user.getNickname());
tPreEmployeeProjectService.save(tPreEmployeeProject);
vo.setTPreEmployeeProject(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
}
String id = main.getId();
......@@ -254,9 +281,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpBadRecord.setProject(dept.getDepartName());
tPreEmpBadRecord.setProjectCode(dept.getDepartNo());
tPreEmpBadRecord.setEmpIdcard(empIdCard);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecordService.save(tPreEmpBadRecord);
}
vo.setTPreEmpBadRecord(tPreEmpBadRecord);
vo.setTpreEmpBadRecord(tPreEmpBadRecord);
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = tPreEmpContactInfoService.getTPreEmpContactInfoList(id);
if (tPreEmpContactInfo == null) {
......@@ -273,9 +302,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpContactInfo.setEmpName(employee.getEmpName());
}
tPreEmpContactInfo.setEmpIdcard(empIdCard);
tPreEmpContactInfo.setCreateBy(user.getId());
tPreEmpContactInfo.setCreateName(user.getNickname());
tPreEmpContactInfoService.save(tPreEmpContactInfo);
}
vo.setTPreEmpContactInfo(tPreEmpContactInfo);
vo.setTpreEmpContactInfo(tPreEmpContactInfo);
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = tPreEmpDisabilityInfoService.getTPreEmpDisabilityInfoList(id);
if (tPreEmpDisabilityInfo == null) {
......@@ -295,9 +326,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpDisabilityInfo.setEmpCode(employee.getEmpCode());
}
tPreEmpDisabilityInfo.setEmpIdcard(empIdCard);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateName(user.getNickname());
tPreEmpDisabilityInfoService.save(tPreEmpDisabilityInfo);
}
vo.setTPreEmpDisabilityInfo(tPreEmpDisabilityInfo);
vo.setTpreEmpDisabilityInfo(tPreEmpDisabilityInfo);
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = tPreEmpEducationService.getTPreEmpEducationList(id);
if (tPreEmpEducation == null) {
......@@ -318,7 +351,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
tPreEmpEducation.setAttaList(attaInfoList);
}
}
tPreEmpEducation.setPreMainId(id);
......@@ -330,6 +362,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
tPreEmpEducation.setEmpIdcard(empIdCard);
tPreEmpEducation.setAttaList(new ArrayList<>());
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateName(user.getNickname());
tPreEmpEducationService.save(tPreEmpEducation);
} else {
// 附件
......@@ -343,7 +377,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
tPreEmpEducation.setAttaList(attaInfoList);
}
vo.setTPreEmpEducation(tPreEmpEducation);
vo.setTpreEmpEducation(tPreEmpEducation);
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = tPreEmpFamilyService.getTPreEmpFamilyList(id);
if (tPreEmpFamilyList == null || tPreEmpFamilyList.isEmpty()) {
......@@ -364,6 +398,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
tPreEmpFamilyList.add(record);
}
tPreEmpFamilyService.saveBatch(tPreEmpFamilyList);
......@@ -379,20 +415,22 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
tPreEmpFamilyService.save(record);
tPreEmpFamilyList.add(record);
}
}
vo.setTPreEmpFamilyList(tPreEmpFamilyList);
vo.setTpreEmpFamilyList(tPreEmpFamilyList);
// 预入职-人员档案表
if (vo.getTPreEmployeeInfo() == null) {
if (vo.getTpreEmployeeInfo() == null) {
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(id);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
}
// 预入职-项目档案表
if (vo.getTPreEmployeeProject() == null) {
if (vo.getTpreEmployeeProject() == null) {
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(id);
vo.setTPreEmployeeProject(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalQualificationService.getTPreEmpProfessionalQualificationList(id);
......@@ -425,6 +463,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
record.setAttaList(attaInfoList);
record.setPreMainId(id);
record.setEmpIdcard(empIdCard);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
tPreEmpProfessionalQualificationList.add(record);
}
tPreEmpProfessionalQualificationService.saveBatch(tPreEmpProfessionalQualificationList);
......@@ -441,6 +481,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setAttaList(new ArrayList<>());
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
tPreEmpProfessionalQualificationService.save(record);
tPreEmpProfessionalQualificationList.add(record);
}
......@@ -458,7 +500,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
info.setAttaList(attaInfoList);
}
}
vo.setTPreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
vo.setTpreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = tPreEmpWorkRecordingService.getTPreEmpWorkRecordingList(id);
if (tPreEmpWorkRecordingList == null || tPreEmpWorkRecordingList.isEmpty()) {
......@@ -479,6 +521,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
tPreEmpWorkRecordingList.add(record);
}
tPreEmpWorkRecordingService.saveBatch(tPreEmpWorkRecordingList);
......@@ -494,11 +538,13 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
record.setEmpIdcard(empIdCard);
record.setPreMainId(id);
record.setCreateBy(user.getId());
record.setCreateName(user.getNickname());
tPreEmpWorkRecordingService.save(record);
tPreEmpWorkRecordingList.add(record);
}
}
vo.setTPreEmpWorkRecordingList(tPreEmpWorkRecordingList);
vo.setTpreEmpWorkRecordingList(tPreEmpWorkRecordingList);
// 预入职-附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
......@@ -528,10 +574,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
vo.setMain(main);
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = tPreEmpBadRecordService.getTPreEmpBadRecordList(id);
vo.setTPreEmpBadRecord(tPreEmpBadRecord);
vo.setTpreEmpBadRecord(tPreEmpBadRecord);
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = tPreEmpContactInfoService.getTPreEmpContactInfoList(id);
vo.setTPreEmpContactInfo(tPreEmpContactInfo);
vo.setTpreEmpContactInfo(tPreEmpContactInfo);
// 预入职-员工申明
TPreEmpDeclaration tPreEmpDeclaration;
if (Common.isNotNull(main.getDeclarationId())) {
......@@ -539,10 +585,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} else {
tPreEmpDeclaration = tPreEmpDeclarationService.getTPreEmpDeclarationList();
}
vo.setTPreEmpDeclaration(tPreEmpDeclaration);
vo.setTpreEmpDeclaration(tPreEmpDeclaration);
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = tPreEmpDisabilityInfoService.getTPreEmpDisabilityInfoList(id);
vo.setTPreEmpDisabilityInfo(tPreEmpDisabilityInfo);
vo.setTpreEmpDisabilityInfo(tPreEmpDisabilityInfo);
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = tPreEmpEducationService.getTPreEmpEducationList(id);
if (tPreEmpEducation != null) {
......@@ -556,16 +602,16 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
tPreEmpEducation.setAttaList(attaInfoList);
}
vo.setTPreEmpEducation(tPreEmpEducation);
vo.setTpreEmpEducation(tPreEmpEducation);
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamily = tPreEmpFamilyService.getTPreEmpFamilyList(id);
vo.setTPreEmpFamilyList(tPreEmpFamily);
vo.setTpreEmpFamilyList(tPreEmpFamily);
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(id);
vo.setTPreEmployeeInfo(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
// 预入职-项目档案表
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(id);
vo.setTPreEmployeeProject(tPreEmployeeProject);
vo.setTpreEmployeeProject(tPreEmployeeProject);
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = tPreEmpProfessionalQualificationService.getTPreEmpProfessionalQualificationList(id);
......@@ -584,10 +630,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
vo.setTPreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
vo.setTpreEmpProfessionalQualificationList(tPreEmpProfessionalQualificationList);
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecording = tPreEmpWorkRecordingService.getTPreEmpWorkRecordingList(id);
vo.setTPreEmpWorkRecordingList(tPreEmpWorkRecording);
vo.setTpreEmpWorkRecordingList(tPreEmpWorkRecording);
// 预入职-附件 9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件)
List<TAttaInfo> attaInfoList = tAttaInfoService.getTAttaInfoListByDoMainId(id);
......@@ -614,8 +660,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
@Override
public R<String> doImproveInformation(PreEmpMainDetailVo vo) {
TPreEmpMain preMain = vo.getMain();
TPreEmployeeInfo tPreEmployee = vo.getTPreEmployeeInfo();
TPreEmployeeProject project = vo.getTPreEmployeeProject();
TPreEmployeeInfo tPreEmployee = vo.getTpreEmployeeInfo();
TPreEmployeeProject project = vo.getTpreEmployeeProject();
if (preMain == null || tPreEmployee == null || project == null ||
Common.isEmpty(preMain.getId()) || Common.isEmpty(tPreEmployee.getId()) || Common.isEmpty(project.getId())) {
return R.failed("请传主表ID与人员ID与项目ID");
......@@ -675,12 +721,22 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private R<String> saveBase(PreEmpMainDetailVo vo, String status) {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", "预入职扫码",
"预入职扫码", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null);
TPreEmpMain main = vo.getMain();
if (main != null && Common.isNotNull(main.getEmpIdcard())) {
TPreEmployeeProject tPreEmployeeProject = vo.getTPreEmployeeProject();
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTPreEmployeeInfo();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())) {
// 转到更新档案去
return updateToEmployeeByPre(vo);
......@@ -689,31 +745,41 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
} else {
main.setStatus(status);
main.setCreateBy(user.getId());
main.setCreateBy(user.getNickname());
this.saveOrUpdate(main);
String mainId = main.getId();
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = vo.getTPreEmpBadRecord();
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
tPreEmpBadRecord.setPreMainId(mainId);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateBy(user.getNickname());
tPreEmpBadRecordService.saveOrUpdate(tPreEmpBadRecord);
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTPreEmpContactInfo();
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
if (tPreEmpContactInfo != null) {
tPreEmpContactInfo.setPreMainId(mainId);
tPreEmpContactInfo.setCreateBy(user.getId());
tPreEmpContactInfo.setCreateBy(user.getNickname());
tPreEmpContactInfoService.saveOrUpdate(tPreEmpContactInfo);
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTPreEmpDisabilityInfo();
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
if (tPreEmpDisabilityInfo != null) {
tPreEmpDisabilityInfo.setPreMainId(mainId);
tPreEmpDisabilityInfo.setCreateBy(user.getId());
tPreEmpDisabilityInfo.setCreateBy(user.getNickname());
tPreEmpDisabilityInfoService.saveOrUpdate(tPreEmpDisabilityInfo);
}
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = vo.getTPreEmpEducation();
TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
if (tPreEmpEducation != null) {
tPreEmpEducation.setPreMainId(mainId);
tPreEmpEducation.setCreateBy(user.getId());
tPreEmpEducation.setCreateBy(user.getNickname());
tPreEmpEducationService.saveOrUpdate(tPreEmpEducation);
// 附件
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
......@@ -722,21 +788,25 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tAttaInfoService.deleteByDomainId(tPreEmpEducation.getId());
for (TAttaInfo atta : attaList) {
atta.setDomainId(tPreEmpEducation.getId());
atta.setCreateBy(user.getId());
atta.setCreateBy(user.getNickname());
}
tAttaInfoService.saveOrUpdateBatch(attaList);
}
}
}
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamily = vo.getTPreEmpFamilyList();
List<TPreEmpFamily> tPreEmpFamily = vo.getTpreEmpFamilyList();
if (tPreEmpFamily != null) {
for (TPreEmpFamily info : tPreEmpFamily) {
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateBy(user.getNickname());
}
tPreEmpFamilyService.saveOrUpdateBatch(tPreEmpFamily);
}
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTPreEmployeeInfo();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (tPreEmployeeInfo != null) {
if (tPreEmpEducation != null) {
if (Common.isNotNull(tPreEmpEducation.getEducationName())) {
......@@ -754,18 +824,24 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 生成性别年龄等:
this.setBaseSexInfo(tPreEmployeeInfo);
tPreEmployeeInfo.setPreMainId(mainId);
tPreEmployeeInfo.setCreateBy(user.getId());
tPreEmployeeInfo.setCreateBy(user.getNickname());
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
}
// 预入职-项目档案表
if (tPreEmployeeProject != null) {
tPreEmployeeProject.setPreMainId(mainId);
tPreEmployeeProject.setCreateBy(user.getId());
tPreEmployeeProject.setCreateBy(user.getNickname());
tPreEmployeeProjectService.saveOrUpdate(tPreEmployeeProject);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTPreEmpProfessionalQualificationList();
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTpreEmpProfessionalQualificationList();
if (tPreEmpProfessionalQualification != null) {
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) {
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateBy(user.getNickname());
tPreEmpProfessionalQualificationService.saveOrUpdate(info);
// 附件
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) {
......@@ -774,6 +850,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tAttaInfoService.deleteByDomainId(info.getId());
for (TAttaInfo atta : attaList) {
atta.setDomainId(info.getId());
atta.setCreateBy(user.getId());
atta.setCreateBy(user.getNickname());
}
tAttaInfoService.saveOrUpdateBatch(attaList);
}
......@@ -781,13 +859,25 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecording = vo.getTPreEmpWorkRecordingList();
List<TPreEmpWorkRecording> tPreEmpWorkRecording = vo.getTpreEmpWorkRecordingList();
if (tPreEmpWorkRecording != null) {
for (TPreEmpWorkRecording info : tPreEmpWorkRecording) {
info.setPreMainId(mainId);
info.setCreateBy(user.getId());
info.setCreateBy(user.getNickname());
}
tPreEmpWorkRecordingService.saveOrUpdateBatch(tPreEmpWorkRecording);
}
// 预入职-员工工作履历信息表
List<TAttaInfo> attaInfoList = vo.getAttaInfoList();
if (attaInfoList != null) {
for (TAttaInfo info : attaInfoList) {
info.setDomainId(mainId);
info.setCreateBy(user.getId());
info.setCreateBy(user.getNickname());
}
tAttaInfoService.updateBatchById(attaInfoList);
}
}
return R.ok("成功");
} else {
......@@ -804,11 +894,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
private R<String> updateToEmployeeByPre(PreEmpMainDetailVo vo) {
YifuUser user = SecurityUtils.getUser();
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTPreEmployeeInfo();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
// 预入职-项目档案表
TPreEmployeeProject tPreEmployeeProject = vo.getTPreEmployeeProject();
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
// 预入职-员工学历信息表
TPreEmpEducation tPreEmpEducation = vo.getTPreEmpEducation();
TPreEmpEducation tPreEmpEducation = vo.getTpreEmpEducation();
// 如果档案项目id都没有,则新增。newFlag是true:
boolean newFlag = true;
String empId = null;
......@@ -933,7 +1023,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
// 预入职-员工不良记录表
TPreEmpBadRecord tPreEmpBadRecord = vo.getTPreEmpBadRecord();
TPreEmpBadRecord tPreEmpBadRecord = vo.getTpreEmpBadRecord();
if (tPreEmpBadRecord != null) {
TEmpBadRecord tEmpBadRecord = null;
if (Common.isNotNull(tPreEmpBadRecord.getOldId())) {
......@@ -946,7 +1036,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tEmpBadRecordService.saveOrUpdate(tEmpBadRecord);
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTPreEmpContactInfo();
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
if (tPreEmpContactInfo != null) {
TEmpContactInfo tEmpContactInfo = null;
if (Common.isNotNull(tPreEmpContactInfo.getOldId())) {
......@@ -959,7 +1049,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tEmpContactInfoService.saveOrUpdate(tEmpContactInfo);
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTPreEmpDisabilityInfo();
TPreEmpDisabilityInfo tPreEmpDisabilityInfo = vo.getTpreEmpDisabilityInfo();
if (tPreEmpDisabilityInfo != null) {
TEmpDisabilityInfo tEmpDisabilityInfo = null;
if (Common.isNotNull(tPreEmpDisabilityInfo.getOldId())) {
......@@ -973,7 +1063,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
// 预入职-员工家庭信息表
List<TPreEmpFamily> tPreEmpFamilyList = vo.getTPreEmpFamilyList();
List<TPreEmpFamily> tPreEmpFamilyList = vo.getTpreEmpFamilyList();
if (tPreEmpFamilyList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpIdAndTable(empId, "t_emp_family");
......@@ -990,7 +1080,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tEmpFamilyService.saveOrUpdateBatch(tEmpFamilyList);
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTPreEmpProfessionalQualificationList();
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualificationList = vo.getTpreEmpProfessionalQualificationList();
if (tPreEmpProfessionalQualificationList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpIdAndTable(empId, "t_pre_emp_professional_qualification");
......@@ -1021,7 +1111,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
// 预入职-员工工作履历信息表
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTPreEmpWorkRecordingList();
List<TPreEmpWorkRecording> tPreEmpWorkRecordingList = vo.getTpreEmpWorkRecordingList();
if (tPreEmpWorkRecordingList != null) {
// 先删除其他信息
tEmpFamilyService.deleteByEmpIdAndTable(empId, "t_pre_emp_work_recording");
......@@ -1041,10 +1131,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TAttaInfo> attaList = vo.getAttaInfoList();
if (attaList != null) {
// 先删除其他信息
tAttaInfoService.deleteByDomainId(empProjectId);
tAttaInfoService.deleteByDomainId(empId);
for (TAttaInfo atta : attaList) {
if (Common.isEmpty(atta.getDomainId())) {
atta.setDomainId(empProjectId);
atta.setDomainId(empId);
}
}
tAttaInfoService.saveOrUpdateBatch(attaList);
......@@ -1452,7 +1542,15 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
auditLog.setMainId(preEmpMain.getId());
auditLog.setAuditResult(status);
tPreEmpMainLogService.save(auditLog);
return R.ok("已审核!");
R<PreEmpMainDetailVo> voR = this.getInfoById(id);
PreEmpMainDetailVo vo = null;
if (voR != null && voR.getCode() == CommonConstants.SUCCESS) {
// 转到更新档案去
vo = voR.getData();
return updateToEmployeeByPre(vo);
} else {
return R.ok("已审核未更新!");
}
}
@Override
......
......@@ -46,6 +46,10 @@ security:
- /fdd/*
- /temployeeinfo/getHcmEmpInfo
- /temployeeinfo/getHcmEmpInfoList
- /tpreempmain/getByCardAndDeptId
- /tpreempmain/saveDraftPreEmpMain
- /tpreempmain/savePreEmpMain
- /tpreempmain/uploadFileReturnAtta
......
......@@ -258,13 +258,52 @@
<!--list-->
<select id="getTPreEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
a.status field1
,a.create_time field2
,'员工主码' field3
,a.emp_Natrue field4
,a.emp_name field5
,a.emp_idcard field6
case a.STATUS when '0' then '草稿' when '1' then '待完善' when '2' then '待审核' when '3' then '审核不通过' when '4' then '审核通过' else '-' end field1
,a.create_time field2,e.EMP_CODE field3,emp_natrue.label field4,a.emp_name field5,a.emp_idcard field6
,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30 00:00:00','长期','固定')) field8 ,e.VALIDITY_END field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14
,politicalStatus.label field15,e.EMP_PHONE field16,e.EMP_EMAIL field17
,concat(ifnull(pi.AREA_NAME,''),ifnull(ci.AREA_NAME,''),ifnull(ti.AREA_NAME,'')) field18 ,registype.label field19
,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.FILE_STATUS=0,'正常','已减档') field21
,e.CONTACT_ADDRESS field22,p.UNIT_NAME field23,p.DEPT_NAME field24
,concat(p.BUSINESS_PRIMARY_TYPE,'-',p.BUSINESS_SECOND_TYPE,'-',p.BUSINESS_THIRD_TYPE) field25
,contractType.label field26 ,workingHours.label field27,p.POST field28,p.ENJOIN_DATE field29
,p.TRY_PERIOD field30,p.EMP_LABEL field31
,ec.EMP_NAME field32,ec.RELATION_TYPE field33,ec.ADDRESS field34,ec.TEL field35
,ee.SCHOOL field36,ee.MAJOR field37,education.label field38,if(e.IS_COLLEGE=0,'否','是') field39
,if(ee.HIGH_IDENTIFICATION=0,'是','否') field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,if(e.FIRST_WORK_FLAG=0,'是','否') field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
,if(e.HAVE_QUALIFICATION=0,'是','否') field51,ep.DECLARE_YEAR field52,qualification_type.label field53
,if(ed.INJURY_IDENTIFICATION=0,'是','否') field54,if(ed.OCCUPATIONAL_DISEASE_FLAG=0,'是','否') field55 ,ed.OCCUPATIONAL_DISEASE field56
,if(ed.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59
,ed.DISABILITY_NAME field60,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
left join view_sys_dict_item emp_married on emp_married.value=e.EMP_MARRI_STATUS and emp_married.type='emp_married'
left join view_sys_dict_item nation on nation.value=e.EMP_NATIONAL and nation.type='emp_national'
left join view_sys_dict_item registype on registype.value=e.EMP_REGIS_TYPE and registype.type='emp_registype'
left join view_sys_dict_item politicalStatus on politicalStatus.value=e.POLITICAL_STATUS and politicalStatus.type='emp_political'
left join sys_area pi on pi.id=e.ID_PROVINCE
left join sys_area ci on ci.id=e.ID_CITY
left join sys_area ti on ti.id=e.ID_TOWN
left join sys_area pf on pf.id=e.FILE_PROVINCE
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join view_sys_dict_item contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='employee_contract_type'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours'
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID
left join t_pre_emp_education ee on a.id=ee.PRE_MAIN_ID
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join t_pre_emp_disability_info ed on a.id=ed.PRE_MAIN_ID
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
......
......@@ -1156,7 +1156,8 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
// 复核使用的
oldDetail = oldMap.get(detailPerson.getCertNum() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getSocialSecurityAccount() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getInsuranceType());
+ detailPerson.getInsuranceType() + CommonConstants.DOWN_LINE_STRING
+ detailPerson.getPayMonth());
if (oldDetail != null) {
detailPerson.setId(oldDetail.getId());
voList.add(detailPerson);
......
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