|
|
@ -670,8 +670,22 @@ public class ScmVehRebateService extends MybatisBaseService<ScmVehRebateMapper, |
|
|
|
BigDecimal rule = new BigDecimal(info.getCalculationStandard()); |
|
|
|
if (calculationModeValue.equals("比例")) { |
|
|
|
scmVehRebate.setCalculationModeKey("001"); |
|
|
|
BigDecimal costPrice = new BigDecimal(baseVehicleRebateVo.getCostPrice()); |
|
|
|
BigDecimal m = rule.multiply(costPrice).divide(new BigDecimal("100")); |
|
|
|
BigDecimal costPrice = new BigDecimal(baseVehicleRebateVo.getCostPrice());// 入库价
|
|
|
|
BigDecimal freight = BigDecimal.ZERO; //运费
|
|
|
|
BigDecimal topAmount = BigDecimal.ZERO; //上装金额
|
|
|
|
BigDecimal money = BigDecimal.ZERO; //基数
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleRebateVo.getFreight())) { |
|
|
|
freight = new BigDecimal(baseVehicleRebateVo.getFreight()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(baseVehicleRebateVo.getTopAmount())) { |
|
|
|
topAmount = new BigDecimal(baseVehicleRebateVo.getTopAmount()); |
|
|
|
} |
|
|
|
if (topAmount.compareTo(BigDecimal.ZERO) > 0 && baseVehicleRebateVo.getBrandName().contains("陕汽")) { |
|
|
|
money = costPrice.subtract(freight).subtract(topAmount); |
|
|
|
} else { |
|
|
|
money = costPrice.subtract(freight); |
|
|
|
} |
|
|
|
BigDecimal m = rule.multiply(money).divide(new BigDecimal("100")); |
|
|
|
scmVehRebate.setEstimateRebate(m.toString()); |
|
|
|
} else { |
|
|
|
scmVehRebate.setCalculationModeKey("002"); |
|
|
|