|
|
|
@@ -2598,6 +2598,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return unitPropertyPrice;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
Date startDate = DateUtils.stringToDate("2024-08-01 00:00:00", DateUtils.DATE_TIME_PATTERN);
|
|
|
|
Date endDate = DateUtils.stringToDate("2024-09-11 23:59:59", DateUtils.DATE_TIME_PATTERN);
|
|
|
|
Date realEndStart = DateUtils.getDaySet(endDate, Calendar.SECOND, 1);
|
|
|
|
int[] diffs = DateUtils.getDiff(startDate, realEndStart);
|
|
|
|
Date preextraStartDay = DateUtils.getTimeAfterMonths(diffs[0], startDate);
|
|
|
|
int predays = DateUtils.daysBetween(preextraStartDay, endDate)+1;
|
|
|
|
System.out.println(diffs[0]+">>>>" +diffs[1]+ ">>>>"+predays);
|
|
|
|
}
|
|
|
|
|
|
|
|
private BigDecimal[] calcuteReveneuJump(BigDecimal sales,WxRentContract rentcontract,Date startDate,Date endDate,List<Date> freePeriods) {
|
|
|
|
BigDecimal revenueDecimal = new BigDecimal(0);
|
|
|
|
@@ -2621,8 +2630,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
if (null != jumpList && jumpList.size() > 0 ) {
|
|
|
|
//不是满时间段的,要按天来计算
|
|
|
|
if (!isFull) {
|
|
|
|
int[] diffs = DateUtils.getDiff(startDate, endDate);
|
|
|
|
if (diffs[0] <= 0 ) {
|
|
|
|
Date realEndStart = DateUtils.getDaySet(endDate, Calendar.SECOND, 1);
|
|
|
|
int[] diffs = DateUtils.getDiff(startDate, realEndStart);
|
|
|
|
if (diffs[0] <= 0 || (diffs[0] == 1 && diffs[1] <= 0 )) {
|
|
|
|
if (rentcontract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode()) {
|
|
|
|
sales = sales.multiply(new BigDecimal(validDates.size())).divide(new BigDecimal(30),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
|
|
|
|
}else {
|
|
|
|
@@ -2630,8 +2640,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
}
|
|
|
|
}else {
|
|
|
|
Date preextraStartDay = DateUtils.getTimeAfterMonths(diffs[0], startDate);
|
|
|
|
Date extraStartDayMonthEnd = DateUtils.getLastDayForMonth(preextraStartDay);
|
|
|
|
int predays = DateUtils.daysBetween(preextraStartDay, extraStartDayMonthEnd)+1;
|
|
|
|
int predays = DateUtils.daysBetween(preextraStartDay, endDate)+1;
|
|
|
|
if (rentcontract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode()) {
|
|
|
|
BigDecimal days = new BigDecimal(diffs[0]).multiply(new BigDecimal(30)).add(new BigDecimal(predays));
|
|
|
|
sales = sales.multiply(new BigDecimal(validDates.size())).divide(days,Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP);
|
|
|
|
@@ -3197,8 +3206,4 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return wxRentContractRevenueJumpMapper.findList(jump);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
Date date = DateUtils.stringToDate("2025-04-01 00:00:00",DateUtils.DATE_TIME_PATTERN);
|
|
|
|
System.out.println(date.getTime());
|
|
|
|
}
|
|
|
|
}
|