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