|
|
@ -138,6 +138,25 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp |
|
|
|
IPage<CarsSoldProfitVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
List<CarsSoldProfitVo> recordList = pagging.getRecords(); |
|
|
|
recordList.removeAll(Collections.singleton(null)); |
|
|
|
if(!recordList.isEmpty()){ |
|
|
|
for (int i = 0; i < recordList.size(); i++) { |
|
|
|
CarsSoldProfitVo carsSoldProfitVo = recordList.get(i); |
|
|
|
//预计毛利=出库价-成本+服务费+返利-中介费-调车费
|
|
|
|
BigDecimal expectedMaoriBig = BigDecimal.ZERO; |
|
|
|
String vinSid = carsSoldProfitVo.getVinSid(); |
|
|
|
CarsSoldProfitRebateAllVo carsSoldProfitRebateAllVo = rebates(vinSid).getData(); |
|
|
|
if(carsSoldProfitRebateAllVo != null){ |
|
|
|
String expectedRebateTotal = carsSoldProfitRebateAllVo.getExpectedRebateTotal(); |
|
|
|
carsSoldProfitVo.setRebatesTotal(expectedRebateTotal); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(carsSoldProfitVo.getExStockPrice())){ |
|
|
|
expectedMaoriBig = expectedMaoriBig.add(new BigDecimal(carsSoldProfitVo.getExStockPrice())); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<CarsSoldProfitVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
@ -158,20 +177,20 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp |
|
|
|
carsSoldProfitRebateDetailsVo.setRebateType(scmVehRebateCarsSoldProfitVo.getRebateTypeValue()); |
|
|
|
carsSoldProfitRebateDetailsVo.setYearAndMonth(scmVehRebateCarsSoldProfitVo.getPalceGenDate()); |
|
|
|
carsSoldProfitRebateDetailsVo.setRebateName(scmVehRebateCarsSoldProfitVo.getRebateName()); |
|
|
|
carsSoldProfitRebateDetailsVo.setExpectedRebate(scmVehRebateCarsSoldProfitVo.getExpectedRebate()); |
|
|
|
carsSoldProfitRebateDetailsVo.setExpectedRebate(scmVehRebateCarsSoldProfitVo.getEstimateRebate()); |
|
|
|
carsSoldProfitRebateDetailsVo.setRebatesAdjust(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney()); |
|
|
|
list.add(carsSoldProfitRebateDetailsVo); |
|
|
|
if (StringUtils.isNotBlank(carsSoldProfitRebateDetailsVo.getExpectedRebate())) { |
|
|
|
expectedRebateTotalAll.add(new BigDecimal(carsSoldProfitRebateDetailsVo.getExpectedRebate())); |
|
|
|
if (StringUtils.isNotBlank(scmVehRebateCarsSoldProfitVo.getEstimateRebate())) { |
|
|
|
expectedRebateTotalAll = expectedRebateTotalAll.add(new BigDecimal(scmVehRebateCarsSoldProfitVo.getEstimateRebate())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(carsSoldProfitRebateDetailsVo.getRebatesAdjust())) { |
|
|
|
adjustedRebateTotalAll.add(new BigDecimal(carsSoldProfitRebateDetailsVo.getRebatesAdjust())); |
|
|
|
if (StringUtils.isNotBlank(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney())) { |
|
|
|
adjustedRebateTotalAll = adjustedRebateTotalAll.add(new BigDecimal(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
carsSoldProfitRebateAllVo.setList(list); |
|
|
|
carsSoldProfitRebateAllVo.setAdjustedRebateTotal(adjustedRebateTotalAll.toString()); |
|
|
|
carsSoldProfitRebateAllVo.setExpectedRebateTotal(adjustedRebateTotalAll.toString()); |
|
|
|
carsSoldProfitRebateAllVo.setExpectedRebateTotal(expectedRebateTotalAll.toString()); |
|
|
|
return rb.success().setData(carsSoldProfitRebateAllVo); |
|
|
|
} |
|
|
|
} |
|
|
|