diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java index a7b9b7ece..146fb6315 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java @@ -322,6 +322,11 @@ public abstract class FanoutConstants { interface QUEUE { String REPORT = "fanout.distribution.DeliveryAndrecheck.report" + ModuleNameConstant.DEVAUTH; + + String waybillStatusLog = "fanout.distribution.DeliveryAndrecheck.waybill.log" + ModuleNameConstant.DEVAUTH; + + + } } @@ -396,6 +401,11 @@ public abstract class FanoutConstants { interface QUEUE { String REPORT = "fanout.BillSignReview.billsignreview.report" + ModuleNameConstant.DEVAUTH; + //增加运单状态的变更日志 + String waybillStatusLog = "fanout.BillSignReview.waybill.log" + ModuleNameConstant.DEVAUTH; + + + } } diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java b/blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java index 7cc0d3e6c..05279fef0 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java +++ b/blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java @@ -3,6 +3,7 @@ package org.springblade.common.model; import lombok.Data; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -40,6 +41,13 @@ public class DistributionSignforVO implements Serializable { * 签收车次 */ private String trainNumber; + + + /** + * 配送时间 + */ + private Date deliveryTime; + /** * 预约单ID */ diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java b/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java index 94c7e7e18..87ec1bf1e 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java +++ b/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java @@ -8,6 +8,7 @@ import org.springblade.common.enums.PackageTypeEnums; import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 提送数据 @@ -138,4 +139,14 @@ public class PackageData implements Serializable { */ private String systemType ; + /** + * 签收时间 + */ + private Date signTime; + + /** + * 签收人 + */ + private String signUser;//签收人 + } diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/workNode/PickUpByScanVO.java b/blade-biz-common/src/main/java/org/springblade/common/model/workNode/PickUpByScanVO.java index 00dd9dff6..60dcfc791 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/model/workNode/PickUpByScanVO.java +++ b/blade-biz-common/src/main/java/org/springblade/common/model/workNode/PickUpByScanVO.java @@ -3,6 +3,7 @@ package org.springblade.common.model.workNode; import lombok.Data; import org.springblade.common.model.PackageData; +import java.util.Date; import java.util.List; @Data @@ -12,6 +13,28 @@ public class PickUpByScanVO { * 自提单号 */ private String pickupBatch; +// +// /** +// * 车次号 +// */ +// private String trainNumber; + + /** + * 车牌号 + */ + private String carNumber; + + /** + * 司机名称 + */ + private String driverName; + + /** + * 配送时间 + */ + private Date deliveryTime; + + /** * 自提明细数据 diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java index d6acbf812..c5ffae5bb 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java @@ -152,6 +152,9 @@ public interface IBasicdataWarehouseClient { @GetMapping(API_PREFIX + "/findAllList") List findAllList(); + @GetMapping(API_PREFIX + "/findAllListBusinessLine") + List findAllListBusinessLine(); + @GetMapping(API_PREFIX + "/findWarehousesByIds") List findWarehousesByIds(@RequestParam("ids") List ids); diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClientFallback.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClientFallback.java index 98d418d2a..5cd43ff85 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClientFallback.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClientFallback.java @@ -120,6 +120,12 @@ public class IBasicdataWarehouseClientFallback implements IBasicdataWarehouseCli throw feignException; } + @Override + public List findAllListBusinessLine() { + log.error("调用logpm-basicdata-api接口失败:findAllListBusinessLine "); + throw feignException; + } + @Override public List findWarehousesByIds(List ids) { log.error("调用logpm-basicdata-api接口失败:findWarehousesByIds {} ", ids); 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 ddf366d28..dc34835c6 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 @@ -660,19 +660,9 @@ public class QualityDeliverEntity extends TenantEntity { @ApiModelProperty(value = "其它成本") private String otherCost; /** - * 仓库租用成本 + * 仓库成本 */ - @ApiModelProperty(value = "仓库租用成本") - private String warehouseRentalCost; - /** - * 仓库临时周转成本 - */ - @ApiModelProperty(value = "仓库临时周转成本") - private String warehouseTurnoverCost; - /** - * 仓库干仓配成本 - */ - @ApiModelProperty(value = "仓库干仓配成本") - private String warehouseDeliveryCost; + @ApiModelProperty(value = "仓库成本") + private BigDecimal warehouseCost; } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java index 6910d9060..606f3c382 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java @@ -20,9 +20,13 @@ import com.logpm.distribution.entity.QualityDeliverEntity; import org.springblade.common.constant.ModuleNameConstant; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; +import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * 配送统计明细表feign @@ -46,4 +50,7 @@ public interface IQualityDeliverClient { @GetMapping(API_PREFIX + "/findSignListByDate") List findSignListByDate(@RequestParam("signTime") String signTime); + @PostMapping(API_PREFIX + "/updateWarehouseCost") + void updateWarehouseCost(@RequestBody Map packageCostMap); + } diff --git a/blade-service-api/logpm-statisticsdata-api/pom.xml b/blade-service-api/logpm-statisticsdata-api/pom.xml index 521bfdf0c..674ec49da 100644 --- a/blade-service-api/logpm-statisticsdata-api/pom.xml +++ b/blade-service-api/logpm-statisticsdata-api/pom.xml @@ -14,5 +14,12 @@ logpm-statisticsdata-api 3.2.0.RELEASE + + + org.springblade + blade-starter-excel + + + diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ExpenseOrderWarehouseTotalDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ExpenseWarehouseOrderDTO.java similarity index 87% rename from blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ExpenseOrderWarehouseTotalDTO.java rename to blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ExpenseWarehouseOrderDTO.java index 9f7e9ea32..5e33e619c 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ExpenseOrderWarehouseTotalDTO.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ExpenseWarehouseOrderDTO.java @@ -16,7 +16,7 @@ */ package com.logpm.statistics.dto; -import com.logpm.statistics.entity.ExpenseOrderWarehouseTotalEntity; +import com.logpm.statistics.entity.ExpenseWarehouseOrderEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -28,7 +28,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper = true) -public class ExpenseOrderWarehouseTotalDTO extends ExpenseOrderWarehouseTotalEntity { +public class ExpenseWarehouseOrderDTO extends ExpenseWarehouseOrderEntity { private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java index 70a0a2e50..47eb56a67 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java @@ -24,7 +24,12 @@ public class MerchantStatisticsDTO implements Serializable { private Integer confirmStatisticsOrder;//对账状态 0 1 private List reconciliationOrderIds; + private List orderInfoIds; + /** + * 运单ID集合 + */ + private List waybillIds; private Long balanceOrderInfoId; diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseOrderWarehouseTotalEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseOrderWarehouseTotalEntity.java deleted file mode 100644 index 3b52d2ad5..000000000 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseOrderWarehouseTotalEntity.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.logpm.statistics.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.tenant.mp.TenantEntity; - -/** - * 订单总仓储成本明细 - * - * @author zqb - * @create 2024-07-17 11:32:30 - */ -@Data -@TableName("logpm_expense_order_warehouse_total") -@ApiModel(value = "ExpenseOrderWarehouseTotal对象", description = "订单总仓储成本明细") -@EqualsAndHashCode(callSuper = true) -public class ExpenseOrderWarehouseTotalEntity extends TenantEntity { - private static final long serialVersionUID = 1L; - /** - * 目的仓 - */ - @ApiModelProperty(value = "目的仓") - private String warehouseName; - /** - * 订单编号 - */ - @ApiModelProperty(value = "订单编号") - private String orderCode; - /** - * 运单编号 - */ - @ApiModelProperty(value = "运单编号") - private String shipmentNumber; - /** - * 收货单位 - */ - @ApiModelProperty(value = "收货单位") - private String receivingUnit; - /** - * 发货单位 - */ - @ApiModelProperty(value = "发货单位") - private String shippingUnit; - /** - * 运单类型 - */ - @ApiModelProperty(value = "运单类型") - private String shipmenttype; - /** - * 服务类型 - */ - @ApiModelProperty(value = "服务类型") - private String servicetype; - /** - * 总件数 - */ - @ApiModelProperty(value = "总件数") - private String totalQuantity; - /** - * 发站仓 - */ - @ApiModelProperty(value = "发站仓") - private String originWarehouse; - /** - * 代入库仓件数 - */ - @ApiModelProperty(value = "代入库仓件数") - private String consignmentInQuantity; - /** - * 代入库总成本 - */ - @ApiModelProperty(value = "代入库总成本") - private String consignmentInTotalCost; - /** - * 代出库仓件数 - */ - @ApiModelProperty(value = "代出库仓件数") - private String consignmentOutQuantity; - /** - * 代出库成本 - */ - @ApiModelProperty(value = "代出库成本") - private String consignmentOutTotalCost; - /** - * 代作业成本 - */ - @ApiModelProperty(value = "代作业成本") - private String contractedOperaCost; - /** - * 仓租成本 - */ - @ApiModelProperty(value = "仓租成本") - private String warehouseRentalCost; - /** - * 仓储成本 - */ - @ApiModelProperty(value = "仓储成本") - private String warehousingCost; - -} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseDayEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseDayEntity.java index 9f7fc86ed..c8c0d0ba9 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseDayEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseDayEntity.java @@ -16,6 +16,8 @@ */ package com.logpm.statistics.entity; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -23,6 +25,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.math.BigDecimal; + /** * 日仓储成本统计表 实体类 * @@ -34,139 +38,163 @@ import org.springblade.core.tenant.mp.TenantEntity; @ApiModel(value = "ExpenseWarehouseDay对象", description = "日仓储成本统计表") @EqualsAndHashCode(callSuper = true) public class ExpenseWarehouseDayEntity extends TenantEntity { + /** + * 统计年 + */ + @ApiModelProperty(value = "统计年") + @ExcelIgnore + private Integer statisticalYear; + /** + * 统计月 + */ + @ApiModelProperty(value = "统计月") + @ExcelIgnore + private Integer statisticalMonth; + /** + * 统计日 + */ + @ApiModelProperty(value = "统计日") + @ExcelIgnore + private Integer statisticalDay; /** * 目的仓 */ @ApiModelProperty(value = "目的仓") + @ExcelProperty("目的仓") private String warehouseName; /** - * 成本结算时间-年 + * 日期 */ - @ApiModelProperty(value = "成本结算时间-年") - private String costSettlementYear; + @ApiModelProperty(value = "日期") + @ExcelProperty("日期") + private String statisticalTime; /** - * 成本结算时间-月 + * 当月天数 */ - @ApiModelProperty(value = "成本结算时间-月") - private String costSettlementMonth; + @ApiModelProperty(value = "当月天数") + @ExcelIgnore + private Integer dayNumber; /** - * 成本结算时间-日 + * 事业线 */ - @ApiModelProperty(value = "成本结算时间-日") - private String costSettlementDay; - /** - * 成本结算时间 - */ - @ApiModelProperty(value = "成本结算时间") - private String costSettlement; + @ApiModelProperty(value = "事业线") + @ExcelIgnore + private String businessUnit; + /** * 仓库总面积(㎡) */ @ApiModelProperty(value = "仓库总面积(㎡)") - private String totalArea; + @ExcelProperty("仓库总面积") + private BigDecimal totalArea; + /** + * 仓库租金 + */ + @ApiModelProperty(value = "仓库租金") + @ExcelProperty("仓库租金") + private BigDecimal rent; /** * 仓库月租金 */ @ApiModelProperty(value = "仓库日租金") - private String monthlyRent; + @ExcelProperty("仓库日租金") + private BigDecimal dailyRent; + /** * 出库总件数 */ @ApiModelProperty(value = "出库总件数") - private String totalQuantityIssued; + @ExcelProperty("出库总件数") + private Integer totalOutQuantity; /** * 客户租用面积(㎡) */ @ApiModelProperty(value = "客户租用面积(㎡)") - private String customerLeasedArea; + @ExcelProperty("客户租用面积") + private BigDecimal customerRentalArea; /** * 客户月租金 */ - @ApiModelProperty(value = "客户日租金") - private String customerMonthlyRent; + @ApiModelProperty(value = "客户租用月租金") + @ExcelProperty("客户租用月租金") + private BigDecimal customerMonthlyRent; + /** + * 客户日租金 + */ + @ApiModelProperty(value = "客户租用日租金") + @ExcelProperty("客户租用日租金") + private BigDecimal customerDailyRent; /** * 租用出库件数 */ - @ApiModelProperty(value = "租用出库件数") - private String rentedItemsDispatchedQuantity; + @ApiModelProperty(value = "客户租用出库件数") + @ExcelProperty("客户租用出库件数") + private Integer customerRentalOutQuantity; /** * 客户租用单件成本 */ @ApiModelProperty(value = "客户租用单件成本") - private String customerRentedItemCostPerUnit; + @ExcelProperty("客户租用单件成本") + private BigDecimal customerRentalUnitCost; /** * 客户租用总成本 */ @ApiModelProperty(value = "客户租用总成本") - private String customerTotalLeasingCost; + @ExcelProperty("客户租用总成本") + private BigDecimal customerTotalRentalCost; /** * 临时周转面积 */ @ApiModelProperty(value = "临时周转面积") - private String temporaryTurnoverArea; + @ExcelProperty("临时周转面积") + private BigDecimal temporaryTurnoverArea; /** * 临时周转件数 */ @ApiModelProperty(value = "临时周转件数") - private String temporaryTurnoverQuantity; + @ExcelProperty("临时周转件数") + private Integer temporaryTurnoverQuantity; /** * 临时周转单件成本 */ @ApiModelProperty(value = "临时周转单件成本") - private String temporaryTurnoverCostPerItem; + @ExcelProperty("临时周转单件成本") + private BigDecimal temporaryTurnoverUnitCost; /** * 临时周转总成本 */ @ApiModelProperty(value = "临时周转总成本") - private String totalTemporaryTurnoverCost; + @ExcelProperty("临时周转总成本") + private BigDecimal temporaryTurnoverTotalCost; /** * 干仓配仓储面积 */ @ApiModelProperty(value = "干仓配仓储面积") - private String drWareDisArea; + @ExcelProperty("干仓配仓储面积") + private BigDecimal drWareDisArea; /** * 干仓配件数 */ @ApiModelProperty(value = "干仓配件数") - private String drWareDisNumber; + @ExcelProperty("干仓配件数") + private Integer drWareDisNumber; /** * 干仓配单件成本 */ @ApiModelProperty(value = "干仓配单件成本") - private String drWareDisCostPerUnit; + @ExcelProperty("干仓配单件成本") + private BigDecimal drWareDisCostPerUnit; /** * 干仓配仓储总成本 */ @ApiModelProperty(value = "干仓配仓储总成本") - private String drWareDisTotalCost; - /** - * 代入库件数 - */ - @ApiModelProperty(value = "代入库件数") - private String consignmentStorage; + @ExcelProperty("干仓配仓储总成本") + private BigDecimal drWareDisTotalCost; /** - * 代入库总成本 + * 仓库租赁总成本 */ - @ApiModelProperty(value = "代入库总成本") - private String totalCostOfConsignmentStorage; - /** - * 代出库件数 - */ - @ApiModelProperty(value = "代出库件数") - private String consignmentWithdrawal; - /** - * 代出库总成本 - */ - @ApiModelProperty(value = "代出库总成本") - private String totalCostOfConsignmentWithdrawal; - /** - * 代作业总成本 - */ - @ApiModelProperty(value = "代作业总成本") - private String totalCostOfAgencyOperations; - /** - * 仓储总成本 - */ - @ApiModelProperty(value = "仓储总成本") - private String totalWarehouseCost; + @ApiModelProperty(value = "仓库租赁总成本") + @ExcelProperty("仓库租赁总成本") + private BigDecimal warehouseCost; + } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseMonthEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseMonthEntity.java index 70a8bc88a..51a09c3fa 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseMonthEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseMonthEntity.java @@ -1,5 +1,7 @@ package com.logpm.statistics.entity; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -7,6 +9,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.math.BigDecimal; + /** * 月度仓储成本统计表 * @@ -18,126 +22,115 @@ import org.springblade.core.tenant.mp.TenantEntity; @ApiModel(value = "ExpenseWarehouseMonth对象", description = "月度仓储成本统计表") @EqualsAndHashCode(callSuper = true) public class ExpenseWarehouseMonthEntity extends TenantEntity { + private static final long serialVersionUID = 1L; /** - * 目的仓 + * 统计年 */ - @ApiModelProperty(value = "目的仓") - private String warehouseName; + @ApiModelProperty(value = "统计年") + @ExcelIgnore + private Integer statisticalYear; /** - * 成本结算时间-年 + * 统计月 */ - @ApiModelProperty(value = "成本结算时间-年") - private String costSettlementYear; + @ApiModelProperty(value = "统计月") + @ExcelIgnore + private Integer statisticalMonth; /** - * 成本结算时间-月 + * 日期 */ - @ApiModelProperty(value = "成本结算时间-月") - private String costSettlementMonth; + @ApiModelProperty(value = "日期") + @ExcelIgnore + private String statisticalTime; /** - * 成本结算时间 + * 事业线 */ - @ApiModelProperty(value = "成本结算时间") - private String costSettlement; + @ApiModelProperty(value = "事业线") + @ExcelIgnore + private String businessUnit; /** - * 仓库总面积(㎡) + * 目的仓 */ - @ApiModelProperty(value = "仓库总面积(㎡)") - private String totalArea; + @ApiModelProperty(value = "目的仓") + @ExcelProperty("目的仓") + private String warehouseName; /** * 仓库月租金 */ @ApiModelProperty(value = "仓库月租金") - private String monthlyRent; + @ExcelProperty("仓库月租金") + private BigDecimal monthlyRent; /** * 出库总件数 */ @ApiModelProperty(value = "出库总件数") - private String totalQuantityIssued; - /** - * 客户租用面积(㎡) - */ - @ApiModelProperty(value = "客户租用面积(㎡)") - private String customerLeasedArea; + @ExcelProperty("出库总件数") + private Integer totalOutQuantity; /** * 客户月租金 */ - @ApiModelProperty(value = "客户月租金") - private String customerMonthlyRent; + @ApiModelProperty(value = "客户租用月租金") + @ExcelProperty("客户租用月租金") + private BigDecimal customerMonthlyRent; /** * 租用出库件数 */ - @ApiModelProperty(value = "租用出库件数") - private String rentedItemsDispatchedQuantity; + @ApiModelProperty(value = "客户租用出库件数") + @ExcelProperty("客户租用出库件数") + private Integer customerRentalOutQuantity; /** * 客户租用单件成本 */ @ApiModelProperty(value = "客户租用单件成本") - private String customerRentedItemCostPerUnit; + @ExcelProperty("客户租用单件成本") + private BigDecimal customerRentalUnitCost; /** * 客户租用总成本 */ @ApiModelProperty(value = "客户租用总成本") - private String customerTotalLeasingCost; - /** - * 临时周转面积 - */ - @ApiModelProperty(value = "临时周转面积") - private String temporaryTurnoverArea; + @ExcelProperty("客户租用总成本") + private BigDecimal customerTotalRentalCost; /** * 临时周转件数 */ @ApiModelProperty(value = "临时周转件数") - private String temporaryTurnoverQuantity; + @ExcelProperty("临时周转件数") + private Integer temporaryTurnoverQuantity; /** * 临时周转单件成本 */ @ApiModelProperty(value = "临时周转单件成本") - private String temporaryTurnoverCostPerItem; + @ExcelProperty("临时周转单件成本") + private BigDecimal temporaryTurnoverUnitCost; /** * 临时周转总成本 */ @ApiModelProperty(value = "临时周转总成本") - private String totalTemporaryTurnoverCost; - /** - * 干仓配仓储面积 - */ - @ApiModelProperty(value = "干仓配仓储面积") - private String drWareDisArea; + @ExcelProperty("临时周转总成本") + private BigDecimal temporaryTurnoverTotalCost; /** * 干仓配件数 */ @ApiModelProperty(value = "干仓配件数") - private String drWareDisNumber; + @ExcelProperty("干仓配件数") + private Integer drWareDisNumber; /** * 干仓配单件成本 */ @ApiModelProperty(value = "干仓配单件成本") - private String drWareDisCostPerUnit; + @ExcelProperty("干仓配单件成本") + private BigDecimal drWareDisCostPerUnit; /** * 干仓配仓储总成本 */ @ApiModelProperty(value = "干仓配仓储总成本") - private String drWareDisTotalCost; - /** - * 代入库总成本 - */ - @ApiModelProperty(value = "代入库总成本") - private String totalCostOfConsignmentStorage; - /** - * 代出库总成本 - */ - @ApiModelProperty(value = "代出库总成本") - private String totalCostOfConsignmentWithdrawal; - /** - * 代作业总成本 - */ - @ApiModelProperty(value = "代作业总成本") - private String totalCostOfAgencyOperations; + @ExcelProperty("干仓配仓储总成本") + private BigDecimal drWareDisTotalCost; /** - * 仓储总成本 + * 仓库租赁总成本 */ - @ApiModelProperty(value = "仓储总成本") - private String totalWarehouseCost; + @ApiModelProperty(value = "仓库租赁总成本") + @ExcelProperty("仓库租赁总成本") + private BigDecimal warehouseCost; } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseOrderEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseOrderEntity.java new file mode 100644 index 000000000..d85d558de --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseOrderEntity.java @@ -0,0 +1,89 @@ +package com.logpm.statistics.entity; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; + +/** + * 订单仓储成本报表 + * + * @author zqb + * @create 2024-07-17 11:32:30 + */ +@Data +@TableName("logpm_expense_warehouse_order") +@ApiModel(value = "ExpenseWarehouseOrderEntity对象", description = "订单仓储成本报表") +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseOrderEntity extends TenantEntity { + private static final long serialVersionUID = 1L; + /** + * 事业线 + */ + @ApiModelProperty(value = "事业线") + @ExcelIgnore + private String businessUnit; + /** + * 目的仓 + */ + @ApiModelProperty(value = "目的仓") + @ExcelProperty("目的仓") + private String warehouseName; + /** + * 订单编号 + */ + @ApiModelProperty(value = "订单编号") + @ExcelProperty("订单编号") + private String orderCode; + /** + * 运单编号 + */ + @ApiModelProperty(value = "运单编号") + @ExcelProperty("运单编号") + private String shipmentNumber; + /** + * 收货单位 + */ + @ApiModelProperty(value = "收货单位") + @ExcelProperty("收货单位") + private String receivingUnit; + /** + * 发货单位 + */ + @ApiModelProperty(value = "发货单位") + @ExcelProperty("发货单位") + private String shippingUnit; + /** + * 发站仓 + */ + @ApiModelProperty(value = "发站仓") + @ExcelProperty("发站仓") + private String originWarehouse; + + /** + * 订单总件数 + */ + @ApiModelProperty(value = "订单总件数") + @ExcelProperty("订单总件数") + private Integer totalNumber; + + /** + * 出库件数 + */ + @ApiModelProperty(value = "出库件数") + @ExcelProperty("出库件数") + private Integer outNumber; + /** + * 租赁成本 + */ + @ApiModelProperty(value = "租赁成本") + @ExcelProperty("租赁成本") + private BigDecimal warehouseRentalCost; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehousePackageDayEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehousePackageDayEntity.java new file mode 100644 index 000000000..3a5c43e62 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehousePackageDayEntity.java @@ -0,0 +1,121 @@ +package com.logpm.statistics.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; + +/** + * 日包件仓储成本报表 + * + * @author zqb + * @create 2024-07-17 11:32:30 + */ +@Data +@TableName("logpm_expense_warehouse_package_day") +@ApiModel(value = "ExpenseWarehousePackageEntity对象", description = "日包件仓储成本报表") +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehousePackageDayEntity extends TenantEntity { + private static final long serialVersionUID = 1L; + + /** + * 统计年 + */ + @ApiModelProperty(value = "统计年") + private Integer statisticalYear; + /** + * 统计月 + */ + @ApiModelProperty(value = "统计月") + private Integer statisticalMonth; + /** + * 统计日 + */ + @ApiModelProperty(value = "统计日") + private Integer statisticalDay; + /** + * 日期 + */ + @ApiModelProperty(value = "日期") + private String statisticalTime; + /** + * 事业线 + */ + @ApiModelProperty(value = "事业线") + private String businessUnit; + /** + * 目的仓 + */ + @ApiModelProperty(value = "目的仓") + private String warehouseName; + /** + * 品牌 + */ + @ApiModelProperty(value = "品牌") + private String brandName; + /** + * 包条码 + */ + @ApiModelProperty(value = "包条码") + private String packageCode; + /** + * 包件类型 + */ + @ApiModelProperty(value = "包件类型") + private String packageType; + /** + * 订单编号 + */ + @ApiModelProperty(value = "订单编号") + private String orderCode; + /** + * 运单编号 + */ + @ApiModelProperty(value = "运单编号") + private String shipmentNumber; + /** + * 收货单位 + */ + @ApiModelProperty(value = "收货单位") + private String receivingUnit; + /** + * 发货单位 + */ + @ApiModelProperty(value = "发货单位") + private String shippingUnit; + /** + * 成本类型 + */ + @ApiModelProperty(value = "成本类型") + private String expenseType; + /** + * 中转仓 + */ + @ApiModelProperty(value = "中转仓") + private String transitWarehouseName; + /** + * 配送类型 + */ + @ApiModelProperty(value = "配送类型") + private String dispatchType; + /** + * 发站仓 + */ + @ApiModelProperty(value = "发站仓") + private String originWarehouse; + /** + * 件数 + */ + @ApiModelProperty(value = "件数") + private Integer number; + /** + * 成本 + */ + @ApiModelProperty(value = "成本") + private BigDecimal cost; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseTransitMonthEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseTransitMonthEntity.java new file mode 100644 index 000000000..212c7dc2e --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseWarehouseTransitMonthEntity.java @@ -0,0 +1,80 @@ +package com.logpm.statistics.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; + +/** + * 中转仓月度成本报表 + * + * @author zqb + * @create 2024-07-17 11:32:30 + */ +@Data +@TableName("logpm_expense_warehouse_transit_month") +@ApiModel(value = "ExpenseWarehouseTransitMonthEntity对象", description = "中转仓月度成本报表") +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseTransitMonthEntity extends TenantEntity { + private static final long serialVersionUID = 1L; + /** + * 统计年 + */ + @ApiModelProperty(value = "统计年") + private Integer statisticalYear; + /** + * 统计月 + */ + @ApiModelProperty(value = "统计月") + private Integer statisticalMonth; + /** + * 日期 + */ + @ApiModelProperty(value = "日期") + private String statisticalTime; + /** + * 事业线 + */ + @ApiModelProperty(value = "事业线") + private String businessUnit; + /** + * 中转仓 + */ + @ApiModelProperty(value = "中转仓") + private String transitWarehouseName; + /** + * 目的仓 + */ + @ApiModelProperty(value = "目的仓") + private String warehouseName; + /** + * 中转入库件数 + */ + @ApiModelProperty(value = "中转入库件数") + private Integer inNumber; + /** + * 中转入库收入 + */ + @ApiModelProperty(value = "中转入库收入") + private BigDecimal inCost; + /** + * 中转出库件数 + */ + @ApiModelProperty(value = "中转出库件数") + private Integer outNumber; + /** + * 中转出库收入 + */ + @ApiModelProperty(value = "中转出库收入") + private BigDecimal outCost; + /** + * 中转总收入 + */ + @ApiModelProperty(value = "中转总收入") + private BigDecimal totalCost; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java index 3fa9c37f4..d9a03bc53 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java @@ -118,4 +118,34 @@ public class StatisticsDistributionPackageEntity extends TenantEntity { private Integer systemDeliveryChargeType; private Integer deliveryChargeType; + /** + * 上楼层数 + */ + @ApiModelProperty(value = "上楼层数") + private BigDecimal deliveryUpfloor; + + /** + * 是否装卸 + */ + @ApiModelProperty(value = "是否装卸") + private Integer deliveryLoading; + + /** + * 是否分货 + */ + @ApiModelProperty(value = "是否分货") + private Integer deliverySorting; + + /** + * 平移米数 + */ + @ApiModelProperty(value = "平移米数") + private BigDecimal deliveryMove; + + /** + * 专车费 + */ + @ApiModelProperty(value = "专车费") + private BigDecimal dedicatedVehicleFee; + } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java index efac832b2..5e1535734 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java @@ -69,11 +69,16 @@ public class StatisticsOrderInfoEntity extends TenantEntity { @ApiModelProperty(value = "服务类型") private Integer typeService; - @ApiModelProperty(value = "签收状态") - private Integer signStatus;// 签收状态 0未签收 1部分签收 2已签收 + @ApiModelProperty(value = "签收状态 0未签收 1部分签收 2已签收") + private Integer signStatus; @ApiModelProperty(value = "签收时间") private Date signDate; + @ApiModelProperty(value = "复核状态 0未复核 1部分复核 2已复核") + private Integer reViewStatus; + @ApiModelProperty(value = "复核时间") + private Date reViewDate; + @ApiModelProperty(value = "计算金额状态 0否 1是") private Integer syncFeeStatus; @ApiModelProperty(value = "计算金额时间") diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseTransitMonthVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseTransitMonthVO.java new file mode 100644 index 000000000..19c7047a1 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseTransitMonthVO.java @@ -0,0 +1,79 @@ +package com.logpm.statistics.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; + +/** + * 中转仓月度成本报表 + * + * @author zqb + * @create 2024-07-17 11:32:30 + */ +@Data +@ApiModel(value = "ExpenseWarehouseTransitMonthEntity对象", description = "中转仓月度成本报表") +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseTransitMonthVO extends TenantEntity { + private static final long serialVersionUID = 1L; + /** + * 统计年 + */ + @ApiModelProperty(value = "统计年") + private Integer statisticalYear; + /** + * 统计月 + */ + @ApiModelProperty(value = "统计月") + private Integer statisticalMonth; + /** + * 日期 + */ + @ApiModelProperty(value = "日期") + private String statisticalTime; + /** + * 事业线 + */ + @ApiModelProperty(value = "事业线") + private String businessUnit; + /** + * 中转仓 + */ + @ApiModelProperty(value = "中转仓") + private String transitWarehouseName; + /** + * 目的仓 + */ + @ApiModelProperty(value = "目的仓") + private String warehouseName; + /** + * 中转入库件数 + */ + @ApiModelProperty(value = "中转入库件数") + private Integer inNumber; + /** + * 中转入库收入 + */ + @ApiModelProperty(value = "中转入库收入") + private BigDecimal inCost; + /** + * 中转出库件数 + */ + @ApiModelProperty(value = "中转出库件数") + private Integer outNumber; + /** + * 中转出库收入 + */ + @ApiModelProperty(value = "中转出库收入") + private BigDecimal outCost; + /** + * 中转总收入 + */ + @ApiModelProperty(value = "中转总收入") + private BigDecimal totalCost; + +} diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java index aa50e0514..4629e54c1 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java @@ -547,6 +547,20 @@ public class WarehouseWaybillEntity extends TenantEntity { @ApiModelProperty(value = "文员复核时间 ") private Date signCheckTime; + /** + *付款状态:(null) 10 未付款 20 部分付款 30 已付款 + */ + @ApiModelProperty(value = "付款状态") + private String payStatus; + + /** + * 结算状态:(nul) 10未结算 20 部分结算 30 已结算 + */ + @ApiModelProperty(value = "结算状态") + private String settlementStatus; + + + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java index 6b48fdf64..1e16a2d51 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java @@ -268,6 +268,34 @@ public class BasicdataWarehouseClient implements IBasicdataWarehouseClient { ); } + @Override + public List findAllListBusinessLine() { + List list = warehouseWarehouseService.list(Wrappers.lambdaQuery() + .eq(BasicdataWarehouseEntity::getEnableStatus, 2) + ); + if(CollUtil.isNotEmpty(list)){ + for (BasicdataWarehouseEntity warehouseEntity : list) { + Long department = warehouseEntity.getDepartment(); + if(ObjectUtil.isNotNull(department)){ + Dept dept = deptClient.findEntityById(department); + if(ObjectUtil.isNotEmpty(dept)){ + Integer deptCategory = dept.getDeptCategory(); + if(NumberUtil.equals(deptCategory,2)){ + warehouseEntity.setBusinessLine(dept.getDeptName()); + } else { + Long parentId = dept.getParentId(); + Dept parentDept = deptClient.findEntityById(parentId); + if(ObjectUtil.isNotEmpty(parentDept)){ + warehouseEntity.setBusinessLine(parentDept.getDeptName()); + } + } + } + } + } + } + return list; + } + @Override public List findWarehousesByIds(List ids) { if(CollUtil.isNotEmpty(ids)){ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java index 67608f940..407dcc4ba 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java @@ -754,7 +754,6 @@ public class DistributionStockupAppController extends BladeController { } - //todo 这里代码没有写完 等TJJ 和CYZ 空了来写 @ResponseBody @PostMapping("/updateStockup") @ApiOperationSupport(order = 1) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java index 82dc5d859..93657a038 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java @@ -381,9 +381,6 @@ public class DistributionSignforController extends BladeController { distributionSignforService.updateSign(distributionSignforDTO); distributionDeliveryListService.maintenanceDeliveryInfo(distributionSignfor.getDeliveryId()); distributionStockupInfoService.maintenanceStockUp(distributionSignfor.getReservationId(),1); - - - } // return R.status(distributionSignforService.updateById(distributionSignfor)); return r; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java index 618f3cb13..72ad30126 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.feign; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; @@ -23,11 +24,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.distribution.entity.QualityDeliverEntity; import com.logpm.distribution.service.IQualityDeliverService; +import io.prometheus.client.CollectorRegistry; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * 通知提货记录 Feign实现类 @@ -41,6 +46,7 @@ import java.util.List; public class QualityDeliverClient implements IQualityDeliverClient { private final IQualityDeliverService qualityDeliverService; + private final CollectorRegistry collectorRegistry; @Override @@ -52,9 +58,24 @@ public class QualityDeliverClient implements IQualityDeliverClient { DateTime dayStart = DateUtil.beginOfDay(dateTime); DateTime dayEnd = DateUtil.endOfDay(dateTime); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); - wrapper.ge(QualityDeliverEntity::getSignTime, dayStart); - wrapper.le(QualityDeliverEntity::getSignTime, dayEnd); - // 本月签收包件 + wrapper.ge(QualityDeliverEntity::getReviewTime, dayStart); + wrapper.le(QualityDeliverEntity::getReviewTime, dayEnd); return qualityDeliverService.list(wrapper); } + + @Override + public void updateWarehouseCost(Map packageCostMap) { + if(CollUtil.isNotEmpty(packageCostMap)){ + List list = new ArrayList<>(); + for (Map.Entry entry : packageCostMap.entrySet()) { + Long key = entry.getKey(); + BigDecimal value = entry.getValue(); + QualityDeliverEntity qualityDeliverEntity = new QualityDeliverEntity(); + qualityDeliverEntity.setId(key); + qualityDeliverEntity.setWarehouseCost(value); + list.add(qualityDeliverEntity); + } + qualityDeliverService.updateBatchById(list); + } + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 535798c52..680bb942a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -757,7 +757,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildNodeFanoutMsgByReCheck(reservationEntity); + NodeFanoutMsg nodeFanoutMsg = buildNodeFanoutMsgByReCheck(deliveryListEntity,reservationEntity); iDistributionNodeWorkService.signForCheck(nodeFanoutMsg, AuthUtil.getUser()); // // 复核作业节点推送 @@ -783,7 +783,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl buildNodeFanoutMsgByReCheck(DistributionReservationEntity reservationEntity) { + private NodeFanoutMsg buildNodeFanoutMsgByReCheck(DistributionDeliveryListEntity deliveryListEntity,DistributionReservationEntity reservationEntity) { // 查询当前预约单下的定制品和零担签收数据 NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); @@ -798,6 +798,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildPickUpByReCheckVO(billLadingEntity, ladingScanEntities, myCurrentWarehouse); + NodeFanoutMsg nodeFanoutMsg = buildPickUpByReCheckVO(distrilbutionBillLadingEntity, ladingScanEntities, myCurrentWarehouse); iDistributionNodeWorkService.billofladingSignforCheck(nodeFanoutMsg, AuthUtil.getUser()); //推送该自提单的包件运单信息 @@ -4165,13 +4165,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageDataList = new ArrayList<>(); pickUpByReCheckVO.setPackageDataList(packageDataList); ladingScanEntities.forEach(t -> { PackageData packageData = new PackageData(); - + packageData.setSignUser(t.getScanUser()); + packageData.setSignTime(t.getCreateTime()); if ("1".equals(t.getMaterialType())) { // 库存 Long stockListId = t.getStockListId(); @@ -4184,10 +4188,16 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl wrapper = Wrappers.lambdaQuery(); @@ -232,9 +232,6 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl { QualityDeliverEntity deliverEntity = new QualityDeliverEntity(); deliverEntity.setId(entity.getId()); - deliverEntity.setWarehouseRentalCost("0"); - deliverEntity.setWarehouseTurnoverCost("0"); - deliverEntity.setWarehouseDeliveryCost("0"); deliverEntity.setWarehouseId(entity.getWarehouseId()); deliverEntity.setWarehouseName(entity.getWarehouseName()); // 结算时间 diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml index e6fbbc30c..faa5be5e3 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml @@ -13,7 +13,7 @@ and create_time <= #{param.endDate} - and departure_warehouse_id in + and destination_warehouse_id in #{item} @@ -24,7 +24,7 @@ select IFNULL(sum(IFNULL(x_pay,0)+IFNULL(d_pay,0)+IFNULL(y_pay,0)+IFNULL(h_pay,0)),0) from logpm_warehouse_waybill where 1=1 - and departure_warehouse_id in + and destination_warehouse_id in #{item} @@ -45,7 +45,7 @@ and create_time <= #{param.endDate} - and departure_warehouse_id in + and destination_warehouse_id in #{item} @@ -840,7 +840,7 @@ - select * from logpm_expense_order_warehouse_total where is_deleted = 0 + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.java index d1866d5a5..3a8d6c944 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.java @@ -18,6 +18,7 @@ package com.logpm.statistics.mapper; import com.logpm.statistics.entity.ExpenseWarehouseDayEntity; import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity; +import com.logpm.statistics.query.ExpenseWarehouseDayQuery; import com.logpm.statistics.vo.ExpenseWarehouseDayVO; import com.logpm.statistics.excel.ExpenseWarehouseDayExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -41,7 +42,7 @@ public interface ExpenseWarehouseDayMapper extends BaseMapper selectExpenseWarehouseDayPage(@Param("page") IPage page, @Param("expenseWarehouseDay") ExpenseWarehouseDayVO expenseWarehouseDay); + List selectExpenseWarehouseDayPage(@Param("page") IPage page, @Param("expenseWarehouseDay") ExpenseWarehouseDayQuery expenseWarehouseDay); /** diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.xml index f6baf77d7..79c65550c 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.xml @@ -7,54 +7,72 @@ - - - - + select + business_unit, + warehouse_name, + statistical_year, + statistical_month, + statistical_day, + statistical_time, + day_number, + round(ifnull(total_area,0),2) total_area, + round(ifnull(rent,0),2) rent, + round(ifnull(daily_rent,0),2) daily_rent, + round(ifnull(total_out_quantity,0),2) total_out_quantity, + round(ifnull(customer_rental_area,0),2) customer_rental_area, + round(ifnull(customer_monthly_rent,0),2) customer_monthly_rent, + round(ifnull(customer_daily_rent,0),2) customer_daily_rent, + round(ifnull(customer_rental_out_quantity,0),2) customer_rental_out_quantity, + round(ifnull(customer_rental_unit_cost,0),2) customer_rental_unit_cost, + round(ifnull(customer_total_rental_cost,0),2) customer_total_rental_cost, + round(ifnull(temporary_turnover_area,0),2) temporary_turnover_area, + round(ifnull(temporary_turnover_quantity,0),2) temporary_turnover_quantity, + round(ifnull(temporary_turnover_unit_cost,0),2) temporary_turnover_unit_cost, + round(ifnull(temporary_turnover_total_cost,0),2) temporary_turnover_total_cost, + round(ifnull(dr_ware_dis_area,0),2) dr_ware_dis_area, + round(ifnull(dr_ware_dis_number,0),2) dr_ware_dis_number, + round(ifnull(dr_ware_dis_cost_per_unit,0),2) dr_ware_dis_cost_per_unit, + round(ifnull(dr_ware_dis_total_cost,0),2) dr_ware_dis_total_cost, + round(ifnull(warehouse_cost,0),2) warehouse_cost + from logpm_expense_warehouse_day + + + and statistical_time >= #{expenseWarehouseDay.startDate} + + + and statistical_time #{expenseWarehouseDay.endDate} + + + and warehouse_name in + + #{item} + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.java index e93271d28..c1f69e9e6 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity; import com.logpm.statistics.excel.ExpenseWarehouseMonthExcel; +import com.logpm.statistics.query.ExpenseWarehouseMonthQuery; import com.logpm.statistics.vo.ExpenseWarehouseMonthVO; import org.apache.ibatis.annotations.Param; @@ -41,15 +42,6 @@ public interface ExpenseWarehouseMonthMapper extends BaseMapper selectExpenseWarehouseMonthPage(@Param("page") IPage page, @Param("vo") ExpenseWarehouseMonthVO vo); - - - /** - * 获取导出数据 - * - * @param queryWrapper - * @return - */ - List exportExpenseWarehouseMonth(@Param("ew") Wrapper queryWrapper); + List selectExpenseWarehouseMonthPage(@Param("page") IPage page, @Param("vo") ExpenseWarehouseMonthQuery vo); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.xml index d9c1dd544..dca768616 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.xml @@ -7,18 +7,18 @@ - select * from logpm_expense_warehouse_month where is_deleted = 0 - - and cost_settlement >= #{vo.startDateQuery} + + and statistical_time >= #{vo.startDate} - - and cost_settlement #{vo.endDateQuery} + + and statistical_time #{vo.endDate} - + and warehouse_name in - + #{item} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehousePackageDayMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehousePackageDayMapper.java new file mode 100644 index 000000000..a1eb8f738 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehousePackageDayMapper.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.statistics.entity.ExpenseWarehousePackageDayEntity; +import com.logpm.statistics.query.ExpenseWarehouseTransitMonthQuery; +import com.logpm.statistics.vo.ExpenseWarehouseTransitMonthVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 包件日仓储成本 Mapper 接口 + * + * @author zqb + * @since 2024-07-17 + */ +public interface ExpenseWarehousePackageDayMapper extends BaseMapper { + + List transitPage(@Param("page") IPage page, @Param("query") ExpenseWarehouseTransitMonthQuery query); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehousePackageDayMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehousePackageDayMapper.xml new file mode 100644 index 000000000..b367eeab1 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehousePackageDayMapper.xml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java index a1b8b5314..a0ef71907 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java @@ -28,6 +28,7 @@ public interface StatisticsOrderInfoMapper extends BaseMapper orderInfoIdsList); List findPackageListByOrderIdsGroupById(@Param("orderInfoIds") List orderInfoIdList); + List findPackageListByOrderIdsGroupByWaybillId(@Param("waybillIds") Set orderInfoIdList); List findOrderInfoIdListByReconciliationOrderIds(@Param("reconciliationOrderIds") List reconciliationOrderIds); @@ -48,4 +49,6 @@ public interface StatisticsOrderInfoMapper extends BaseMapper selectAdvinceDetail(@Param("waybillIds") Set waybillIds, @Param("orderCodes") Set orderCodes); + + IPage pageList2B(IPage page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml index 4e26bd7b3..187ea9cd9 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml @@ -498,6 +498,52 @@ group by lstp.order_info_id + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseDayQuery.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseDayQuery.java new file mode 100644 index 000000000..c2ec5b837 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseDayQuery.java @@ -0,0 +1,17 @@ +package com.logpm.statistics.query; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.Query; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseDayQuery extends Query { + @ApiModelProperty(value = "开始时间 年-月-日") + private String startDate; + @ApiModelProperty(value = "结束时间 年-月-日") + private String endDate; + @ApiModelProperty(value = "仓库 A,B,C") + private String warehouseName; +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseMonthQuery.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseMonthQuery.java new file mode 100644 index 000000000..408a945c6 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseMonthQuery.java @@ -0,0 +1,17 @@ +package com.logpm.statistics.query; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.Query; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseMonthQuery extends Query { + @ApiModelProperty(value = "开始时间 年-月-日") + private String startDate; + @ApiModelProperty(value = "结束时间 年-月-日") + private String endDate; + @ApiModelProperty(value = "仓库 A,B,C") + private String warehouseName; +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseOrderQuery.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseOrderQuery.java new file mode 100644 index 000000000..f949e387a --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseOrderQuery.java @@ -0,0 +1,20 @@ +package com.logpm.statistics.query; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.Query; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseOrderQuery extends Query { + @ApiModelProperty(value = "仓库 A,B,C") + private String warehouseName; + @ApiModelProperty(value = "订单号") + private String orderCode; + @ApiModelProperty(value = "运单号") + private String shipmentNumber; + @ApiModelProperty(value = "复核状态 已完成 未完成") + private String reviewStatus; + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehousePackageDayQuery.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehousePackageDayQuery.java new file mode 100644 index 000000000..c5425d7f6 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehousePackageDayQuery.java @@ -0,0 +1,11 @@ +package com.logpm.statistics.query; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.Query; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehousePackageDayQuery extends Query { + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseTransitMonthQuery.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseTransitMonthQuery.java new file mode 100644 index 000000000..8befd79d7 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseWarehouseTransitMonthQuery.java @@ -0,0 +1,11 @@ +package com.logpm.statistics.query; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.Query; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ExpenseWarehouseTransitMonthQuery extends Query { + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseOrderWarehouseTotalService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseOrderWarehouseTotalService.java index 8fcce08a2..1db5d9499 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseOrderWarehouseTotalService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseOrderWarehouseTotalService.java @@ -16,13 +16,13 @@ */ package com.logpm.statistics.service; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.logpm.statistics.entity.ExpenseOrderWarehouseTotalEntity; -import com.logpm.statistics.vo.ExpenseOrderWarehouseTotalVO; -import com.logpm.statistics.excel.ExpenseOrderWarehouseTotalExcel; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.statistics.entity.ExpenseWarehouseOrderEntity; +import com.logpm.statistics.query.ExpenseWarehouseOrderQuery; +import com.logpm.statistics.vo.ExpenseWarehouseOrderVO; import org.springblade.core.mp.base.BaseService; -import java.util.List; + +import javax.servlet.http.HttpServletResponse; /** * 订单总仓储成本明细 服务类 @@ -30,23 +30,9 @@ import java.util.List; * @author BladeX * @since 2024-07-16 */ -public interface IExpenseOrderWarehouseTotalService extends BaseService { - /** - * 自定义分页 - * - * @param page - * @param expenseOrderWarehouseTotal - * @return - */ - IPage selectExpenseOrderWarehouseTotalPage(IPage page, ExpenseOrderWarehouseTotalVO expenseOrderWarehouseTotal); - +public interface IExpenseOrderWarehouseTotalService extends BaseService { - /** - * 导出数据 - * - * @param queryWrapper - * @return - */ - List exportExpenseOrderWarehouseTotal(Wrapper queryWrapper); + IPage orderPage(ExpenseWarehouseOrderQuery query); + void exporOrder(HttpServletResponse response, ExpenseWarehouseOrderQuery query); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseDayService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseDayService.java index 28848d114..65aab2fb8 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseDayService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseDayService.java @@ -16,14 +16,14 @@ */ package com.logpm.statistics.service; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.statistics.entity.ExpenseWarehouseDayEntity; import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity; -import com.logpm.statistics.excel.ExpenseWarehouseDayExcel; +import com.logpm.statistics.query.ExpenseWarehouseDayQuery; import com.logpm.statistics.vo.ExpenseWarehouseDayVO; import org.springblade.core.mp.base.BaseService; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -34,22 +34,12 @@ import java.util.List; */ public interface IExpenseWarehouseDayService extends BaseService { /** - * 自定义分页 - * - * @param page - * @param expenseWarehouseDay - * @return - */ - IPage selectExpenseWarehouseDayPage(IPage page, ExpenseWarehouseDayVO expenseWarehouseDay); - - - /** - * 导出数据 - * - * @param queryWrapper - * @return - */ - List exportExpenseWarehouseDay(Wrapper queryWrapper); + * 分页 + * @param query + * @Return com.baomidou.mybatisplus.core.metadata.IPage + * @Author zqb 2024/11/27 + **/ + IPage dayPage(ExpenseWarehouseDayQuery query); /** * 按年月统计仓储成本数据 @@ -60,4 +50,12 @@ public interface IExpenseWarehouseDayService extends BaseService statisticsMonthWarehouseExpense(int year, int month); + /** + * 导出日仓储成本统计表 + * @param response + * @param query + * @Return void + * @Author zqb 2024/11/27 + **/ + void exporDay(HttpServletResponse response, ExpenseWarehouseDayQuery query); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseMonthService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseMonthService.java index c5e9b46ec..a508cfbcd 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseMonthService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehouseMonthService.java @@ -16,13 +16,13 @@ */ package com.logpm.statistics.service; -import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity; +import com.logpm.statistics.query.ExpenseWarehouseMonthQuery; import com.logpm.statistics.vo.ExpenseWarehouseMonthVO; -import com.logpm.statistics.excel.ExpenseWarehouseMonthExcel; -import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseService; -import java.util.List; + +import javax.servlet.http.HttpServletResponse; /** * 月度仓储成本统计表 服务类 @@ -31,22 +31,8 @@ import java.util.List; * @since 2024-07-17 */ public interface IExpenseWarehouseMonthService extends BaseService { - /** - * 自定义分页 - * - * @param page - * @param expenseWarehouseMonth - * @return - */ - IPage selectExpenseWarehouseMonthPage(IPage page, ExpenseWarehouseMonthVO expenseWarehouseMonth); - - /** - * 导出数据 - * - * @param queryWrapper - * @return - */ - List exportExpenseWarehouseMonth(Wrapper queryWrapper); + IPage monthPage(ExpenseWarehouseMonthQuery query); + void exporMonth(HttpServletResponse response, ExpenseWarehouseMonthQuery query); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehousePackageDayService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehousePackageDayService.java new file mode 100644 index 000000000..6c2f5a180 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IExpenseWarehousePackageDayService.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.statistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.statistics.entity.ExpenseWarehousePackageDayEntity; +import com.logpm.statistics.query.ExpenseWarehouseTransitMonthQuery; +import com.logpm.statistics.vo.ExpenseWarehouseDayVO; +import com.logpm.statistics.vo.ExpenseWarehousePackageDayVO; +import com.logpm.statistics.vo.ExpenseWarehouseTransitMonthVO; +import org.springblade.core.mp.base.BaseService; + +/** + * 日仓储成本统计表 服务类 + * + * @author zqb + * @since 2024-09-23 + */ +public interface IExpenseWarehousePackageDayService extends BaseService { + + IPage transitPage(ExpenseWarehouseTransitMonthQuery query); + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java index 1dc4ccdf0..ba9237674 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java @@ -56,4 +56,10 @@ public interface IStatisticsOrderInfoService extends BaseService waybillIds); + + R createFinishWaybillId(List waybillIds); + + boolean calculateRealCostByWaybillId(Long id); + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseOrderWarehouseTotalServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseOrderWarehouseTotalServiceImpl.java index 15cc4d2e3..f079a32d9 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseOrderWarehouseTotalServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseOrderWarehouseTotalServiceImpl.java @@ -16,15 +16,18 @@ */ package com.logpm.statistics.service.impl; -import com.logpm.statistics.entity.ExpenseOrderWarehouseTotalEntity; -import com.logpm.statistics.vo.ExpenseOrderWarehouseTotalVO; -import com.logpm.statistics.excel.ExpenseOrderWarehouseTotalExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.statistics.entity.ExpenseWarehouseOrderEntity; import com.logpm.statistics.mapper.ExpenseOrderWarehouseTotalMapper; +import com.logpm.statistics.query.ExpenseWarehouseOrderQuery; import com.logpm.statistics.service.IExpenseOrderWarehouseTotalService; -import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.statistics.vo.ExpenseWarehouseOrderVO; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -34,21 +37,20 @@ import java.util.List; * @since 2024-07-16 */ @Service -public class ExpenseOrderWarehouseTotalServiceImpl extends BaseServiceImpl implements IExpenseOrderWarehouseTotalService { - - @Override - public IPage selectExpenseOrderWarehouseTotalPage(IPage page, ExpenseOrderWarehouseTotalVO expenseOrderWarehouseTotal) { - return page.setRecords(baseMapper.selectExpenseOrderWarehouseTotalPage(page, expenseOrderWarehouseTotal)); - } - +public class ExpenseOrderWarehouseTotalServiceImpl extends BaseServiceImpl implements IExpenseOrderWarehouseTotalService { @Override - public List exportExpenseOrderWarehouseTotal(Wrapper queryWrapper) { - List expenseOrderWarehouseTotalList = baseMapper.exportExpenseOrderWarehouseTotal(queryWrapper); - //expenseOrderWarehouseTotalList.forEach(expenseOrderWarehouseTotal -> { - // expenseOrderWarehouseTotal.setTypeName(DictCache.getValue(DictEnum.YES_NO, ExpenseOrderWarehouseTotal.getType())); - //}); - return expenseOrderWarehouseTotalList; + public IPage orderPage(ExpenseWarehouseOrderQuery query) { + IPage page = Condition.getPage(query); + return page.setRecords(baseMapper.selectExpenseOrderWarehouseTotalPage(page, query)); } + @Override + public void exporOrder(HttpServletResponse response, ExpenseWarehouseOrderQuery query) { + IPage page = Condition.getPage(query); + page.setSize(-1); + page.setCurrent(1); + List list = baseMapper.selectExpenseOrderWarehouseTotalPage(page, query); + ExcelUtil.export(response, list, ExpenseWarehouseOrderVO.class); + } } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseDayServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseDayServiceImpl.java index 43dffa400..49a24df52 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseDayServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseDayServiceImpl.java @@ -17,17 +17,19 @@ package com.logpm.statistics.service.impl; import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.statistics.entity.ExpenseWarehouseDayEntity; import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity; -import com.logpm.statistics.excel.ExpenseWarehouseDayExcel; import com.logpm.statistics.mapper.ExpenseWarehouseDayMapper; +import com.logpm.statistics.query.ExpenseWarehouseDayQuery; import com.logpm.statistics.service.IExpenseWarehouseDayService; import com.logpm.statistics.vo.ExpenseWarehouseDayVO; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; import java.util.Collections; import java.util.List; @@ -41,26 +43,26 @@ import java.util.List; public class ExpenseWarehouseDayServiceImpl extends BaseServiceImpl implements IExpenseWarehouseDayService { @Override - public IPage selectExpenseWarehouseDayPage(IPage page, ExpenseWarehouseDayVO expenseWarehouseDay) { - return page.setRecords(baseMapper.selectExpenseWarehouseDayPage(page, expenseWarehouseDay)); - } - - - @Override - public List exportExpenseWarehouseDay(Wrapper queryWrapper) { - List expenseWarehouseDayList = baseMapper.exportExpenseWarehouseDay(queryWrapper); - //expenseWarehouseDayList.forEach(expenseWarehouseDay -> { - // expenseWarehouseDay.setTypeName(DictCache.getValue(DictEnum.YES_NO, ExpenseWarehouseDay.getType())); - //}); - return expenseWarehouseDayList; + public IPage dayPage(ExpenseWarehouseDayQuery query) { + IPage page = Condition.getPage(query); + return page.setRecords(baseMapper.selectExpenseWarehouseDayPage(page, query)); } @Override public List statisticsMonthWarehouseExpense(int year, int month) { - if(ObjectUtil.isEmpty(year) || ObjectUtil.isEmpty(month)){ + if (ObjectUtil.isEmpty(year) || ObjectUtil.isEmpty(month)) { return Collections.emptyList(); } return baseMapper.statisticsMonthWarehouseExpense(year, month); } + @Override + public void exporDay(HttpServletResponse response, ExpenseWarehouseDayQuery query) { + IPage page = Condition.getPage(query); + page.setSize(-1); + page.setCurrent(1); + List list = baseMapper.selectExpenseWarehouseDayPage(page, query); + ExcelUtil.export(response, list, ExpenseWarehouseDayVO.class); + } + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseMonthServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseMonthServiceImpl.java index 0db13337f..de191d0f0 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseMonthServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseMonthServiceImpl.java @@ -16,16 +16,18 @@ */ package com.logpm.statistics.service.impl; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity; -import com.logpm.statistics.excel.ExpenseWarehouseMonthExcel; import com.logpm.statistics.mapper.ExpenseWarehouseMonthMapper; +import com.logpm.statistics.query.ExpenseWarehouseMonthQuery; import com.logpm.statistics.service.IExpenseWarehouseMonthService; import com.logpm.statistics.vo.ExpenseWarehouseMonthVO; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -37,21 +39,18 @@ import java.util.List; @Service public class ExpenseWarehouseMonthServiceImpl extends BaseServiceImpl implements IExpenseWarehouseMonthService { - @Override - public IPage selectExpenseWarehouseMonthPage(IPage page, ExpenseWarehouseMonthVO expenseWarehouseMonth) { - // QueryWrapper queryWrapper = QueryUtil.buildQueryWrapper(expenseWarehouseMonth, ExpenseWarehouseMonthVO.class); - // queryWrapper.lambda().eq(ExpenseWarehouseMonthVO::getIsDeleted, BladeConstant.DB_NOT_DELETED); - return page.setRecords(baseMapper.selectExpenseWarehouseMonthPage(page, expenseWarehouseMonth)); - } - + @Override + public IPage monthPage(ExpenseWarehouseMonthQuery query) { + IPage page = Condition.getPage(query); + return page.setRecords(baseMapper.selectExpenseWarehouseMonthPage(page, query)); + } @Override - public List exportExpenseWarehouseMonth(Wrapper queryWrapper) { - List expenseWarehouseMonthList = baseMapper.exportExpenseWarehouseMonth(queryWrapper); - //expenseWarehouseMonthList.forEach(expenseWarehouseMonth -> { - // expenseWarehouseMonth.setTypeName(DictCache.getValue(DictEnum.YES_NO, ExpenseWarehouseMonth.getType())); - //}); - return expenseWarehouseMonthList; + public void exporMonth(HttpServletResponse response, ExpenseWarehouseMonthQuery query) { + IPage page = Condition.getPage(query); + page.setSize(-1); + page.setCurrent(1); + List list = baseMapper.selectExpenseWarehouseMonthPage(page, query); + ExcelUtil.export(response, list, ExpenseWarehouseMonthVO.class); } - } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehousePackageDayServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehousePackageDayServiceImpl.java new file mode 100644 index 000000000..c71b75491 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehousePackageDayServiceImpl.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.statistics.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.statistics.entity.ExpenseWarehousePackageDayEntity; +import com.logpm.statistics.mapper.ExpenseWarehousePackageDayMapper; +import com.logpm.statistics.query.ExpenseWarehouseTransitMonthQuery; +import com.logpm.statistics.service.IExpenseWarehousePackageDayService; +import com.logpm.statistics.vo.ExpenseWarehouseTransitMonthVO; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springframework.stereotype.Service; + +/** + * 月度仓储成本统计表 服务实现类 + * + * @author zqb + * @since 2024-07-17 + */ +@Service +public class ExpenseWarehousePackageDayServiceImpl extends BaseServiceImpl implements IExpenseWarehousePackageDayService { + + @Override + public IPage transitPage(ExpenseWarehouseTransitMonthQuery query) { + IPage page = Condition.getPage(query); + return page.setRecords(baseMapper.transitPage(page, query)); + } +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java index 6ab9d0508..64d7ef1be 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java @@ -6,11 +6,14 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataPriceTemplateEntity; +import com.logpm.basicdata.feign.IBasicdataClientClient; import com.logpm.basicdata.feign.IBasicdataPriceClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.vo.BasicdatPriceApiVO; @@ -28,8 +31,11 @@ import com.logpm.statistics.entity.*; import com.logpm.statistics.mapper.StatisticsOrderInfoMapper; import com.logpm.statistics.service.*; import com.logpm.statistics.vo.*; +import com.logpm.warehouse.entity.WarehouseWaybillEntity; +import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springblade.common.enums.BooleanZeroOneEnums; import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; @@ -63,6 +69,8 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl findListByWaybillId(Long waybillId) { @@ -88,20 +96,35 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl warehouseIds = warehouseClient.getWarehouseIds(); - if(!warehouseIds.isEmpty()){ + if (!warehouseIds.isEmpty()) { merchantStatisticsDTO.setWarehouseIds(warehouseIds); } - IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); + + //区分 2B 和 2C 的订单 + if (merchantStatisticsDTO.getListType() == 1) { + //2B + return getStatisticsOrderInfoVOIPage2B(merchantStatisticsDTO, page); + + } else { + // 2C + return getStatisticsOrderInfoVOIPage2C(merchantStatisticsDTO, page); + } + + } + + private IPage getStatisticsOrderInfoVOIPage2B(MerchantStatisticsDTO merchantStatisticsDTO, IPage page) { +// IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); + IPage statisticsOrderInfoVOIPage = baseMapper.pageList2B(page, merchantStatisticsDTO); List records = statisticsOrderInfoVOIPage.getRecords(); - if(CollUtil.isEmpty(records)){ + if (CollUtil.isEmpty(records)) { return statisticsOrderInfoVOIPage; } //把records中所有的orderInfoId放入一个集合 - List orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); +// List orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); // 得到运单ID集合 - Set waybillIds = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); + Set waybillIds = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); // 查询运单明细集合 List waybillDetailByWaybillId = baseMapper.findWaybillDetailByWaybillId(waybillIds); @@ -114,22 +137,22 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl> waybillDetailByWaybillIdMap = waybillDetailByWaybillId.stream().collect(Collectors.groupingBy(WaybillDetailByWaybillNoVo::getWaybillId)); Map orderPackageInfoMap; - if(CollUtil.isNotEmpty(orderInfoIdList)){ - List orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupById(orderInfoIdList); + if (CollUtil.isNotEmpty(waybillIds)) { + List orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupByWaybillId(waybillIds); //把orderPackageInfoList转化成以orderInfoId为key的Map - if(CollUtil.isNotEmpty(orderPackageInfoList)){ + if (CollUtil.isNotEmpty(orderPackageInfoList)) { orderPackageInfoMap = orderPackageInfoList.stream() - .collect(Collectors.toMap(StatisticsPackageFeeInfoVO::getOrderInfoId, statisticsPackageFeeInfoVO -> statisticsPackageFeeInfoVO)); + .collect(Collectors.toMap(StatisticsPackageFeeInfoVO::getWaybillId, statisticsPackageFeeInfoVO -> statisticsPackageFeeInfoVO)); } else { - orderPackageInfoMap = null; - } - } else { - orderPackageInfoMap = null; - } + orderPackageInfoMap = null; + } + } else { + orderPackageInfoMap = null; + } - List advanceDetailDTOS=baseMapper.selectAdvinceDetail(waybillIds, orderCodeSet); + List advanceDetailDTOS = baseMapper.selectAdvinceDetail(waybillIds, orderCodeSet); - records.forEach(statisticsOrderInfoVO -> { + records.forEach(statisticsOrderInfoVO -> { // Long waybillId = statisticsOrderInfoVO.getWaybillId(); @@ -140,18 +163,18 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl advanceDetailDTOList = advanceDetailDTOS.stream(). filter(advanceDetailDTO -> advanceDetailDTO.getWaybillId().equals(waybillId) && advanceDetailDTO.getOrderCode().equals(orderCode)).collect(Collectors.toList()); - // 对advanceDetailDTOList 按照 incomeCategoryName 进分组 并统计数量 + // 对advanceDetailDTOList 按照 incomeCategoryName 进分组 并统计数量 Map> collect = advanceDetailDTOList.stream().filter(advanceDetailDTO -> !Objects.isNull(advanceDetailDTO.getIncomeCategoryName())).collect(Collectors.groupingBy(AdvanceDetailDTO::getIncomeCategoryName)); - Long orderInfoId = statisticsOrderInfoVO.getOrderInfoId(); - if(orderPackageInfoMap!=null){ - StatisticsPackageFeeInfoVO statisticsPackageFeeInfoVO = orderPackageInfoMap.get(orderInfoId); + Long waybillId1 = statisticsOrderInfoVO.getWaybillId(); + if (orderPackageInfoMap != null) { + StatisticsPackageFeeInfoVO statisticsPackageFeeInfoVO = orderPackageInfoMap.get(waybillId1); - if(statisticsPackageFeeInfoVO!=null){ + if (statisticsPackageFeeInfoVO != null) { // statisticsPackageFeeInfoVO.setGoodsName(statisticsOrderInfoVO.getGoodsName()); BeanUtil.copy(statisticsPackageFeeInfoVO, statisticsOrderInfoVO); - if(StringUtil.isNotBlank(statisticsOrderInfoVO.getGoodsName())){ + if (StringUtil.isNotBlank(statisticsOrderInfoVO.getGoodsName())) { // String[] split = statisticsOrderInfoVO.getGoodsName().split(","); List waybillDetailByWaybillNoVos = waybillDetailByWaybillIdMap.get(statisticsOrderInfoVO.getWaybillId()); @@ -159,23 +182,23 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl { - if(!sb3.toString().isEmpty()){ + if (!sb3.toString().isEmpty()) { sb3.append(","); } sb3.append(s); List advanceDetailDTOS1 = collect.get(s); Optional first = waybillDetailByWaybillNoVos.stream().filter(waybillDetailByWaybillNoVo -> waybillDetailByWaybillNoVo.getProductName().equals(s)).findFirst(); - if(first.isPresent()){ + if (first.isPresent()) { WaybillDetailByWaybillNoVo waybillDetailByWaybillNoVo = first.get(); - if(!sb.toString().isEmpty()){ + if (!sb.toString().isEmpty()) { sb.append(","); } @@ -204,7 +227,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl getStatisticsOrderInfoVOIPage2C(MerchantStatisticsDTO merchantStatisticsDTO, IPage page) { + IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); + List records = statisticsOrderInfoVOIPage.getRecords(); + if (CollUtil.isEmpty(records)) { + return statisticsOrderInfoVOIPage; + } + + //把records中所有的orderInfoId放入一个集合 + List orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); + // 得到运单ID集合 + Set waybillIds = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); + + // 查询运单明细集合 + List waybillDetailByWaybillId = baseMapper.findWaybillDetailByWaybillId(waybillIds); + + //得到运单号 + Set orderCodeSet = records.stream().map(StatisticsOrderInfoVO::getOrderCode).collect(Collectors.toSet()); + + + // 通过运单号进行分组 + Map> waybillDetailByWaybillIdMap = waybillDetailByWaybillId.stream().collect(Collectors.groupingBy(WaybillDetailByWaybillNoVo::getWaybillId)); + + Map orderPackageInfoMap; + if (CollUtil.isNotEmpty(orderInfoIdList)) { + List orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupById(orderInfoIdList); + //把orderPackageInfoList转化成以orderInfoId为key的Map + if (CollUtil.isNotEmpty(orderPackageInfoList)) { + orderPackageInfoMap = orderPackageInfoList.stream() + .collect(Collectors.toMap(StatisticsPackageFeeInfoVO::getOrderInfoId, statisticsPackageFeeInfoVO -> statisticsPackageFeeInfoVO)); + } else { + orderPackageInfoMap = null; + } + } else { + orderPackageInfoMap = null; + } + + List advanceDetailDTOS = baseMapper.selectAdvinceDetail(waybillIds, orderCodeSet); + records.forEach(statisticsOrderInfoVO -> { +// Long waybillId = statisticsOrderInfoVO.getWaybillId(); + + + Long waybillId = statisticsOrderInfoVO.getWaybillId(); + String orderCode = statisticsOrderInfoVO.getOrderCode(); + // 查询站存单上的 + + List advanceDetailDTOList = advanceDetailDTOS.stream(). + filter(advanceDetailDTO -> advanceDetailDTO.getWaybillId().equals(waybillId) && advanceDetailDTO.getOrderCode().equals(orderCode)).collect(Collectors.toList()); + + // 对advanceDetailDTOList 按照 incomeCategoryName 进分组 并统计数量 + Map> collect = advanceDetailDTOList.stream().filter(advanceDetailDTO -> !Objects.isNull(advanceDetailDTO.getIncomeCategoryName())).collect(Collectors.groupingBy(AdvanceDetailDTO::getIncomeCategoryName)); + + Long orderInfoId = statisticsOrderInfoVO.getOrderInfoId(); + if (orderPackageInfoMap != null) { + StatisticsPackageFeeInfoVO statisticsPackageFeeInfoVO = orderPackageInfoMap.get(orderInfoId); + + if (statisticsPackageFeeInfoVO != null) { +// statisticsPackageFeeInfoVO.setGoodsName(statisticsOrderInfoVO.getGoodsName()); + BeanUtil.copy(statisticsPackageFeeInfoVO, statisticsOrderInfoVO); + + if (StringUtil.isNotBlank(statisticsOrderInfoVO.getGoodsName())) { +// String[] split = statisticsOrderInfoVO.getGoodsName().split(","); + List waybillDetailByWaybillNoVos = waybillDetailByWaybillIdMap.get(statisticsOrderInfoVO.getWaybillId()); + + StringBuffer sb = new StringBuffer(); + StringBuffer sb1 = new StringBuffer(); + StringBuffer sb3 = new StringBuffer(); + + if (collect.isEmpty()) { + + if (waybillDetailByWaybillNoVos != null && !waybillDetailByWaybillNoVos.isEmpty()) { + + for (WaybillDetailByWaybillNoVo waybillDetailByWaybillNoVo : waybillDetailByWaybillNoVos) { + + if (!sb3.toString().isEmpty()) { + sb3.append(","); + } + sb3.append(waybillDetailByWaybillNoVo.getProductName()); + + if (!sb.toString().isEmpty()) { + sb.append(","); + } + sb.append(waybillDetailByWaybillNoVo.getNum()); + + if (!sb1.toString().isEmpty()) { + sb1.append(","); + } + sb1.append(waybillDetailByWaybillNoVo.getPrice()); + + } + + } + + } else { + collect.keySet().forEach(s -> { + if (!sb3.toString().isEmpty()) { + sb3.append(","); + } + sb3.append(s); + List advanceDetailDTOS1 = collect.get(s); + + if (waybillDetailByWaybillNoVos != null) { + Optional first = waybillDetailByWaybillNoVos.stream().filter(waybillDetailByWaybillNoVo -> waybillDetailByWaybillNoVo.getProductName().equals(s)).findFirst(); + + if (first.isPresent()) { + WaybillDetailByWaybillNoVo waybillDetailByWaybillNoVo = first.get(); + + if (!sb.toString().isEmpty()) { + sb.append(","); + } + + //统计 advanceDetailDTOS1 这个集合种 quantity 的和值 + int sum = advanceDetailDTOS1.stream().mapToInt(AdvanceDetailDTO::getQuantity).sum(); + sb.append(sum); + + if (!sb1.toString().isEmpty()) { + sb1.append(","); + } + sb1.append(waybillDetailByWaybillNoVo.getPrice()); + } + } + + + }); + + } + + statisticsOrderInfoVO.setGoodsName(sb3.toString()); + statisticsOrderInfoVO.setGoodsNum(sb.toString()); + statisticsOrderInfoVO.setGoodsPrice(sb1.toString()); + } + + } + } + + }); statisticsOrderInfoVOIPage.setRecords(records); return statisticsOrderInfoVOIPage; } @@ -244,7 +407,6 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl list = changesRecordService.list(queryWrapper); - if (CollUtil.isNotEmpty(list)) { // 获取list中所有元素的id @@ -318,9 +480,9 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl 1){ + if (consigneeIdSet.size() > 1) { log.warn("############checkBalance: 对账单商家不相同={} ", consigneeIdSet); throw new CustomerException(405, "对账单商家不相同"); } - if(destinationWarehouseIdSet.size() > 1){ + if (destinationWarehouseIdSet.size() > 1) { log.warn("############checkBalance: destinationWarehouseIdSet={} ", destinationWarehouseIdSet); throw new CustomerException(405, "对账单目的仓不相同"); } @@ -379,7 +541,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); - if(CollUtil.isNotEmpty(orderInfoIdList)){ + if (CollUtil.isNotEmpty(orderInfoIdList)) { List orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupById(orderInfoIdList); //把orderPackageInfoList转化成以orderInfoId为key的Map Map orderPackageInfoMap = orderPackageInfoList.stream() @@ -541,7 +703,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl distributionPackageEntities = distributionPackageService.list(new QueryWrapper().lambda().eq(StatisticsDistributionPackageEntity::getWaybillId, id)); + // 校验是否全部配送完成 + if (CollUtil.isEmpty(distributionPackageEntities) || distributionPackageEntities.stream().anyMatch(distributionPackageEntity -> distributionPackageEntity.getIsSign() == null || NumberUtil.equals(0, distributionPackageEntity.getIsSign()))) { + log.warn("#############calculateRealCost: 订单未全部配送完成,无法计算。"); + throw new CustomerException(405, "订单未全部配送完成,无法计算。"); + } + List warehousePackageEntities = warehousePackageService.list(new QueryWrapper().lambda().eq(StatisticsWarehousePackageEntity::getWaybillId, id)); + PriceDispatchVO dispatch = price.getDispatch(); + PriceWarehouseVO warehouse = price.getWarehouse(); + + BasicdataPriceTemplateEntity template = price.getTemplate(); + if (ObjectUtil.isEmpty(template)) { + log.warn("#############calculateRealCost: 未维护模版,无法计算。"); + throw new CustomerException(405, "未维护模版,无法计算。"); + } + String serviceType = template.getServiceType(); + Integer dispatchIsMinCost = template.getDispatchIsMinCost(); + + BasicdataClientEntity entityById = basicdataClientClient.findEntityById(consigneeId); + + // 模版的服务类型 + String typeService = String.valueOf(entityById.getTypeService()); + if (StrUtil.isNotEmpty(serviceType)) { + // 模版是否有仓储 + if (StrUtil.contains(serviceType, "3")) { + if (CollUtil.isNotEmpty(warehousePackageEntities)) { + calculateWarehouseCost(warehouse, warehousePackageEntities, template); + } + } + // 模版是否有配送 + if (StrUtil.contains(serviceType, "4")) { + if (CollUtil.isNotEmpty(distributionPackageEntities)) { + calculateDispatchCost(template, typeService, distributionPackageEntities, dispatch, dispatchIsMinCost, brandId, consigneeId); + } + } + } + + lambdaUpdate().set(StatisticsOrderInfoEntity::getSyncFeeStatus, 1).set(StatisticsOrderInfoEntity::getSyncFeeDate, new Date()).eq(StatisticsOrderInfoEntity::getWaybillId, id).update(); + +// orderInfoEntity.setSyncFeeStatus(1); +// orderInfoEntity.setSyncFeeDate(new Date()); +// updateById(orderInfoEntity); + + + return Boolean.TRUE; } + @Override public StatisticsPackageFeeInfoVO findPackageListByOrderIds(List orderInfoIdsList) { return baseMapper.findPackageListByOrderIds(orderInfoIdsList); @@ -564,9 +799,9 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl orderInfoEntities = baseMapper.selectBatchIds(orderInfoIds); - if(CollUtil.isEmpty(orderInfoEntities)){ + if (CollUtil.isEmpty(orderInfoEntities)) { log.warn("############createReconciliationOrder: 未找到对应订单信息"); - return R.fail(405,"未找到对应订单信息"); + return R.fail(405, "未找到对应订单信息"); } @@ -577,24 +812,24 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl> groupByConsigneeId = orderInfoEntities.stream().collect(Collectors.groupingBy(StatisticsOrderInfoEntity::getConsigneeId)); int consigneeSize = groupByConsigneeId.keySet().size(); - if(consigneeSize > 1){ + if (consigneeSize > 1) { log.warn("############createReconciliationOrder: 订单不属于同一个商家"); - return R.fail(405,"订单不属于同一个商家"); + return R.fail(405, "订单不属于同一个商家"); } Map> groupByDestinationWarehouseId = orderInfoEntities.stream().collect(Collectors.groupingBy(StatisticsOrderInfoEntity::getDestinationWarehouseId)); int destinationWarehouseIdSize = groupByDestinationWarehouseId.keySet().size(); - if(destinationWarehouseIdSize > 1){ + if (destinationWarehouseIdSize > 1) { log.warn("############createReconciliationOrder: 订单不属于同一个目的仓"); - return R.fail(405,"订单不属于同一个目的仓"); + return R.fail(405, "订单不属于同一个目的仓"); } StatisticsPackageFeeInfoVO orderPackageTotalVO = baseMapper.findPackageListByOrderIds(orderInfoIds); BigDecimal freightPrice = orderPackageTotalVO.getFreightPrice(); @@ -612,7 +847,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl updateList = new ArrayList<>(); orderInfoEntities.forEach(orderInfoEntity -> { @@ -682,6 +917,272 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl waybillIds) { +// List orderInfoEntities = baseMapper.selectBatchIds(orderInfoIds); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + queryWrapper.in(StatisticsOrderInfoEntity::getWaybillId, waybillIds); + queryWrapper.eq(StatisticsOrderInfoEntity::getConfirmBalanceOrderStatus, 0); + + List orderInfoEntities = baseMapper.selectList(queryWrapper); + if (CollUtil.isEmpty(orderInfoEntities)) { + log.warn("############createReconciliationOrder: 未找到对应订单信息"); + return R.fail(405, "未找到对应订单信息"); + } + + + List orderInfoIds = orderInfoEntities.stream().map(StatisticsOrderInfoEntity::getId).collect(Collectors.toList()); + + for (StatisticsOrderInfoEntity orderInfoEntity : orderInfoEntities) { + if (orderInfoEntity.getTypeService() != null && orderInfoEntity.getTypeService() != 2) { + continue; + } + Integer syncFeeStatus = orderInfoEntity.getSyncFeeStatus(); + Long orderId = orderInfoEntity.getId(); + String orderCode = orderInfoEntity.getOrderCode(); + if (syncFeeStatus == 0) { + log.warn("############createReconciliationOrder: 订单还未计算价格的数据 orderId={}", orderId); + return R.fail(405, "订单[" + orderCode + "]未计算价格的数据"); + } + } + + //判断orderInfoEntities中所有元素通过consigneeId进行分组 + Map> groupByConsigneeId = orderInfoEntities.stream().collect(Collectors.groupingBy(StatisticsOrderInfoEntity::getConsigneeId)); + int consigneeSize = groupByConsigneeId.keySet().size(); + if (consigneeSize > 1) { + log.warn("############createReconciliationOrder: 订单不属于同一个商家"); + return R.fail(405, "订单不属于同一个商家"); + } + Map> groupByDestinationWarehouseId = orderInfoEntities.stream().collect(Collectors.groupingBy(StatisticsOrderInfoEntity::getDestinationWarehouseId)); + int destinationWarehouseIdSize = groupByDestinationWarehouseId.keySet().size(); + if (destinationWarehouseIdSize > 1) { + log.warn("############createReconciliationOrder: 订单不属于同一个目的仓"); + return R.fail(405, "订单不属于同一个目的仓"); + } + StatisticsPackageFeeInfoVO orderPackageTotalVO = baseMapper.findPackageListByOrderIds(orderInfoIds); + BigDecimal freightPrice = orderPackageTotalVO.getFreightPrice(); + BigDecimal systemFreightPrice = orderPackageTotalVO.getSystemFreightPrice(); + BigDecimal pickupPrice = orderPackageTotalVO.getPickupPrice(); + BigDecimal systemPickupPrice = orderPackageTotalVO.getSystemPickupPrice(); + BigDecimal warehouseServiceFee = orderPackageTotalVO.getWarehouseServiceFee(); + BigDecimal deliveryServiceFee = orderPackageTotalVO.getDeliveryServiceFee(); + BigDecimal totalFee = freightPrice.add(pickupPrice).add(warehouseServiceFee).add(deliveryServiceFee); + BigDecimal sysTotalFee = systemFreightPrice.add(systemPickupPrice).add(warehouseServiceFee).add(deliveryServiceFee); + + StatisticsOrderInfoEntity statisticsOrderInfoEntity = orderInfoEntities.get(0); + Long consigneeId = statisticsOrderInfoEntity.getConsigneeId(); + String consignee = statisticsOrderInfoEntity.getConsignee(); + Long destinationWarehouseId = statisticsOrderInfoEntity.getDestinationWarehouseId(); + String destinationWarehouseName = statisticsOrderInfoEntity.getDestinationWarehouseName(); + + String reconciliationOrdeCode = "DZD" + System.currentTimeMillis(); + + StatisticsReconciliationOrderInfoEntity reconciliationOrder = new StatisticsReconciliationOrderInfoEntity(); + reconciliationOrder.setReconciliationOrderNo(reconciliationOrdeCode); + //把orderInfoEntities中所有waybillNo去重拼接起来 + reconciliationOrder.setWaybillNo(orderInfoEntities.stream().map(StatisticsOrderInfoEntity::getWaybillNo).distinct().collect(Collectors.joining(","))); + // 增加运单的制单时间 +// reconciliationOrder.setWaybillCreateTime(orderInfoEntities.get(0).getWaybillCreateTime()); + + reconciliationOrder.setOrderCode(orderInfoEntities.stream().map(StatisticsOrderInfoEntity::getOrderCode).distinct().collect(Collectors.joining(","))); + reconciliationOrder.setBrand(orderInfoEntities.stream().map(StatisticsOrderInfoEntity::getBrand).distinct().collect(Collectors.joining(","))); + reconciliationOrder.setConsigneeId(consigneeId); + reconciliationOrder.setConsignee(consignee); + reconciliationOrder.setDestinationWarehouseName(destinationWarehouseName); + reconciliationOrder.setDestinationWarehouseId(destinationWarehouseId); + reconciliationOrder.setTotalNum(orderPackageTotalVO.getTotalNum()); + reconciliationOrder.setTotalWeight(orderPackageTotalVO.getTotalWeight()); + reconciliationOrder.setTotalVolume(orderPackageTotalVO.getTotalVolume()); + + reconciliationOrder.setSystemTotalFee(sysTotalFee); + reconciliationOrder.setRealTotalFee(totalFee); + reconciliationOrder.setPickupFee(pickupPrice); + reconciliationOrder.setFreightFee(freightPrice); + reconciliationOrder.setWarehouseServiceFee(warehouseServiceFee); + reconciliationOrder.setWarehouseFee(orderPackageTotalVO.getWarehouseFee()); + reconciliationOrder.setWarehouseManageFee(orderPackageTotalVO.getWarehouseManageFee()); + reconciliationOrder.setWarehouseSortingFee(orderPackageTotalVO.getWarehouseSortingFee()); + reconciliationOrder.setWarehouseOperatingFee(orderPackageTotalVO.getWarehouseOperatingFee()); + reconciliationOrder.setDeliveryFee(orderPackageTotalVO.getDeliveryFee()); + reconciliationOrder.setDeliveryServiceFee(deliveryServiceFee); + reconciliationOrder.setDeliveryLoadingFee(orderPackageTotalVO.getDeliveryLoadingFee()); + reconciliationOrder.setDeliverySortingFee(orderPackageTotalVO.getDeliverySortingFee()); + reconciliationOrder.setDeliveryUpfloorFee(orderPackageTotalVO.getDeliveryUpfloorFee()); + reconciliationOrder.setDeliveryMoveFee(orderPackageTotalVO.getDeliveryMoveFee()); + reconciliationOrder.setDeliveryOtherFee(orderPackageTotalVO.getDeliveryOtherFee()); + reconciliationOrder.setDeliveryCrossingFee(orderPackageTotalVO.getDeliveryCrossingFee()); + reconciliationOrder.setInstallFee(BigDecimal.ZERO); + reconciliationOrder.setOtherFee(BigDecimal.ZERO); + + reconciliationOrder.setIsAftersale(0); +// reconciliationOrder.setH(BigDecimal.ZERO); + + reconciliationOrder.setCreateUserName(AuthUtil.getNickName()); + + reconciliationOrder.setIsChanges(0); + reconciliationOrder.setChangesFee(BigDecimal.ZERO); + + reconciliationOrder.setCheckStatus(0); + + + boolean saveFlag = reconciliationOrderInfoService.save(reconciliationOrder); + if (saveFlag) { + Long reconciliationOrderId = reconciliationOrder.getId(); + List updateList = new ArrayList<>(); + orderInfoEntities.forEach(orderInfoEntity -> { + StatisticsOrderInfoEntity updateEntity = new StatisticsOrderInfoEntity(); + updateEntity.setId(orderInfoEntity.getId()); + updateEntity.setCreateReconciliationOrderStatus(1); + updateEntity.setCreateReconciliationUserName(AuthUtil.getNickName()); + updateEntity.setCreateReconciliationDate(new Date()); + updateEntity.setReconciliationOrderId(reconciliationOrderId); + updateEntity.setReconciliationOrderNo(reconciliationOrdeCode); + updateList.add(updateEntity); + }); + updateBatchById(updateList); + } + return R.success("生成成功"); + } + + + @Transactional + @Override + public R createFinishWaybillId(List waybillIds) { + + for (Long waybillId : waybillIds) { + WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); + if (Objects.isNull(waybillEntity)) { + log.error("############createBalanceOrder: 运单不存在 waybillId={}", waybillId); + } + +// List wayBillDetailList = warehouseWaybillDetailClient.findByWaybillId(waybillId); + //把wayBillDetailList中所有productName用逗号拼起来 +// String productTypeNum = wayBillDetailList.stream().map(t->t.getProductName()+"("+t.getNum()+")").collect(Collectors.joining(",")); +// String productTypePrice = wayBillDetailList.stream().map(t->t.getProductName()+"("+t.getPrice()+")").collect(Collectors.joining(",")); + + List orderInfoEntityList = this.findListByWaybillId(waybillId); + //把orderInfoEntityList中所有id放入一个list,以便查询所有包件信息 + List orderInfoIdsList = orderInfoEntityList.stream().map(StatisticsOrderInfoEntity::getId).collect(Collectors.toList()); + + StatisticsPackageFeeInfoVO trunklinePackageFeeVO = this.findPackageListByOrderIds(orderInfoIdsList); + + String balanceOrderCode = "JSD" + System.currentTimeMillis(); + + BigDecimal freightPrice = trunklinePackageFeeVO.getFreightPrice(); + BigDecimal pickupPrice = trunklinePackageFeeVO.getPickupPrice(); + BigDecimal warehouseServiceFee = trunklinePackageFeeVO.getWarehouseServiceFee(); + BigDecimal deliveryServiceFee = trunklinePackageFeeVO.getDeliveryServiceFee(); + BigDecimal totalFee = freightPrice.add(pickupPrice).add(warehouseServiceFee).add(deliveryServiceFee); + + StatisticsBalanceOrderInfoEntity balanceOrderInfoEntity = new StatisticsBalanceOrderInfoEntity(); + balanceOrderInfoEntity.setBalanceOrderNo(balanceOrderCode); + balanceOrderInfoEntity.setBrand(waybillEntity.getBrand()); + balanceOrderInfoEntity.setWaybillNo(waybillEntity.getWaybillNo()); + //把orderInfoEntityList中所有orderCode用逗号拼起来 + balanceOrderInfoEntity.setOrderCode(orderInfoEntityList.stream().map(StatisticsOrderInfoEntity::getOrderCode).collect(Collectors.joining(","))); + balanceOrderInfoEntity.setTypeService(waybillEntity.getServiceType()); + + balanceOrderInfoEntity.setTotalBalanceFee(totalFee); + balanceOrderInfoEntity.setRealTotalFee(totalFee); + balanceOrderInfoEntity.setTotalCount(trunklinePackageFeeVO.getTotalNum()); + balanceOrderInfoEntity.setTotalWeight(trunklinePackageFeeVO.getTotalWeight()); + balanceOrderInfoEntity.setTotalVolume(trunklinePackageFeeVO.getTotalVolume()); + balanceOrderInfoEntity.setConsigneeId(waybillEntity.getConsigneeId()); + balanceOrderInfoEntity.setConsignee(waybillEntity.getConsignee()); + balanceOrderInfoEntity.setPickupFee(pickupPrice); + balanceOrderInfoEntity.setFreightFee(freightPrice); + balanceOrderInfoEntity.setWarehouseServiceFee(warehouseServiceFee); + balanceOrderInfoEntity.setWarehouseFee(trunklinePackageFeeVO.getWarehouseFee()); + balanceOrderInfoEntity.setWarehouseManageFee(trunklinePackageFeeVO.getWarehouseManageFee()); + balanceOrderInfoEntity.setWarehouseSortingFee(trunklinePackageFeeVO.getWarehouseSortingFee()); + balanceOrderInfoEntity.setWarehouseOperatingFee(trunklinePackageFeeVO.getWarehouseOperatingFee()); + balanceOrderInfoEntity.setDeliveryFee(trunklinePackageFeeVO.getDeliveryFee()); + balanceOrderInfoEntity.setDeliveryServiceFee(deliveryServiceFee); + balanceOrderInfoEntity.setDeliveryLoadingFee(trunklinePackageFeeVO.getDeliveryLoadingFee()); + balanceOrderInfoEntity.setDeliverySortingFee(trunklinePackageFeeVO.getDeliverySortingFee()); + balanceOrderInfoEntity.setDeliveryUpfloorFee(trunklinePackageFeeVO.getDeliveryUpfloorFee()); + balanceOrderInfoEntity.setDeliveryMoveFee(trunklinePackageFeeVO.getDeliveryMoveFee()); + balanceOrderInfoEntity.setDeliveryCrossingFee(trunklinePackageFeeVO.getDeliveryCrossingFee()); + balanceOrderInfoEntity.setDeliveryOtherFee(trunklinePackageFeeVO.getDeliveryOtherFee()); + balanceOrderInfoEntity.setOtherFee(BigDecimal.ZERO); + balanceOrderInfoEntity.setInstallFee(BigDecimal.ZERO); + + balanceOrderInfoEntity.setIsAftersale(0); + balanceOrderInfoEntity.setAftersalesFee(BigDecimal.ZERO); + + balanceOrderInfoEntity.setBalanceStatus(2); + balanceOrderInfoEntity.setHasBalanceFee(balanceOrderInfoEntity.getTotalBalanceFee()); + balanceOrderInfoEntity.setBalanceUserName(AuthUtil.getUserName()); + balanceOrderInfoEntity.setBalanceTime(new Date(System.currentTimeMillis())); + +// balanceOrderInfoEntity.setHasBalanceFee(BigDecimal.ZERO); + balanceOrderInfoEntity.setNoBalanceFee(BigDecimal.ZERO); + balanceOrderInfoEntity.setAbnormalBalanceStatus(0); + balanceOrderInfoEntity.setAbnormalBalanceFee(BigDecimal.ZERO); + + balanceOrderInfoEntity.setDestinationWarehouseId(waybillEntity.getDestinationWarehouseId()); + balanceOrderInfoEntity.setDestinationWarehouseName(waybillEntity.getDestinationWarehouseName()); + + boolean saveFlag = balanceOrderInfoService.save(balanceOrderInfoEntity); + if (saveFlag) { + Long balanceOrderId = balanceOrderInfoEntity.getId(); + List updateOrderInfoList = new ArrayList<>(); + orderInfoEntityList.forEach(orderInfoEntity -> { + StatisticsOrderInfoEntity updateEntity = new StatisticsOrderInfoEntity(); + updateEntity.setId(orderInfoEntity.getId()); + updateEntity.setBalanceOrderId(balanceOrderId); + updateEntity.setBalanceOrderNo(balanceOrderCode); + updateEntity.setCreateReconciliationOrderStatus(1); + updateEntity.setCreateReconciliationUserName(AuthUtil.getNickName()); + updateEntity.setCreateReconciliationDate(new Date()); + updateEntity.setConfirmBalanceOrderStatus(1); + updateEntity.setConfirmBalanceDate(new Date()); + updateEntity.setConfirmBalanceUserName(AuthUtil.getNickName()); + updateOrderInfoList.add(updateEntity); + }); + if (CollUtil.isNotEmpty(updateOrderInfoList)) { + this.updateBatchById(updateOrderInfoList); + } + } + + + // 保存结算记录 + StatisticsBalanceRecordEntity balanceRecordEntity = new StatisticsBalanceRecordEntity(); + balanceRecordEntity.setBalanceOrderInfoId(balanceOrderInfoEntity.getId()); + balanceRecordEntity.setBalanceUserName(AuthUtil.getNickName()); + balanceRecordEntity.setBalanceRemark("批量完成结算"); + balanceRecordEntity.setBalanceFee(totalFee); + balanceRecordService.save(balanceRecordEntity); + } + + // 批量更新运单状态 + List te = warehouseWaybillClient.findListByWaybillIds(waybillIds); + List data = new ArrayList<>(); + te.forEach(waybillEntity ->{ + WarehouseWaybillEntity t = new WarehouseWaybillEntity(); + t.setId(waybillEntity.getId()); + t.setPayStatus("30"); + t.setSettlementStatus("30"); + data.add(t); + + + }); + + + + + warehouseWaybillClient.updateList(data); + + + return R.success("操作成功"); + + + + } + @Override public R findAftersalesOrderList(Long consigneeId) { @@ -696,21 +1197,21 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl aftersalesOrderDTOS = merchantStatisticsDTO.getAftersalesOrderDTOS(); - if(CollUtil.isEmpty(aftersalesOrderDTOS)){ - log.warn("#########addAftersalesToReconciliationOrder: 请选择售后单 aftersalesOrderDTOS={}",aftersalesOrderDTOS); - return R.fail(405,"请选择售后单"); + if (CollUtil.isEmpty(aftersalesOrderDTOS)) { + log.warn("#########addAftersalesToReconciliationOrder: 请选择售后单 aftersalesOrderDTOS={}", aftersalesOrderDTOS); + return R.fail(405, "请选择售后单"); } //把aftersalesOrderDTOS中所有元素的aftersalesFee 求和 @@ -728,7 +1229,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl orderInfoIds) { StatisticsReconciliationOrderInfoEntity reconciliationOrderInfo = reconciliationOrderInfoService.getById(reconciliationOrderId); - if(Objects.isNull(reconciliationOrderInfo)){ - log.warn("#########cancleOrderInfoBindReconcilitionOrder: 对账单信息不存在 reconciliationOrderId={}",reconciliationOrderId); - return R.fail(405,"对账单信息不存在"); + if (Objects.isNull(reconciliationOrderInfo)) { + log.warn("#########cancleOrderInfoBindReconcilitionOrder: 对账单信息不存在 reconciliationOrderId={}", reconciliationOrderId); + return R.fail(405, "对账单信息不存在"); } Integer checkStatus = reconciliationOrderInfo.getCheckStatus(); - if(checkStatus == 1){ - log.warn("#########cancleOrderInfoBindReconcilitionOrder: 对账单已确认对账 reconciliationOrderId={}",reconciliationOrderId); - return R.fail(405,"对账单已确认对账"); + if (checkStatus == 1) { + log.warn("#########cancleOrderInfoBindReconcilitionOrder: 对账单已确认对账 reconciliationOrderId={}", reconciliationOrderId); + return R.fail(405, "对账单已确认对账"); } - baseMapper.clearReconcilitionOrderInfoByOrderInfoIds(orderInfoIds,AuthUtil.getNickName(),new Date()); + baseMapper.clearReconcilitionOrderInfoByOrderInfoIds(orderInfoIds, AuthUtil.getNickName(), new Date()); //重新计算对账单的数据 calculateReconcilitionOrder(reconciliationOrderInfo); @@ -801,19 +1302,19 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl balanceOrderIds = baseMapper.findBalanceOrderIdListByWaybillId(waybillId); - if(CollUtil.isNotEmpty(balanceOrderIds)){ + if (CollUtil.isNotEmpty(balanceOrderIds)) { QueryWrapper balanceAbnormalEntityQueryWrapper = new QueryWrapper<>(); balanceAbnormalEntityQueryWrapper.in("balance_order_info_id", balanceOrderIds); List list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper); - if(CollUtil.isNotEmpty(list)){ + if (CollUtil.isNotEmpty(list)) { return 1; - }else{ + } else { return 0; } - }else{ + } else { return 0; } } @@ -849,11 +1350,11 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl orderInfoIds = baseMapper.findOrderInfoIdListByReconciliationOrderIds(reconciliationOrderIdList); - if(CollUtil.isNotEmpty(orderInfoIds)){ + if (CollUtil.isNotEmpty(orderInfoIds)) { List orderInfoEntities = baseMapper.selectBatchIds(orderInfoIds); - if(CollUtil.isEmpty(orderInfoEntities)){ + if (CollUtil.isEmpty(orderInfoEntities)) { log.warn("############calculateReconcilitionOrder: 未找到对应订单信息"); - throw new CustomerException(405,"未找到对应订单信息"); + throw new CustomerException(405, "未找到对应订单信息"); } @@ -861,24 +1362,24 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl> groupByConsigneeId = orderInfoEntities.stream().collect(Collectors.groupingBy(StatisticsOrderInfoEntity::getConsigneeId)); int consigneeSize = groupByConsigneeId.keySet().size(); - if(consigneeSize > 1){ + if (consigneeSize > 1) { log.warn("############calculateReconcilitionOrder: 订单不属于同一个商家"); - throw new CustomerException(405,"订单不属于同一个商家"); + throw new CustomerException(405, "订单不属于同一个商家"); } Map> groupByDestinationWarehouseId = orderInfoEntities.stream().collect(Collectors.groupingBy(StatisticsOrderInfoEntity::getDestinationWarehouseId)); int destinationWarehouseIdSize = groupByDestinationWarehouseId.keySet().size(); - if(destinationWarehouseIdSize > 1){ + if (destinationWarehouseIdSize > 1) { log.warn("############calculateReconcilitionOrder: 订单不属于同一个目的仓"); - throw new CustomerException(405,"订单不属于同一个目的仓"); + throw new CustomerException(405, "订单不属于同一个目的仓"); } StatisticsPackageFeeInfoVO orderPackageTotalVO = baseMapper.findPackageListByOrderIds(orderInfoIds); BigDecimal freightPrice = orderPackageTotalVO.getFreightPrice(); @@ -928,13 +1429,11 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl warehousePackageEntities, BasicdataPriceTemplateEntity template) { @@ -976,66 +1475,66 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl trainNumberSet = distributionPackageEntities.stream().map(StatisticsDistributionPackageEntity::getTrainNumber).collect(Collectors.toSet()); - List distributionPackageEntities1 = distributionPackageService.list(Wrappers.lambdaQuery() - .in(StatisticsDistributionPackageEntity::getTrainNumber, trainNumberSet)); - for (String s : trainNumberSet) { - if(CollUtil.isNotEmpty(distributionPackageEntities1)){ - List packageEntities = distributionPackageEntities1.stream() - .filter(entity -> ObjectUtil.equals(s, entity.getTrainNumber())) - .filter(entity -> ObjectUtil.equals(entity.getBrandId(), brandId)) - .filter(entity -> ObjectUtil.equals(entity.getConsigneeId(), consigneeId)) - .collect(Collectors.toList()); - if(CollUtil.isNotEmpty(packageEntities)){ - buildDispatchCostToPackage(dispatchMinCostType, packageEntities, minCost, additionalCost); - } + } + // 保底价 + // 1 是否有最低价 2 最低价的计费类型是按订单还是按配送任务 3 按价格还是件方重量 + if (ObjectUtil.equals(BooleanZeroOneEnums.YES.getCode(), dispatchIsMinCost)) { + // 1 订单 2 配送任务 + Integer dispatchMinCostMode = template.getDispatchMinCostMode(); + // 1 价格 2 件 3 方 4 重量 + Integer dispatchMinCostType = template.getDispatchMinCostType(); + // 最低价 + Double minCost = dispatch.getMinCost(); + // 加算价格 + Double additionalCost = dispatch.getAdditionalCost(); + if (ObjectUtil.equals(1, dispatchMinCostMode)) { + buildDispatchCostToPackage(dispatchMinCostType, distributionPackageEntities, minCost, additionalCost); + } else if (ObjectUtil.equals(2, dispatchMinCostMode)) { + // 按配送任务 计算规则 1 取出包件中所有的配送任务号 2 按配送任务号查出所有包件信息 3 按品牌和收货单位过滤(可能存在同一个配送任务存在同一客户不同订单情况) 4 按配送任务分组计算 + Set trainNumberSet = distributionPackageEntities.stream().map(StatisticsDistributionPackageEntity::getTrainNumber).collect(Collectors.toSet()); + List distributionPackageEntities1 = distributionPackageService.list(Wrappers.lambdaQuery() + .in(StatisticsDistributionPackageEntity::getTrainNumber, trainNumberSet)); + for (String s : trainNumberSet) { + if (CollUtil.isNotEmpty(distributionPackageEntities1)) { + List packageEntities = distributionPackageEntities1.stream() + .filter(entity -> ObjectUtil.equals(s, entity.getTrainNumber())) + .filter(entity -> ObjectUtil.equals(entity.getBrandId(), brandId)) + .filter(entity -> ObjectUtil.equals(entity.getConsigneeId(), consigneeId)) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(packageEntities)) { + buildDispatchCostToPackage(dispatchMinCostType, packageEntities, minCost, additionalCost); } } - // Map> map = distributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getTrainNumber)); - // if (CollUtil.isNotEmpty(map)) { - // for (Map.Entry> entry : map.entrySet()) { - // List value = entry.getValue(); - // buildDispatchCostToPackage(dispatchMinCostType, value, minCost, additionalCost); - // } - // } } + // Map> map = distributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getTrainNumber)); + // if (CollUtil.isNotEmpty(map)) { + // for (Map.Entry> entry : map.entrySet()) { + // List value = entry.getValue(); + // buildDispatchCostToPackage(dispatchMinCostType, value, minCost, additionalCost); + // } + // } } + } - // 保存配送包件信息 - if (CollUtil.isNotEmpty(distributionPackageEntities)) { - // 计算配送服务费 realDeliveryServiceFee = 所有real费用的和 - distributionPackageEntities.stream().forEach(entity -> { - entity.setDeliveryServiceFee(entity.getDeliveryFee() - .add(entity.getDeliveryLoadingFee()) - .add(entity.getDeliveryMoveFee()) - .add(entity.getDeliveryCrossingFee()) - .add(entity.getDeliverySortingFee()) - .add(entity.getDeliveryUpfloorFee())); - }); - distributionPackageService.saveOrUpdateBatch(distributionPackageEntities); - } + // 保存配送包件信息 + if (CollUtil.isNotEmpty(distributionPackageEntities)) { + // 计算配送服务费 realDeliveryServiceFee = 所有real费用的和 + distributionPackageEntities.stream().forEach(entity -> { + entity.setDeliveryServiceFee(entity.getDeliveryFee() + .add(entity.getDeliveryLoadingFee()) + .add(entity.getDeliveryMoveFee()) + .add(entity.getDeliveryCrossingFee()) + .add(entity.getDeliverySortingFee()) + .add(entity.getDeliveryUpfloorFee())); + }); + distributionPackageService.saveOrUpdateBatch(distributionPackageEntities); + } // } } @@ -1054,7 +1553,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl { +public class ExpenseOrderWarehouseTotalWrapper extends BaseEntityWrapper { public static ExpenseOrderWarehouseTotalWrapper build() { return new ExpenseOrderWarehouseTotalWrapper(); } @Override - public ExpenseOrderWarehouseTotalVO entityVO(ExpenseOrderWarehouseTotalEntity expenseOrderWarehouseTotal) { - ExpenseOrderWarehouseTotalVO expenseOrderWarehouseTotalVO = Objects.requireNonNull(BeanUtil.copy(expenseOrderWarehouseTotal, ExpenseOrderWarehouseTotalVO.class)); + public ExpenseWarehouseOrderVO entityVO(ExpenseWarehouseOrderEntity expenseOrderWarehouseTotal) { + ExpenseWarehouseOrderVO expenseOrderWarehouseTotalVO = Objects.requireNonNull(BeanUtil.copy(expenseOrderWarehouseTotal, ExpenseWarehouseOrderVO.class)); //User createUser = UserCache.getUser(expenseOrderWarehouseTotal.getCreateUser()); //User updateUser = UserCache.getUser(expenseOrderWarehouseTotal.getUpdateUser()); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java new file mode 100644 index 000000000..f334e6e2c --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java @@ -0,0 +1,161 @@ +package com.logpm.trunkline.mq.waybil; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.logpm.trunkline.dto.WaybillLogDTO; +import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient; +import com.logpm.trunkline.mapper.TrunklineWaybillPackageMapper; +import com.logpm.trunkline.service.ITrunklineWaybillPackageService; +import com.logpm.trunkline.service.ITrunklineWaybillTrackService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.broadcast.FanoutConstants; +import org.springblade.common.enums.BizOperationEnums; +import org.springblade.common.model.DistributionReCheckSignVO; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.common.model.PackageData; +import org.springblade.common.model.workNode.PickUpByReCheckVO; +import org.springframework.amqp.core.ExchangeTypes; +import org.springframework.amqp.rabbit.annotation.Exchange; +import org.springframework.amqp.rabbit.annotation.Queue; +import org.springframework.amqp.rabbit.annotation.QueueBinding; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 运单日志和状态变更 + */ +@Slf4j +@Component +@AllArgsConstructor +public class StatusLogListener { + + private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient ; + + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FanoutConstants.DeliveryOfPickup.BillSignReview.QUEUE.waybillStatusLog, durable = "true"), + exchange = @Exchange(name = FanoutConstants.DeliveryOfPickup.BillSignReview.EXCHANGE, type = ExchangeTypes.FANOUT) + )) + @Transactional(rollbackFor = Exception.class) + public void statusPickUpLog(String msg) { + + log.info("自提复核处理运单日志和状态: {}", msg); + if (StrUtil.isEmpty(msg)) { + return; + } + NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class); + Object main = bean.getMain(); + JSONObject entries = JSONUtil.parseObj(main); + PickUpByReCheckVO vo = JSONUtil.toBean(entries, PickUpByReCheckVO.class); + Long warehouseId = bean.getWarehouseId(); + BizOperationEnums bizOperation = bean.getBizOperation(); + List details = vo.getPackageDataList(); + + // 按照运单号进行分组 后面的集合 按照创建时间进行排序 + Map> map = details.stream().collect(Collectors.groupingBy(PackageData::getWaybillNumber)); + // 根据运单号 统计 每个运单的数量 + Map waybillCountMap = new HashMap<>(); + + for (PackageData packageData : details) { + String waybillNumber = packageData.getWaybillNumber(); + waybillCountMap.put(waybillNumber, waybillCountMap.getOrDefault(waybillNumber, 0) + packageData.getNumber()); + } + Set strings = waybillCountMap.keySet(); + + for (String waybillNumber : strings) { + + WaybillLogDTO t = new WaybillLogDTO(); + List packageDataList = map.get(waybillNumber); + if (packageDataList != null && !packageDataList.isEmpty()) { + packageDataList.sort(Comparator.comparing(PackageData::getSignTime)); + // 获取排序第一个 + t.setSignUser(packageDataList.get(0).getSignUser()); + t.setSignTime(packageDataList.get(0).getSignTime()); + } + t.setWaybillNo(waybillNumber); + t.setWarehouseName(bean.getWarehouse()); + t.setWarehouseId(warehouseId); + + t.setTrainNumber(vo.getPickupBatch()); + t.setCarNumber(vo.getCarNumber()); + t.setDriverName(vo.getDriverName()); + t.setDeliveryTime(vo.getDeliveryTime()); + t.setNum(waybillCountMap.get(waybillNumber)); + t.setSignOrderCode(vo.getPickupBatch()); + t.setType(3); + trunklineWaybillTrackClient.addSignWaybillLog(t); + + + } + + } + + + /** + * 配送签收复核 + * @param msg + */ + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FanoutConstants.distribution.DeliveryAndrecheck.QUEUE.waybillStatusLog, durable = "true"), + exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndrecheck.EXCHANGE, type = ExchangeTypes.FANOUT) + )) + @Transactional(rollbackFor = Exception.class) + public void statusDekiveryLog(String msg) { + + log.info("商/市配送 复核处理运单日志和状态: {}", msg); + if (StrUtil.isEmpty(msg)) { + return; + } + NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class); + Object main = bean.getMain(); + JSONObject entries = JSONUtil.parseObj(main); + DistributionReCheckSignVO vo = JSONUtil.toBean(entries, DistributionReCheckSignVO.class); + Long warehouseId = bean.getWarehouseId(); + BizOperationEnums bizOperation = bean.getBizOperation(); + List details = vo.getPackageDataList(); + + // 按照运单号进行分组 后面的集合 按照创建时间进行排序 + Map> map = details.stream().collect(Collectors.groupingBy(PackageData::getWaybillNumber)); + // 根据运单号 统计 每个运单的数量 + Map waybillCountMap = new HashMap<>(); + + for (PackageData packageData : details) { + String waybillNumber = packageData.getWaybillNumber(); + waybillCountMap.put(waybillNumber, waybillCountMap.getOrDefault(waybillNumber, 0) + packageData.getNumber()); + } + Set strings = waybillCountMap.keySet(); + + for (String waybillNumber : strings) { + + WaybillLogDTO t = new WaybillLogDTO(); + List packageDataList = map.get(waybillNumber); + if (packageDataList != null && !packageDataList.isEmpty()) { + packageDataList.sort(Comparator.comparing(PackageData::getSignTime)); + // 获取排序第一个 + t.setSignUser(packageDataList.get(0).getSignUser()); + t.setSignTime(packageDataList.get(0).getSignTime()); + } + t.setWaybillNo(waybillNumber); + t.setWarehouseName(bean.getWarehouse()); + t.setWarehouseId(warehouseId); + + t.setTrainNumber(vo.getTrainNumber()); + t.setCarNumber(vo.getVehicleName()); + t.setDriverName(vo.getDriverName()); + t.setDeliveryTime(vo.getDeliveryTime()); + t.setNum(waybillCountMap.get(waybillNumber)); + t.setSignOrderCode(vo.getReservationCode()); + t.setType(3); + trunklineWaybillTrackClient.addSignWaybillLog(t); + + } + + } + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java index 896d9f5d4..36e3892fd 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.OpenOrderDTO; import com.logpm.trunkline.dto.WaybillLogDTO; import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity; +import com.logpm.trunkline.mapper.TrunklineWaybillPackageMapper; import com.logpm.trunkline.mapper.TrunklineWaybillTrackMapper; import com.logpm.trunkline.service.IOpenOrderAsyncService; import com.logpm.trunkline.service.ITrunklineWaybillOrderService; @@ -27,12 +28,13 @@ import java.util.Objects; @Service @AllArgsConstructor public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl implements ITrunklineWaybillTrackService { - private final IWarehouseWaybillClient warehouseWaybillClient; private final IOpenOrderAsyncService openOrderAsyncService; - private final ITrunklineWaybillOrderService waybillOrderService; private final ITrunklineWaybillPackageService trunklineWaybillPackageService; + private final TrunklineWaybillPackageMapper trunklineWaybillPackageMapper; + + @Override public List findWaybillLog(Long waybillId, String trackType) { return baseMapper.findWaybillLog(waybillId,trackType); @@ -59,6 +61,11 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl>>>",packageStatus+" **"); + WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); if(Objects.isNull(warehouseWaybillEntity)){ log.warn("未找到运单信息 waybillNo:{}",waybillNo); @@ -78,6 +85,7 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl