From c676f114eb48ef377b7beec4c84002ad9c6c1823 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Mon, 25 Mar 2019 19:57:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=89=8D=E7=AB=AF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A3=80=E6=9F=A5][=E4=BF=AE=E6=94=B9]:=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/controller/WxCampaignController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java index 88449d955..cd66ca593 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java @@ -96,6 +96,9 @@ public class WxCampaignController extends BaseController { @PostMapping("updateStatus") public ResultData updateStatus(@RequestBody WxCampaign wxCampaign) { logger.debug("[" + getIpAddr() + "] WxCampaignController::updateStatus"); + if(wxCampaign.getType() == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "type不能为空"); + } // check coupon 状态 if (wxCampaign.getType().equals(EnumCampaignType.STABLE.getCode())) { if (wxCampaign.getStatus().equals(EnumCampaignStatus.STATUS_THROW_IN.getCode())) { From 3290a1f85f4bfb1c4cb4243787fb09cd129f63a6 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 26 Mar 2019 11:52:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E9=A2=84=E8=A7=88=E8=B4=A6=E5=8D=95][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E8=B0=83=E6=95=B4=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E8=B4=A6=E5=8D=95=E9=80=BB=E8=BE=91]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 24 ++++++++++--------- .../impl/WxRentContractServiceImpl.java | 24 ++++++++++--------- 2 files changed, 26 insertions(+), 22 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 98c5c3ade..ebcb677fc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -270,26 +270,28 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } + //查询预账单用于展示 + WxBillProperty wxBillRent = new WxBillProperty(); + wxBillRent.setPropertyContractId(record.getId()); + wxBillRent.setSortColumns(WxBillProperty.Field.Period_ASC); + wxBillRent.setIsPreview(EnumIsPreview.YES.getCode()); + List billList = wxBillPropertyMapper.findList(wxBillRent); + record.setPreviewBillRentList(billList); + //生成预览账单 - if(!wxPropertyContract.getReceivePeriod().equals(record.getReceivePeriod()) + if(CollectionUtils.isEmpty(billList) || + (!wxPropertyContract.getReceivePeriod().equals(record.getReceivePeriod()) ||!wxPropertyContract.getPrice().equals(record.getPrice()) ||!wxPropertyContract.getDeposit().equals(record.getDeposit()) - ||!wxPropertyContract.getAdjustPeriod().equals(record.getAdjustPeriod())){ + ||!wxPropertyContract.getAdjustPeriod().equals(record.getAdjustPeriod()) + )){ wxBillPropertyMapper.deletePreviewBill(record); //重新生成 wxPropertyContract.setPrice(record.getPrice()); wxPropertyContract.setDeposit(record.getDeposit()); wxPropertyContract.setReceivePeriod(record.getReceivePeriod()); wxPropertyContract.setPayAccount(record.getPayAccount()); - List billList = buildProperty(new WxMerchant(),userId,wxPropertyContract,EnumIsPreview.YES.getCode()); - record.setPreviewBillRentList(billList); - }else{ - //查询预账单用于展示 - WxBillProperty wxBillRent = new WxBillProperty(); - wxBillRent.setPropertyContractId(record.getId()); - wxBillRent.setSortColumns(WxBillProperty.Field.Period_ASC); - wxBillRent.setIsPreview(EnumIsPreview.YES.getCode()); - List billList = wxBillPropertyMapper.findList(wxBillRent); + billList = buildProperty(new WxMerchant(),userId,wxPropertyContract,EnumIsPreview.YES.getCode()); record.setPreviewBillRentList(billList); } message = "更新物业合同信息成功"; 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 74231fbec..b480c7505 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -249,8 +249,18 @@ public class WxRentContractServiceImpl implements WxRentContractService { public ResultData update(WxRentContract record, Long userId,String userName) { //对比上一次,是否有更改,有,重新生成预账单 WxRentContract dbRent = wxRentContractMapper.selectByPrimaryKey(record.getId()); + + //查询预账单用于展示 + WxBillRent wxBillRent = new WxBillRent(); + wxBillRent.setRentContractId(record.getId()); + wxBillRent.setSortColumns(WxBillRent.Field.Period_ASC); + wxBillRent.setIsPreview(EnumIsPreview.YES.getCode()); + List resultList = wxBillRentMapper.findList(wxBillRent); + boolean change = false; - if(record.getAdjustPeriod().intValue() != dbRent.getAdjustPeriod().intValue()){ + if(CollectionUtils.isEmpty(resultList)){ + change = true; + }else if(record.getAdjustPeriod().intValue() != dbRent.getAdjustPeriod().intValue()){ change = true; }else{ if(record.getReceivePeriod() != null && record.getLease()!=null && record.getPrice()!= null) { @@ -289,17 +299,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { ResultData resultData = getResultDataForUpdate(record, userId); //有改变,删除预账单,重新生成 - List resultList; if(change) { wxBillRentMapper.deletePreviewBill(record); resultList = buildRent(new WxMerchant(), null, record, EnumIsPreview.YES.getCode()); - }else{ - //查询预账单用于展示 - WxBillRent wxBillRent = new WxBillRent(); - wxBillRent.setRentContractId(record.getId()); - wxBillRent.setSortColumns(WxBillRent.Field.Period_ASC); - wxBillRent.setIsPreview(EnumIsPreview.YES.getCode()); - resultList = wxBillRentMapper.findList(wxBillRent); } //启动审批流 @@ -320,8 +322,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { // 保存调整金额(预账单调整) if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ - for (WxBillRent wxBillRent:record.getPreviewBillRentList()) { - wxBillRentMapper.update(wxBillRent); + for (WxBillRent billRent:record.getPreviewBillRentList()) { + wxBillRentMapper.update(billRent); } } WxRentContract wxRentContract = (WxRentContract)resultData.data;