Commit b3ed8e19 authored by hongguangwu's avatar hongguangwu

合同-date

parent a2d87422
...@@ -23,9 +23,10 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; ...@@ -23,9 +23,10 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* 法大大合同附属信息表 * 法大大合同附属信息表
...@@ -56,25 +57,25 @@ public class FddContractAttachInfo extends BaseEntity { ...@@ -56,25 +57,25 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同试用期开始时间 * 合同试用期开始时间
*/ */
@Schema(description ="合同试用期开始时间") @Schema(description ="合同试用期开始时间")
private LocalDate periodStart; private Date periodStart;
/** /**
* 合同试用期结束时间 * 合同试用期结束时间
*/ */
@Schema(description ="合同试用期结束时间") @Schema(description ="合同试用期结束时间")
private LocalDate periodEnd; private Date periodEnd;
/** /**
* 合同起始时间 * 合同起始时间
*/ */
@Schema(description ="合同起始时间") @Schema(description ="合同起始时间")
private LocalDate contractStart; private Date contractStart;
/** /**
* 合同到期时间 * 合同到期时间
*/ */
@Schema(description ="合同到期时间") @Schema(description ="合同到期时间")
private LocalDate contractEnd; private Date contractEnd;
/** /**
* 试用期工资 元/月 * 试用期工资 元/月
......
...@@ -29,7 +29,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; ...@@ -29,7 +29,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.NoUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -334,7 +337,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -334,7 +337,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING));
if (employeeContractInfo != null) { if (employeeContractInfo != null) {
long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId())); long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId()));
if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().isBefore(employeeContractInfo.getContractEnd())) { if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().before(employeeContractInfo.getContractEnd())) {
errorList.add(new ErrorMessage(i, "已导入合同相关基础数据", CommonConstants.RED)); errorList.add(new ErrorMessage(i, "已导入合同相关基础数据", CommonConstants.RED));
continue; continue;
} }
......
...@@ -28,15 +28,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -28,15 +28,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants; import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.FamilySearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -45,7 +46,6 @@ import javax.servlet.ServletOutputStream; ...@@ -45,7 +46,6 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -218,10 +218,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -218,10 +218,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
Map<String,TEmpContractAlert> alertMap = new HashMap<>(); Map<String,TEmpContractAlert> alertMap = new HashMap<>();
if (Common.isNotNull(alertList)){ if (Common.isNotNull(alertList)){
LocalDate now = LocalDate.now();
Date nowDate = new Date(); Date nowDate = new Date();
for (TEmployeeContractInfo contract:alertList){ for (TEmployeeContractInfo contract:alertList){
extracted(now, nowDate, contract,alertMap); extracted(nowDate, contract,alertMap);
} }
} }
if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)){ if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)){
...@@ -241,13 +240,13 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -241,13 +240,13 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
return R.ok(); return R.ok();
} }
private void extracted(LocalDate now, Date nowDate, private void extracted(Date nowDate,
TEmployeeContractInfo contract, TEmployeeContractInfo contract,
Map<String,TEmpContractAlert> alertMap) { Map<String,TEmpContractAlert> alertMap) {
TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard()); TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard());
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的 // 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if (Common.isNotNull(alert) && if (Common.isNotNull(alert) &&
alert.getContractEnd().after(LocalDateTimeUtils.convertLDToDate(contract.getContractEnd()))){ alert.getContractEnd().after(contract.getContractEnd())){
return; return;
} }
alert = new TEmpContractAlert(); alert = new TEmpContractAlert();
...@@ -257,8 +256,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -257,8 +256,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setProject(contract.getSubjectDepart()); alert.setProject(contract.getSubjectDepart());
alert.setProjectNo(contract.getDeptNo()); alert.setProjectNo(contract.getDeptNo());
alert.setEmpIdcard(contract.getEmpIdcard()); alert.setEmpIdcard(contract.getEmpIdcard());
alert.setContractStart(LocalDateTimeUtils.convertLDToDate(contract.getContractStart())); alert.setContractStart(contract.getContractStart());
alert.setContractEnd(LocalDateTimeUtils.convertLDToDate(contract.getContractEnd())); alert.setContractEnd(contract.getContractEnd());
if (Common.isNotNull(contract.getFileProvince())){ if (Common.isNotNull(contract.getFileProvince())){
alert.setFileProvince(Integer.toString(contract.getFileProvince())); alert.setFileProvince(Integer.toString(contract.getFileProvince()));
} }
...@@ -272,7 +271,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -272,7 +271,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setContractTerm(contract.getContractType()); alert.setContractTerm(contract.getContractType());
alert.setContractTerm(contract.getContractTerm()); alert.setContractTerm(contract.getContractTerm());
if (Common.isNotNull(alert.getContractEnd())){ if (Common.isNotNull(alert.getContractEnd())){
if (Common.isNotNull(contract.getContractEnd()) && contract.getContractEnd().isBefore(now)){ if (Common.isNotNull(contract.getContractEnd()) && contract.getContractEnd().before(nowDate)){
alert.setDueFlag(CommonConstants.ONE_STRING); alert.setDueFlag(CommonConstants.ONE_STRING);
alert.setDaysOver(DateUtil.daysBetween(nowDate,alert.getContractEnd())); alert.setDaysOver(DateUtil.daysBetween(nowDate,alert.getContractEnd()));
}else { }else {
......
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