|
|
|
@@ -735,7 +735,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
//按月计租 |
|
|
|
// if (wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) |
|
|
|
// ||wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { |
|
|
|
rentList = buildRentMonth(wxMerchant, userId, wxRentContract, receivePeriod, lease, rentalStartDate, price,isPreview); |
|
|
|
rentList = buildRentMonth(wxMerchant, userId, wxRentContract, receivePeriod, lease, rentalStartDate, price,isPreview); |
|
|
|
// } else { |
|
|
|
// //如果按日 |
|
|
|
// List<Date> yearList = new ArrayList<>(); |
|
|
|
@@ -952,7 +952,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
if(i == 0){//第一期 |
|
|
|
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ |
|
|
|
needpay = new Double(getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue(); |
|
|
|
if(isFirstDay(billTimeVo.getStartDate())){ |
|
|
|
needpay = new Double(receivePeriod * priceD).longValue(); |
|
|
|
}else{ |
|
|
|
needpay = new Double(getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue(); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
needpay = new Double(receivePeriod * priceD).longValue(); |
|
|
|
} |
|
|
|
@@ -1798,6 +1802,20 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
Double total = new Double(0); |
|
|
|
int[] diff; |
|
|
|
|
|
|
|
//同一天 |
|
|
|
if(sd.format(start).equals(sd.format(end))){ |
|
|
|
int dayCount = DateUtils.getMonthDayCount(start); |
|
|
|
return 1 * (price/dayCount); |
|
|
|
} |
|
|
|
|
|
|
|
//同月 |
|
|
|
if(sdM.format(start).equals(sdM.format(end))){ |
|
|
|
diff = DateUtils.getDiff(start,end); |
|
|
|
int dayCount = DateUtils.getMonthDayCount(start); |
|
|
|
total += (diff[1]+1) * (price/dayCount); |
|
|
|
return total; |
|
|
|
} |
|
|
|
|
|
|
|
//第一个月 |
|
|
|
Date lastMonthDay = DateUtils.getLastDayForMonth(start); |
|
|
|
diff = DateUtils.getDiff(start,lastMonthDay); |
|
|
|
@@ -1955,3 +1973,4 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|