Browse Source

修改车辆利润

master
dimengzhe 3 weeks ago
parent
commit
35da3b6821
  1. 4
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java
  2. 2
      anrui-reportcenter/anrui-reportcenter-api/src/main/java/com/yxt/anrui/reportcenter/api/carsSoldProfit/CarsSoldProfitRebateAllVo.java
  3. 1
      anrui-reportcenter/anrui-reportcenter-biz/src/main/java/com/yxt/anrui/reportcenter/biz/carsSoldProfit/CarsSoldProfitMapper.xml
  4. 35
      anrui-reportcenter/anrui-reportcenter-biz/src/main/java/com/yxt/anrui/reportcenter/biz/carsSoldProfit/CarsSoldProfitService.java
  5. 3
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebate/ScmVehRebateCarsSoldProfitVo.java
  6. 3
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebate/ScmVehRebateMapper.xml

4
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

@ -1454,9 +1454,9 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
carsSoldProfitDto.setLocationSid(baseVehicle.getLocation()); carsSoldProfitDto.setLocationSid(baseVehicle.getLocation());
carsSoldProfitDto.setLocationName(baseVehicle.getLocationName()); carsSoldProfitDto.setLocationName(baseVehicle.getLocationName());
//厂家结算价 //厂家结算价
if(baseVehicle.getSettlePrice() != null){ /* if(baseVehicle.getSettlePrice() != null){
carsSoldProfitDto.setMakersSettlementPrice(baseVehicle.getSettlePrice().toString()); carsSoldProfitDto.setMakersSettlementPrice(baseVehicle.getSettlePrice().toString());
} }*/
//排产订单编号 //排产订单编号
carsSoldProfitDto.setSchedulingId(baseVehicle.getOrderingNo()); carsSoldProfitDto.setSchedulingId(baseVehicle.getOrderingNo());
//数据日期 //数据日期

2
anrui-reportcenter/anrui-reportcenter-api/src/main/java/com/yxt/anrui/reportcenter/api/carsSoldProfit/CarsSoldProfitRebateAllVo.java

@ -20,4 +20,6 @@ public class CarsSoldProfitRebateAllVo implements Vo {
private String expectedRebateTotal; private String expectedRebateTotal;
@ApiModelProperty("调整返利合计") @ApiModelProperty("调整返利合计")
private String adjustedRebateTotal; private String adjustedRebateTotal;
@ApiModelProperty("厂家结算价")
private String makersSettlementPrice;
} }

1
anrui-reportcenter/anrui-reportcenter-biz/src/main/java/com/yxt/anrui/reportcenter/biz/carsSoldProfit/CarsSoldProfitMapper.xml

@ -19,7 +19,6 @@
cp.expectedMaori, cp.expectedMaori,
cp.rebatesAdjust, cp.rebatesAdjust,
cp.adjustedMaori, cp.adjustedMaori,
cp.makersSettlementPrice,
cp.rebatesTotal, cp.rebatesTotal,
cp.carCost, cp.carCost,
cp.financeServiceCharge, cp.financeServiceCharge,

35
anrui-reportcenter/anrui-reportcenter-biz/src/main/java/com/yxt/anrui/reportcenter/biz/carsSoldProfit/CarsSoldProfitService.java

