| @@ -534,11 +534,11 @@ public class WxRentContractHelper { | |||||
| Date lastMonthDay = DateUtils.getLastDayForMonth(start); | Date lastMonthDay = DateUtils.getLastDayForMonth(start); | ||||
| List<Date> currValidDays = getValidDays(start,lastMonthDay,freeDays); | List<Date> currValidDays = getValidDays(start,lastMonthDay,freeDays); | ||||
| if (null == currValidDays || currValidDays.size() <= 0 ) { | 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); | Date newStartDate = DateUtils.getDaySet(lastMonthDay,Calendar.SECOND,1); | ||||
| @@ -585,11 +585,11 @@ public class WxRentContractHelper { | |||||
| } | } | ||||
| public static void main(String[] args) { | 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<Date> f1 = DateUtils.getAllDays(d1, d2); | List<Date> f1 = DateUtils.getAllDays(d1, d2); | ||||
| // Date d3 = DateUtils.str2Date("2024-09-01 00:00:00").getTime(); | // Date d3 = DateUtils.str2Date("2024-09-01 00:00:00").getTime(); | ||||