From 5cd04058b25ea39f0d24ca19d679fd656b699f68 Mon Sep 17 00:00:00 2001 From: luozukai Date: Mon, 3 Jun 2019 18:56:50 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=A2=84=E8=A7=88=E8=B4=A6=E5=8D=95][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E4=BF=AE=E6=94=B9=E9=A2=84=E8=B4=A6?= =?UTF-8?q?=E5=8D=95=E9=87=91=E9=A2=9D=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 11 ++++++++++- .../service/impl/WxRentContractServiceImpl.java | 14 +++++++++++++- 2 files changed, 23 insertions(+), 2 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 5612a454c..292a23033 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -565,18 +565,25 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService if(wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ if(isFirstDay(billTimeVo.getStartDate())){ int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + months++; needpay = new Double(months * priceD).longValue(); }else{ needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue(); } }else{ int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + if(isFirstDay(billTimeVo.getStartDate())){ + months++; + } needpay = new Double(months * priceD).longValue(); } }else if(i == billTimeVoList.size()-1){//最后 needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue(); }else{//中间 int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + if(isFirstDay(billTimeVo.getStartDate())){ + months++; + } needpay = new Double(months * priceD).longValue(); } } @@ -666,7 +673,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService //按月计租 // if (propertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) // ||propertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { - result = buildRentMonth(wxMerchant, userId, propertyContract, receivePeriod, lease, rentalStartDate, price,isPreview); + result = buildRentMonth(wxMerchant, userId, propertyContract, receivePeriod, lease, rentalStartDate, price,isPreview); // } else { // //如果按日 // List yearList = new ArrayList<>(); @@ -932,3 +939,5 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } + + 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 029fa65ba..c15ad37df 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -735,7 +735,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { //按月计租 // if (wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) // ||wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { - rentList = buildRentMonth(wxMerchant, userId, wxRentContract, receivePeriod, lease, rentalStartDate, price,isPreview); + rentList = buildRentMonth(wxMerchant, userId, wxRentContract, receivePeriod, lease, rentalStartDate, price,isPreview); // } else { // //如果按日 // List yearList = new ArrayList<>(); @@ -955,18 +955,25 @@ public class WxRentContractServiceImpl implements WxRentContractService { if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ if(isFirstDay(billTimeVo.getStartDate())){ int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + months++; needpay = new Double(months * priceD).longValue(); }else{ needpay = new Double(getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue(); } }else{ int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + if(isFirstDay(billTimeVo.getStartDate())){ + months++; + } needpay = new Double(months * priceD).longValue(); } }else if(i == billTimeVoList.size()-1){//最后 needpay = new Double(getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue(); }else{//中间 int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + if(isFirstDay(billTimeVo.getStartDate())){ + months++; + } needpay = new Double(months * priceD).longValue(); } } @@ -1806,6 +1813,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { Double total = new Double(0); int[] diff; + if(sd.format(start).equals("2019-07-01")){ + System.out.println(); + } //同一天 if(sd.format(start).equals(sd.format(end))){ int dayCount = DateUtils.getMonthDayCount(start); @@ -1987,3 +1997,5 @@ public class WxRentContractServiceImpl implements WxRentContractService { + +