@ -143,14 +143,46 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp
CarsSoldProfitVo carsSoldProfitVo = recordList.get(i); CarsSoldProfitVo carsSoldProfitVo = recordList.get(i);
//预计毛利=出库价-成本+服务费+返利-中介费-调车费 //预计毛利=出库价-成本+服务费+返利-中介费-调车费
BigDecimal expectedMaoriBig = BigDecimal.ZERO; BigDecimal expectedMaoriBig = BigDecimal.ZERO;
//车辆成本 = 厂家结算价-返利
BigDecimal carCostBig = BigDecimal.ZERO;
BigDecimal adjustedMaoriBig = BigDecimal.ZERO;
String vinSid = carsSoldProfitVo.getVinSid(); String vinSid = carsSoldProfitVo.getVinSid();
CarsSoldProfitRebateAllVo carsSoldProfitRebateAllVo = rebates(vinSid).getData(); CarsSoldProfitRebateAllVo carsSoldProfitRebateAllVo = rebates(vinSid).getData();
if(carsSoldProfitRebateAllVo != null){ if(carsSoldProfitRebateAllVo != null){
String expectedRebateTotal = carsSoldProfitRebateAllVo.getExpectedRebateTotal(); String expectedRebateTotal = carsSoldProfitRebateAllVo.getExpectedRebateTotal();
carsSoldProfitVo.setRebatesTotal(expectedRebateTotal); carsSoldProfitVo.setRebatesTotal(expectedRebateTotal);
carsSoldProfitVo.setMakersSettlementPrice(carsSoldProfitRebateAllVo.getMakersSettlementPrice());
carsSoldProfitVo.setRebatesAdjust(carsSoldProfitRebateAllVo.getAdjustedRebateTotal());
} }
if(StringUtils.isNotBlank(carsSoldProfitVo.getExStockPrice())){ if(StringUtils.isNotBlank(carsSoldProfitVo.getExStockPrice())){
expectedMaoriBig = expectedMaoriBig.add(new BigDecimal(carsSoldProfitVo.getExStockPrice())); expectedMaoriBig = expectedMaoriBig.add(new BigDecimal(carsSoldProfitVo.getExStockPrice()));
}
//厂家结算价
if(StringUtils.isNotBlank(carsSoldProfitVo.getMakersSettlementPrice())){
carCostBig = carCostBig.add(new BigDecimal(carsSoldProfitVo.getMakersSettlementPrice()));
}
if(StringUtils.isNotBlank(carsSoldProfitVo.getRebatesTotal())){
carCostBig = carCostBig.subtract(new BigDecimal(carsSoldProfitVo.getRebatesTotal()));
carsSoldProfitVo.setCarCost(carCostBig.toString());
expectedMaoriBig = expectedMaoriBig.add(new BigDecimal(carsSoldProfitVo.getRebatesTotal()));
}
if(StringUtils.isNotBlank(carsSoldProfitVo.getCarCost())){
expectedMaoriBig = expectedMaoriBig.subtract(carCostBig);
}
if(StringUtils.isNotBlank(carsSoldProfitVo.getFinanceServiceCharge())){
expectedMaoriBig = expectedMaoriBig.add(new BigDecimal(carsSoldProfitVo.getFinanceServiceCharge()));
}
if(StringUtils.isNotBlank(carsSoldProfitVo.getMediatorRebatePrice())){
expectedMaoriBig = expectedMaoriBig.subtract(new BigDecimal(carsSoldProfitVo.getMediatorRebatePrice()));
}
if(StringUtils.isNotBlank(carsSoldProfitVo.getMoveCarPrice())){
expectedMaoriBig = expectedMaoriBig.subtract(new BigDecimal(carsSoldProfitVo.getMoveCarPrice()));
}
carsSoldProfitVo.setExpectedMaori(expectedMaoriBig.toString());
carsSoldProfitVo.setAdjustedMaori(expectedMaoriBig.subtract(new BigDecimal(carsSoldProfitVo.getRebatesAdjust())).toString());
if(StringUtils.isBlank(carsSoldProfitVo.getMakersSettlementPrice())){
carsSoldProfitVo.setMakersSettlementPrice("-");
} }
@ -168,6 +200,7 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp
String vinSid = sid; String vinSid = sid;
BigDecimal expectedRebateTotalAll = BigDecimal.ZERO; BigDecimal expectedRebateTotalAll = BigDecimal.ZERO;
BigDecimal adjustedRebateTotalAll = BigDecimal.ZERO; BigDecimal adjustedRebateTotalAll = BigDecimal.ZERO;
String makersSettlementPrice = "";
List<ScmVehRebateCarsSoldProfitVo> scmList = scmVehRebateFeign.getDetailByVinSid(vinSid).getData(); List<ScmVehRebateCarsSoldProfitVo> scmList = scmVehRebateFeign.getDetailByVinSid(vinSid).getData();
if (!scmList.isEmpty()) { if (!scmList.isEmpty()) {
for (int i = 0; i < scmList.size(); i++) { for (int i = 0; i < scmList.size(); i++) {
@ -186,9 +219,11 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp
if (StringUtils.isNotBlank(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney())) { if (StringUtils.isNotBlank(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney())) {
adjustedRebateTotalAll = adjustedRebateTotalAll.add(new BigDecimal(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney())); adjustedRebateTotalAll = adjustedRebateTotalAll.add(new BigDecimal(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney()));
} }
makersSettlementPrice = scmVehRebateCarsSoldProfitVo.getManufactorSettlementPrice();
} }
} }
carsSoldProfitRebateAllVo.setList(list); carsSoldProfitRebateAllVo.setList(list);
carsSoldProfitRebateAllVo.setMakersSettlementPrice(makersSettlementPrice);
carsSoldProfitRebateAllVo.setAdjustedRebateTotal(adjustedRebateTotalAll.toString()); carsSoldProfitRebateAllVo.setAdjustedRebateTotal(adjustedRebateTotalAll.toString());
carsSoldProfitRebateAllVo.setExpectedRebateTotal(expectedRebateTotalAll.toString()); carsSoldProfitRebateAllVo.setExpectedRebateTotal(expectedRebateTotalAll.toString());
return rb.success().setData(carsSoldProfitRebateAllVo); return rb.success().setData(carsSoldProfitRebateAllVo);

3
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehrebate/ScmVehRebateCarsSoldProfitVo.java

@ -30,4 +30,7 @@ public class ScmVehRebateCarsSoldProfitVo implements Vo {
@ApiModelProperty("返利调整") @ApiModelProperty("返利调整")
private String adjustmentMoney; private String adjustmentMoney;
@ApiModelProperty("厂家结算价")
private String manufactorSettlementPrice;
} }

3
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebate/ScmVehRebateMapper.xml

@ -424,7 +424,8 @@
r.estimateRebate, r.estimateRebate,
r.expectTreatCost, r.expectTreatCost,
r.expectSuppCost, r.expectSuppCost,
r.adjustmentMoney r.adjustmentMoney,
r.manufactorSettlementPrice
FROM FROM
scm_veh_rebate r scm_veh_rebate r
WHERE r.vehSid = #{vinSid} WHERE r.vehSid = #{vinSid}

Loading…
Cancel
Save