Commit a6e8a7ff authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.16' into MVP1.7.16

parents b4557d03 c1de183c
......@@ -318,7 +318,7 @@ public class TEmployeeContractPreController {
/**
* 一键催办
* @param idList 一键催办列表
* @param id 一键催办列表
**/
@Operation(description = "一键催办")
@PostMapping("/contractUrg")
......
......@@ -542,7 +542,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(tEmployeeContractInfo.getPreId())) {
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getId, tEmployeeContractInfo.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.contractDIsStatus)
.in(TEmployeeContractPre::getProcessStatus, Arrays.asList("0","1","3","5","7","11"))
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
//合同状态初始为签署中
......
......@@ -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;
......@@ -277,9 +278,16 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
@Override
public R dispatcherContract(List<String> idList, String type) {
List<TEmployeeContractPre> contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query()
List<TEmployeeContractPre> contractPreList;
if ("2".equals(type)) {
contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query()
.lambda().in(TEmployeeContractPre::getId, idList)
.in(TEmployeeContractPre::getProcessStatus, Arrays.asList("0","1","3","5","7","11")));
} else {
contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query()
.lambda().in(TEmployeeContractPre::getId, idList)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.contractDIsStatus));
}
// 如果没有找到任何未处理的合同待派单数据,返回失败消息
if (Common.isEmpty(contractPreList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
......@@ -336,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);
......@@ -349,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);
......@@ -1043,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)) {
......
......@@ -327,7 +327,7 @@
a.contract_type,
a.signatory,
a.customer_username,
if(a.sign_type = '0','线下签','电子签') sign_type,
if(a.sign_type = '0','电子签','线下签') sign_type,
a.fadada_template,
DATE_FORMAT(a.expected_confirm_time,'%Y-%m-%d %H:%i') expected_confirm_time,
DATE_FORMAT(a.expected_collection_time,'%Y-%m-%d %H:%i') expected_collection_time,
......@@ -340,6 +340,7 @@
WHEN a.process_status =6 THEN "签署中"
WHEN a.process_status =7 THEN "签署失败"
WHEN a.process_status =8 THEN "电子待归档"
WHEN a.process_status =10 THEN "撤销签署-客服撤销"
WHEN a.process_status =11 THEN "撤销签署-系统自动撤销"
ELSE a.process_status END as process_status,
if(b.id is null,'否','是') archives_is_create
......
......@@ -1509,6 +1509,12 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.atZone(ZoneId.systemDefault())
.toLocalDate();
// 添加年数和月数
if (vo.getMonthAfter() ==0 && vo.getYearAfter() ==0) {
// 转回Date类型
return Date.from(localDate.atStartOfDay()
.atZone(ZoneId.systemDefault())
.toInstant());
} else {
localDate = localDate
.plusYears(vo.getYearAfter())
.plusMonths(vo.getMonthAfter())
......@@ -1518,6 +1524,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.atZone(ZoneId.systemDefault())
.toInstant());
}
}
/**
* @Description: 批量处理日志
......
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