|
|
|
@@ -1141,7 +1141,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
SimpleDateFormat sdD = new SimpleDateFormat("d"); |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
// System.out.println(sd.format(startDate)); |
|
|
|
// System.out.println(sd.format(endDate)); |
|
|
|
System.out.println(sd.format(endDate)); |
|
|
|
if(sd.format(endDate).equals("2020-08-18")){ |
|
|
|
System.out.println(); |
|
|
|
} |
|
|
|
|
|
|
|
if(i == billTimeVoListSize - 1){//最后 |
|
|
|
//判断是否满足整月 |
|
|
|
@@ -2027,6 +2030,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
System.out.println(sd.format(start)); |
|
|
|
System.out.println(sd.format(end)); |
|
|
|
if(sd.format(end).equals("2020-08-18")){ |
|
|
|
System.out.println(); |
|
|
|
} |
|
|
|
|
|
|
|
//同一天 |
|
|
|
if(sd.format(start).equals(sd.format(end))){ |
|
|
|
@@ -2066,18 +2072,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
//最后一个月 |
|
|
|
diff = DateUtils.getDiff(DateUtils.getFirstDayForCurrMonth(end),end); |
|
|
|
dayCount = DateUtils.getMonthDayCount(end); |
|
|
|
total += (diff[1]) * (price/dayCount); |
|
|
|
total += (diff[1]+1) * (price/dayCount); |
|
|
|
return total; |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception{ |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
int[] a= DateUtils.getDiff(sd.parse("2020-11-01"),sd.parse("2021-04-30")); |
|
|
|
System.out.println(a[0]); |
|
|
|
System.out.println(a[1]); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 按日计租 根据每月的日期总数计算needpay |
|
|
|
* @param monthPrice |
|
|
|
@@ -2126,12 +2124,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
//最后一个月 |
|
|
|
if(sdM.format(monthStartDate).equals(sdM.format(end))){ |
|
|
|
diff = DateUtils.getDiff(monthStartDate,end); |
|
|
|
total += price * (diff[1]); |
|
|
|
total += price * (diff[1]+1); |
|
|
|
break; |
|
|
|
}else{ |
|
|
|
currEnd = DateUtils.getLastDayForMonth(monthStartDate); |
|
|
|
diff = DateUtils.getDiff(monthStartDate,currEnd); |
|
|
|
total += price * (diff[1]); |
|
|
|
total += price * (diff[1]+1); |
|
|
|
} |
|
|
|
|
|
|
|
//预警 |
|
|
|
@@ -2242,4 +2240,4 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
public WxRentContract getByBill(WxBillRent billRent) { |
|
|
|
return wxRentContractMapper.getByBill(billRent); |
|
|
|
} |
|
|
|
} |
|
|
|
} |