From d3907367d8241f89921708ac88a42e5e29ff08dd Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 9 Aug 2019 11:29:39 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E4=B8=9A=E5=90=88=E5=90=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=8A=A5=E9=94=99]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 14 +++++++++----- .../service/impl/WxRentContractServiceImpl.java | 6 ------ 2 files changed, 9 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 fae6dae09..ec4efa1a4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -743,14 +743,18 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService return needpay; } - SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); + SimpleDateFormat sdD = new SimpleDateFormat("d"); + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + if(i == billTimeVoListSize - 1){//最后 - if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getEndDate())) ){ - int months = WxRentContractServiceImpl.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); - months++; + //判断是否满足整月 + int startInt = Integer.parseInt(sdD.format(startDate)); + int endInt = Integer.parseInt(sdD.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))); + if(startInt == endInt){ + int months = WxRentContractServiceImpl.getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01"); needpay = new Double(months * priceD).longValue(); - }else { + }else{ needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate)).longValue(); } }else if(i == 0){//第一期 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 aa74cdd71..fad09b239 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1136,15 +1136,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { return needpay; } - SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdD = new SimpleDateFormat("d"); SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); -// System.out.println(sd.format(startDate)); - System.out.println(sd.format(endDate)); - if(sd.format(endDate).equals("2020-08-18")){ - System.out.println(); - } if(i == billTimeVoListSize - 1){//最后 //判断是否满足整月