Commit c10b4d74 authored by huyuchen's avatar huyuchen

huych-入职登记商险待办提交

parent 97a8a4b4
......@@ -656,13 +656,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
TEmployeeInsuranceExitCheckVo checkVo;
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
for (EmployeeRegistration registration : registrationList) {
StringBuilder errorTemp = new StringBuilder();
for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) {
//是否工作日判断
String error = checkInsuranceBuy(insurancePreVo, CommonConstants.ONE_STRING);
if (null != error) {
errorTemp.append(error);
}
insurancePreVo.setEmpIdcard(registration.getEmpIdcard());
insurancePreVo.setDeptNo(registration.getDeptNo());
//商险是否存在判断
......@@ -671,9 +665,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
errorList.add(checkVo);
}
}
if (errorTemp.length() > 0) {
return R.other(CommonConstants.TWO_INT, null, errorTemp.toString());
}
}
if (!errorList.isEmpty()) {
return R.other(CommonConstants.TWO_INT, null, errorList);
......
......@@ -36,7 +36,7 @@ public class ScheduleServiceImpl implements ScheduleService {
public void initSchedule() {
List<TEmployeeInsurancePre> records = insurancePreService.list(Wrappers.<TEmployeeInsurancePre>query()
.lambda().ge(TEmployeeInsurancePre::getExpectedCollectionTime,LocalDateTime.now())
.eq(TEmployeeInsurancePre::getProcessStatus,CommonConstants.ONE_STRING));
.in(TEmployeeInsurancePre::getProcessStatus,CommonConstants.processStatus));
records.forEach(this::scheduleTask);
}
......
......@@ -215,8 +215,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setReplaceEmpName(insurancePre.getReplaceEmployeeName());
addParam.setReplaceDeptNo(insurancePre.getReplaceDeptNo());
addParam.setReplaceEmpIdcardNo(insurancePre.getReplaceEmpIdcard());
//todo
// addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setRemark(CommonConstants.EMPTY_STRING);
replaceAddParamList.add(addParam);
}
}
......
......@@ -15,9 +15,12 @@ import java.util.Date;
@Data
public class TEmployeeInsuranceWorkDayVo implements Serializable {
@Schema(description = "日期")
@Schema(description = "保单开始日期")
private Date registDate;
@Schema(description = "预计派单日期")
private Date priDisDate;
@Schema(description = "类型 1 前一个工作日 2 后一个工作日")
private String type;
......
......@@ -47,7 +47,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;
/**
......@@ -292,6 +294,41 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
holidayMap.put(h.getDate(),h.getDay());
}
}
if (vo.getType().equals(CommonConstants.TWO_STRING)) {
//查找入职日期的前一个工作日
TEmployeeInsuranceWorkDayVo newVo = new TEmployeeInsuranceWorkDayVo();
newVo.setRegistDate(vo.getRegistDate());
newVo.setType(CommonConstants.ONE_STRING);
getWorkDay(holidayMap, newVo);
//判断前一个工作日是否大于今天
LocalDate givenLocalDate = newVo.getRegistDate().toInstant()
.atZone(java.time.ZoneId.systemDefault())
.toLocalDate();
// 获取今天的 LocalDate
LocalDate today = LocalDate.now();
LocalTime currentTime = LocalTime.now();
if (givenLocalDate.isBefore(today) || givenLocalDate.isEqual(today)) {
// 如果日期前一个工作日日期小于等于今天
if (currentTime.isBefore(LocalTime.of(14, 0))) {
// 如果当前时间在14:00之前
vo.setRegistDate(LocalDateTimeUtils.convertLDToDate(today));
vo.setPriDisDate(LocalDateTimeUtils.convertLDToDate(today));
} else {
// 如果当前时间在14:00之后
TEmployeeInsuranceWorkDayVo afterVo = new TEmployeeInsuranceWorkDayVo();
afterVo.setRegistDate(vo.getRegistDate());
afterVo.setType(CommonConstants.TWO_STRING);
getWorkDay(holidayMap, afterVo);
vo.setRegistDate(afterVo.getRegistDate());
vo.setPriDisDate(afterVo.getRegistDate());
}
} else {
//如果前一个工作日日期大于今天
vo.setRegistDate(newVo.getRegistDate());
}
}
getWorkDay(holidayMap,vo);
return vo;
}
......
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