winter пре 1 година
родитељ
комит
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); List<Date> yearList = this.getYearList(rentPriceArrs.length, 12, rentcontract.getRentalStartDate(),null);
int yearIndex = 0; int yearIndex = 0;
for( int i = 0 ; i < yearList.size() ; i ++) { 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; break;
} }
} }
@@ -2653,6 +2655,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if (null != operationManagerPriceArrs) { if (null != operationManagerPriceArrs) {
rentTotal = rentTotal.add(new BigDecimal(operationManagerPriceArrs[yearIndex])); rentTotal = rentTotal.add(new BigDecimal(operationManagerPriceArrs[yearIndex]));
} }
//此处需要物业合同合租金合同的计费周期一致,严谨的需要用到上面计算的propertyPrice
if (null != propertyContractArrs) { if (null != propertyContractArrs) {
rentTotal = rentTotal.add(new BigDecimal(propertyContractArrs[yearIndex])); rentTotal = rentTotal.add(new BigDecimal(propertyContractArrs[yearIndex]));
} }
@@ -3084,7 +3087,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
yearIndex = 0; yearIndex = 0;
} }
StringBuffer sb = new StringBuffer(""); 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) { public static Date getTimeAfterDays(int days, Date myDate) {
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
now.setTime(myDate); now.setTime(myDate);
now.set(Calendar.MILLISECOND, 0);
now.set(Calendar.DATE, now.get(Calendar.DATE) + days); now.set(Calendar.DATE, now.get(Calendar.DATE) + days);
return now.getTime(); return now.getTime();
} }
@@ -481,6 +482,7 @@ public class DateUtils {
public static Date getTimeAfterMonths(int months, Date myDate) { public static Date getTimeAfterMonths(int months, Date myDate) {
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
now.setTime(myDate); now.setTime(myDate);
now.set(Calendar.MILLISECOND, 0);
now.set(Calendar.MONTH, now.get(Calendar.MONTH) + months); now.set(Calendar.MONTH, now.get(Calendar.MONTH) + months);
return now.getTime(); return now.getTime();
} }


Loading…
Откажи
Сачувај