winter 1 год назад
Родитель
Сommit
ade9c38e4d
2 измененных файлов: 9 добавлений и 4 удалений
  1. +7
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java

+ 7
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -2635,9 +2635,11 @@ public class WxRentContractServiceImpl implements WxRentContractService {
List<Date> yearList = this.getYearList(rentPriceArrs.length, 12, rentcontract.getRentalStartDate(),null);
int yearIndex = 0;
for( int i = 0 ; i < yearList.size() ; i ++) {
Date yearEndDate = yearList.get(i);
if (rentBill.getEndtime().before(yearEndDate) || rentBill.getEndtime().equals(yearEndDate)) {
yearIndex = i-1;
Date yearStartDate = yearList.get(i);
Date yearEndDate = DateUtils.getTimeAfterMonths(12, yearStartDate);
if (rentBill.getStarttime().equals(yearStartDate) ||
(rentBill.getStarttime().after(yearStartDate) && (rentBill.getEndtime().before(yearEndDate) || rentBill.getEndtime().equals(yearEndDate)) )) {
yearIndex = i;
break;
}
}
@@ -2653,6 +2655,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if (null != operationManagerPriceArrs) {
rentTotal = rentTotal.add(new BigDecimal(operationManagerPriceArrs[yearIndex]));
}
//此处需要物业合同合租金合同的计费周期一致,严谨的需要用到上面计算的propertyPrice
if (null != propertyContractArrs) {
rentTotal = rentTotal.add(new BigDecimal(propertyContractArrs[yearIndex]));
}
@@ -3084,7 +3087,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
yearIndex = 0;
}
StringBuffer sb = new StringBuffer("");
return handleBills(sb,rentcontract,null,owe,null,rentcontract.getYearsEnd(),rentcontract.getYearsEnd(),EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN,null,rentPriceArrs,bussinessManagerPriceArrs,operationManagerPriceArrs,propertyContractArrs,yearIndex);
return handleBills(sb,rentcontract,null,owe,null,rentcontract.getYearsBegin(),rentcontract.getYearsEnd(),EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN,null,rentPriceArrs,bussinessManagerPriceArrs,operationManagerPriceArrs,propertyContractArrs,yearIndex);
}


+ 2
- 0
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Просмотреть файл

@@ -467,6 +467,7 @@ public class DateUtils {
public static Date getTimeAfterDays(int days, Date myDate) {
Calendar now = Calendar.getInstance();
now.setTime(myDate);
now.set(Calendar.MILLISECOND, 0);
now.set(Calendar.DATE, now.get(Calendar.DATE) + days);
return now.getTime();
}
@@ -481,6 +482,7 @@ public class DateUtils {
public static Date getTimeAfterMonths(int months, Date myDate) {
Calendar now = Calendar.getInstance();
now.setTime(myDate);
now.set(Calendar.MILLISECOND, 0);
now.set(Calendar.MONTH, now.get(Calendar.MONTH) + months);
return now.getTime();
}


Загрузка…
Отмена
Сохранить