From 5fe88961a0019cba4d502425a38687e03137b435 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 18 Dec 2024 15:05:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E8=BD=A6=E6=AC=A1=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E6=98=8E=E7=BB=86=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改报表逻辑 --- .../entity/QualityDeliverEntity.java | 28 ++++---- .../report/DeliverFinishReportListener.java | 66 ++++++++++++------- .../impl/QualityDeliverServiceImpl.java | 44 ++++++------- 3 files changed, 77 insertions(+), 61 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java index 9d92c0c22..55f75c767 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java +++ b/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; /** * 仓库成本 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java index 8a1b7f056..23b41e416 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java +++ b/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 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 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 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 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 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); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java index afc944049..c809ca2a3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java @@ -140,38 +140,38 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl