Commit 8a915caf authored by hongguangwu's avatar hongguangwu

MVP1.7.16-法大大字段

parent f285c0dc
......@@ -188,6 +188,12 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (Common.isEmpty(contract.getContractId())) {
return R.failed("未生成合同,请联系管理员");
}
TEmployeeContractInfo empContract = tEmployeeContractInfoMapper.selectById(contract.getContractId());
if (empContract == null) {
return R.failed(FASC_NO_EMP_CONTRACT);
}
if (Common.isEmpty(contract.getFadadaTemplateId())) {
return R.failed("未找到合同模板ID,请联系管理员");
}
......@@ -206,10 +212,6 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if (Common.isNotNull(contract.getRequestId())) {
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);
......@@ -222,11 +224,6 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
// - 判断是否入职超过1个月——接口入口做了
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper, tFascTemplate, detailList);
if (!R.isSuccess(requestInfo)) {
contract.setRequestId(requestInfo.getData());
contract.setProcessStatus(CommonConstants.dingleDigitStrArray[2]);
tEmployeeContractPreMapper.updateById(contract);
}
return requestInfo;
}
......
......@@ -388,6 +388,12 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
try {
result = fascService.submitContract(contractPre.getId());
} catch (Exception e) {
// 更新合同:
if (Common.isNotNull(contractPre.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPre.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
log.error("法大大推送执行异常", e);
}
if (result == null || result.getCode() != CommonConstants.SUCCESS) {
......@@ -401,6 +407,12 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.set(TEmployeeContractPre::getErrorInfo, errorMsg)
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
// 更新合同:
if (Common.isNotNull(contractPre.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPre.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
// 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), errorMsg);
......
......@@ -359,7 +359,7 @@ public class FascUtil {
tFascPushLogService.updateById(pushLog);
if (Common.isNotNull(requestId)) {
// 第二步:填写控件
R<String> sendValue = buildDocFieldValue(contract, requestId, openApiClient, accessToken, tFascTemplate, detailList);
R<String> sendValue = buildDocFieldValue(contract, requestId, openApiClient, accessToken, detailList);
if (R.isSuccess(sendValue)) {
// 第三步:提交任务
sendValue = submitTask(requestId, openApiClient, accessToken);
......@@ -401,7 +401,7 @@ public class FascUtil {
// 第二步:填写控件
private R<String> buildDocFieldValue(TEmployeeContractPre contract, String requestId
, OpenApiClient openApiClient, String accessToken
, TFascTemplate tFascTemplate, List<TFascTemplateDetail> detailList) throws ApiException {
, List<TFascTemplateDetail> detailList) throws ApiException {
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
FillFieldValuesReq fillFieldValuesReq = new FillFieldValuesReq();
fillFieldValuesReq.setSignTaskId(requestId);
......
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