Commit c426ddf2 authored by hongguangwu's avatar hongguangwu

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

parents 2562cd3c 36130edd
......@@ -96,18 +96,22 @@ public class TEmployeeContractPre extends BaseEntity {
*/
@Schema(description = "预计确认时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime expectedConfirmTime;
@Schema(description = "预计发起时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime expectedCollectionTime;
@Schema(description = "合同起始时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date contractStart;
@Schema(description = "合同到期时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date contractEnd;
@Schema(description = "签订类型")
......@@ -124,10 +128,12 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "合同试用期开始时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date tryPeriodStart;
@Schema(description = "合同试用期结束时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date tryPeriodEnd;
@Schema(description = "工作任务")
......@@ -178,6 +184,9 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "购买补充保险说明")
private String riskBuyDesc;
@Schema(description = "业务细分")
private String contractSubName;
@Schema(description = "其他 (工资形式其他时的工资)")
private String otherWage;
......@@ -203,9 +212,11 @@ public class TEmployeeContractPre extends BaseEntity {
private String dispatchPeriodMonth;
@Schema(description = "派遣开始日期")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date dispatchPeriodStart;
@Schema(description = "派遣结束日期")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date dispatchPeriodEnd;
@Schema(description = "工作方式 0 第一种方式 1 第二种方式")
......@@ -227,9 +238,11 @@ public class TEmployeeContractPre extends BaseEntity {
private String internshipPeriod;
@Schema(description = "实习开始日期")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date internshipPeriodStart;
@Schema(description = "实习结束日期")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date internshipPeriodEnd;
@Schema(description = "合同岗位 0 固定岗位 1 等于档案处维护 2 自定义")
......@@ -261,7 +274,7 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "新合同发起时间 入职日期 0、入职3天后 3、入职1周后 7、入职2周后 14、入职3周后 21")
@TableField(exist = false)
private int registType;
private String registType;
@Schema(description = "试用期月份数字 1、2、3、4...")
@TableField(exist = false)
......
......@@ -88,7 +88,14 @@ public class TEmployeeContractPreVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "新合同发起时间")
@Schema(description = "新合同发起时间 入职日期 0、入职3天后 3、入职1周后 7、入职2周后 14、入职3周后 21")
@ExcelProperty("新合同发起时间")
private int registType;
private String registType;
/**
* 业务细分
*/
@ExcelAttribute(name = "业务细分")
@Schema(description = "业务细分(存lable)")
private String contractSubName;
/**
* 合同类型
*/
......
......@@ -207,8 +207,8 @@ public class EmployeeRegistrationPreController {
**/
@Operation(summary = "查询瓜子身份信息")
@SysLog("查询身份信息")
@GetMapping("/getGzEmployeeInfo")
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(@RequestParam String id) {
return employeeRegistrationPreService.getGzEmployeeInfo(id);
@PostMapping("/getGzEmployeeInfo")
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(@RequestBody EmployeeInfoMsgVo vo) {
return employeeRegistrationPreService.getGzEmployeeInfo(vo);
}
}
......@@ -197,8 +197,8 @@ public class TEmployeeContractPreController {
*/
@Operation(description = "查询在用或者在途的合同数据")
@GetMapping("/getContractInfo")
public R<TEmployeeContractInfo> getInuseContractInfo(@RequestParam String deptNo,@RequestParam String empIdcard) {
TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
public R<List<TEmployeeContractInfo>> getInuseContractInfo(@RequestParam String deptNo,@RequestParam String empIdcard) {
List<TEmployeeContractInfo> employeeContractInfo = employeeContractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, empIdcard)
.eq(TEmployeeContractInfo::getDeptNo, deptNo)
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
......@@ -206,8 +206,7 @@ public class TEmployeeContractPreController {
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
return R.ok(employeeContractInfo);
}
......
......@@ -93,7 +93,7 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
R<EmployeeInfoMsgVo> getEmployeeInfo(String cardOrId);
R<EmployeeInfoMsgVo> getGzEmployeeInfo(String cardOrId);
R<EmployeeInfoMsgVo> getGzEmployeeInfo(EmployeeInfoMsgVo vo);
/**
* @param empIdCard 身份证
......
......@@ -301,6 +301,25 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapper);
//清空合同待签订数据
if (preVo.getServerItem().contains("合同") && null != preVo.getEmployeeContractPreVos() &&
Common.isNotNull(preVo.getEmployeeContractPreVos().getContractFlag()) &&
CommonConstants.ZERO_STRING.equals(preVo.getEmployeeContractPreVos().getContractFlag())) {
//查询老的合同明细
TEmployeeContractPre contractOld = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId,pre.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractOld)) {
// 创建更新条件构造器
LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapperContract.eq(TAttaInfo::getDomainId, contractOld.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
contractPreMapper.deleteById(contractOld);
}
}
}
baseMapper.insert(pre);
//附件赋值
......@@ -662,6 +681,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.eq(TEmployeeContractPre::getRegisterId,employeeRegistrationPre.getId())
.last(CommonConstants.LAST_ONE_SQL));
//1.9.12合同自动化校验逻辑
//根据身份证号码和项目编号查询合同
boolean flag = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, employeeRegistrationPre.getEmpIdcard())
.eq(TEmployeeContractInfo::getDeptNo, employeeRegistrationPre.getDeptNo())
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL)) > 0;
if (employeeRegistrationPre.getServerItem().contains("合同") && Common.isEmpty(employeeRegistrationPre.getEmployeeContractPre()) && !flag) {
return R.failed("未找到流程中或者在用的合同!");
}
if (employeeRegistrationPre.getServerItem().contains("合同") && null != employeeRegistrationPre.getEmployeeContractPre()) {
TEmployeeContractPre employeeContractPreVo = employeeRegistrationPre.getEmployeeContractPre();
if (Common.isNotNull(employeeContractPreVo.getId())) {
......@@ -676,27 +709,16 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
return R.failed("流程中的合同待签订数据不可修改!");
}
}
//根据身份证号码和项目编号查询合同
boolean flag = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, employeeRegistrationPre.getEmpIdcard())
.eq(TEmployeeContractInfo::getDeptNo, employeeRegistrationPre.getDeptNo())
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_INT)
.or()
.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_INT)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL)) > 0;
//是否已签署为是需要判断合同是否在用或者流程中
if (CommonConstants.ZERO_STRING.equals(employeeContractPreVo.getContractFlag()) && !flag) {
return R.failed("未找到流程中或者在用的合同!");
}
//是否已签署为否需要判断是否在用或者流程中的合同
if (CommonConstants.ONE_STRING.equals(employeeContractPreVo.getContractFlag()) && flag) {
return R.failed("该项目下存在在途/有效的合同数据,请“是否已签署合同”是否调整为“是”");
if ((CommonConstants.ONE_STRING.equals(employeeContractPreVo.getContractFlag()) || Common.isEmpty(employeeContractPreVo.getContractFlag())) && flag) {
return R.failed("该人员已存在审核中或已签署的合同,请勿重复发起签署!");
}
if (CommonConstants.ONE_STRING.equals(employeeContractPreVo.getContractFlag()) || Common.isEmpty(employeeContractPreVo.getContractFlag())) {
initContractPreInfo(employeeRegistrationPre,employeeContractPreVo, user, id);
employeeRegistrationPre.setEmployeeContractPre(employeeContractPreVo);
} else {
employeeRegistrationPre.setEmployeeContractPre(null);
}
}
//操作记录中字典值的转化
......@@ -872,6 +894,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (Common.isNotNull(employeeContractPreVo.getInternshipPeriodEnd())) {
employeeContractPreVo.setContractEnd(employeeContractPreVo.getInternshipPeriodEnd());
}
//合同岗位名称
if (CommonConstants.ONE_STRING.equals(employeeContractPreVo.getPostType())
&& Common.isEmpty(employeeContractPreVo.getPost())) {
employeeContractPreVo.setPost(registration.getPosition());
}
}
/**
......@@ -1208,9 +1235,14 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
@Override
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(String id) {
public R<EmployeeInfoMsgVo> getGzEmployeeInfo(EmployeeInfoMsgVo vo) {
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
//短信入口
if (Common.isNotNull(vo.getDetailId())) {
//获取人员档案id
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(id, Stream.of("4").collect(Collectors.toList()));
EmployeeInfoMsgVo msgInfoVo = baseMapper.getEmployeeArchivesInfo(vo.getDetailId(), Stream.of("4").collect(Collectors.toList()));
if (Common.isEmpty(msgInfoVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
......@@ -1225,6 +1257,24 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
return R.ok(msgInfoVo);
}
}
//二维码入口
if (Common.isNotNull(vo.getCard()) && Common.isNotNull(vo.getName())) {
//获取预入职信息,如果有的话提示
TGzOfferInfo empMain = gzOfferInfoMapper.selectOne(Wrappers.<TGzOfferInfo>query().lambda()
.eq(TGzOfferInfo::getNationalId, vo.getCard())
.eq(TGzOfferInfo::getName, vo.getName())
.eq(TGzOfferInfo::getOfferStatus, CommonConstants.NINE_STRING)
.orderByDesc(TGzOfferInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(empMain)) {
vo.setMessage("当前Offer不符合档案采集状态,禁止操作");
} else {
vo.setPhone(empMain.getPhone());
vo.setDetailId(empMain.getId().toString());
}
return R.ok(vo);
}
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
......
......@@ -68,6 +68,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.ZoneId;
......@@ -1427,10 +1428,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isEmpty(insert.getContractTerm())
&& Common.isNotNull(insert.getContractStart())
&& Common.isNotNull(insert.getContractEnd())) {
int monthDiff = DateUtil.getMonthDiff(insert.getContractStart(), insert.getContractEnd());
BigDecimal b = new BigDecimal(String.valueOf(monthDiff / 12.0));
b = b.setScale(1, BigDecimal.ROUND_HALF_UP);
insert.setContractTerm(String.valueOf(b));
//1.9.12合同年限优化
long daysDiff = DateUtil.getDaysDiff(insert.getContractStart(), insert.getContractEnd());
if (daysDiff < 0) {
insert.setContractTerm("0.0");
} else {
double years = daysDiff / 365.25; // 考虑闰年因素
BigDecimal b = BigDecimal.valueOf(years).setScale(2, RoundingMode.HALF_UP);
insert.setContractTerm(b.toString());
}
// int monthDiff = DateUtil.getMonthDiff(insert.getContractStart(), insert.getContractEnd());
// BigDecimal b = new BigDecimal(String.valueOf(monthDiff / 12.0));
// b = b.setScale(1, BigDecimal.ROUND_HALF_UP);
// insert.setContractTerm(String.valueOf(b));
}
// 核心保存
R<List<ErrorMessage>> info = this.setBaseInfo(insert, project);
......
......@@ -10,14 +10,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractAudit;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAuditService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -30,6 +28,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
......@@ -65,6 +64,9 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
@Autowired
private UpmsDaprUtils upmsDaprUtils;
@Lazy
private final TAttaInfoService attaInfoService;
/**
* 合同待签订任务记录表简单分页查询
* @param tEmployeeContractPre 合同待签订任务记录表
......@@ -195,8 +197,15 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
// 如果已存在合同预信息,则删除旧的信息并插入新的信息
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.deleteById(preExit);
//附件信息清空
LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapperContract.eq(TAttaInfo::getDomainId, preExit.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
pre.setId(preExit.getId());
baseMapper.insert(pre);
} else {
// 如果不存在,则直接插入新的合同预信息
......@@ -299,6 +308,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.set(TEmployeeContractPre::getErrorInfo, errorMessage.getMessage())
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
// 执行更新操作
errorMessage.setData(contractVO);
this.update(updateWrapper);
}
}
......
......@@ -20,15 +20,14 @@ import cn.hutool.core.util.ArrayUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService;
......@@ -71,6 +70,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
private final TEmployeePreLogDetailService tEmployeePreLogDetailService;
@Lazy
private final TEmployeeContractPreService contractPreService;
@Lazy
private final TAttaInfoService attaInfoService;
/**
* 入职确认信息变更日志表简单分页查询
......@@ -187,6 +188,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
IGNORE_FIELD.add("customerUserLoginname");
IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("position");
IGNORE_FIELD.add("contractId");
IGNORE_FIELD.add("registerId");
IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy");
......@@ -219,7 +222,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
// 档案信息修改
TEmployeePreLogDetail detailEmpLog = null;
if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey)
&& !"employeeContractPre".equals(differenceKey)) {
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre","");
diffTitle = "档案信息";
......@@ -303,19 +306,38 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
}
}
}
boolean isModifyContract =false;
String differenceContractKey = "";
String differenceContractKey = null;
TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre();
if (contractOld != null && employeeContractPre != null) {
if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
//记录操作记录
contractOld.setAttaList(null);
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.THREE_STRING);
detailEmpLog.setType(CommonConstants.THREE_STRING);
this.setLogBaseInfo(empPreId, contractOld, null, user, differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
diffTitle = "合同信息";
}
// 创建更新条件构造器
LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapperContract.eq(TAttaInfo::getDomainId, contractOld.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
//删除历史的合同待签订数据
contractPreService.removeById(contractOld.getId());
}
if (newInfo.getServerItem().contains("合同") && contractOld != null && employeeContractPre != null) {
//1.9.11 huych 附件类型不比较差异
contractOld.setAttaList(null);
employeeContractPre.setAttaList(null);
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, employeeContractPre, CONTRACT_IGNORE_FIELD);
if (differenceContractKey.length() > 0) {
isModifyContract = true;
}
}
if (isModifyContract) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
......@@ -327,6 +349,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
this.setLogBaseInfo(empPreId, contractOld, employeeContractPre, user, differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
}
// 有修改,则加日志
if (Common.isNotNull(diffTitle)) {
TEmployeePreLog empPreLog = new TEmployeePreLog();
......@@ -344,7 +367,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
}
}
//保存合同待签订数据
if (employeeContractPre != null) {
if (newInfo.getServerItem().contains("合同") && employeeContractPre != null) {
TEmployeeContractPreVo preVo = new TEmployeeContractPreVo();
BeanUtils.copyProperties(employeeContractPre,preVo);
if (Common.isNotNull(employeeContractPre.getExpectedCollectionTime()) ) {
......@@ -392,8 +415,9 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
TEmployeePreLogDetail detailEmpLog = null;
if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey)
&& !"attaIdList".equals(differenceKey)) {
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre","");
diffTitle = "档案信息二次确认";
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
......@@ -434,19 +458,38 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
}
}
}
boolean isModifyContract =false;
String differenceContractKey = "";
String differenceContractKey = null;
TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre();
if (contractOld != null && employeeContractPre != null) {
if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
//记录操作记录
contractOld.setAttaList(null);
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.THREE_STRING);
detailEmpLog.setType(CommonConstants.THREE_STRING);
this.setPreLogBaseInfo(empPreId, contractOld, null, userId, nickName,
differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
diffTitle = "合同信息";
}
// 创建更新条件构造器
LambdaUpdateWrapper<TAttaInfo> updateWrapperContract = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapperContract.eq(TAttaInfo::getDomainId, contractOld.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapperContract);
//删除历史的合同待签订数据
contractPreService.removeById(contractOld.getId());
}
if (newInfo.getServerItem().contains("合同") && contractOld != null && employeeContractPre != null) {
//1.9.11 huych 附件类型不比较差异
contractOld.setAttaList(null);
employeeContractPre.setAttaList(null);
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, employeeContractPre, CONTRACT_IGNORE_FIELD);
if (differenceContractKey.length() > 0) {
isModifyContract = true;
}
}
if (isModifyContract) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
......@@ -459,6 +502,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
}
// 有修改,则加日志
if (Common.isNotNull(diffTitle)) {
TEmployeePreLog empPreLog = new TEmployeePreLog();
......
......@@ -84,6 +84,7 @@
<result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="contractSubName" column="CONTRACT_SUB_NAME,"/>
</resultMap>
<sql id="Base_Column_List">
id
......@@ -163,7 +164,7 @@
,update_by
,TASK
,TASK_TYPE
,TASK_END_STANDARD,contract_flag
,TASK_END_STANDARD,contract_flag,a.CONTRACT_SUB_NAME
</sql>
<sql id="tEmployeeContractPre_where">
<if test="tEmployeeContractPre != null">
......@@ -334,12 +335,12 @@
a.dept_no deptNo,
a.situation,
a.contract_type contractName,
null contractSubName,
a.CONTRACT_SUB_NAME contractSubName,
null reason,
a.signatory contractParty,
if(a.CONTRACT_TERM = '' or a.CONTRACT_TERM is null,'2',a.CONTRACT_TERM) contractType,
a.CONTRACT_START as contractStart,
if(a.CONTRACT_TERM ='1',a.CONTRACT_END,null) as contractEnd,
if(a.contract_type = '实习协议',a.CONTRACT_END,if(a.CONTRACT_TERM ='1' ,a.CONTRACT_END,null)) as contractEnd,
a.post,
if(a.working_hours = '' or a.working_hours is null,'4',a.working_hours) as workingHours,
null contractNo,
......
......@@ -11,8 +11,10 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
......@@ -965,6 +967,17 @@ public class DateUtil {
}
}
public static long getDaysDiff(Date startDate, Date endDate) {
if (startDate == null || endDate == null) return 0;
// 标准化为 LocalDate(忽略时间部分)
LocalDate start = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate end = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 计算绝对天数差
return Math.abs(ChronoUnit.DAYS.between(start, end));
}
/**
* @param date1
* @param date2
......
......@@ -719,7 +719,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(registration.getJoinLeaveDate());
dayVo.setRegistType(employeeContractPreVo.getRegistType());
dayVo.setRegistType(Integer.parseInt(employeeContractPreVo.getRegistType()));
dataR = socialDaprUtils.getContractAfterWorkDay(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getData())
&& Common.isNotNull(dataR.getData().getRegistDate())) {
......@@ -752,13 +752,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//合同年限推算
if (Common.isEmpty(employeeContractPreVo.getContractStart())
&& Common.isEmpty(employeeContractPreVo.getContractEnd())
&& Common.isNotNull(employeeContractPreVo.getContractDurationYear())
&& Common.isNotNull(employeeContractPreVo.getContractDurationMonth())
&& (Common.isNotNull(employeeContractPreVo.getContractDurationYear())
|| Common.isNotNull(employeeContractPreVo.getContractDurationMonth()))
&& Common.isNotNull(employeeContractPreVo.getContractEndType())
&& CommonConstants.ZERO_STRING.equals(employeeContractPreVo.getContractEndType())) {
employeeContractPreVo.setContractStart(employeeContractPreVo.getJoinLeaveDate());
vo.setMonthAfter(Integer.parseInt(employeeContractPreVo.getContractDurationMonth()));
vo.setYearAfter(Integer.parseInt(employeeContractPreVo.getContractDurationYear()));
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(employeeContractPreVo.getContractDurationMonth()) ? "0":employeeContractPreVo.getContractDurationMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(employeeContractPreVo.getContractDurationYear()) ? "0":employeeContractPreVo.getContractDurationYear()));
vo.setRegistDate(employeeContractPreVo.getContractStart());
employeeContractPreVo.setContractEnd(this.addYearsMonths(vo));
}
......@@ -780,11 +780,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
//派遣开始日期、派遣结束日期
if (Common.isEmpty(employeeContractPreVo.getDispatchPeriodStart())
&& Common.isNotNull(employeeContractPreVo.getDispatchPeriodYear())
&& Common.isNotNull(employeeContractPreVo.getDispatchPeriodMonth())) {
&& (Common.isNotNull(employeeContractPreVo.getDispatchPeriodYear())
|| Common.isNotNull(employeeContractPreVo.getDispatchPeriodMonth()))) {
employeeContractPreVo.setDispatchPeriodStart(employeeContractPreVo.getJoinLeaveDate());
vo.setMonthAfter(Integer.parseInt(employeeContractPreVo.getDispatchPeriodMonth()));
vo.setYearAfter(Integer.parseInt(employeeContractPreVo.getDispatchPeriodYear()));
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(employeeContractPreVo.getDispatchPeriodMonth()) ? "0":employeeContractPreVo.getDispatchPeriodMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(employeeContractPreVo.getDispatchPeriodYear()) ? "0":employeeContractPreVo.getDispatchPeriodYear()));
vo.setRegistDate(employeeContractPreVo.getDispatchPeriodStart());
employeeContractPreVo.setDispatchPeriodEnd(this.addYearsMonths(vo));
}
......@@ -961,8 +961,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initInsruancePreInfo(registration, insurancePreVo, user, domainR.getData());
insuranceDaprUtil.saveInsurancePreInfo(preVo);
}
TEmployeeContractPreVo employeeContractPreVo = preVo.getEmployeeContractPreVos();
if (preVo.getServerItem().contains("合同") && Common.isNotNull(employeeContractPreVo)) {
TEmployeeContractPreVo employeeContractPreVo = new TEmployeeContractPreVo();
if (preVo.getServerItem().contains("合同") && Common.isNotNull(preVo.getEmployeeContractPreVos())) {
BeanUtils.copyProperties(preVo.getEmployeeContractPreVos(),employeeContractPreVo);
//生成合同待购买数据
initContractPreInfo(registration, employeeContractPreVo, user, domainR.getData());
}
......
......@@ -44,7 +44,7 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> {
List<Map<String,String>> getAllserioNo();
/**
* 获取近天的到账明细的交易流水号
* 获取近天的到账明细的交易流水号
* @param
* @return
*/
......
......@@ -16,6 +16,7 @@ import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankCodeSetService;
import com.yifu.cloud.plus.v1.ekp.service.IcbcTransactionFlowQueryService;
import com.yifu.cloud.plus.v1.ekp.vo.EKPEntryPushParam;
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.R;
import io.micrometer.core.instrument.util.StringUtils;
......@@ -133,7 +134,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
public R getIcbcTransactionFlowYesterdayInner() throws IcbcApiException {
log.info("开始推昨日新增网银到账明细条数");
String tranDate = DateUtil.addDay(-7).replace("-","");
String tranDate = DateUtil.addDay(-3).replace("-","");
String beginDate = tranDate;
String endDate = DateUtil.getThisDay();
......@@ -171,7 +172,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
if ("0".equals(flag)) {
serioList = baseMapper.getAllserioNo();
} else {
//ekp1.9.12 获取近天的到账明细的交易流水号
//ekp1.9.12 获取近天的到账明细的交易流水号
serioList = baseMapper.getAllserioNoLsatSevenDays();
}
// 整理各个账户下的流水:账号为key,账户下流水号列表作为value
......@@ -216,11 +217,13 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
request.setServiceUrl(icbcConfigProperties.getServerUrl());
request.setBizContent(bizContent);
MybankEnterpriseTradeQhisdResponseV1 response = client.execute(request);
if(response.isSuccess()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> valueList = new ArrayList<>();
if (response.isSuccess()) {
getInfoList(request, valueList, client, bizContent);
// 获取所有账号的流水,每个账号存一个流水
accountRecordListMap.put(accountInfo.get("bank_no"),response.getRd());
if(accountInfo.get("bank_no").equals(response.getAccountNo())){
accountInfoMap.put(accountInfo.get("bank_no"),response.getAccountName());
accountRecordListMap.put(accountInfo.get("bank_no"), valueList);
if (accountInfo.get("bank_no").equals(response.getAccountNo())) {
accountInfoMap.put(accountInfo.get("bank_no"), response.getAccountName());
}
}
}
......@@ -294,6 +297,24 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return R.ok();
}
private void getInfoList(MybankEnterpriseTradeQhisdRequestV1 request,
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> valueList,
DefaultIcbcClient client, MybankEnterpriseTradeQhisdRequestV1.MybankEnterpriseTradeQhisdRequestBizV1 bizContent) {
try {
MybankEnterpriseTradeQhisdResponseV1 response = client.execute(request);
if (response.isSuccess()) {
valueList.addAll(response.getRd());
if (Common.isNotNull(response.getNextTag())) {
bizContent.setNextTag(response.getNextTag());
request.setBizContent(bizContent);
getInfoList(request, valueList,client,bizContent);
}
}
} catch (Exception e){
log.error("异常", e);
}
}
//推送数据
private String sendToEkp(EKPEntryPushParam pushParam){
RestTemplate yourRestTemplate = new RestTemplate();
......
......@@ -124,10 +124,10 @@
and fd_3b57f8de9df354 = '是'
</select>
<!--ekp1.9.12查询近天的所有入账记录数据, 查账号和流水号-->
<!--ekp1.9.12查询近天的所有入账记录数据, 查账号和流水号-->
<select id="getAllserioNoLsatSevenDays" resultType="Map">
SELECT fd_3b573843db30ce as onlySequence,fd_3b62f3470beb30 as receiveBkNo from ekp_79c234bf64d412294f23
where DATE_FORMAT(fd_3aa4531d3b86e0, '%Y-%m-%d') between DATE_SUB(curdate(), INTERVAL 7 day) and DATE_ADD(now(), INTERVAL 1 day)
where DATE_FORMAT(fd_3aa4531d3b86e0, '%Y-%m-%d') between DATE_SUB(curdate(), INTERVAL 3 day) and DATE_ADD(now(), INTERVAL 1 day)
and fd_3b57f8de9df354 = '是'
</select>
......
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