Commit 2efa9991 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-派单暂存

parent 2e652bb6
......@@ -49,9 +49,11 @@ public class BaseServiceParamListVO implements Serializable {
// @Schema(description = "减档:0空1无需处理2待减档8减档成功9减档失败")
private String doStatus;
// 0:未最终成功;1:最终成功
// 0:失败;1:成功
private String isSuccess;
// 备注
private String remark;
// 操作人
private String userName;
}
......@@ -67,22 +67,6 @@ public class EmployeeRegistrationLeave extends BaseEntity {
@ExcelProperty("执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理")
@Schema(description = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理")
private String doStatus;
/**
* 执行详情
*/
@ExcelAttribute(name = "执行详情", maxLength = 100)
@Length(max = 100, message = "执行详情不能超过100个字符")
@ExcelProperty("执行详情")
@Schema(description = "执行详情")
private String doDetail;
/**
* 原因
*/
@ExcelAttribute(name = "原因", maxLength = 100)
@Length(max = 100, message = "原因不能超过100个字符")
@ExcelProperty("原因")
@Schema(description = "原因")
private String doRemark;
/**
* 合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
......
......@@ -60,10 +60,6 @@ public class EmployeeRegistrationLeaveConfirmExportVo {
*/
@ExcelProperty("执行结果")
private String doStatus;
@ExcelProperty("执行详情")
private String doDetail;
@ExcelProperty("原因")
private String doRemark;
/**
* 合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
......
......@@ -50,10 +50,6 @@ public class EmployeeRegistrationLeaveExportVo {
*/
@ExcelProperty("执行结果")
private String doStatus;
@ExcelProperty("执行详情")
private String doDetail;
@ExcelProperty("原因")
private String doRemark;
/**
* 合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
......
......@@ -225,7 +225,7 @@ public class EmployeeRegistrationLeaveController {
**/
@Operation(description = "离职待办单个/批量派单")
@PostMapping("/batchDoLeave")
public R<ErrorInfoVo> batchDoLeave(@RequestBody List<String> idList, @RequestParam String isExit
public R<List<EmployeeRegistrationLeave>> batchDoLeave(@RequestBody List<String> idList, @RequestParam String isExit
, @RequestParam(required = false) String doType) {
return employeeRegistrationLeaveService.batchDoLeave(idList, isExit, doType);
}
......
......@@ -80,7 +80,7 @@ public interface EmployeeRegistrationLeaveService extends IService<EmployeeRegis
// 批量派单
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
R<ErrorInfoVo> batchDoLeave(List<String> idList, String isExit, String doType);
R<List<EmployeeRegistrationLeave>> batchDoLeave(List<String> idList, String isExit, String doType);
void reduceHandleToLeave(BaseServiceParamListVO vo);
......
......@@ -1003,7 +1003,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// * @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
@Override
public R<ErrorInfoVo> batchDoLeave(List<String> idList, String isExit, String doType) {
public R<List<EmployeeRegistrationLeave>> batchDoLeave(List<String> idList, String isExit, String doType) {
List<EmployeeRegistrationLeave> leaveList = baseMapper.selectLeaveListByDispatch(idList);
YifuUser user = SecurityUtils.getUser();
String userName = "自动化手动-";
......@@ -1027,7 +1027,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// * @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
private R<ErrorInfoVo> batchDoLeaveCore(List<EmployeeRegistrationLeave> leaveList, String isExit, String doType, YifuUser user) {
private R<List<EmployeeRegistrationLeave>> batchDoLeaveCore(List<EmployeeRegistrationLeave> leaveList, String isExit, String doType, YifuUser user) {
if (Common.isEmpty(leaveList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
......@@ -1045,9 +1045,6 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
List<BaseSearchVO> listParamEmp = new ArrayList<>();
BaseSearchVO searchVo;
int i = 0;
Map<Integer, String> rowLeaveMap = new HashMap<>();
// 商险id与离职待办的映射
Map<String, String> insuranceLeaveMap = new HashMap<>();
// 离职待办与商险的映射
Map<String, List<String>> leaveInsuranceMap = new HashMap<>();
// 单一离职待办里的商险
......@@ -1055,7 +1052,6 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
String[] insuranceArr;
for (EmployeeRegistrationLeave leave : leaveList) {
i++;
rowLeaveMap.put(i, leave.getId());
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.ONE_STRING))
&& Common.isNotNull(leave.getSocialDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getSocialExpectedTime().isBefore(nowTime)))) {
......@@ -1094,7 +1090,6 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
for (String id : insuranceArr) {
insuranceList.add(id);
insuranceOldList.add(id);
insuranceLeaveMap.put(id, leave.getId());
}
leaveInsuranceMap.put(leave.getId(), insuranceList);
}
......@@ -1413,6 +1408,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
preContent += ",且发起全部日期的事项";
}
// 是否返回前端错误信息
boolean isReturn = false;
// 最终更新总状态
for (EmployeeRegistrationLeave leave : leaveList) {
judgeStatus(leave);
......@@ -1423,6 +1420,17 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
leaveLog.setCreateTime(LocalDateTime.now());
leaveLog.setContent(preContent);
logList.add(leaveLog);
if (!isReturn) {
if ((Common.isNotNull(leave.getDoStatusSocial()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusSocial()))
|| (Common.isNotNull(leave.getDoStatusFund()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusFund()))
|| (Common.isNotNull(leave.getDoStatusContract()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusContract()))
|| (Common.isNotNull(leave.getDoStatusInsurance()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusInsurance()))
|| (Common.isNotNull(leave.getDoStatusProject()) && CommonConstants.NINE_STRING.equals(leave.getDoStatusProject()))
|| (Common.isNotNull(leave.getDoStatusEmp()) && CommonConstants.NINE_STRING.equals(leave.getDoStatusEmp()))
) {
isReturn = true;
}
}
}
leaveLogService.saveBatch(logList);
this.updateBatchById(leaveList);
......@@ -1433,7 +1441,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
errorVo.setSocialParamList(socialParamList);
errorVo.setFundParamList(fundParamList);
errorVo.setInsuranceParamList(insuranceParamList);
return R.ok(errorVo);
if (isReturn) {
return R.failed(leaveList, "发起失败!");
} else {
return R.ok();
}
}
@Override
......@@ -1443,15 +1455,17 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
String doType = vo.getDoType();
String doStatus = vo.getDoStatus();
// 0:失败;1:成功(失败要记录信息)
String isSuccess = vo.getIsSuccess();
String userName = vo.getUserName();
// 最终成功,才更新执行详情
boolean canUpdateDoDetail = false;
if (Common.isNotNull(isSuccess) && CommonConstants.ONE_STRING.equals(isSuccess)) {
canUpdateDoDetail = true;
boolean canUpdateFail = false;
if (Common.isNotNull(isSuccess) && CommonConstants.ZERO_STRING.equals(isSuccess)) {
canUpdateFail = true;
}
String doRemark = vo.getRemark();
if (doRemark.length()>200) {
doRemark = doRemark.substring(0,200);
if (doRemark.length()>50) {
doRemark = doRemark.substring(0,50);
}
List<String> idList = vo.getListParam();
if (idList != null && !idList.isEmpty() && Common.isNotNull(doType)) {
......@@ -1467,26 +1481,26 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
if (leaveList != null && !leaveList.isEmpty()) {
String newDetail;
List<EmployeeRegistrationLeaveInsurance> insuranceList;
String minStatus;
String currentStatus;
for (EmployeeRegistrationLeave leave : leaveList) {
leave.setDoRemark(doRemark);
if (canUpdateDoDetail) {
newDetail = RegistConstants.DO_TYPE_REDUCE_ARR[Integer.parseInt(doType)];
if (Common.isEmpty(leave.getDoDetail())) {
leave.setDoDetail(newDetail);
} else if (!leave.getDoDetail().contains(newDetail)) {
leave.setDoDetail(leave.getDoDetail() + newDetail);
}
}
// 处理社保
if (CommonConstants.ONE_STRING.equals(doType)) {
leave.setDoStatusSocial(doStatus);
if (canUpdateFail) {
leave.setFailSocialUser(userName);
leave.setFailSocialTime(LocalDateTime.now());
leave.setFailSocialRemark(doRemark);
}
}
if (CommonConstants.TWO_STRING.equals(doType)) {
leave.setDoStatusFund(doStatus);
if (canUpdateFail) {
leave.setFailFundUser(userName);
leave.setFailFundTime(LocalDateTime.now());
leave.setFailFundRemark(doRemark);
}
}
if (CommonConstants.THREE_STRING.equals(doType)) {
insuranceList = leaveInsuranceMapper.getLeaveInsuranceList(leave.getId(), null);
......@@ -1505,16 +1519,36 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
}
if (canUpdateFail) {
leave.setFailInsuranceUser(userName);
leave.setFailInsuranceTime(LocalDateTime.now());
leave.setFailInsuranceRemark(doRemark);
}
leave.setDoStatusInsurance(minStatus);
}
if (CommonConstants.FOUR_STRING.equals(doType)) {
leave.setDoStatusContract(doStatus);
if (canUpdateFail) {
leave.setFailContractUser(userName);
leave.setFailContractTime(LocalDateTime.now());
leave.setFailContractRemark(doRemark);
}
}
if (CommonConstants.FIVE_STRING.equals(doType)) {
leave.setDoStatusProject(doStatus);
if (canUpdateFail) {
leave.setFailEmpProjectUser(userName);
leave.setFailEmpProjectTime(LocalDateTime.now());
leave.setFailEmpProjectRemark(doRemark);
}
}
if (CommonConstants.SIX_STRING.equals(doType)) {
leave.setDoStatusEmp(doStatus);
if (canUpdateFail) {
leave.setFailEmpUser(userName);
leave.setFailEmpTime(LocalDateTime.now());
leave.setFailEmpRemark(doRemark);
}
}
judgeStatus( leave);
}
......
......@@ -77,8 +77,6 @@
<id property="id" column="id"/>
<result property="leaveStatus" column="leave_status"/>
<result property="doStatus" column="do_status"/>
<result property="doDetail" column="do_detail"/>
<result property="doRemark" column="do_remark"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/>
......@@ -162,8 +160,6 @@
a.id,
a.leave_status,
a.do_status,
a.do_detail,
a.do_remark,
a.create_by,
a.create_name,
a.create_time,
......@@ -285,12 +281,6 @@
<if test="employeeRegistrationLeave.doStatus != null and employeeRegistrationLeave.doStatus.trim() != ''">
AND a.do_status = #{employeeRegistrationLeave.doStatus}
</if>
<if test="employeeRegistrationLeave.doDetail != null and employeeRegistrationLeave.doDetail.trim() != ''">
AND a.do_detail = #{employeeRegistrationLeave.doDetail}
</if>
<if test="employeeRegistrationLeave.doRemark != null and employeeRegistrationLeave.doRemark.trim() != ''">
AND a.do_remark = #{employeeRegistrationLeave.doRemark}
</if>
<if test="employeeRegistrationLeave.createBy != null and employeeRegistrationLeave.createBy.trim() != ''">
AND a.create_by = #{employeeRegistrationLeave.createBy}
</if>
......@@ -403,8 +393,6 @@
<sql id="Base_Export_List">
case a.leave_status when '0' then '待确认' when '1' then '待处理' when '2' then '处理中' when '3' then '已处理' else '--' end leave_status,
case a.do_status when '0' then '--' when '1' then '未执行' when '2' then '执行中' when '3' then '部分成功' when '4' then '全部失败' when '5' then '全部成功' when '6' then '无需处理' else '--' end do_status,
a.do_detail,
a.do_remark,
case a.do_status_contract when '0' then '--' when '1' then '无需处理' when '2' then '待发起' when '3' then '发起失败'
when '4' then '待审核' when '8' then '审核通过' when '10' then '审核不通过' else '--' end do_status_contract,
case a.do_status_social when '0' then '--' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
......
......@@ -288,7 +288,7 @@
<include refid="tInsuranceAlert_where"/>
<if test="tInsuranceAlert != null">
<if test="tInsuranceAlert.isBefore != null and tInsuranceAlert.isBefore.trim() != ''">
<if test="tInsuranceAlert.isBefore.trim() == '1'">
<if test='tInsuranceAlert.isBefore.trim() == "1"'>
AND DATE_FORMAT(now(),'%Y-%m-%d') >= DATE_FORMAT(b.expected_collection_time,'%Y-%m-%d')
</if>
</if>
......
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