Browse Source

feat(all): 车次成本明细报表

1 修改报表逻辑
fix-sign
zhaoqiaobo 4 months ago
parent
commit
5fe88961a0
  1. 28
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java
  2. 66
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  3. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java

28
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java

@ -618,72 +618,72 @@ public class QualityDeliverEntity extends TenantEntity {
* 配送总成本
*/
@ApiModelProperty(value = "配送总成本")
private String totalDistributionCost;
private BigDecimal totalDistributionCost;
/**
* 配送成本
*/
@ApiModelProperty(value = "配送成本")
private String distributionCost;
private BigDecimal distributionCost;
/**
* 整车成本
*/
@ApiModelProperty(value = "整车成本")
private String wholeVehicleCost;
private BigDecimal wholeVehicleCost;
/**
* 分货费成本
*/
@ApiModelProperty(value = "分货费成本")
private String apartCost;
private BigDecimal apartCost;
/**
* 上楼费成本
*/
@ApiModelProperty(value = "上楼费成本")
private String apstairsCost;
private BigDecimal apstairsCost;
/**
* 平移费成本
*/
@ApiModelProperty(value = "平移费成本")
private String moveCost;
private BigDecimal moveCost;
/**
* 装卸费成本
*/
@ApiModelProperty(value = "装卸费成本")
private String stevedoreCost;
private BigDecimal stevedoreCost;
/**
* 公里数成本
*/
@ApiModelProperty(value = "公里数成本")
private String kiloAllowCost;
private BigDecimal kiloAllowCost;
/**
* 补贴公里数成本
*/
@ApiModelProperty(value = "补贴公里数成本")
private String allowKiloAllowCost;
private BigDecimal allowKiloAllowCost;
/**
* 超区公里数成本
*/
@ApiModelProperty(value = "超区公里数成本")
private String ultrAllpwCost;
private BigDecimal ultrAllpwCost;
/**
* 点位补贴成本
*/
@ApiModelProperty(value = "点位补贴成本")
private String pointAllowCost;
private BigDecimal pointAllowCost;
/**
* 保底费成本
*/
@ApiModelProperty(value = "保底费成本")
private String guarCost;
private BigDecimal guarCost;
/**
* 油费成本
*/
@ApiModelProperty(value = "油费成本")
private String fuelCost;
private BigDecimal fuelCost;
/**
* 其它成本
*/
@ApiModelProperty(value = "其它成本")
private String otherCost;
private BigDecimal otherCost;
/**
* 仓库成本
*/

66
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -167,7 +167,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
if (StrUtil.isNotEmpty(deliveryFee)) {
BigDecimal div = NumberUtil.div(new BigDecimal(deliveryFee), totalNum);
value2.setWholeVehicleCost(Convert.toStr(div));
value2.setWholeVehicleCost(div);
}
}
}
@ -190,7 +190,7 @@ public class DeliverFinishReportListener implements ReportService {
BigDecimal div = NumberUtil.div(new BigDecimal(wholeVehicleCost), totalNum);
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
value2.setWholeVehicleCost(Convert.toStr(div));
value2.setWholeVehicleCost(div);
}
}
} else {
@ -221,7 +221,7 @@ public class DeliverFinishReportListener implements ReportService {
if (NumberUtil.equals(unit, 1)) {
// 按件 成本就是单价
BigDecimal mul = NumberUtil.mul(entity.getSignNum(), new BigDecimal(cost));
entity1.setDistributionCost(Convert.toStr(mul));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
if (NumberUtil.equals(unit, 2)) {
@ -229,7 +229,7 @@ public class DeliverFinishReportListener implements ReportService {
BigDecimal volume = entity.getVolume();
if (ObjectUtil.isNotEmpty(volume)) {
BigDecimal mul = NumberUtil.mul(volume, new BigDecimal(cost));
entity1.setDistributionCost(Convert.toStr(mul));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
}
@ -238,7 +238,7 @@ public class DeliverFinishReportListener implements ReportService {
BigDecimal weight = entity.getWeight();
if (ObjectUtil.isNotEmpty(weight)) {
BigDecimal mul = NumberUtil.mul(weight, new BigDecimal(cost));
entity1.setDistributionCost(Convert.toStr(mul));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
}
@ -256,7 +256,7 @@ public class DeliverFinishReportListener implements ReportService {
BigDecimal divide = NumberUtil.div(new BigDecimal(minimumFee), totalNum);
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
value2.setGuarCost(Convert.toStr(divide));
value2.setGuarCost(divide);
}
}
}
@ -294,19 +294,19 @@ public class DeliverFinishReportListener implements ReportService {
// 上楼费成本 = 上楼费单价 * 上楼层数 * 签收件数
QualityDeliverEntity qualityDeliverEntity1 = valueMap.get(entity.getId());
if (ObjectUtil.isNotEmpty(stairsNumber) && StrUtil.isNotEmpty(stairsCharge)) {
qualityDeliverEntity1.setApstairsCost(Convert.toStr(NumberUtil.mul(stairsNumber, new BigDecimal(stairsCharge))));
qualityDeliverEntity1.setApstairsCost(NumberUtil.mul(stairsNumber, new BigDecimal(stairsCharge)));
}
// 分货费成本 = 分货费单价 * 签收件数
if (StrUtil.isNotEmpty(cargoSplittingFee)) {
qualityDeliverEntity1.setApartCost(Convert.toStr(NumberUtil.mul(signNum, new BigDecimal(cargoSplittingFee))));
qualityDeliverEntity1.setApartCost(NumberUtil.mul(signNum, new BigDecimal(cargoSplittingFee)));
}
// 平移费成本 = 平移费单价 * 签收件数
if (StrUtil.isNotEmpty(translationFee)) {
qualityDeliverEntity1.setMoveCost(Convert.toStr(NumberUtil.mul(signNum, new BigDecimal(translationFee))));
qualityDeliverEntity1.setMoveCost(NumberUtil.mul(signNum, new BigDecimal(translationFee)));
}
// 装卸费成本 = 装卸费单价 * 签收件数
if (StrUtil.isNotEmpty(loadingUnloadingFee)) {
qualityDeliverEntity1.setStevedoreCost(Convert.toStr(NumberUtil.mul(signNum, new BigDecimal(loadingUnloadingFee))));
qualityDeliverEntity1.setStevedoreCost(NumberUtil.mul(signNum, new BigDecimal(loadingUnloadingFee)));
}
}
}
@ -347,7 +347,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String kilometerCost = priceVO.getKilometerCost();
if (StrUtil.isNotEmpty(kilometerCost)) {
value2.setKiloAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(kilometerCost)), totalNum)));
value2.setKiloAllowCost(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(kilometerCost)), totalNum));
}
}
}
@ -379,7 +379,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String kilometerCost = priceVO.getKilometerCost();
if (StrUtil.isNotEmpty(kilometerCost)) {
value2.setKiloAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(kilometerCost)), totalNum)));
value2.setKiloAllowCost(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(kilometerCost)), totalNum));
}
}
}
@ -420,7 +420,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String kilometerCost = priceVO.getKilometerCost();
if (StrUtil.isNotEmpty(kilometerCost)) {
value2.setKiloAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(kilometerCost)), totalNum)));
value2.setKiloAllowCost(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(kilometerCost)), totalNum));
}
}
}
@ -465,7 +465,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String subsidyCost = priceVO.getSubsidyCost();
if (StrUtil.isNotEmpty(subsidyCost)) {
value2.setAllowKiloAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost)), totalNum)));
value2.setAllowKiloAllowCost(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost)), totalNum));
}
}
}
@ -503,7 +503,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String subsidyCost = priceVO.getSubsidyCost();
if (StrUtil.isNotEmpty(subsidyCost)) {
value2.setAllowKiloAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost)), totalNum)));
value2.setAllowKiloAllowCost(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost)), totalNum));
}
}
}
@ -550,7 +550,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String subsidyCost = priceVO.getSubsidyCost();
if (StrUtil.isNotEmpty(subsidyCost)) {
value2.setAllowKiloAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost)), totalNum)));
value2.setAllowKiloAllowCost(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost)), totalNum));
}
}
}
@ -589,7 +589,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String overZoneKilometerCost = priceVO.getOverZoneKilometerCost();
if (StrUtil.isNotEmpty(overZoneKilometer) && StrUtil.isNotEmpty(overZoneKilometerCost)) {
value2.setUltrAllpwCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometer)), new BigDecimal(overZoneKilometerCost)), totalNum)));
value2.setUltrAllpwCost(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometer)), new BigDecimal(overZoneKilometerCost)), totalNum));
}
}
}
@ -621,7 +621,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String overZoneKilometerCost = priceVO.getOverZoneKilometerCost();
if (StrUtil.isNotEmpty(overZoneKilometer) && StrUtil.isNotEmpty(overZoneKilometerCost)) {
value2.setUltrAllpwCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometer)), new BigDecimal(overZoneKilometerCost)), totalNum)));
value2.setUltrAllpwCost(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometer)), new BigDecimal(overZoneKilometerCost)), totalNum));
}
}
}
@ -654,7 +654,7 @@ public class DeliverFinishReportListener implements ReportService {
}
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
value2.setUltrAllpwCost(Convert.toStr(NumberUtil.div(total, totalNum)));
value2.setUltrAllpwCost(NumberUtil.div(total, totalNum));
}
}
}
@ -690,7 +690,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String overZoneKilometerCost = priceVO.getOverZoneKilometerCost();
if (StrUtil.isNotEmpty(overZoneKilometer) && StrUtil.isNotEmpty(overZoneKilometerCost)) {
value2.setUltrAllpwCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometer)), new BigDecimal(overZoneKilometerCost)), totalNum)));
value2.setUltrAllpwCost(NumberUtil.div(NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometer)), new BigDecimal(overZoneKilometerCost)), totalNum));
}
}
}
@ -735,7 +735,7 @@ public class DeliverFinishReportListener implements ReportService {
}
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
value2.setUltrAllpwCost(Convert.toStr(NumberUtil.div(total, totalNum)));
value2.setUltrAllpwCost(NumberUtil.div(total, totalNum));
}
}
}
@ -753,7 +753,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String siteSubsidyCost = priceVO.getSiteSubsidyCost();
if (StrUtil.isNotEmpty(siteSubsidyCost)) {
value2.setPointAllowCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(longs.size(), new BigDecimal(siteSubsidyCost)), totalNum)));
value2.setPointAllowCost(NumberUtil.div(NumberUtil.mul(longs.size(), new BigDecimal(siteSubsidyCost)), totalNum));
}
}
}
@ -793,7 +793,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String subsidyCost = priceVO.getSubsidyCost();
if (StrUtil.isNotEmpty(subsidyCost)) {
value2.setFuelCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(subsidyCost)), totalNum)));
value2.setFuelCost(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(subsidyCost)), totalNum));
}
}
}
@ -825,7 +825,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String subsidyCost = priceVO.getSubsidyCost();
if (StrUtil.isNotEmpty(subsidyCost)) {
value2.setFuelCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(subsidyCost)), totalNum)));
value2.setFuelCost(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(subsidyCost)), totalNum));
}
}
}
@ -866,7 +866,7 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity value2 = entityEntry.getValue();
String subsidyCost = priceVO.getSubsidyCost();
if (StrUtil.isNotEmpty(subsidyCost)) {
value2.setFuelCost(Convert.toStr(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(subsidyCost)), totalNum)));
value2.setFuelCost(NumberUtil.div(NumberUtil.mul(total, new BigDecimal(subsidyCost)), totalNum));
}
}
}
@ -879,6 +879,22 @@ public class DeliverFinishReportListener implements ReportService {
if (CollUtil.isNotEmpty(valueMap)) {
// 修改配送明细信息
for (Map.Entry<Long, QualityDeliverEntity> entityEntry : valueMap.entrySet()) {
QualityDeliverEntity value2 = entityEntry.getValue();
value2.setTotalDistributionCost(NumberUtil.add(
value2.getDistributionCost(),
value2.getWholeVehicleCost(),
value2.getApartCost(),
value2.getApstairsCost(),
value2.getMoveCost(),
value2.getStevedoreCost(),
value2.getKiloAllowCost(),
value2.getAllowKiloAllowCost(),
value2.getUltrAllpwCost(),
value2.getPointAllowCost(),
value2.getGuarCost(),
value2.getFuelCost(),
value2.getOtherCost()
));
sendReport(BizOperationEnums.MODIFY, entityEntry.getValue(), BizOperationEnums.MODIFY);
}
}

44
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java

@ -140,38 +140,38 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl<QualityDeliverMap
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getSignNum())) {
totalSignNumber = NumberUtil.add(totalSignNumber, qualityDeliverEntity.getSignNum());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getDistributionCost())) {
distributionCost = distributionCost.add(new BigDecimal(qualityDeliverEntity.getDistributionCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getDistributionCost())) {
distributionCost = distributionCost.add(qualityDeliverEntity.getDistributionCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getApartCost())) {
apartCost = apartCost.add(new BigDecimal(qualityDeliverEntity.getApartCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getApartCost())) {
apartCost = apartCost.add(qualityDeliverEntity.getApartCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getApstairsCost())) {
apstairsCost = apstairsCost.add(new BigDecimal(qualityDeliverEntity.getApstairsCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getApstairsCost())) {
apstairsCost = apstairsCost.add(qualityDeliverEntity.getApstairsCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getMoveCost())) {
moveCost = moveCost.add(new BigDecimal(qualityDeliverEntity.getMoveCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getMoveCost())) {
moveCost = moveCost.add(qualityDeliverEntity.getMoveCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getStevedoreCost())) {
stevedoreCost = stevedoreCost.add(new BigDecimal(qualityDeliverEntity.getStevedoreCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getStevedoreCost())) {
stevedoreCost = stevedoreCost.add(qualityDeliverEntity.getStevedoreCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getKiloAllowCost())) {
kiloAllowCost = kiloAllowCost.add(new BigDecimal(qualityDeliverEntity.getKiloAllowCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getKiloAllowCost())) {
kiloAllowCost = kiloAllowCost.add(qualityDeliverEntity.getKiloAllowCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getAllowKiloAllowCost())) {
allowKiloAllowCost = allowKiloAllowCost.add(new BigDecimal(qualityDeliverEntity.getAllowKiloAllowCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getAllowKiloAllowCost())) {
allowKiloAllowCost = allowKiloAllowCost.add(qualityDeliverEntity.getAllowKiloAllowCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getUltrAllpwCost())) {
ultrAllpwCost = ultrAllpwCost.add(new BigDecimal(qualityDeliverEntity.getUltrAllpwCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getUltrAllpwCost())) {
ultrAllpwCost = ultrAllpwCost.add(qualityDeliverEntity.getUltrAllpwCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getPointAllowCost())) {
pointAllowCost = pointAllowCost.add(new BigDecimal(qualityDeliverEntity.getPointAllowCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getPointAllowCost())) {
pointAllowCost = pointAllowCost.add(qualityDeliverEntity.getPointAllowCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getGuarCost())) {
guarCost = guarCost.add(new BigDecimal(qualityDeliverEntity.getGuarCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getGuarCost())) {
guarCost = guarCost.add(qualityDeliverEntity.getGuarCost());
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getFuelCost())) {
fuelCost = fuelCost.add(new BigDecimal(qualityDeliverEntity.getFuelCost()));
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getFuelCost())) {
fuelCost = fuelCost.add(qualityDeliverEntity.getFuelCost());
}
}
// 订单数

Loading…
Cancel
Save