Commit 30a725b1 authored by huyuchen's avatar huyuchen

huych-入离职登记提交

parent 17254673
......@@ -393,6 +393,19 @@ public class TEmployeeProjectController {
return tEmployeeProjectService.getEmpProjectStatus(vo);
}
/**
* @param vo 人员信息
* @Description: 获取人员项目档案信息
* @Author: huyc
* @Date: 2025/2/27 15:18
* @return:
**/
@Inner
@PostMapping("/inner/getOutEmpProjectStatus")
public EmpProjectStatusVo getOutEmpProjectStatus(@RequestBody EmpProjectStatusVo vo) {
return tEmployeeProjectService.getOutEmpProjectStatus(vo);
}
/**
* 通过项目编码查询项目信息
* @param tEmployeeProject
......
......@@ -46,6 +46,8 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
TSalaryStandardSelectViewVo getUnProjectEmpList(List<TSalaryStandardUnprojectVo> voList);
EmpProjectStatusVo getEmpProjectStatus(EmpProjectStatusVo vo);
EmpProjectStatusVo getOutEmpProjectStatus(EmpProjectStatusVo vo);
/**
* @param tEmployeeProject
* @Description: 新增项目档案校验
......
......@@ -160,6 +160,20 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return null;
}
@Override
public EmpProjectStatusVo getOutEmpProjectStatus(EmpProjectStatusVo vo) {
TEmployeeProject employeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdcard())
.eq(TEmployeeProject::getDeptNo, vo.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ONE_INT).last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(employeeProject)) {
vo.setProjectTime(employeeProject.getLeaveTime());
return vo;
}
return null;
}
@Override
public R addCheck(TEmployeeProject tEmployeeProject) {
......
......@@ -21,8 +21,12 @@ public class RegistConstants {
public static final String CONFIRM_SUBMIT = "确认接收";
public static final String BEFORE_IN_PROJECT = "先于登记入项";
public static final String BEFORE_IN_PROJECT = "入职登记前已增员";
public static final String BEFORE_OUT_PROJECT = "离职登记前已减员";
public static final String MESSAGE_REGIST = "信息登记";
public static final String MESSAGE_FINISH = "已处理";
}
......@@ -162,7 +162,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
*/
@Override
public void listHrExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo) {
String fileName = "入离职登记表批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "入离职待办任务表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeRegistrationHrExportVo> list = new ArrayList<>();
long count = baseMapper.selectExportCount(searchVo);
......@@ -180,7 +180,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.selectHrExportList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("入离职登记表" + index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("入离职待办任务表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
......@@ -189,7 +189,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("入离职登记表" + index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("入离职待办任务表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......@@ -347,14 +347,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
//状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项
EmpProjectStatusVo vo = new EmpProjectStatusVo();
vo.setEmpIdcard(registrationNow.getEmpIdcard());
vo.setDeptNo(registrationNow.getDeptNo());
EmpProjectStatusVo exit;
if (CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())) {
EmpProjectStatusVo vo = new EmpProjectStatusVo();
vo.setEmpIdcard(registrationNow.getEmpIdcard());
vo.setDeptNo(registrationNow.getDeptNo());
EmpProjectStatusVo exit = getEmpProjectStatus(vo);
if (Common.isNotNull(exit)) {
return R.ok(exit.getProjectTime());
}
exit = getEmpProjectStatus(vo);
} else {
exit = getOutEmpProjectStatus(vo);
}
if (Common.isNotNull(exit)) {
return R.ok(exit.getProjectTime());
}
registrationNow.setProcessStatus(CommonConstants.ZERO_STRING);
baseMapper.updateById(registrationNow);
......@@ -368,9 +371,12 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (Common.isEmpty(registrationNow) || !CommonConstants.ONE_STRING.equals(registrationNow.getProcessStatus())) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
}
registrationNow.setProcessStatus(CommonConstants.ZERO_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.CONFIRM_SUBMIT, registration.getProjectCreateTime(),
registrationNow.getRegistorUsername(),RegistConstants.BEFORE_IN_PROJECT);
registrationNow.setProcessStatus(CommonConstants.TWO_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
registrationNow.getRegistorUsername(),null);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.MESSAGE_FINISH, registration.getProjectCreateTime(),
registrationNow.getRegistorUsername(),CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())
? RegistConstants.BEFORE_IN_PROJECT :RegistConstants.BEFORE_OUT_PROJECT);
baseMapper.updateById(registrationNow);
return R.ok();
}
......@@ -422,6 +428,19 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
//获取减项人员档案信息
private EmpProjectStatusVo getOutEmpProjectStatus(EmpProjectStatusVo vo) {
//找到不在项人员的身份证信息
R<EmpProjectStatusVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/temployeeproject/inner/getOutEmpProjectStatus", vo, EmpProjectStatusVo.class, SecurityConstants.FROM_IN);
if (sdr != null && sdr.getData() != null) {
vo = sdr.getData();
return vo;
} else {
return null;
}
}
//数据初始化
private void initRegistInfo(EmployeeRegistration insert,YifuUser user,TSettleDomainSelectVo selectVo) {
insert.setRegistorDeptname(user.getDeptName());
......@@ -463,7 +482,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
StringBuilder description = new StringBuilder();
String title = "";
if (CommonConstants.ONE_STRING.equals(type) || CommonConstants.TWO_STRING.equals(type)) {
title = "人员入职提醒";
title = CommonConstants.ONE_STRING.equals(type) ? "人员入职提醒:":"人员离职提醒:";
description.append(CommonConstants.ONE_STRING.equals(type) ? "入职日期:":"离职日期:")
.append(DateUtil.dateToString(registration.getJoinLeaveDate(),DateUtil.ISO_EXPANDED_DATE_FORMAT)).append("<br>");
description.append("项目名称:").append(registration.getDeptName()).append("<br>");
......
......@@ -94,13 +94,13 @@
AND a.id = #{employeeRegistration.id}
</if>
<if test="employeeRegistration.employeeName != null and employeeRegistration.employeeName.trim() != ''">
AND a.employee_name like CONCAT(#{employeeRegistration.employeeName},'%')
AND a.employee_name like CONCAT('%',#{employeeRegistration.employeeName},'%')
</if>
<if test="employeeRegistration.empIdcard != null and employeeRegistration.empIdcard.trim() != ''">
AND a.emp_idcard like CONCAT(#{employeeRegistration.empIdcard},'%')
AND a.emp_idcard like CONCAT('%',#{employeeRegistration.empIdcard},'%')
</if>
<if test="employeeRegistration.empPhone != null and employeeRegistration.empPhone.trim() != ''">
AND a.emp_phone like CONCAT(#{employeeRegistration.empPhone},'%')
AND a.emp_phone like CONCAT('%',#{employeeRegistration.empPhone},'%')
</if>
<if test="employeeRegistration.postList != null and employeeRegistration.postList.size() > 0 ">
AND a.position in
......@@ -138,8 +138,8 @@
<if test="employeeRegistration.registorUsername != null and employeeRegistration.registorUsername.trim() != ''">
AND a.registor_username = #{employeeRegistration.registorUsername}
</if>
<if test="employeeRegistration.registorDeptname != null and employeeRegistration.registorDeptname.trim() != ''">
AND a.registor_deptname like CONCAT(#{employeeRegistration.registorDeptname},'%')
<if test="employeeRegistration.deptName != null and employeeRegistration.deptName.trim() != ''">
AND a.dept_name like CONCAT('%',#{employeeRegistration.deptName},'%')
</if>
<if test="employeeRegistration.registorDeptid != null and employeeRegistration.registorDeptid.trim() != ''">
AND a.registor_deptid = #{employeeRegistration.registorDeptid}
......
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