|
|
|
@@ -2846,4 +2846,46 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "保存租赁合同信息成功", wxRentContract); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public ResultData extensionUpdateFile(WxRentContract record, Long userId,String userName,Date oldRentStartDate) { |
|
|
|
// 保存调整金额(预账单调整) |
|
|
|
if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ |
|
|
|
savePreviewBill(record); |
|
|
|
} |
|
|
|
ResultData resultData = getResultDataForExtensionUpdate(record, userId,0,oldRentStartDate); |
|
|
|
if (resultData.code != Result.SUCCESS) { |
|
|
|
return resultData; |
|
|
|
} |
|
|
|
|
|
|
|
//有模板,启动审批流,没有,直接生产账单 |
|
|
|
if (!CollectionUtils.isEmpty(record.getFlowParams())) { |
|
|
|
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record) == null |
|
|
|
&& record.getMerchantId() != null) { |
|
|
|
updateRentContractStatus(record.getId()); |
|
|
|
}else{ |
|
|
|
record.getFlowParams().put("businessId", record.getId().toString()); |
|
|
|
if (record.getMerchantId() != null) { |
|
|
|
record.getFlowParams().put("supplement", true); //设置补录 |
|
|
|
} |
|
|
|
wxFlowService.start(record.getFlowParams(), userId, userName, record); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
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); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//审批状态重置 |
|
|
|
WxRentContract updateRentContract = new WxRentContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); |
|
|
|
updateApplyStatus(updateRentContract); |
|
|
|
} |
|
|
|
|
|
|
|
return resultData; |
|
|
|
} |
|
|
|
} |