From a773bad5f6eb5d78189c199279c26ae76085d456 Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 8 Aug 2024 13:13:35 +0800 Subject: [PATCH] fix --- .../service/helper/WxRentContractHelper.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java index c44544916..ffc959c6a 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java @@ -534,11 +534,11 @@ public class WxRentContractHelper { Date lastMonthDay = DateUtils.getLastDayForMonth(start); List currValidDays = getValidDays(start,lastMonthDay,freeDays); if (null == currValidDays || currValidDays.size() <= 0 ) { - return "0"; + }else { + NeedPayDTO np = getCurrentMonthPay(start, lastMonthDay, price, decimalSize, currValidDays, dayPriceCalcute, monthAvageDays); + total = total.add(np.getMoney()); + System.out.println("首1月>>>>"+DateUtils.date2String(start)+">>>"+DateUtils.date2String(lastMonthDay)+">>>>"+total.toPlainString()); } - NeedPayDTO np = getCurrentMonthPay(start, lastMonthDay, price, decimalSize, currValidDays, dayPriceCalcute, monthAvageDays); - total = total.add(np.getMoney()); - System.out.println("首1月>>>>"+DateUtils.date2String(start)+">>>"+DateUtils.date2String(lastMonthDay)+">>>>"+total.toPlainString()); //中间月份 Date newStartDate = DateUtils.getDaySet(lastMonthDay,Calendar.SECOND,1); @@ -585,11 +585,11 @@ public class WxRentContractHelper { } public static void main(String[] args) { - Date start = DateUtils.str2Date("2024-09-01 00:00:00").getTime(); - Date end = DateUtils.str2Date("2024-09-30 23:59:59").getTime(); + Date start = DateUtils.str2Date("2026-08-10 00:00:00").getTime(); + Date end = DateUtils.str2Date("2026-09-30 23:59:59").getTime(); - Date d1 = DateUtils.str2Date("2024-08-20 00:00:00").getTime(); - Date d2 = DateUtils.str2Date("2024-09-10 00:00:00").getTime(); + Date d1 = DateUtils.str2Date("2026-08-09 00:00:00").getTime(); + Date d2 = DateUtils.str2Date("2026-09-08 00:00:00").getTime(); List f1 = DateUtils.getAllDays(d1, d2); // Date d3 = DateUtils.str2Date("2024-09-01 00:00:00").getTime();