Commit be8338f1 authored by hongguangwu's avatar hongguangwu

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

parents a1aa825a 5aaf17ee
......@@ -88,6 +88,13 @@ public class ContractAlertSearchVo extends TEmpContractAlert {
@TableField(exist = false)
@Schema(description = "合同IDS")
private List<String> idList;
/**
* 确认信息IDS
*/
@TableField(exist = false)
@Schema(description = "确认信息IDS")
private List<String> preIdList;
@Schema(description = "处理状态数组")
@TableField(exist = false)
......
......@@ -287,11 +287,11 @@ public class TEmpContractAlertExportVo {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("签署方式")
@Schema(description = "签署方式:1线下签0电子签")
private Integer signType;
private String signType;
/**
* 续签状态:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
*/
@ExcelAttribute(name = "续签状态", readConverterExp = "0=待确认,1=待发起,2=线待审核,3=审核不通过,4=线下签待归档,5=发起失败,6=签署中,7=签署失败,8=电子待归档,9=已归档,10=撤销签署-客服撤销 11=撤销签署-系统自动撤销")
@ExcelAttribute(name = "续签状态", readConverterExp = "0=待确认,1=待发起,2=线下签待审核,3=线下签审核不通过,4=线下签待归档,5=发起失败,6=签署中,7=签署失败,8=电子待归档,9=已完结,10=撤销签署-客服撤销,11=撤销签署-系统自动撤销")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("续签状态")
@Schema(description = "签署方式:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署-客服撤销 11撤销签署-系统自动撤销")
......
......@@ -336,6 +336,7 @@ public class TEmpContractAlertController {
@Operation(description = "导出自动化续签待办")
@PostMapping("/autoExport")
public void autoExport(HttpServletResponse response, @RequestBody ContractAlertSearchVo searchVo) {
searchVo.setAutoFlag(CommonConstants.ZERO_STRING);
tEmpContractAlertService.listAutoExport(response,searchVo);
}
......
......@@ -384,6 +384,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
for (TAttaInfoSaveVo attaInfoVo : preVo.getAttaList()) {
TAttaInfo attaInfo = new TAttaInfo();
BeanUtils.copyProperties(attaInfoVo, attaInfo);
attaInfo.setId(null);
attaInfo.setDomainId(pre.getId());
attaInfo.setCreateName("确认接收同步");
attaInfoService.save(attaInfo);
......
......@@ -1151,12 +1151,19 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
searchVo.setIdList(Arrays.asList(searchVo.getIds().split(CommonConstants.COMMA_STRING)));
}
// 如果查询条件续签状态为空默认查询 非已完成 状态数据
if (Common.isNotNull(searchVo.getProcessStatusList())){
if (!Common.isNotNull(searchVo.getProcessStatusList())){
searchVo.setProcessStatusList(Stream.of("0","1","2","3","4","5","6","7","8","10","11").collect(Collectors.toList()));
}
//初始化客服的项目权限 ,管理员及SSC 全量
initSearchVo(searchVo);
if (ArrayUtil.isNotEmpty(searchVo.getStartEndTimecreate())
&& searchVo.getStartEndTimecreate().length == 2) {
searchVo.setExpectedCollectionTimeStart(searchVo.getStartEndTimecreate()[0]);
searchVo.setExpectedCollectionTimeEnd(searchVo.getStartEndTimecreate()[1]);
}
//默认导出自动化的合同续签待办
searchVo.setAutoFlag(CommonConstants.ZERO_STRING);
initSearchVo(searchVo);
String fileName = ArchivesConstants.EMP_AUTO_RENEWAL_RECORD + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TEmpContractAlertExportVo> list = new ArrayList<>();
......
......@@ -108,6 +108,9 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
@Autowired
private TAutoContractRuleInfoMapper contractRuleInfoMapper;
@Autowired
private TEmployeeContractPreHistoryMapper preHistoryMapper;
/**
* 合同续签预派单信息简单分页查询
*
......@@ -276,7 +279,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
//判断两个合同时间是否重合
if (LocalDateUtil.hasOverlap(contract.getContractStart(),contract.getContractEnd(),preVo.getContractStart(),preVo.getContractEnd())){
return R.failed("发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
return R.failed(EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR_TWO);
}
TEmpContractAlert alert = empContractAlertMapper.selectOne(Wrappers.<TEmpContractAlert>query().lambda()
.eq(TEmpContractAlert::getContractId,preVo.getContractId())
......@@ -501,7 +504,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return buildErrorCheckVo(contract, preVoTemp, "续签合同开始日期解析失败");
}
if (reminderDate.isAfter(contractStartDateNew.plusMonths(1))) {
return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR_TWO);
}
}
//reminderDate 设置15:20
......@@ -630,8 +633,24 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
}
if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){
//处理劳务协议
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
//处理劳务协议: 先看上一份合同是否为劳务协议,如果是取值上一份合同的劳务协议结束日期
Date initDate = contract.getContractEnd();
if (Common.isNotNull(contract.getPreNewId())){
TEmployeeContractPreNew preNew = baseMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, contract.getPreNewId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(preNew) && Common.isNotNull(preNew.getDispatchPeriodEnd())){
initDate = preNew.getDispatchPeriodEnd();
}
}else {
TEmployeeContractPreHistory pre = preHistoryMapper.selectOne(Wrappers.<TEmployeeContractPreHistory>query().lambda()
.eq(TEmployeeContractPreHistory::getContractId,contract.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(pre) && Common.isNotNull(pre.getDispatchPeriodEnd())){
initDate = pre.getDispatchPeriodEnd();
}
}
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1));
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth()));
......@@ -712,6 +731,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (Common.isEmpty(contractPreList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
ContractAlertSearchVo searchVo = new ContractAlertSearchVo();
searchVo.setPreIdList(idList);
//获取返回信息
List<TEmployeeContractPreNewDetailVo> exitsList = baseMapper.getDetailList(searchVo);
Map<String, TEmployeeContractPreNewDetailVo> backInfoMap = new HashMap<>();
if (Common.isNotNull(exitsList)) {
for (TEmployeeContractPreNewDetailVo vo : exitsList) {
backInfoMap.put(vo.getId(), vo);
}
}
// 创建一个Map映射preId到TEmployeeContractPre对象
Map<String, TEmployeeContractPreNew> preContractMap = contractPreList.stream()
......@@ -788,8 +817,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "系统自动撤销签署须走线下签!");
errorMessage.setData(contractVO);
ErrorMessage<TEmployeeContractPreNewDetailVo> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "系统自动撤销签署须走线下签!");
errorMessage.setData(backInfoMap.get(contractVO.getPreNewId()));
errorMessageListAll.add(errorMessage);
continue;
}
......@@ -809,7 +838,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, contractPre.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPreNew::getErrorInfo, "发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签")
.set(TEmployeeContractPreNew::getErrorInfo, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR_TWO)
.set(TEmployeeContractPreNew::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
......@@ -820,13 +849,13 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
contractAutoLog.setEmpName(contractPre.getEmployeeName());
contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard());
contractAutoLog.setMainId(contractPre.getId());
contractAutoLog.setErrorInfo("发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
contractAutoLog.setErrorInfo(EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR_TWO);
contractAutoLogService.save(contractAutoLog);
}
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
errorMessage.setData(contractVO);
ErrorMessage<TEmployeeContractPreNewDetailVo> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR_TWO);
errorMessage.setData(backInfoMap.get(contractVO.getPreNewId()));
errorMessageListAll.add(errorMessage);
} else {
// 未超过一个月,先调用contractInfoService.importContract方法创建合同
......@@ -865,8 +894,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
contractAutoLogService.save(contractAutoLog);
}
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(contractVO);
ErrorMessage<TEmployeeContractPreNewDetailVo> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(backInfoMap.get(contractVO.getPreNewId()));
errorMessageListAll.add(errorMessage);
} else {
// 合同创建成功,继续调用FascService的submitContract方法
......@@ -923,8 +952,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
contractAutoLogService.save(contractAutoLog);
}
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(contractVO);
ErrorMessage<TEmployeeContractPreNewDetailVo> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
errorMessage.setData(backInfoMap.get(contractVO.getPreNewId()));
errorMessageListAll.add(errorMessage);
} else {
if (Common.isNotNull(contractPreTemp.getId()) && Common.isNotNull(result.getData())) {
......@@ -1037,7 +1066,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
.set(TEmployeeContractPreNew::getErrorInfo, errorMessage.getMessage())
.set(TEmployeeContractPreNew::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
// 执行更新操作
errorMessage.setData(contractVO);
errorMessage.setData(backInfoMap.get(contractVO.getPreNewId()));
this.update(updateWrapper);
//线下签发起失败 更新合同提醒为待处理
LambdaUpdateWrapper<TEmpContractAlert> updateWrapperAlert = new LambdaUpdateWrapper<>();
......@@ -1378,13 +1407,24 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (Common.isEmpty(contractIds)) {
return R.ok("前一日撤销记录中未找到有效的合同ID");
}
List<TEmployeeContractInfo> contracts = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda()
.in(TEmployeeContractInfo::getId, contractIds));
List<String> preNewIds = null;
if (!Common.isEmpty(contracts)){
preNewIds = contracts.stream()
.map(TEmployeeContractInfo::getPreNewId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
if (Common.isEmpty(preNewIds)) {
return R.ok("前一日撤销记录中未找到有效的PreNewID");
}
// 根据合同ID查询对应的合同预签订记录
List<TEmployeeContractPreNew> revokedContracts = baseMapper.selectList(Wrappers.<TEmployeeContractPreNew>query()
.lambda()
.in(TEmployeeContractPreNew::getContractId, contractIds)
.in(TEmployeeContractPreNew::getId, preNewIds)
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.ELEVEN_STRING) // 撤销签署-系统自动撤销
.eq(TEmployeeContractPreNew::getSignType, CommonConstants.ZERO_STRING) // 线下签
.eq(TEmployeeContractPreNew::getChangeTypeReason, "超时未签署自行变更为线下签")
);
......@@ -1727,7 +1767,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
@Override
public R<List<TEmployeeContractPreNewDetailVo>> getDetailList(ContractAlertSearchVo tEmployeeContractPreNew) {
//系统会自动拉取当前客服且“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息
//续签状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
//续签状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署 11系统自动撤销
List<String> statusList = new ArrayList<>();
statusList.add(CommonConstants.ONE_STRING);
statusList.add(CommonConstants.FIVE_STRING);
......
......@@ -191,7 +191,7 @@
AND a.ID = #{tEmpContractAlert.id}
</if>
<if test="tEmpContractAlert.empName != null and tEmpContractAlert.empName.trim() != ''">
AND a.EMP_NAME = #{tEmpContractAlert.empName}
AND a.EMP_NAME like concat('%', #{tEmpContractAlert.empName}, '%')
</if>
<if test="tEmpContractAlert.empId != null and tEmpContractAlert.empId.trim() != ''">
AND a.EMP_ID = #{tEmpContractAlert.empId}
......@@ -200,7 +200,7 @@
AND a.DEPT_ID = #{tEmpContractAlert.deptId}
</if>
<if test="tEmpContractAlert.project != null and tEmpContractAlert.project.trim() != ''">
AND a.PROJECT = #{tEmpContractAlert.project}
AND a.PROJECT like concat('%', #{tEmpContractAlert.project}, '%')
</if>
<if test="tEmpContractAlert.deptNoList != null and tEmpContractAlert.deptNoList.size > 0">
AND a.PROJECT in
......
......@@ -696,7 +696,7 @@
SELECT
a.id
FROM t_employee_contract_pre_new a
where a.process_status in('1','5' and (a.expected_collection_time <![CDATA[ <= ]]> now())
where a.process_status in('1','5') and (a.expected_collection_time <![CDATA[ <= ]]> now())
</select>
<!--tEmployeeContractPreNew简单分页查询-->
......@@ -710,7 +710,7 @@
b.emp_idcard,
b.emp_phone,
b.employee_nature,
b.position,
b.post as 'position',
b.customer_username,
b.customer_user_loginname,
b.sign_type,
......@@ -811,6 +811,14 @@
#{id}
</foreach>
</if>
<if test="tEmpContractAlert.preIdList != null and tEmpContractAlert.preIdList.size > 0">
AND b.id in
<foreach item="preId" index="index" collection="tEmpContractAlert.preIdList" open="(" separator=","
close=")">
#{preId}
</foreach>
</if>
</if>
<include refid="tEmpContractAlert_where"/>
</where>
......
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