Commit c1de183c authored by huyuchen's avatar huyuchen

huych-社保自动化相关提交

parent e55822c9
......@@ -318,7 +318,7 @@ public class TEmployeeContractPreController {
/**
* 一键催办
* @param idList 一键催办列表
* @param id 一键催办列表
**/
@Operation(description = "一键催办")
@PostMapping("/contractUrg")
......
......@@ -36,6 +36,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -343,10 +344,13 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
});
customerStats.setInitiatedCount(customerStats.getInitiatedCount() + 1);
LocalDate joinDate = LocalDateTimeUtils.convertDateToLDT(contractPre.getJoinLeaveDate()).toLocalDate();
LocalDate localDate = contractPre.getJoinLeaveDate().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
localDate = localDate.plusMonths(1)
.minusDays(1);
// 判断是否超过入职日期一个月
if (currentDate.isAfter(joinDate.plusMonths(1))) {
if (currentDate.isAfter(localDate)) {
// 超过一个月,算电子签发起失败
customerStats.setFailedCount(customerStats.getFailedCount() + 1);
customerStats.setElectronicSignFailedCount(customerStats.getElectronicSignFailedCount() + 1);
......@@ -356,6 +360,10 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getErrorInfo, "电子签发起失败:已超过入职日期一个月")
.set(TEmployeeContractPre::getChangeTypeUser, type.equals("1") ? "自动化手动—" + contractPre.getCustomerUsername()
: "自动化自动—" + contractPre.getCustomerUsername() )
.set(TEmployeeContractPre::getChangeTypeReason, "已超过入职日期一个月,自动转线下签")
.set(TEmployeeContractPre::getChangeTypeTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()))
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING)
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
......@@ -1050,11 +1058,14 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
for (TEmployeeContractPre contract : signingContracts) {
if (contract.getJoinLeaveDate() != null) {
// 计算入职一个月的最后一天
LocalDate joinDate = LocalDateTimeUtils.convertDateToLDT(contract.getJoinLeaveDate()).toLocalDate();
LocalDate lastDayOfMonth = joinDate.plusMonths(1);
LocalDate localDate = contract.getJoinLeaveDate().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
localDate = localDate.plusMonths(1)
.minusDays(1);
// 计算往前3个工作日
List<LocalDate> reminderDates = calculateReminderWorkDays(lastDayOfMonth);
List<LocalDate> reminderDates = calculateReminderWorkDays(localDate);
// 判断今天是否是提醒日期之一
if (reminderDates.contains(today)) {
......
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