|
|
|
@@ -622,18 +622,23 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { |
|
|
|
BigDecimal priceD = new BigDecimal(price); |
|
|
|
for (int i = 1; i < size; i++) { |
|
|
|
priceD = priceD.add(priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(100))); |
|
|
|
priceArr[i] = priceD.setScale(wxPropertyContract.getDecimalSize(), RoundingMode.HALF_EVEN).toPlainString(); |
|
|
|
priceD = priceD.add(priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000))); |
|
|
|
priceArr[i] = priceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_EVEN).toPlainString(); |
|
|
|
} |
|
|
|
} else if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) { |
|
|
|
BigDecimal priceD = new BigDecimal(price); |
|
|
|
for (int i = 1; i < size; i++) { |
|
|
|
priceD = priceD.add(new BigDecimal(integers.get(i))); |
|
|
|
priceArr[i] = priceD.setScale(wxPropertyContract.getDecimalSize(), RoundingMode.HALF_EVEN).toPlainString(); |
|
|
|
priceD = priceD.add(new BigDecimal(integers.get(i)).divide(new BigDecimal(100))); |
|
|
|
priceArr[i] = priceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_EVEN).toPlainString(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (int i = 1; i < size; i++) { |
|
|
|
priceArr[i] = new BigDecimal(integers.get(i)).setScale(wxPropertyContract.getDecimalSize(), RoundingMode.HALF_EVEN).toPlainString(); |
|
|
|
}else if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ |
|
|
|
for (int i = 1; i < size; i++) { |
|
|
|
priceArr[i] = new BigDecimal(integers.get(i)).divide(new BigDecimal(100)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); |
|
|
|
} |
|
|
|
}else if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ |
|
|
|
BigDecimal priceD = new BigDecimal(price); |
|
|
|
for (int i = 1; i < size; i++) { |
|
|
|
priceArr[i] = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(100)).toPlainString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -921,47 +926,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); |
|
|
|
return needpay; |
|
|
|
} |
|
|
|
|
|
|
|
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); |
|
|
|
SimpleDateFormat sdD = new SimpleDateFormat("d"); |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); |
|
|
|
|
|
|
|
if(i == billTimeVoListSize - 1){//最后 |
|
|
|
if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getEndDate())) ){ |
|
|
|
int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); |
|
|
|
months++; |
|
|
|
needpay = new BigDecimal(months).multiply(priceD).toPlainString(); |
|
|
|
}else { |
|
|
|
needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); |
|
|
|
} |
|
|
|
}else if(i == 0){//第一期 |
|
|
|
if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ |
|
|
|
if(isFirstDay(startDate)){ |
|
|
|
int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); |
|
|
|
months++; |
|
|
|
needpay = new BigDecimal(months).multiply(priceD).toPlainString(); |
|
|
|
}else{ |
|
|
|
needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(isFirstDay(startDate)){ |
|
|
|
int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); |
|
|
|
if(isFirstDay(startDate)){ |
|
|
|
months++; |
|
|
|
} |
|
|
|
needpay = new BigDecimal(months).multiply(priceD).toPlainString(); |
|
|
|
}else{ |
|
|
|
needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); |
|
|
|
} |
|
|
|
} |
|
|
|
}else{//中间 |
|
|
|
int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); |
|
|
|
if(isFirstDay(startDate)){ |
|
|
|
months++; |
|
|
|
} |
|
|
|
needpay = new BigDecimal(months).multiply(priceD).toPlainString(); |
|
|
|
} |
|
|
|
needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); |
|
|
|
} |
|
|
|
return needpay; |
|
|
|
} |
|
|
|
|