Browse Source

修改车辆利润

zhanglei
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.setLocationName(baseVehicle.getLocationName());
//厂家结算价
if(baseVehicle.getSettlePrice() != null){
/* if(baseVehicle.getSettlePrice() != null){
carsSoldProfitDto.setMakersSettlementPrice(baseVehicle.getSettlePrice().toString());
}
}*/
//排产订单编号
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;
@ApiModelProperty("调整返利合计")
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.rebatesAdjust,
cp.adjustedMaori,
cp.makersSettlementPrice,
cp.rebatesTotal,
cp.carCost,
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);
//预计毛利=出库价-成本+服务费+返利-中介费-调车费
BigDecimal expectedMaoriBig = BigDecimal.ZERO;
//车辆成本 = 厂家结算价-返利
BigDecimal carCostBig = BigDecimal.ZERO;
BigDecimal adjustedMaoriBig = BigDecimal.ZERO;
String vinSid = carsSoldProfitVo.getVinSid();
CarsSoldProfitRebateAllVo carsSoldProfitRebateAllVo = rebates(vinSid).getData();
if(carsSoldProfitRebateAllVo != null){
String expectedRebateTotal = carsSoldProfitRebateAllVo.getExpectedRebateTotal();
carsSoldProfitVo.setRebatesTotal(expectedRebateTotal);
carsSoldProfitVo.setMakersSettlementPrice(carsSoldProfitRebateAllVo.getMakersSettlementPrice());
carsSoldProfitVo.setRebatesAdjust(carsSoldProfitRebateAllVo.getAdjustedRebateTotal());
}
if(StringUtils.isNotBlank(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;
BigDecimal expectedRebateTotalAll = BigDecimal.ZERO;
BigDecimal adjustedRebateTotalAll = BigDecimal.ZERO;
String makersSettlementPrice = "";
List<ScmVehRebateCarsSoldProfitVo> scmList = scmVehRebateFeign.getDetailByVinSid(vinSid).getData();
if (!scmList.isEmpty()) {
for (int i = 0; i < scmList.size(); i++) {
@ -186,9 +219,11 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp
if (StringUtils.isNotBlank(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney())) {
adjustedRebateTotalAll = adjustedRebateTotalAll.add(new BigDecimal(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney()));
}
makersSettlementPrice = scmVehRebateCarsSoldProfitVo.getManufactorSettlementPrice();
}
}
carsSoldProfitRebateAllVo.setList(list);
carsSoldProfitRebateAllVo.setMakersSettlementPrice(makersSettlementPrice);
carsSoldProfitRebateAllVo.setAdjustedRebateTotal(adjustedRebateTotalAll.toString());
carsSoldProfitRebateAllVo.setExpectedRebateTotal(expectedRebateTotalAll.toString());
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("返利调整")
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.expectTreatCost,
r.expectSuppCost,
r.adjustmentMoney
r.adjustmentMoney,
r.manufactorSettlementPrice
FROM
scm_veh_rebate r
WHERE r.vehSid = #{vinSid}

Loading…
Cancel
Save