From a406262d598c03b964de6e0b241fac37e61e0456 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 18 Aug 2021 18:29:32 +0800 Subject: [PATCH] hetong --- .../impl/WxRentContractServiceImpl.java | 81 +++++-------------- 1 file changed, 18 insertions(+), 63 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 7c8373054..6ed074a1e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -500,46 +500,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } - - - - - - - - - - - - - - - - - - - //生成预览账单(补录第二步,第三步走编辑) -// if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null -// && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) { -// wxBillRentMapper.deletePreviewBill(record); -// //重新生成 -// List resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); -// record.setPreviewBillRentList(resultList); -// } - - - - - - - - - - - - - + if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null + && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0l)) { + wxBillRentMapper.deletePreviewBill(record); + //重新生成 + List resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); + record.setPreviewBillRentList(resultList); + } //创建预览账单 // List resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); @@ -590,30 +558,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { return resultData; } + if(CollectionUtils.isEmpty(record.getPreviewBillRentList())) { + if (record.getReceivePeriod() != null && record.getLease() != null + && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { + //删除预账单,重新生成 + wxBillRentMapper.deletePreviewBill(record); + resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); + } + } - - - - - - - - - - - - -// if(CollectionUtils.isEmpty(record.getPreviewBillRentList())) { -// if (record.getReceivePeriod() != null && record.getLease() != null -// && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { -// //删除预账单,重新生成 -// wxBillRentMapper.deletePreviewBill(record); -// resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); -// } -// } -// -// //保存调整金额(预账单调整) -// savePreviewBill(record); + //保存调整金额(预账单调整) + savePreviewBill(record); WxRentContract wxRentContract = (WxRentContract)resultData.data; wxRentContract.setPreviewBillRentList(resultList); @@ -1015,7 +970,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { Date rentalStartDate = wxRentContract.getRentalStartDate(); Long price = wxRentContract.getPrice(); if(EnumContractOperationType.JINMAO.getCode().equals(wxRentContract.getOperationType())){ - rentList = buildRentJinmao(userId, wxRentContract, receivePeriod, lease, rentalStartDate, price, isPreview,saveDb); +// rentList = buildRentJinmao(userId, wxRentContract, receivePeriod, lease, rentalStartDate, price, isPreview,saveDb); }else{ //按月计租