From 1f0053373695c556db7f8b6eed26cb8b5a2fa023 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 23 Jul 2019 19:06:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B6=88=E6=81=AF][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=8E=89=E9=82=AE=E7=AE=B1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxRentContractServiceImpl.java | 50 ++++++++++++------- .../mapper/WxMsgValidationcodeModelMapper.xml | 6 ++- 2 files changed, 37 insertions(+), 19 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 cfb87491b..beb6a92ec 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1031,33 +1031,47 @@ public class WxRentContractServiceImpl implements WxRentContractService { //计算金额 long needpay = 0; + boolean flag = false; if(yearList.size() > 1) { if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate) || billTimeVo.getEndDate().after(endDate) )) { logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate)); - index++; - if(index >= yearList.size()-1){ - endDate = null; - }else{ - endDate = yearList.get(index+1);//price index 0开始,year.end 从第二年开始 - logger.info("==========cross:"+sd.format(endDate)); - - //如果是计算账单金额&cross 拆分日期进行计算 - if(!saveDb) { - logger.info("==========s:"+sd.format(billTimeVo.getStartDate())); - logger.info("==========e:"+sd.format(billTimeVo.getEndDate())); - logger.info("==========:"+sd.format(endDate)); - long needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),billTimeVo.getEndDate(),i,billTimeVoList.size()); - long needpayAfter = getNeedPayMoney(wxRentContract,priceArrs[index],billTimeVo.getStartDate(),billTimeVo.getEndDate(),i,billTimeVoList.size()); - needpay = needpayFront+needpayAfter; - }else{ - //计算金额 - needpay = getNeedPayMoney(wxRentContract,priceArrs[index],billTimeVo.getStartDate(),billTimeVo.getEndDate(),i,billTimeVoList.size()); + if(yearList.size() > 1) { + if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate) || billTimeVo.getEndDate().after(endDate) )) { + //logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate)); + + index++; + if(index >= yearList.size()-1){ + endDate = null; + }else{ + //如果是计算账单金额&cross 拆分日期进行计算 + if(!saveDb && billTimeVo.getEndDate().after(endDate)) { + logger.info("==========s:"+sd.format(billTimeVo.getStartDate())); + logger.info("==========e:"+sd.format(billTimeVo.getEndDate())); + logger.info("==========endDate:"+sd.format(endDate)); + + long needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size()); + long needpayAfter = getNeedPayMoney(wxRentContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size()); + logger.info("==========needpayFront:"+needpayFront); + logger.info("==========needpayAfter:"+needpayAfter); + System.out.println(); + needpay = needpayFront+needpayAfter; + flag = true; + } + + endDate = yearList.get(index+1);//price index 0开始,year.end 从第二年开始 + //logger.info("==========cross:"+sd.format(endDate)); + } } } } } + //计算金额 + if(!flag){ + needpay = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size()); + } + WxBillRent wxBillRent = new WxBillRent(); wxBillRent.setIsPreview(isPreview); wxBillRent.setId(idWorker.nextId()); diff --git a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml index cf7b180a4..962400733 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml @@ -34,7 +34,11 @@ and `type` = #{type} and `tenant_id` = #{tenantId} and `open` = #{open} - and content not like '<%' + + and id not in( + select id from wx_msg_validationcode_model where content like '<%' and `tenant_id` = #{tenantId} + ) + and id in