Commit 93788c53 authored by huyuchen's avatar huyuchen

huych-社保自动化相关提交

parent 3fa2ab1c
......@@ -463,6 +463,9 @@ public class TEmployeeContractInfo extends BaseEntity {
@Schema(description = "作废、终止选择的合同id", name = "reason")
private String oldContractId;
@Schema(description = "签署方式1线下签0电子签")
private String signType;
/**
* 是否附件 0是/1否
*/
......
......@@ -207,6 +207,9 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
@ExcelProperty("备注")
private String remark;
@Schema(description = "签署方式1线下签0电子签")
private String signType;
/**
* 0 是 1 否
*/
......
......@@ -1447,6 +1447,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// b = b.setScale(1, BigDecimal.ROUND_HALF_UP);
// insert.setContractTerm(String.valueOf(b));
}
// 处理signType字段
if (Common.isNotNull(excel.getSignType())) {
insert.setSignType(excel.getSignType());
}
// 核心保存
R<List<ErrorMessage>> info = this.setBaseInfo(insert, project);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getMsg()));
......
......@@ -296,7 +296,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
// 拆分电子签和线下签
List<EmployeeContractVO> electronicSignList = new ArrayList<>();
List<EmployeeContractVO> offlineSignList = new ArrayList<>();
if (Common.isNotNull(excelVOList) && !excelVOList.isEmpty()) {
for (EmployeeContractVO contractVO : excelVOList) {
TEmployeeContractPre contractPre = preContractMap.get(contractVO.getPreId());
......@@ -309,14 +309,14 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
}
}
// 按前端客服分组统计
Map<String, CustomerStatistics> customerStatisticsMap = new HashMap<>();
// 处理电子签合同
if (!electronicSignList.isEmpty()) {
LocalDate currentDate = LocalDate.now();
for (EmployeeContractVO contractVO : electronicSignList) {
TEmployeeContractPre contractPre = preContractMap.get(contractVO.getPreId());
if (contractPre != null && contractPre.getJoinLeaveDate() != null) {
......@@ -329,44 +329,51 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
return stats;
});
customerStats.setInitiatedCount(customerStats.getInitiatedCount() + 1);
LocalDate joinDate = LocalDateTimeUtils.convertDateToLDT(contractPre.getJoinLeaveDate()).toLocalDate();
// 判断是否超过入职日期一个月
if (currentDate.isAfter(joinDate.plusMonths(1))) {
// 超过一个月,算电子签发起失败
customerStats.setFailedCount(customerStats.getFailedCount() + 1);
customerStats.setElectronicSignFailedCount(customerStats.getElectronicSignFailedCount() + 1);
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getErrorInfo, "电子签发起失败:已超过入职日期一个月")
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING)
.set(TEmployeeContractPre::getSignType, CommonConstants.ONE_STRING)
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "电子签发起失败:已超过入职日期一个月");
errorMessage.setData(contractVO);
errorMessageListAll.add(errorMessage);
} else {
// 未超过一个月,调用FascService的submitContract方法
R<String> result = null;
try {
result = fascService.submitContract(contractPre.getId());
} catch (Exception e) {
log.error("法大大推送执行异常", e);
}
if (result == null || result.getCode() != CommonConstants.SUCCESS) {
// 未超过一个月,先调用contractInfoService.importContract方法创建合同
List<EmployeeContractVO> singleContractList = new ArrayList<>();
singleContractList.add(contractVO);
List<ErrorMessage> singleErrorMessageList = new ArrayList<>();
// 调用合同导入方法
contractInfoService.importContract(singleContractList, singleErrorMessageList);
// 检查合同创建是否成功
boolean contractCreateSuccess = singleErrorMessageList.stream()
.allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS));
if (!contractCreateSuccess) {
// 合同创建失败,统计错误并更新状态
customerStats.setFailedCount(customerStats.getFailedCount() + 1);
customerStats.setElectronicSignFailedCount(customerStats.getElectronicSignFailedCount() + 1);
String errorMsg = result != null ? result.getMsg() : "电子签发起失败";
String errorMsg = singleErrorMessageList.isEmpty() ? "合同创建失败" : singleErrorMessageList.get(0).getMessage();
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.SIX_STRING)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getErrorInfo, errorMsg)
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
......@@ -375,6 +382,31 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(contractVO);
errorMessageListAll.add(errorMessage);
} else {
// 合同创建成功,继续调用FascService的submitContract方法
R<String> result = null;
try {
result = fascService.submitContract(contractPre.getId());
} catch (Exception e) {
log.error("法大大推送执行异常", e);
}
if (result == null || result.getCode() != CommonConstants.SUCCESS) {
customerStats.setFailedCount(customerStats.getFailedCount() + 1);
customerStats.setElectronicSignFailedCount(customerStats.getElectronicSignFailedCount() + 1);
String errorMsg = result != null ? result.getMsg() : "电子签发起失败";
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPre::getId, contractPre.getId())
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.SIX_STRING)
.set(TEmployeeContractPre::getErrorInfo, errorMsg)
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(contractVO);
errorMessageListAll.add(errorMessage);
}
}
}
}
......
......@@ -144,6 +144,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TGzPushEntryService tGzPushEntryService;
private final TEmployeeContractPreMapper contractPreMapper;
@Autowired
private OSSUtil ossUtil;
......@@ -2624,6 +2626,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
//tEmployeeProjectService.updateContractStatus(c.getEmpId(), c.getSettleDomain(), CommonConstants.ONE_INT)
baseMapper.updateContractStatus(c.getEmpId(), CommonConstants.ONE_INT);
//更新合同状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, c.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.FOUR_STRING);
contractPreMapper.updateById(contractPre);
}
//瓜子项目编码:皖A694302
if (CommonConstants.GZ_DEPT_NO.equals(c.getDeptNo())) {
//审核通过瓜子合同状态更新合同审核通过
......
......@@ -79,6 +79,7 @@
<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
<result property="reason" column="REASON"/>
<result property="auditTimeLast" column="AUDIT_TIME_LAST"/>
<result property="signType" column="sign_type"/>
<result property="type" column="TYPE"/>
<result property="leaveDate" column="LEAVE_DATE"/>
......@@ -208,7 +209,7 @@
a.AUDIT_USER_NAME,
a.REDUCE_REASON,
a.type,
a.TRY_PERIOD
a.TRY_PERIOD,a.sign_type
</sql>
......
......@@ -354,6 +354,7 @@
null leaveDate,
null reduceReason,
null remark,
a.sign_type signType,
null changeContractAndEmployee,
if(a.TRY_PERIOD = '' or a.TRY_PERIOD is null,'无',a.TRY_PERIOD) as tryPeriod,
a.id preId,
......
......@@ -1274,11 +1274,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return RegistConstants.PHONE_FORMAT_ERROR;
}
//姓名、身份证+手机号真实性校验
R<Boolean> checkRes = checkDaprUtil.checkIdCardAndMobile(registration.getEmployeeName(),
registration.getEmpIdcard(),registration.getEmpPhone());
if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
return checkRes.getMsg();
}
// R<Boolean> checkRes = checkDaprUtil.checkIdCardAndMobile(registration.getEmployeeName(),
// registration.getEmpIdcard(),registration.getEmpPhone());
// if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
// return checkRes.getMsg();
// }
EmployeeRegistration exit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, registration.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, registration.getDeptNo())
......
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