| @@ -254,17 +254,15 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| * @param revenueLong | |||
| * @return | |||
| */ | |||
| public static Long countPrice(Integer ratio,Long revenueLong,int timeType,int period){ | |||
| public static Long countPrice(Integer ratio,Long revenueLong,int timeType,int period,int from){ | |||
| BigDecimal hundred = new BigDecimal(100); | |||
| BigDecimal revenue = new BigDecimal(revenueLong == null ? 0 : revenueLong).divide(hundred); | |||
| BigDecimal payRatio = new BigDecimal(ratio == null ? 0 : ratio).divide(new BigDecimal(10000)); | |||
| BigDecimal price; | |||
| if(EnumMissTimeType.YEAR.getCode().equals(timeType)){ | |||
| if(EnumMissTimeType.YEAR.getCode().equals(timeType) && EnumGetRatioFrom.RENT.getCode().equals(from)){ | |||
| price = revenue.multiply(new BigDecimal(12)).multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN);;; | |||
| }else if(EnumMissTimeType.PERIOD.getCode().equals(timeType)){ | |||
| }else if(EnumMissTimeType.PERIOD.getCode().equals(timeType) && EnumGetRatioFrom.RENT.getCode().equals(from)){ | |||
| price = revenue.multiply(new BigDecimal(period)).multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN);; | |||
| }else if(EnumMissTimeType.MONTH.getCode().equals(timeType)){ | |||
| price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | |||
| }else{ | |||
| price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | |||
| } | |||
| @@ -315,7 +313,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| if (revenue.compareTo(start) >= 0 && revenue.compareTo(end)<= 0){ | |||
| ratioVo.setRatio(ratio); | |||
| ratioVo.setPrice(countPrice(ratioVo.getRatio(),revenueLong,timeType,period)); | |||
| ratioVo.setPrice(countPrice(ratioVo.getRatio(),revenueLong,timeType,period,from)); | |||
| break; | |||
| } | |||
| }else if(e.indexOf(">") >= 0){ | |||
| @@ -401,7 +399,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| record.setPrice(0l); | |||
| }else{ | |||
| if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ | |||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue(),EnumMissTimeType.OTHER.getCode(),record.getAdjustPeriod())); | |||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue(),EnumMissTimeType.OTHER.getCode(),record.getAdjustPeriod(),EnumGetRatioFrom.RENT.getCode())); | |||
| }else{ | |||
| int dayCount = record.getReceivePeriod() * 30; | |||
| RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); | |||
| @@ -634,7 +632,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| if(!EnumFromType.SWITCH.getCode().equals(from)){ | |||
| if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ | |||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue(),EnumMissTimeType.OTHER.getCode(),record.getAdjustPeriod())); | |||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue(),EnumMissTimeType.OTHER.getCode(),record.getAdjustPeriod(),from)); | |||
| }else{ | |||
| int dayCount = record.getReceivePeriod() * 30; | |||
| RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); | |||