|
|
|
@@ -1041,7 +1041,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); |
|
|
|
if(i == billTimeVoList.size()-1){//最后 |
|
|
|
needpay = new Double(getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue(); |
|
|
|
if(isFirstDay(billTimeVo.getStartDate())){ |
|
|
|
int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); |
|
|
|
months++; |
|
|
|
needpay = new Double(months * priceD).longValue(); |
|
|
|
}else { |
|
|
|
needpay = new Double(getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue(); |
|
|
|
} |
|
|
|
}else if(i == 0){//第一期 |
|
|
|
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ |
|
|
|
if(isFirstDay(billTimeVo.getStartDate())){ |
|
|
|
@@ -1983,6 +1989,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
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 |
|
|
|
|