Commit 27ddc5e7 authored by hongguangwu's avatar hongguangwu

MVP1.7.16-法大大

parent b5905b3c
...@@ -22,6 +22,7 @@ import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo; ...@@ -22,6 +22,7 @@ import com.fasc.open.api.v5_1.res.template.SignTemplateListInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
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.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FascUtil; import com.yifu.cloud.plus.v1.yifu.archives.utils.FascUtil;
...@@ -53,10 +54,13 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -53,10 +54,13 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private final TFascTemplateService tFascTemplateService; private final TFascTemplateService tFascTemplateService;
private final TFascTemplateDetailService tFascTemplateDetailService; private final TFascTemplateDetailService tFascTemplateDetailService;
private final TEmployeeContractPreMapper tEmployeeContractPreMapper; private final TEmployeeContractPreMapper tEmployeeContractPreMapper;
private final TEmployeeContractInfoMapper tEmployeeContractInfoMapper;
private final TAttaInfoMapper tAttaInfoMapper; private final TAttaInfoMapper tAttaInfoMapper;
private final OSSUtil ossUtil; private final OSSUtil ossUtil;
private final static String FASC_NO_CONTRACT = "未找到合同"; private final static String FASC_NO_CONTRACT = "未找到合同自动化";
private final static String FASC_NO_EMP_CONTRACT = "未找到自动生成的员工合同";
private final static String FASC_NO_TEMPLATE = "未找到新法大大模板";
@Override @Override
public R<String> getTemplate(String templateName) throws ApiException { public R<String> getTemplate(String templateName) throws ApiException {
...@@ -181,6 +185,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -181,6 +185,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (contract == null) { if (contract == null) {
return R.failed(FASC_NO_CONTRACT); return R.failed(FASC_NO_CONTRACT);
} }
if (Common.isEmpty(contract.getContractId())) {
return R.failed("未生成合同,请联系管理员");
}
if (Common.isEmpty(contract.getFadadaTemplateId())) { if (Common.isEmpty(contract.getFadadaTemplateId())) {
return R.failed("未找到合同模板ID,请联系管理员"); return R.failed("未找到合同模板ID,请联系管理员");
} }
...@@ -191,14 +198,27 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -191,14 +198,27 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
} }
if (Common.isEmpty(contract.getProcessStatus())) { if (Common.isEmpty(contract.getProcessStatus())) {
return R.failed("合同无状态,请联系管理员"); return R.failed("合同无状态,请联系管理员");
} else if (!CommonConstants.dingleDigitStrArray[1].equals(contract.getProcessStatus()) } else if (!(CommonConstants.dingleDigitStrArray[1].equals(contract.getProcessStatus())
&& !CommonConstants.dingleDigitStrArray[5].equals(contract.getProcessStatus()) || CommonConstants.dingleDigitStrArray[5].equals(contract.getProcessStatus())
&& !CommonConstants.dingleDigitStrArray[7].equals(contract.getProcessStatus())) { || CommonConstants.dingleDigitStrArray[7].equals(contract.getProcessStatus()))) {
return R.failed("合同状态不是待发起、发起失败、签署失败,不可发起电子签署!"); return R.failed("合同状态不是待发起、发起失败、签署失败,不可发起电子签署!");
} }
if (Common.isNotNull(contract.getRequestId())) { if (Common.isNotNull(contract.getRequestId())) {
return R.failed("合同已发起,请勿重复发起!"); return R.failed("合同已发起,请勿重复发起!");
} }
TEmployeeContractInfo empContract = tEmployeeContractInfoMapper.selectById(contract.getContractId());
if (empContract == null) {
return R.failed(FASC_NO_EMP_CONTRACT);
}
TFascTemplate tFascTemplate = tFascTemplateService.getById(contract.getFadadaTemplateId());
if (tFascTemplate == null) {
return R.failed(FASC_NO_TEMPLATE);
} else if (!"valid".equals(tFascTemplate.getSignTemplateStatus())) {
return R.failed("法大大模版状态不是“启用”,不可发起电子签署");
}
TFascTemplateDetail detail = new TFascTemplateDetail();
detail.setSignTemplateId(contract.getFadadaTemplateId());
List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTFascTemplateDetailList(detail);
// TODO - 判断是否入职超过1个月 // TODO - 判断是否入职超过1个月
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper); R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper);
......
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