Commit 753e849c authored by hongguangwu's avatar hongguangwu

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

parent 052fd56d
......@@ -55,6 +55,13 @@ public interface EmployeeRegistrationPreMapper extends BaseMapper<EmployeeRegist
* @return: java.lang.String
**/
String judegIsSimpleByPre(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
/**
* @Description: 获取员工类型与档案地市 -优先从档案维护任务表
* @Author: hgw
* @Date: 2025/3/21 11:25
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre
**/
EmployeeRegistrationPre getPreByPre(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
/**
* @Description: 判断简档详档-从项目档案表
......@@ -63,5 +70,12 @@ public interface EmployeeRegistrationPreMapper extends BaseMapper<EmployeeRegist
* @return: java.lang.String
**/
String judegIsSimpleByEmpProject(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
/**
* @Description: 获取员工类型与档案地市 从项目档案表
* @Author: hgw
* @Date: 2025/3/21 11:25
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre
**/
EmployeeRegistrationPre getPreByEmpProject(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
}
......@@ -99,4 +99,13 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
* @return: java.lang.String
**/
String judgeIsSimple(String empIdCard, String deptId);
/**
* @Description: 获取员工类型与档案地市 -优先从档案维护任务表
* @Author: hgw
* @Date: 2025/3/21 11:26
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre
**/
EmployeeRegistrationPre getPreInfo(String empIdCard, String deptId);
}
......@@ -564,4 +564,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
return type;
}
/**
* @Description: 获取员工类型与档案地市 -优先从档案维护任务表
* @Author: hgw
* @Date: 2025/3/21 11:26
* @return: com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre
**/
@Override
public EmployeeRegistrationPre getPreInfo(String empIdCard, String deptId) {
// 类型1详档2简档
EmployeeRegistrationPre pre = baseMapper.getPreByPre(empIdCard, deptId);
if (Common.isEmpty(pre) || Common.isEmpty(pre.getId())) {
pre = baseMapper.getPreByEmpProject(empIdCard, deptId);
}
return pre;
}
}
......@@ -1466,15 +1466,45 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (CommonConstants.ONE_STRING.equals(isSimple) && !isSimple.equals(main.getIsSimple())) {
return R.failed("员工类型或合同类型已变更,请刷新后重新提交!");
}
EmployeeRegistrationPre pre = registrationPreService.getPreInfo(idCard, main.getDeptId());
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (pre != null && Common.isNotNull(pre.getId())) {
if (Common.isNotNull(pre.getEmpNature())) {
if (tPreEmployeeProject != null) {
tPreEmployeeProject.setEmpNatrue(pre.getEmpNature());
}
main.setEmpNatrue(pre.getEmpNature());
}
if (tPreEmployeeInfo != null) {
if (Common.isNotNull(pre.getEmpNature())) {
tPreEmployeeInfo.setEmpNatrue(pre.getEmpNature());
}
if (Common.isNotNull(pre.getFileProvince())) {
tPreEmployeeInfo.setFileProvince(Integer.parseInt(pre.getFileProvince()));
} else {
tPreEmployeeInfo.setFileProvince(null);
}
if (Common.isNotNull(pre.getFileCity())) {
tPreEmployeeInfo.setFileCity(Integer.parseInt(pre.getFileCity()));
} else {
tPreEmployeeInfo.setFileCity(null);
}
if (Common.isNotNull(pre.getFileTown())) {
tPreEmployeeInfo.setFileTown(Integer.parseInt(pre.getFileTown()));
} else {
tPreEmployeeInfo.setFileTown(null);
}
}
}
// 如果是简档,将清空多余信息
if (CommonConstants.TWO_STRING.equals(isSimple)) {
// TODO - 删除多余
}
TPreEmployeeProject tPreEmployeeProject = vo.getTpreEmployeeProject();
if (tPreEmployeeProject != null && Common.isNotNull(tPreEmployeeProject.getOldId())) {
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getOldId())) {
// 转到更新档案去
return updateToEmployeeByPre(vo);
......@@ -1482,6 +1512,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return R.failed("档案原ID不可为空!");
}
} else {
// 有信息,就跳转到待审核
if (pre != null && Common.isNotNull(pre.getId()) && CommonConstants.ONE_STRING.equals(status)) {
main.setStatus(CommonConstants.TWO_STRING);
}
main.setStatus(status);
main.setCreateBy(user.getId());
main.setCreateName(user.getNickname());
......@@ -1580,7 +1614,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpFamilyService.saveOrUpdateBatch(tPreEmpFamily);
}
// 预入职-人员档案表
TPreEmployeeInfo tPreEmployeeInfo = vo.getTpreEmployeeInfo();
if (tPreEmployeeInfo != null) {
if (tPreEmpEducation != null) {
if (Common.isNotNull(tPreEmpEducation.getEducationName())) {
......
......@@ -289,6 +289,29 @@
from t_employee_project a where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0 and a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<!-- 获取员工类型与档案地市-优先从档案维护任务表 -->
<select id="getPreByPre" resultMap="employeeRegistrationPreMap">
select
a.id,
a.emp_nature,
a.file_province,
a.file_city,
a.file_town
from employee_registration_pre a where a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<!-- 获取员工类型与档案地市-从项目档案表 -->
<select id="getPreByEmpProject" resultMap="employeeRegistrationPreMap">
select
a.id,
a.emp_natrue emp_nature,
e.file_province,
e.file_city,
e.file_town
from t_employee_project a
left join t_employee_info e on e.id = a.EMP_ID
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0 and a.emp_idcard = #{empIdCard} and a.dept_id = #{deptId}
</select>
<select id="getEmployeeArchivesInfo" resultMap="getEmployeeInfoMap">
SELECT
......
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