| @@ -268,7 +268,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| } | } | ||||
| //保存物业合同信息 | //保存物业合同信息 | ||||
| String message; | String message; | ||||
| boolean hasFlow = true; | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| hasFlow = false; | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setRentalStartDate(wxRentContract.getRentalStartDate()); | record.setRentalStartDate(wxRentContract.getRentalStartDate()); | ||||
| @@ -330,6 +332,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| record.setPrice(record.getPrice() != null ? record.getPrice() : 0); | record.setPrice(record.getPrice() != null ? record.getPrice() : 0); | ||||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit() : 0); | record.setDeposit(record.getDeposit() != null ? record.getDeposit() : 0); | ||||
| record.setUpdatetime(new Date()); | record.setUpdatetime(new Date()); | ||||
| if (CollectionUtils.isEmpty(record.getFlowParams())) { | |||||
| hasFlow = false; | |||||
| record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); | |||||
| } | |||||
| try { | try { | ||||
| wxPropertyContractMapper.updateByPrimaryKeySelective(record); | wxPropertyContractMapper.updateByPrimaryKeySelective(record); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -340,8 +346,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| message = "更新物业合同信息成功"; | message = "更新物业合同信息成功"; | ||||
| } | } | ||||
| if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { | |||||
| if (!CollectionUtils.isEmpty(record.getFlowParams())) { | |||||
| if (hasFlow) { | |||||
| if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { | |||||
| if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null) { | if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null) { | ||||
| updatePropertyContractStatus(record.getId()); | updatePropertyContractStatus(record.getId()); | ||||
| } else { | } else { | ||||
| @@ -355,10 +361,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| wxPropertyContractMapper.updateStatus(updateRentContract); | wxPropertyContractMapper.updateStatus(updateRentContract); | ||||
| logger.info("id:{},启动审批流成功", record.getId().toString()); | logger.info("id:{},启动审批流成功", record.getId().toString()); | ||||
| } | } | ||||
| } | |||||
| } else { | |||||
| //有模板,启动审批流,没有,直接生产账单 | |||||
| if (!CollectionUtils.isEmpty(record.getFlowParams())) { | |||||
| } else { | |||||
| if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null | if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null | ||||
| && record.getMerchantId() != null) { | && record.getMerchantId() != null) { | ||||
| wxRentContractService.updateRentContractStatus(record.getId()); | wxRentContractService.updateRentContractStatus(record.getId()); | ||||