|
|
|
@@ -217,25 +217,20 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
// 启动审批流 |
|
|
|
if(record.getFlowParams() != null){ |
|
|
|
record.getFlowParams().put("businessId",record.getId().toString()); |
|
|
|
if(record.getMerchantId() != null) { |
|
|
|
record.getFlowParams().put("supplement", true); //设置补录 |
|
|
|
} |
|
|
|
wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxRentContract updateRentContract = new WxRentContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxRentContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功, 是否补录:{}",record.getId().toString(),record.getMerchantId() != null); |
|
|
|
// 启动审批流 |
|
|
|
if(record.getFlowParams() != null){ |
|
|
|
record.getFlowParams().put("businessId",record.getId().toString()); |
|
|
|
if(record.getMerchantId() != null) { |
|
|
|
record.getFlowParams().put("supplement", true); //设置补录 |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("启动审批流失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.FLOW_FAIL.getCode(), "FLOW FAILD " + e.getMessage()); |
|
|
|
wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxRentContract updateRentContract = new WxRentContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxRentContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功, 是否补录:{}",record.getId().toString(),record.getMerchantId() != null); |
|
|
|
} |
|
|
|
|
|
|
|
//生成预览账单(补录第二步,第三步走编辑) |
|
|
|
@@ -928,32 +923,27 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
public ResultData updateFile(WxRentContract record, Long userId,String userName) { |
|
|
|
ResultData resultData = getResultDataForUpdate(record, userId); |
|
|
|
try { |
|
|
|
// 启动审批流 |
|
|
|
if(record.getFlowParams() != null){ |
|
|
|
record.getFlowParams().put("businessId",record.getId().toString()); |
|
|
|
if(record.getMerchantId() != null) { |
|
|
|
record.getFlowParams().put("supplement", true); //设置补录 |
|
|
|
} |
|
|
|
wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxRentContract updateRentContract = new WxRentContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxRentContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功,是否补录:{}",record.getId().toString(),record.getMerchantId() != null); |
|
|
|
// 启动审批流 |
|
|
|
if(record.getFlowParams() != null){ |
|
|
|
record.getFlowParams().put("businessId",record.getId().toString()); |
|
|
|
if(record.getMerchantId() != null) { |
|
|
|
record.getFlowParams().put("supplement", true); //设置补录 |
|
|
|
} |
|
|
|
wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); |
|
|
|
|
|
|
|
// 保存调整金额(预账单调整) |
|
|
|
if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ |
|
|
|
for (WxBillRent wxBillRent:record.getPreviewBillRentList()) { |
|
|
|
wxBillRentMapper.update(wxBillRent); |
|
|
|
} |
|
|
|
// 合同状态改成待签约 |
|
|
|
WxRentContract updateRentContract = new WxRentContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxRentContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功,是否补录:{}",record.getId().toString(),record.getMerchantId() != null); |
|
|
|
} |
|
|
|
|
|
|
|
// 保存调整金额(预账单调整) |
|
|
|
if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ |
|
|
|
for (WxBillRent wxBillRent:record.getPreviewBillRentList()) { |
|
|
|
wxBillRentMapper.update(wxBillRent); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("启动审批流失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.FLOW_FAIL.getCode(), "FLOW FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
return resultData; |
|
|
|
} |
|
|
|
|