Commit 3687fb1f authored by hongguangwu's avatar hongguangwu

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

parents 6f470bb9 dd766872
...@@ -214,7 +214,7 @@ public class FascController { ...@@ -214,7 +214,7 @@ public class FascController {
@Operation(description = "自动化待办续签获取附件") @Operation(description = "自动化待办续签获取附件")
@GetMapping("/getRenewFileByRequestId") @GetMapping("/getRenewFileByRequestId")
public R<String> getRenewFileByRequestId(@RequestParam String id) throws ApiException { public R<String> getRenewFileByRequestId(@RequestParam String id) throws ApiException {
fascService.getFileByRequestIdRenew(id); fascService.getFileByRequestIdRenew(id,null);
return R.ok(); return R.ok();
} }
......
...@@ -115,7 +115,12 @@ public class TEmployeeContractPreNewController { ...@@ -115,7 +115,12 @@ public class TEmployeeContractPreNewController {
@Operation(summary = "通过id查询", description = "通过id查询") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<TEmployeeContractPreNew> getById(@PathVariable("id") String id) { public R<TEmployeeContractPreNew> getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContractPreNewService.getById(id)); TEmployeeContractPreNew preNew = tEmployeeContractPreNewService.getById(id);
//特殊处理兼容处理 合同详情
if (null != preNew){
preNew.setConfirmEmpSelect(preNew.getContractContent());
}
return R.ok(preNew);
} }
/** /**
......
...@@ -64,6 +64,6 @@ public interface FascService extends IService<FddContractInfo> { ...@@ -64,6 +64,6 @@ public interface FascService extends IService<FddContractInfo> {
boolean getFileByRequestId(String id) throws ApiException; boolean getFileByRequestId(String id) throws ApiException;
// 自动化续签待办:获取附件 // 自动化续签待办:获取附件
boolean getFileByRequestIdRenew(String id) throws ApiException; boolean getFileByRequestIdRenew(String id,String contractId) throws ApiException;
} }
...@@ -582,7 +582,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -582,7 +582,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil, company); return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil, company);
} }
@Override @Override
public boolean getFileByRequestIdRenew(String id) throws ApiException { public boolean getFileByRequestIdRenew(String id,String contractId) throws ApiException {
// templateName 签署任务模板名称 // templateName 签署任务模板名称
TEmployeeContractPreNew contract = tEmployeeContractPreNewMapper.selectById(id); TEmployeeContractPreNew contract = tEmployeeContractPreNewMapper.selectById(id);
if (contract == null) { if (contract == null) {
...@@ -596,7 +596,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -596,7 +596,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (company == null) { if (company == null) {
return false; return false;
} }
return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil, company); return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil, company, contractId);
} }
} }
...@@ -1252,7 +1252,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -1252,7 +1252,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
vo.setEmpPhone(employeeInfo.getEmpPhone()); vo.setEmpPhone(employeeInfo.getEmpPhone());
} }
TEmployeeContractPreNew preNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>lambdaQuery() TEmployeeContractPreNew preNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>lambdaQuery()
.eq(TEmployeeContractPreNew::getContractId, contractInfo.getId()).last(CommonConstants.LAST_ONE_SQL)); .eq(TEmployeeContractPreNew::getId, contractInfo.getPreNewId()).last(CommonConstants.LAST_ONE_SQL));
vo.setPreNew(preNew); vo.setPreNew(preNew);
TEmployeeContractPreHistory pre = contractPreHistoryMapper.selectOne(Wrappers.<TEmployeeContractPreHistory>lambdaQuery() TEmployeeContractPreHistory pre = contractPreHistoryMapper.selectOne(Wrappers.<TEmployeeContractPreHistory>lambdaQuery()
.eq(TEmployeeContractPreHistory::getContractId, contractInfo.getId()).last(CommonConstants.LAST_ONE_SQL)); .eq(TEmployeeContractPreHistory::getContractId, contractInfo.getId()).last(CommonConstants.LAST_ONE_SQL));
......
...@@ -59,6 +59,7 @@ import javax.servlet.ServletOutputStream; ...@@ -59,6 +59,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
...@@ -241,7 +242,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -241,7 +242,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
&& null != preVo.getContractStart()){ && null != preVo.getContractStart()){
LocalDate reminderDate = LocalDateUtil.parseLocalDate(DateUtil.dateToString(preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT)); LocalDate reminderDate = LocalDateUtil.parseLocalDate(DateUtil.dateToString(preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
LocalDate contractStartDateNew = parseContractEndDate(preVo.getContractStart()); LocalDate contractStartDateNew = parseContractEndDate(preVo.getContractStart());
if (null != contractStartDateNew && reminderDate.isAfter(contractStartDateNew.minusMonths(1))){ if (null != contractStartDateNew && reminderDate.isAfter(contractStartDateNew.plusMonths(1))){
return R.failed(EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR); return R.failed(EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
} }
} }
...@@ -282,6 +283,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -282,6 +283,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
pre.setOverFlag(CommonConstants.ONE_STRING); pre.setOverFlag(CommonConstants.ONE_STRING);
pre.setSignFlag(CommonConstants.ONE_STRING); pre.setSignFlag(CommonConstants.ONE_STRING);
} }
String errorInfo = initDateInfo(pre,contract);
if (null != errorInfo){
return R.failed(errorInfo);
}
int res = -1; int res = -1;
if (Common.isNotNull(pre.getId())){ if (Common.isNotNull(pre.getId())){
res = baseMapper.updateById(pre); res = baseMapper.updateById(pre);
...@@ -327,11 +332,9 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -327,11 +332,9 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmployeeContractDateVo vo = null; TEmployeeContractDateVo vo = null;
TEmployeeContractPreNew preNew = null; TEmployeeContractPreNew preNew = null;
String innitError = null; String innitError = null;
int i =0;
for (TEmployeeContractInfo contract : contractList){ for (TEmployeeContractInfo contract : contractList){
i++;
alert = alertMap.get(contract.getId()); alert = alertMap.get(contract.getId());
if (null == alert || i > 1){ if (null == alert){
checkVo = new TEmployeeAutoRegistCheckVo(); checkVo = new TEmployeeAutoRegistCheckVo();
checkVo.setEmployeeName(contract.getEmpName()); checkVo.setEmployeeName(contract.getEmpName());
checkVo.setEmpIdcard(contract.getEmpIdcard()); checkVo.setEmpIdcard(contract.getEmpIdcard());
...@@ -385,9 +388,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -385,9 +388,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
} }
//初始化岗位名称 //初始化岗位名称
TAutoContractScheme scheme = contractSchemeMapper.selectById(pre.getConfigId()); TAutoContractScheme scheme = contractSchemeMapper.selectById(preVo.getConfigId());
if (Common.isNotNull(pre.getConfigId()) && "固定岗位".equals(preVo.getPost()) && null != scheme){ if (Common.isNotNull(preVo.getConfigId()) && "固定岗位".equals(preVo.getPost()) && null != scheme){
pre.setPost(scheme.getPost()); preVo.setPost(scheme.getPost());
}else {
//等于上一份合同的岗位明细
preVo.setPost(contract.getPost());
} }
//处理预计发起时间 //处理预计发起时间
TAutoContractRuleInfo rule = null; TAutoContractRuleInfo rule = null;
...@@ -417,6 +423,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -417,6 +423,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
continue; continue;
} }
// 调整提醒日期为最近工作日 (0 上一份合同到期前第5个工作日的场景才调整)
if (CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType())){
reminderDate = adjustToNearestWorkday(reminderDate);
}
// 检查电子签是否超期(和续签的合同开始日期进行比较) // 检查电子签是否超期(和续签的合同开始日期进行比较)
if (null != preVo.getContractStart() && CommonConstants.ZERO_STRING.equals(preVo.getSignType())){ if (null != preVo.getContractStart() && CommonConstants.ZERO_STRING.equals(preVo.getSignType())){
LocalDate contractStartDateNew = parseContractEndDate(preVo.getContractStart()); LocalDate contractStartDateNew = parseContractEndDate(preVo.getContractStart());
...@@ -425,19 +435,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -425,19 +435,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
errorList.add(checkVo); errorList.add(checkVo);
continue; continue;
} }
if (reminderDate.isAfter(contractStartDateNew.minusMonths(1))) { if (reminderDate.isAfter(contractStartDateNew.plusMonths(1))) {
checkVo = buildErrorCheckVo(contract, preVo, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR); checkVo = buildErrorCheckVo(contract, preVo, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
errorList.add(checkVo); errorList.add(checkVo);
continue; continue;
} }
} }
// 调整提醒日期为最近工作日 (0 上一份合同到期前第5个工作日的场景才调整)
if (CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType())){
reminderDate = adjustToNearestWorkday(reminderDate);
}
// 设置预计发起时间 // 设置预计发起时间
pre.setExpectedCollectionTime(DateUtil.getDateByLocalDate(reminderDate)); preVo.setExpectedCollectionTime(DateUtil.getDateByLocalDate(reminderDate));
} }
...@@ -467,6 +473,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -467,6 +473,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
boolean res = false; boolean res = false;
if (preList != null && preList.size() > 0){ if (preList != null && preList.size() > 0){
res = this.saveBatch(preList); res = this.saveBatch(preList);
}else {
res = true;
} }
if (res){ if (res){
if (!errorList.isEmpty()) { if (!errorList.isEmpty()) {
...@@ -529,7 +537,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -529,7 +537,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
* 调整日期为最近工作日 * 调整日期为最近工作日
*/ */
private LocalDate adjustToNearestWorkday(LocalDate date) { private LocalDate adjustToNearestWorkday(LocalDate date) {
return date.isBefore(LocalDate.now()) ? calculateReminderWorkDaysBefore(date, 1, 0) : date; return date.isBefore(LocalDate.now()) ? calculateReminderWorkDaysBefore(LocalDate.now(), 1, 0) : date;
} }
private String initDateInfo(TEmployeeContractPreNewVo preVo, TEmployeeContractInfo contract) { private String initDateInfo(TEmployeeContractPreNewVo preVo, TEmployeeContractInfo contract) {
...@@ -585,8 +593,13 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -585,8 +593,13 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
preVo.setInternshipPeriodEnd(this.addYearsMonths(vo)); preVo.setInternshipPeriodEnd(this.addYearsMonths(vo));
preVo.setContractEnd(preVo.getInternshipPeriodEnd()); preVo.setContractEnd(preVo.getInternshipPeriodEnd());
} }
if (Common.isNotNull(preVo.getInternshipPeriodStart()) && Common.isNotNull(preVo.getInternshipPeriodEnd())){
if (preVo.getInternshipPeriodEnd().before(preVo.getInternshipPeriodStart())){
return "实习结束日期需大于等于实习开始日期";
}
}
} }
if (CommonConstants.THREE_STRING.equals(preVo.getContractType())){ if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){
//处理劳务协议 //处理劳务协议
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(contract.getContractEnd(),1)); preVo.setDispatchPeriodStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){ if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
...@@ -596,11 +609,51 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -596,11 +609,51 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
vo.setRegistDate(preVo.getDispatchPeriodStart()); vo.setRegistDate(preVo.getDispatchPeriodStart());
preVo.setDispatchPeriodEnd(this.addYearsMonths(vo)); preVo.setDispatchPeriodEnd(this.addYearsMonths(vo));
} }
if (Common.isNotNull(preVo.getDispatchPeriodStart()) && Common.isNotNull(preVo.getDispatchPeriodEnd())){
if (preVo.getDispatchPeriodEnd().before(preVo.getDispatchPeriodStart())){
return "派遣结束日期需大于等于派遣开始日期";
}
}
}
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){
if (preVo.getContractEnd().before(preVo.getContractStart())){
return "合同截止日期需大于等于合同开始日期";
}
} }
//更新岗位名称 //更新岗位名称
return null; return null;
} }
private String initDateInfo(TEmployeeContractPreNew preVo, TEmployeeContractInfo contract) {
TEmployeeContractDateVo vo;
//标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同
//1:"标准合同,3:“劳务协议”,5:“实习协议,8:“非全日制’,9:"补贴合同,13:’见习协议,18:“兼职协议”,19:”临时聘用合同,20:"劳务派遣合同’,21:’其他
if (CommonConstants.FIVE_STRING.equals(preVo.getContractType())){
//处理实习协议
preVo.setContractStart(preVo.getInternshipPeriodStart());
preVo.setContractEnd(preVo.getInternshipPeriodEnd());
}
if (Common.isNotNull(preVo.getInternshipPeriodStart()) && Common.isNotNull(preVo.getInternshipPeriodEnd())){
if (preVo.getInternshipPeriodEnd().before(preVo.getInternshipPeriodStart())){
return "实习结束日期需大于等于实习开始日期";
}
}
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){
if (preVo.getContractEnd().before(preVo.getContractStart())){
return "合同截止日期需大于等于合同开始日期";
}
}
if (Common.isNotNull(preVo.getDispatchPeriodStart()) && Common.isNotNull(preVo.getDispatchPeriodEnd())){
if (preVo.getDispatchPeriodEnd().before(preVo.getDispatchPeriodStart())){
return "派遣结束日期需大于等于派遣开始日期";
}
}
//更新岗位名称
return null;
}
/** /**
* @Author fxj * @Author fxj
* @Description 合同续签待签订信息单个/批量发起签署任务 * @Description 合同续签待签订信息单个/批量发起签署任务
...@@ -665,16 +718,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -665,16 +718,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
for (EmployeeContractVO contractVO : electronicSignList) { for (EmployeeContractVO contractVO : electronicSignList) {
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId()); TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId());
if ("2".equals(type)){ contractVO.setReNewSubmitter("自动化手动-"+ (null==contractPre.getCustomerUsername()?"":contractPre.getCustomerUsername()));
contractVO.setReNewSubmitter("自动化自动-超管");
} else if("1".equals(type)){
YifuUser user = SecurityUtils.getUser();
if (user != null){
contractVO.setReNewSubmitter("自动化手动-"+user.getNickname());
}else {
contractVO.setReNewSubmitter("自动化手动-"+ (null==contractPre.getCustomerUsername()?"":contractPre.getCustomerUsername()));
}
}
if (contractPre != null && contractPre.getContractStart() != null) { if (contractPre != null && contractPre.getContractStart() != null) {
if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) && if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) &&
null == loginNameMap.get(contractPre.getCustomerUserLoginname())) { null == loginNameMap.get(contractPre.getCustomerUserLoginname())) {
...@@ -735,7 +779,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -735,7 +779,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, contractPre.getId()) updateWrapper.eq(TEmployeeContractPreNew::getId, contractPre.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FIVE_STRING) .set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPreNew::getErrorInfo, "电子签发起失败:已超过合同开始日期一个月") .set(TEmployeeContractPreNew::getErrorInfo, "发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签")
.set(TEmployeeContractPreNew::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now())); .set(TEmployeeContractPreNew::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper); this.update(updateWrapper);
...@@ -746,12 +790,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -746,12 +790,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
contractAutoLog.setEmpName(contractPre.getEmployeeName()); contractAutoLog.setEmpName(contractPre.getEmployeeName());
contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard()); contractAutoLog.setEmpIdcard(contractPre.getEmpIdcard());
contractAutoLog.setMainId(contractPre.getId()); contractAutoLog.setMainId(contractPre.getId());
contractAutoLog.setErrorInfo("电子签发起失败:已超过合同开始日期一个月"); contractAutoLog.setErrorInfo("发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
contractAutoLogService.save(contractAutoLog); contractAutoLogService.save(contractAutoLog);
} }
// 添加错误信息 // 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "电子签发起失败:已超过合同开始日期一个月"); ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
errorMessage.setData(contractVO); errorMessage.setData(contractVO);
errorMessageListAll.add(errorMessage); errorMessageListAll.add(errorMessage);
} else { } else {
...@@ -857,14 +901,21 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -857,14 +901,21 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
contractPreTemp.setRequestId(result.getData()); contractPreTemp.setRequestId(result.getData());
baseMapper.updateById(contractPreTemp); baseMapper.updateById(contractPreTemp);
} }
if (Common.isNotNull(contractPreTemp.getContractId())) { if (Common.isNotNull(contractPreTemp.getId())) {
TEmployeeContractAudit audit = new TEmployeeContractAudit(); TEmployeeContractInfo empContract = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
audit.setRootName("签署中"); .eq(TEmployeeContractInfo::getPreNewId, contractPreTemp.getId())
audit.setLinkId(contractPreTemp.getContractId()); .eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
audit.setLinkType(CommonConstants.ONE_INT); .orderByDesc(BaseEntity::getCreateTime)
audit.setCreateName("法大大电子签"); .last(CommonConstants.LAST_ONE_SQL));
audit.setCreateBy("1"); if (null != empContract && empContract.getId() != null){
tEmployeeContractAuditService.save(audit); TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("签署中");
audit.setLinkId(empContract.getId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setCreateName("法大大电子签");
audit.setCreateBy("1");
tEmployeeContractAuditService.save(audit);
}
//更新合同的办理状态 //更新合同的办理状态
updateEmpContractAlertHandleStatus(contractPre.getContractId(), CommonConstants.ONE_STRING); updateEmpContractAlertHandleStatus(contractPre.getContractId(), CommonConstants.ONE_STRING);
// 更新processStatus为电子签发起失败 // 更新processStatus为电子签发起失败
...@@ -972,6 +1023,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -972,6 +1023,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING) .set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING); .set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING);
this.update(updateWrapper); this.update(updateWrapper);
//更新合同的办理状态
updateEmpContractAlertHandleStatus(contractVO.getContractId(), CommonConstants.ONE_STRING);
} }
} }
} }
...@@ -986,6 +1039,9 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -986,6 +1039,9 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING) .set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING); .set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING);
this.update(updateWrapper); this.update(updateWrapper);
//更新合同的办理状态
updateEmpContractAlertHandleStatus(contractVO.getContractId(), CommonConstants.ONE_STRING);
} }
} }
} }
...@@ -1672,6 +1728,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -1672,6 +1728,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (Common.isEmpty(startDate) || Common.isEmpty(endDate)) { if (Common.isEmpty(startDate) || Common.isEmpty(endDate)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
try {
Date parseStartDate = sdf.parse(startDate);
Date parseEndDate = sdf.parse(endDate);
if (parseStartDate.after(parseEndDate)){
return R.ok( null);
}
}catch (Exception e){
return R.ok( null);
}
ContractTermCalculator.ContractTerm term = calculator.calculateTerm(startDate, endDate); ContractTermCalculator.ContractTerm term = calculator.calculateTerm(startDate, endDate);
return R.ok( term); return R.ok( term);
} }
......
...@@ -96,7 +96,7 @@ public class DoFascTask { ...@@ -96,7 +96,7 @@ public class DoFascTask {
this.saveAuditLogSuccess("签署成功",contractInfo.getId()); this.saveAuditLogSuccess("签署成功",contractInfo.getId());
// 尝试获取归档文件 // 尝试获取归档文件
boolean flag = fascService.getFileByRequestIdRenew(preNew.getId()); boolean flag = fascService.getFileByRequestIdRenew(preNew.getId(),contractInfo.getId());
contractInfo.setAuditStatus(CommonConstants.TWO_INT); contractInfo.setAuditStatus(CommonConstants.TWO_INT);
// 传了false,就不要审核日志 // 传了false,就不要审核日志
......
...@@ -1370,7 +1370,7 @@ public class FascUtil { ...@@ -1370,7 +1370,7 @@ public class FascUtil {
} }
// 自动化续签待办:获取附件 // 自动化续签待办:获取附件
public boolean getFileByRequestId(TEmployeeContractPreNew contract, TFascPushLogService tFascPushLogService public boolean getFileByRequestId(TEmployeeContractPreNew contract, TFascPushLogService tFascPushLogService
, TAttaInfoMapper tAttaInfoMapper, OSSUtil ossUtil, TFascCompany company) throws ApiException { , TAttaInfoMapper tAttaInfoMapper, OSSUtil ossUtil, TFascCompany company,String contractId) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl()); OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company); String accessToken = this.getFascToken(openApiClient, company);
...@@ -1387,7 +1387,7 @@ public class FascUtil { ...@@ -1387,7 +1387,7 @@ public class FascUtil {
String empIdCard = contract.getEmpIdcard(); String empIdCard = contract.getEmpIdcard();
pushLog.setTypeKey("获取附件,身份证:" + empIdCard); pushLog.setTypeKey("获取附件,身份证:" + empIdCard);
pushLog.setTypeName("获取附件"); pushLog.setTypeName("获取附件");
pushLog.setContractId(contract.getId()); pushLog.setContractId(contractId);
pushLog.setSignTaskId(contract.getRequestId()); pushLog.setSignTaskId(contract.getRequestId());
tFascPushLogService.save(pushLog); tFascPushLogService.save(pushLog);
...@@ -1402,7 +1402,7 @@ public class FascUtil { ...@@ -1402,7 +1402,7 @@ public class FascUtil {
if (Common.isNotNull(doc.getFddFileUrl())) { if (Common.isNotNull(doc.getFddFileUrl())) {
// 存储文档 // 存储文档
// 将法大大回传的url字符串转化为流,存储到阿里云 // 将法大大回传的url字符串转化为流,存储到阿里云
this.streamUpload(doc.getFddFileUrl(), ossUtil, tAttaInfoMapper, contract.getContractId(), doc.getDocName()); this.streamUpload(doc.getFddFileUrl(), ossUtil, tAttaInfoMapper, contractId, doc.getDocName());
} }
} }
} }
......
...@@ -696,7 +696,7 @@ ...@@ -696,7 +696,7 @@
SELECT SELECT
a.id a.id
FROM t_employee_contract_pre_new a FROM t_employee_contract_pre_new a
where a.process_status in('3','5','7') and (a.expected_collection_time is null or a.expected_collection_time <![CDATA[ <= ]]> now()) where a.process_status in('1','5' and (a.expected_collection_time <![CDATA[ <= ]]> now())
</select> </select>
<!--tEmployeeContractPreNew简单分页查询--> <!--tEmployeeContractPreNew简单分页查询-->
......
...@@ -58,7 +58,9 @@ public class TEmployeeInsurancePreController { ...@@ -58,7 +58,9 @@ public class TEmployeeInsurancePreController {
menuUtil.setAuthSql(user, tEmployeeInsurancePre); menuUtil.setAuthSql(user, tEmployeeInsurancePre);
//无查询条件的时候直接 默认传非 已完成的数据 //无查询条件的时候直接 默认传非 已完成的数据
if (Common.isEmpty(tEmployeeInsurancePre.getProcessStatus())){ if (Common.isEmpty(tEmployeeInsurancePre.getProcessStatus())){
tEmployeeInsurancePre.setStatusList(CommonConstants.processListPreArchivesStatus); if (Common.isEmpty(tEmployeeInsurancePre.getStatusList())){
tEmployeeInsurancePre.setStatusList(CommonConstants.processListPreArchivesStatus);
}
}else { }else {
//有查询条件的时候 按查询条件查询 后面有判断statusList 为空默认的情况 //有查询条件的时候 按查询条件查询 后面有判断statusList 为空默认的情况
List<String> statusList = new ArrayList<>(); List<String> statusList = new ArrayList<>();
...@@ -152,6 +154,17 @@ public class TEmployeeInsurancePreController { ...@@ -152,6 +154,17 @@ public class TEmployeeInsurancePreController {
public void export(HttpServletResponse response, @RequestBody TEmployeeInsurancePreSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TEmployeeInsurancePreSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
//无查询条件的时候直接 默认传非 已完成的数据
if (Common.isEmpty(searchVo.getProcessStatus())){
if (Common.isEmpty(searchVo.getStatusList())){
searchVo.setStatusList(CommonConstants.processListPreArchivesStatus);
}
}else {
//有查询条件的时候 按查询条件查询 后面有判断statusList 为空默认的情况
List<String> statusList = new ArrayList<>();
statusList.add(searchVo.getProcessStatus());
searchVo.setStatusList(statusList);
}
tEmployeeInsurancePreService.listExport(response,searchVo); tEmployeeInsurancePreService.listExport(response,searchVo);
} }
......
...@@ -94,7 +94,7 @@ public class TDispatchInfoPreController { ...@@ -94,7 +94,7 @@ public class TDispatchInfoPreController {
if (Common.isEmpty(tDispatchInfoPre.getProcessStatus())) { if (Common.isEmpty(tDispatchInfoPre.getProcessStatus())) {
String typeSub = null==tDispatchInfoPre.getTypeSub()?CommonConstants.EMPTY_STRING:tDispatchInfoPre.getTypeSub(); String typeSub = null==tDispatchInfoPre.getTypeSub()?CommonConstants.EMPTY_STRING:tDispatchInfoPre.getTypeSub();
List<String> statusList = STATUS_MAP.get(typeSub); List<String> statusList = STATUS_MAP.get(typeSub);
if (statusList != null) { if (statusList != null && Common.isEmpty(tDispatchInfoPre.getStatusList())) {
tDispatchInfoPre.setStatusList(new ArrayList<>(statusList)); // 拷贝以防止外部修改 tDispatchInfoPre.setStatusList(new ArrayList<>(statusList)); // 拷贝以防止外部修改
} }
} }
...@@ -192,6 +192,16 @@ public class TDispatchInfoPreController { ...@@ -192,6 +192,16 @@ public class TDispatchInfoPreController {
public void export(HttpServletResponse response, @RequestBody TDispatchInfoPreSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TDispatchInfoPreSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
//typeSuB 0 社保 1 公积金
searchVo.setTypeSub(CommonConstants.ZERO_STRING);
// 主逻辑优化
if (Common.isEmpty(searchVo.getProcessStatus())) {
String typeSub = null==searchVo.getTypeSub()?CommonConstants.EMPTY_STRING:searchVo.getTypeSub();
List<String> statusList = STATUS_MAP.get(typeSub);
if (statusList != null && Common.isEmpty(searchVo.getStatusList())) {
searchVo.setStatusList(new ArrayList<>(statusList)); // 拷贝以防止外部修改
}
}
tDispatchInfoPreService.listExport(response, searchVo); tDispatchInfoPreService.listExport(response, searchVo);
} }
...@@ -207,6 +217,16 @@ public class TDispatchInfoPreController { ...@@ -207,6 +217,16 @@ public class TDispatchInfoPreController {
public void exportFund(HttpServletResponse response, @RequestBody TDispatchInfoPreSearchVo searchVo) { public void exportFund(HttpServletResponse response, @RequestBody TDispatchInfoPreSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
//typeSuB 0 社保 1 公积金
searchVo.setTypeSub(CommonConstants.ONE_STRING);
// 主逻辑优化
if (Common.isEmpty(searchVo.getProcessStatus())) {
String typeSub = null==searchVo.getTypeSub()?CommonConstants.EMPTY_STRING:searchVo.getTypeSub();
List<String> statusList = STATUS_MAP.get(typeSub);
if (statusList != null && Common.isEmpty(searchVo.getStatusList())) {
searchVo.setStatusList(new ArrayList<>(statusList)); // 拷贝以防止外部修改
}
}
tDispatchInfoPreService.listExportFund(response, searchVo); tDispatchInfoPreService.listExportFund(response, searchVo);
} }
......
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