Commit d7425f90 authored by fangxinjiang's avatar fangxinjiang

版本切换-fxj

parent dd766872
......@@ -47,4 +47,7 @@ public class TEmployeeAutoRegistCheckVo implements Serializable {
@ExcelProperty("错误信息")
private String errorMsg;
//反馈文件要求
ContractAlertConfirmVo confirmVo;
}
......@@ -721,4 +721,10 @@ public class TEmployeeContractPreNewVo extends TEmployeeContractPreNew implement
**/
private List<String> contractIds;
/**
* @Author fxj
* @Description 批量确认返回对象
**/
private List<ContractAlertConfirmVo> confirmVos;
}
......@@ -107,4 +107,5 @@ public class EmployeeConstants {
public static final String DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR = "待续签合同超期一个月,需走线下签";
}
......@@ -1059,7 +1059,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//更新合同提醒办理状态
LambdaUpdateWrapper<TEmpContractAlert> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmpContractAlert::getContractId, contractPreNew.getContractId())
.eq(TEmpContractAlert::getHandleStatus, CommonConstants.ZERO_STRING);
.set(TEmpContractAlert::getHandleStatus, CommonConstants.ZERO_STRING);
contractAlertMapper.update(null, updateWrapper);
}
}
if (EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())) {
......
......@@ -236,6 +236,17 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (contract == null){
return R.failed(EmployeeConstants.DATA_CAN_NOT_FOUND);
}
long preNewCount = 0;
if (Common.isNotNull(preVo.getId())){
preNewCount = baseMapper.selectCount(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getContractId, preVo.getContractId())
.ne(TEmployeeContractPreNew::getId, preVo.getId()));
}else {
preNewCount = baseMapper.selectCount(Wrappers.<TEmployeeContractPreNew>query().lambda().eq(TEmployeeContractPreNew::getContractId, preVo.getContractId()));
}
if (preNewCount > CommonConstants.ZERO_INT){
return R.failed("已存在确认数据,请确认后重试");
}
//电子签判断预计发起时间是否为当前时间的一个月前
if (Common.isNotNull(preVo.getExpectedCollectionTime())
&& CommonConstants.ZERO_STRING.equals(preVo.getSignType())
......@@ -246,7 +257,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return R.failed(EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
}
}
//电子签判断合同开始时间是否为当前时间的一个月前
if (Common.isNotNull(preVo.getExpectedCollectionTime())
&& CommonConstants.ZERO_STRING.equals(preVo.getSignType())
&& null != preVo.getContractStart()){
LocalDate reminderDate = LocalDateUtil.parseLocalDate(DateUtil.dateToString(preVo.getContractStart(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
LocalDate nowDate = LocalDate.now();
if (null != nowDate && nowDate.isAfter(reminderDate.plusMonths(1))){
return R.failed(EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
}
}
////如果电子签是系统自动撤销对应的签署方式必须更新为 线下签
TEmployeeContractPreNew preNew = null;
if (Common.isNotNull(preVo.getId()) && CommonConstants.ZERO_STRING.equals(preVo.getSignType())){
......@@ -324,6 +344,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
alertMap = alertList.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(TEmpContractAlert::getContractId, v -> v));
}
List<TEmployeeContractPreNew> exsitPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPreNew>query().lambda()
.in(TEmployeeContractPreNew::getContractId,contractIds));
Map<String, String> preMap = new HashMap<>();
if (exsitPreList != null){
preMap = exsitPreList.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(TEmployeeContractPreNew::getContractId, v -> v.getId()));
}
if (null == preMap){
preMap = new HashMap<>();
}
TEmployeeContractPreNew pre = null;
List<TEmployeeContractPreNew> preList = new ArrayList<>();
List<TEmployeeAutoRegistCheckVo> errorList = new ArrayList<>();
......@@ -332,6 +362,18 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmployeeContractDateVo vo = null;
TEmployeeContractPreNew preNew = null;
String innitError = null;
String preId = null;
//已合同Id 组建map
Map<String,ContractAlertConfirmVo> confirmMap = null;
List<ContractAlertConfirmVo> confirmVos = preVo.getConfirmVos();
if (null != confirmVos && confirmVos.size() > 0){
confirmMap = confirmVos.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(ContractAlertConfirmVo::getContractId, v -> v));
}
if (null == confirmMap){
confirmMap = new HashMap<>();
}
for (TEmployeeContractInfo contract : contractList){
alert = alertMap.get(contract.getId());
if (null == alert){
......@@ -342,6 +384,20 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setErrorMsg("未找到合同续签待办信息");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
errorList.add(checkVo);
continue;
}
preId = preMap.get(contract.getId());
if (Common.isNotNull(preId)){
checkVo = new TEmployeeAutoRegistCheckVo();
checkVo.setEmployeeName(contract.getEmpName());
checkVo.setEmpIdcard(contract.getEmpIdcard());
checkVo.setDeptName(preVo.getDeptName());
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setErrorMsg("已确认,请勿重复确认");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
errorList.add(checkVo);
continue;
}
......@@ -354,6 +410,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
checkVo.setDeptName(preVo.getDeptName());
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
checkVo.setErrorMsg(innitError);
errorList.add(checkVo);
continue;
......@@ -367,6 +424,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
checkVo.setDeptName(preVo.getDeptName());
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
checkVo.setErrorMsg(EmployeeConstants.DATA_CONTRACT_OVERLAP);
errorList.add(checkVo);
continue;
......@@ -382,6 +440,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
checkVo.setDeptName(preVo.getDeptName());
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
checkVo.setErrorMsg(EmployeeConstants.DATA_CONTRACT_CANCEL_MUST_OFFLINE_SIGN);
errorList.add(checkVo);
continue;
......@@ -411,6 +470,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LocalDate contractEndDate = parseContractEndDate(contract.getContractEnd());
if (null == contractEndDate) {
checkVo = buildErrorCheckVo(contract, preVo, "合同结束日期解析失败");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
errorList.add(checkVo);
continue;
}
......@@ -419,6 +479,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LocalDate reminderDate = calculateReminderDate(rule.getRenewalDateType(), contractEndDate);
if (null == reminderDate) {
checkVo = buildErrorCheckVo(contract, preVo, "预计发起时间初始化失败");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
errorList.add(checkVo);
continue;
}
......@@ -432,11 +493,13 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LocalDate contractStartDateNew = parseContractEndDate(preVo.getContractStart());
if (null == contractEndDate) {
checkVo = buildErrorCheckVo(contract, preVo, "续签合同开始日期解析失败");
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
errorList.add(checkVo);
continue;
}
if (reminderDate.isAfter(contractStartDateNew.plusMonths(1))) {
checkVo = buildErrorCheckVo(contract, preVo, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
checkVo.setConfirmVo(confirmMap.get(contract.getId()));
errorList.add(checkVo);
continue;
}
......@@ -1966,14 +2029,27 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
@Override
public void updateByIdAndUpdateAlert(TEmployeeContractPreNew preNew) {
baseMapper.updateById(preNew);
//已完成同步更新续签待办提醒为已办理
if (preNew.getProcessStatus().equals(CommonConstants.dingleDigitStrArray[9])
&& null != preNew.getContractId()){
TEmpContractAlert alert = empContractAlertMapper.selectOne(Wrappers.<TEmpContractAlert>query().lambda()
//已完成同步更新续签待办提醒为已办理.
TEmpContractAlert alert = null;
if (null != preNew.getContractId()){
alert = empContractAlertMapper.selectOne(Wrappers.<TEmpContractAlert>query().lambda()
.eq(TEmpContractAlert::getContractId,preNew.getContractId())
.last(CommonConstants.LAST_ONE_SQL));
if (null != alert){
}
if (null != alert){
//已完成
if (preNew.getProcessStatus().equals(CommonConstants.dingleDigitStrArray[9])){
alert.setHandleStatus(CommonConstants.dingleDigitStrArray[2]);
}
//撤销签署
if (preNew.getProcessStatus().equals(CommonConstants.dingleDigitStrArray[10])){
alert.setHandleStatus(CommonConstants.dingleDigitStrArray[0]);
}
//签署失败
if (preNew.getProcessStatus().equals(CommonConstants.dingleDigitStrArray[7])){
alert.setHandleStatus(CommonConstants.dingleDigitStrArray[0]);
}
if (null != alert){
empContractAlertMapper.updateById(alert);
}
}
......
......@@ -147,6 +147,8 @@ public class DoFascTask {
preNew.setSignFlag(CommonConstants.ZERO_STRING);
preNew.setRevokeReason(Common.isEmpty(terminationNote)?CommonConstants.EMPTY_STRING:terminationNote);
tEmployeeContractPreNewService.updateById(preNew);
//更新合同待办
tEmployeeContractPreNewService.updateByIdAndUpdateAlert(preNew);
}
//如果存在合同申请审核数据,将状态更新成5撤销签署
contractInfo.setAuditStatus(CommonConstants.FIVE_INT);
......@@ -178,9 +180,10 @@ public class DoFascTask {
contractAutoLog.setMainId(preNew.getId());
contractAutoLog.setErrorInfo(null == terminationNote ? "法大大签署失败" : terminationNote);
contractAutoLogService.save(contractAutoLog);
//更新合同待办
tEmployeeContractPreNewService.updateByIdAndUpdateAlert(preNew);
//签署失败发送企微消息
sendFddFalureInfoToWx(preNew, contractAutoLog.getId());
// 加日志
this.saveAuditLogFail("签署失败", terminationNote,contractInfo.getId());
pushLog.setReturnData("签署任务参与方签署失败事件:fddEvent:" + fddEvent + FASC_BIZ_CONTENT_STR + fddBizContent);
......@@ -492,7 +495,7 @@ public class DoFascTask {
StringBuilder description = new StringBuilder();
String title = "作业自动化——电子合同续签失败提醒";
description.append(pre.getEmployeeName() + "-" + pre.getEmpIdcard() + "-" + pre.getEmpPhone() +
",电子合同签署失败").append("<br>");
",电子合同续签失败").append("<br>");
description.append("请及时处理,以免产生用工风险!").append("<br>");
textcard.put("title", title);
textcard.put("url", authUrl);
......
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