Commit 45a39c46 authored by fangxinjiang's avatar fangxinjiang

证明补充

parent db553efb
......@@ -23,9 +23,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCertRecordService;
......@@ -33,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor;
......@@ -53,6 +56,9 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
private final TEmployeeProjectMapper projectMapper;
private final TEmployeeInfoMapper employeeInfoMapper;
private final TEmployeeContractInfoMapper contractInfoMapper;
@Override
public R<TCertRecordVo> getCertRecordInfo(String id) {
TEmployeeProject project = projectMapper.selectById(id);
......@@ -63,6 +69,21 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
if (!Common.isNotNull(employeeInfo)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
// 取值最早的合同
TEmployeeContractInfo last = contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_STRING)
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.orderByDesc(TEmployeeContractInfo::getAuditTimeLast)
.last(CommonConstants.LAST_ONE_SQL));
// 取值最早的合同
TEmployeeContractInfo first = contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_STRING)
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.orderByAsc(TEmployeeContractInfo::getAuditTimeLast)
.last(CommonConstants.LAST_ONE_SQL));
TCertRecordVo vo = new TCertRecordVo();
vo.setEmpIdcard(project.getEmpIdcard());
vo.setEmpId(project.getEmpId());
......@@ -70,17 +91,24 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
vo.setPost(project.getPost());
vo.setProjectName(project.getDeptName());
vo.setProjectCode(project.getDeptNo());
// TODO 最新合同时间
vo.setContractStart(null);
vo.setContractEnd(null);
// TODO 派减离职时间和原因
// 最新合同时间
if (Common.isNotNull(last)){
if (Common.isNotNull(last.getContractStart())){
vo.setContractStart(LocalDateTimeUtils.convertDateToLDT(last.getContractStart()));
}
if (Common.isNotNull(last.getContractEnd())){
vo.setContractEnd(LocalDateTimeUtils.convertDateToLDT(last.getContractEnd()));
}
}
// 派减离职时间和原因
vo.setLeaveTime(employeeInfo.getLeaveTime());
vo.setLeaveReason(employeeInfo.getLeaveReason());
// TODO 第一次合同开始截止时间
vo.setEntryTime(employeeInfo.getCreateTime());
vo.setFirstContractTime(null);
// 第一次合同开始时间和创建时间
if (Common.isNotNull(first) && Common.isNotNull(first.getContractStart())){
vo.setEntryTime(LocalDateTimeUtils.convertDateToLDT(first.getContractStart()));
vo.setFirstContractTime(first.getCreateTime());
}
vo.setSex(employeeInfo.getEmpSex());
vo.setIntroductionUnit(CommonConstants.EMPTY_STRING);
vo.setSeal("安徽皖信人力资源管理有限公司");
......
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