From a524903d17cae36fe756ca91a2ffd2f10eed83af Mon Sep 17 00:00:00 2001 From: luozukai Date: Sun, 28 Apr 2019 20:10:37 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A1=E6=89=B9=E6=B5=81][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E9=A2=84=E8=A7=88=E8=B4=A6=E5=8D=95=E9=80=BB?= =?UTF-8?q?=E8=BE=91]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 4aede0d2e..f5b52d197 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -155,10 +155,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService @Transactional(rollbackFor = {Exception.class}) public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { // 保存调整金额(预账单调整) + boolean haspreview = false; if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ for (WxBillProperty wxBillProperty:record.getPreviewBillRentList()) { wxBillPropertyMapper.update(wxBillProperty); } + haspreview = true; } if (record.getRentShopType().equals(EnumRentShopType.POINT.getCode()) && null == record.getShopId()) { @@ -296,18 +298,22 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService // ||!wxPropertyContract.getAdjustPeriod().equals(record.getAdjustPeriod()) // || !DateUtils.date2String(wxPropertyContract.getRentalStartDate(),"yyyy-MM-dd").equals(DateUtils.date2String(record.getRentalStartDate(),"yyyy-MM-dd")) // )){ - if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null - && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) { - //删除预账单,重新生成 - wxBillPropertyMapper.deletePreviewBill(record); - //重新生成 - wxPropertyContract.setPrice(record.getPrice()); - wxPropertyContract.setDeposit(record.getDeposit()); - wxPropertyContract.setReceivePeriod(record.getReceivePeriod()); - wxPropertyContract.setPayAccount(record.getPayAccount()); - billList = buildProperty(new WxMerchant(),userId,wxPropertyContract,EnumIsPreview.YES.getCode()); - record.setPreviewBillRentList(billList); + + if(!haspreview){ + if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null + && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) { + //删除预账单,重新生成 + wxBillPropertyMapper.deletePreviewBill(record); + //重新生成 + wxPropertyContract.setPrice(record.getPrice()); + wxPropertyContract.setDeposit(record.getDeposit()); + wxPropertyContract.setReceivePeriod(record.getReceivePeriod()); + wxPropertyContract.setPayAccount(record.getPayAccount()); + billList = buildProperty(new WxMerchant(),userId,wxPropertyContract,EnumIsPreview.YES.getCode()); + record.setPreviewBillRentList(billList); + } } + message = "更新物业合同信息成功"; } @@ -1017,3 +1023,4 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } +