From 022ac3c7d9b10f395fdcd72cd8dd651a4a97127b Mon Sep 17 00:00:00 2001 From: luozukai Date: Mon, 12 Aug 2019 14:11:34 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=BD=A6=E6=B5=81][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E4=B8=8A=E7=BC=B4=E8=B4=B9=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E9=87=91=E9=A2=9D=E6=9F=A5=E8=AF=A2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxPropertyContractServiceImpl.java | 11 +++++------ .../src/main/resources/mapper/WxCarCmdLogMapper.xml | 2 +- .../main/resources/mapper/WxCarPayRecordMapper.xml | 4 ++-- 3 files changed, 8 insertions(+), 9 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 ec4efa1a4..5b9c0b9cd 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -746,15 +746,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdD = new SimpleDateFormat("d"); SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); if(i == billTimeVoListSize - 1){//最后 - //判断是否满足整月 - 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"); + 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++; 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/resources/mapper/WxCarCmdLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml index 3f89e5f82..2fd12b8fb 100644 --- a/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCarCmdLogMapper.xml @@ -88,7 +88,7 @@ select sum(fee) fee,c.create_time from ( select id,DATE_FORMAT(create_date,'%m/%d') create_time,CONVERT(JSON_EXTRACT(cmd_json,'$.fee'), Decimal(16,2)) fee from wx_car_cmd_log where tenant_id = #{tenantId} and cmd_type=#{cmdType} - and create_date BETWEEN #{startdate} and #{enddate} + and REPLACE (JSON_EXTRACT(cmd_json,'$.time'),'"','') BETWEEN #{startdate} and #{enddate} ) c group by c.create_time order by c.create_time diff --git a/mallinkService/src/main/resources/mapper/WxCarPayRecordMapper.xml b/mallinkService/src/main/resources/mapper/WxCarPayRecordMapper.xml index 233432a52..aa2323443 100644 --- a/mallinkService/src/main/resources/mapper/WxCarPayRecordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCarPayRecordMapper.xml @@ -59,10 +59,10 @@ - and create_date >= #{startDate} + and fee_time >= #{startDate} - and create_date <= #{endDate} + and fee_time <= #{endDate} and fee is not null