diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java
index e18484e8d..0d65c89a1 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java
@@ -18,7 +18,7 @@ import java.util.Set;
/**
* bms财务结算系统feign调用接口
*/
-@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.3:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
+@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.33.0.129:8012",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface BmsServiceFeign {
diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java
index e9418197a..8a7006304 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.concurrent.CompletableFuture;
-@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.4:8017",fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
+@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.33.0.99:8017",fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface OmsServiceFeign {
diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java
index de19e469b..ba9a45148 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
-@FeignClient(contextId = "commonWlhyServiceFeign",url = "http://10.102.192.30:8014",value = ServiceNameConstants.WLHY_SERVICE,configuration = FeignAutoConfiguration.class)
+@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.33.0.129:8014",configuration = FeignAutoConfiguration.class)
public interface WlhyServiceFeign {
/**
diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java
index 26a92624c..7fbd7dd9b 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java
@@ -21,7 +21,7 @@ import java.util.Map;
* @description: TODO
* @date 2024/5/10 8:58
**/
-@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.102.192.3:8016",fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
+@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.33.0.109:8016",fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface WmsServiceFeign {
/**
diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java
index 12571141a..beba5b1af 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java
@@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
-@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,url = "http://10.102.192.4:8018",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
+@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,url = "http://10.33.0.99:8018",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface YmsServiceFeign {
/**
diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/feign/ThirdPartyServiceFeign.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/feign/ThirdPartyServiceFeign.java
index 6238639f6..9fd21ae67 100644
--- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/feign/ThirdPartyServiceFeign.java
+++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/feign/ThirdPartyServiceFeign.java
@@ -26,7 +26,7 @@ import java.io.InputStream;
import java.util.List;
import java.util.Map;
-@FeignClient(value = "mhd-third-party-service",url = "http://10.102.192.30:8012", configuration = FeignAutoConfiguration.class)
+@FeignClient(value = "mhd-third-party-service",url = "http://10.33.0.129:8012",configuration = FeignAutoConfiguration.class)
public interface ThirdPartyServiceFeign {
//查询当前组织所有三方接口信息
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/mapper/ExecutionInboundRankMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/mapper/ExecutionInboundRankMapper.java
index 64654e548..699f91e69 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/mapper/ExecutionInboundRankMapper.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/mapper/ExecutionInboundRankMapper.java
@@ -15,7 +15,7 @@ import java.util.List;
public interface ExecutionInboundRankMapper {
/**
- * 商品入库排名列表(仓单+货品汇总,按件数降序)
+ * 商品入库排名列表(按物料编码合并,按件数降序,过滤0件行)
*/
List queryMaterialRankList(ExecutionInboundRankDO executionInboundRankDO);
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundMaterialRankPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundMaterialRankPO.java
index 6532af87f..1aa7db54f 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundMaterialRankPO.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundMaterialRankPO.java
@@ -1,24 +1,21 @@
package com.mhd.oms.domain.inboundRank.repository.po;
-import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
-import java.util.Date;
/**
- * 入库排名统计PO(一行 = 某仓单内某货品的合计,按件数降序排名)
+ * 入库排名统计PO(一行 = 一个物料的合计(按物料编码合并,查询区间内全部已入库仓单),按件数降序排名)
*
* 数据源跨库取 WMS 入库表(NGWL_TEST_WMS.stock_in_order / in_material_detail,OMS 执行单状态/上架量不回传),
* 口径与 WMS 端 /inboundRankApi 完全一致,两边数字一致。
- * 字段口径:入仓日期=WMS入仓单入仓日期(为空兜底建档时间);仓单编号=WMS入库单号;客户编号/存货人=入仓单货主;
- * 件数/毛重/体积=仓单内该货品明细合计(件数取实际上架量 SHELVES_QUANTITY);毛重(吨)=明细总毛重KG/1000;
- * 投保总额=货品档案保额(NGWL_TEST_WMS.material_base_info.insure_amount,组内取MAX防多批次明细行重复累加)
+ * 字段口径:件数=实际上架量(SHELVES_QUANTITY)合计;毛重(吨)=明细总毛重KG/1000;体积=明细合计;
+ * 投保总额=货品档案保额(NGWL_TEST_WMS.material_base_info.insure_amount,物料维度单一值取MAX,不跨仓单累加);
+ * 仓单编号/客户编号/存货人/入仓日期为单据级字段,按物料合并后单值失真,仅作查询条件不返回
*
* @author rcx
* @date 2026-08-31
@@ -29,26 +26,8 @@ public class ExecutionInboundMaterialRankPO implements Serializable {
private static final long serialVersionUID = 1L;
- @ApiModelProperty("入仓日期")
- @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd")
- @Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
- private Date warehouseDate;
-
- @ApiModelProperty("仓单编号(WMS入库单号)")
- @Excel(name = "仓单编号")
- private String inOrderNumber;
-
- @ApiModelProperty("客户编号")
- @Excel(name = "客户编号")
- private String shipperCode;
-
- @ApiModelProperty("存货人(客户名称)")
- @Excel(name = "存货人")
- private String shipperName;
-
- @ApiModelProperty("商品货号")
- @Excel(name = "商品货号")
+ @ApiModelProperty("物料编码(合并依据)")
+ @Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("货名/商品名称")
@@ -63,19 +42,19 @@ public class ExecutionInboundMaterialRankPO implements Serializable {
@Excel(name = "单位")
private String unitName;
- @ApiModelProperty("件数(仓单内该货品实际上架量合计 SHELVES_QUANTITY,排名依据)")
+ @ApiModelProperty("件数(该物料实际上架量合计 SHELVES_QUANTITY,排名依据)")
@Excel(name = "件数")
private BigDecimal pieceCount;
- @ApiModelProperty("毛重(吨)(仓单内该货品合计,KG/1000)")
+ @ApiModelProperty("毛重(吨)(该物料合计,KG/1000)")
@Excel(name = "毛重(吨)")
private BigDecimal grossWeightTon;
- @ApiModelProperty("投保总额(货品档案保额)")
+ @ApiModelProperty("投保总额(货品档案保额,物料维度单一值)")
@Excel(name = "投保总额")
private BigDecimal insureAmount;
- @ApiModelProperty("体积(CBM)(仓单内该货品合计)")
+ @ApiModelProperty("体积(CBM)(该物料合计)")
@Excel(name = "体积(CBM)")
private BigDecimal totalVolume;
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundRankTotalPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundRankTotalPO.java
index c8a51892e..6bd14a5f4 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundRankTotalPO.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/inboundRank/repository/po/ExecutionInboundRankTotalPO.java
@@ -28,12 +28,12 @@ public class ExecutionInboundRankTotalPO implements Serializable {
@ApiModelProperty("毛重(吨)合计")
private BigDecimal totalGrossWeightTon;
- @ApiModelProperty("投保总额合计(各仓单+货品行保额之和)")
+ @ApiModelProperty("投保总额合计(各物料保额之和,每物料计一次)")
private BigDecimal totalInsureAmount;
@ApiModelProperty("体积(CBM)合计")
private BigDecimal totalVolume;
- @ApiModelProperty("仓单数合计")
+ @ApiModelProperty("涉及仓单数(当前筛选条件下去重统计)")
private Long totalOrderCount;
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/materialBaseInfo/service/MaterialBaseInfoResolveService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/materialBaseInfo/service/MaterialBaseInfoResolveService.java
index 510ca34b6..02b37e095 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/materialBaseInfo/service/MaterialBaseInfoResolveService.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/materialBaseInfo/service/MaterialBaseInfoResolveService.java
@@ -5,6 +5,7 @@ import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMateria
import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper;
import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationStockInOrderMapper;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
* 解决客户端推单把 materialInventoryId 传进 materialBaseInfoId 字段、或漏传导致明细存脏ID的问题。
* 三级解析:1.按baseId直查 → 2.按库存ID反查纠正 → 3.按物料编码+组织兜底
*/
+@Slf4j
@Service
public class MaterialBaseInfoResolveService {
@@ -30,11 +32,23 @@ public class MaterialBaseInfoResolveService {
* @return 解析成功返回物料信息(调用方需用 po.getMaterialBaseInfoId() 回填纠正后的ID);全部失败返回 null
*/
public MaterialBaseInfoPO resolve(Long materialBaseInfoId, Long materialInventoryId, String materialCode, Long organizationId) {
- // 1. 优先按 baseId 直查(有效ID不受影响)
+ // 1. 优先按 baseId 直查(有效ID不受影响)。
+ // 防张冠李戴:客户端曾把库存ID传进 materialBaseInfoId,若该库存ID恰好撞上另一条有效档案的主键
+ // (如库存1201撞上编码=名称的脏档案"水箱"),按ID查到的档案编码会与明细编码对不上。
+ // 此时 baseId 不可信,继续走库存反查/编码兜底;两级都落空时才退回按ID查到的档案
+ MaterialBaseInfoPO byId = null;
if (materialBaseInfoId != null && materialBaseInfoId > 0) {
MaterialBaseInfoPO po = reservationStockInOrderMapper.getinfo(materialBaseInfoId);
if (po != null) {
- return po;
+ if (StringUtils.isNotBlank(materialCode) && po.getMaterialCode() != null
+ && !po.getMaterialCode().trim().equals(materialCode.trim())) {
+ log.warn("物料ID疑似误传:baseInfoId={} 按主键查到档案[{}({})],与明细编码[{}]不一致," +
+ "转库存反查/编码兜底(客户端可能把库存ID传进了materialBaseInfoId)",
+ materialBaseInfoId, po.getMaterialCode(), po.getMaterialName(), materialCode);
+ byId = po;
+ } else {
+ return po;
+ }
}
}
// 2. baseId 无效但带了库存ID → 反查库存表拿正确 baseInfoId(修复"库存ID传进baseId"场景)
@@ -50,8 +64,12 @@ public class MaterialBaseInfoResolveService {
}
// 3. 兜底:按物料编码+组织查(修复 baseId=0 漏传场景)
if (StringUtils.isNotBlank(materialCode) && organizationId != null) {
- return reservationStockInOrderMapper.getByCode(materialCode.trim(), organizationId);
+ MaterialBaseInfoPO po = reservationStockInOrderMapper.getByCode(materialCode.trim(), organizationId);
+ if (po != null) {
+ return po;
+ }
}
- return null;
+ // 编码不一致已证明 baseId 不可信,但库存反查/编码兜底都落空时,退回按ID查到的档案,保持原有兜底行为
+ return byId;
}
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/facade/IExecutionOutboundRankService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/facade/IExecutionOutboundRankService.java
index 477fc1e99..239e6f118 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/facade/IExecutionOutboundRankService.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/facade/IExecutionOutboundRankService.java
@@ -1,13 +1,14 @@
package com.mhd.oms.domain.outboundRank.repository.facade;
-import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankPO;
import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankTotalPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundLineRankPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundMaterialRankPO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDO;
import java.util.List;
/**
- * 出库排名统计(明细)Service接口
+ * 出库排名统计Service接口
*
* @author rcx
* @date 2026-08-31
@@ -15,12 +16,22 @@ import java.util.List;
public interface IExecutionOutboundRankService {
/**
- * 出库明细列表
+ * 商品出库排名列表(货品聚合)
*/
- List queryDetailList(ExecutionOutboundRankDO executionOutboundRankDO);
+ List queryMaterialRankList(ExecutionOutboundRankDO executionOutboundRankDO);
/**
- * 出库明细合计(不分页)
+ * 商品出库排名合计(不分页)
*/
- ExecutionOutboundDetailRankTotalPO queryDetailTotal(ExecutionOutboundRankDO executionOutboundRankDO);
+ ExecutionOutboundDetailRankTotalPO queryMaterialRankTotal(ExecutionOutboundRankDO executionOutboundRankDO);
+
+ /**
+ * 线路出库排名列表(线路×货品聚合)
+ */
+ List queryLineRankList(ExecutionOutboundRankDO executionOutboundRankDO);
+
+ /**
+ * 线路出库排名合计(不分页)
+ */
+ ExecutionOutboundDetailRankTotalPO queryLineRankTotal(ExecutionOutboundRankDO executionOutboundRankDO);
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/mapper/ExecutionOutboundRankMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/mapper/ExecutionOutboundRankMapper.java
index 3f88c7823..411aaa893 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/mapper/ExecutionOutboundRankMapper.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/mapper/ExecutionOutboundRankMapper.java
@@ -1,13 +1,14 @@
package com.mhd.oms.domain.outboundRank.repository.mapper;
-import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankPO;
import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankTotalPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundLineRankPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundMaterialRankPO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDO;
import java.util.List;
/**
- * 出库排名统计(明细)Mapper接口
+ * 出库排名统计Mapper接口
*
* @author rcx
* @date 2026-08-31
@@ -15,12 +16,22 @@ import java.util.List;
public interface ExecutionOutboundRankMapper {
/**
- * 出库明细列表(一行=仓单×货品,按件数倒序)
+ * 商品出库排名列表(一行=一个货品,跨单汇总,按实际出库量降序)
*/
- List queryDetailList(ExecutionOutboundRankDO executionOutboundRankDO);
+ List queryMaterialRankList(ExecutionOutboundRankDO executionOutboundRankDO);
/**
- * 出库明细合计(不分页,当前筛选条件全量合计)
+ * 商品出库排名合计(不分页,当前筛选条件全量合计)
*/
- ExecutionOutboundDetailRankTotalPO queryDetailTotal(ExecutionOutboundRankDO executionOutboundRankDO);
+ ExecutionOutboundDetailRankTotalPO queryMaterialRankTotal(ExecutionOutboundRankDO executionOutboundRankDO);
+
+ /**
+ * 线路出库排名列表(一行=线路×货品,按实际出库量降序,仅统计带线路的单)
+ */
+ List queryLineRankList(ExecutionOutboundRankDO executionOutboundRankDO);
+
+ /**
+ * 线路出库排名合计(不分页,当前筛选条件全量合计)
+ */
+ ExecutionOutboundDetailRankTotalPO queryLineRankTotal(ExecutionOutboundRankDO executionOutboundRankDO);
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/persistence/ExecutionOutboundRankImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/persistence/ExecutionOutboundRankImpl.java
index 76e2abcd4..e4c23f36b 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/persistence/ExecutionOutboundRankImpl.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/persistence/ExecutionOutboundRankImpl.java
@@ -2,8 +2,9 @@ package com.mhd.oms.domain.outboundRank.repository.persistence;
import com.mhd.oms.domain.outboundRank.repository.facade.IExecutionOutboundRankService;
import com.mhd.oms.domain.outboundRank.repository.mapper.ExecutionOutboundRankMapper;
-import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankPO;
import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankTotalPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundLineRankPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundMaterialRankPO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -11,7 +12,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
- * 出库排名统计(明细)Service业务层处理
+ * 出库排名统计Service业务层处理
*
* @author rcx
* @date 2026-08-31
@@ -23,12 +24,22 @@ public class ExecutionOutboundRankImpl implements IExecutionOutboundRankService
private ExecutionOutboundRankMapper executionOutboundRankMapper;
@Override
- public List queryDetailList(ExecutionOutboundRankDO executionOutboundRankDO) {
- return executionOutboundRankMapper.queryDetailList(executionOutboundRankDO);
+ public List queryMaterialRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankMapper.queryMaterialRankList(executionOutboundRankDO);
}
@Override
- public ExecutionOutboundDetailRankTotalPO queryDetailTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
- return executionOutboundRankMapper.queryDetailTotal(executionOutboundRankDO);
+ public ExecutionOutboundDetailRankTotalPO queryMaterialRankTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankMapper.queryMaterialRankTotal(executionOutboundRankDO);
+ }
+
+ @Override
+ public List queryLineRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankMapper.queryLineRankList(executionOutboundRankDO);
+ }
+
+ @Override
+ public ExecutionOutboundDetailRankTotalPO queryLineRankTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankMapper.queryLineRankTotal(executionOutboundRankDO);
}
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankPO.java
deleted file mode 100644
index 2c37d7725..000000000
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankPO.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.mhd.oms.domain.outboundRank.repository.po;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.mhd.common.core.annotation.Excel;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * 出库排名统计(明细)PO(一行 = 仓单×货品,件数/毛重/体积按行汇总)
- *
- * 字段口径:种类=出库单据类型;仓单编号=出库单号;收货人=出库单 TO 栏(为空取联系人);
- * 毛重(吨)=明细总毛重KG/1000;出仓日期=出仓日期(为空依次兜底完成时间/创建时间);
- * 退保总额为占位字段,后端暂无对应数据来源,恒为 null(候选:货品档案保额 insure_amount,确认后可补)
- *
- * @author rcx
- * @date 2026-08-31
- */
-@Data
-@ApiModel(value = "出库排名统计明细对象", description = "出库排名统计明细响应对象")
-public class ExecutionOutboundDetailRankPO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @ApiModelProperty("种类(出库单据类型)")
- @Excel(name = "种类")
- private String orderTypeName;
-
- @ApiModelProperty("仓单编号(出库单号)")
- @Excel(name = "仓单编号")
- private String outOrderNumber;
-
- @ApiModelProperty("入库单号")
- @Excel(name = "入库单号")
- private String inOrderNumber;
-
- @ApiModelProperty("客户编号")
- @Excel(name = "客户编号")
- private String customerCode;
-
- @ApiModelProperty("收货人(出库单 TO 栏,为空取联系人)")
- @Excel(name = "收货人")
- private String receiver;
-
- @ApiModelProperty("商品货号(辅助字段,不导出)")
- private String materialCode;
-
- @ApiModelProperty("货名")
- @Excel(name = "货名")
- private String materialName;
-
- @ApiModelProperty("线路编码(辅助字段,不导出)")
- private String lineCode;
-
- @ApiModelProperty("线路")
- @Excel(name = "线路")
- private String lineName;
-
- @ApiModelProperty("件数(复核确认的实际出库量合计,与入库排名的实际上架量对称)")
- @Excel(name = "件数")
- private BigDecimal pieceCount;
-
- @ApiModelProperty("毛重(吨)")
- @Excel(name = "毛重(吨)")
- private BigDecimal grossWeightTon;
-
- @ApiModelProperty("体积(CBM)")
- @Excel(name = "体积(CBM)")
- private BigDecimal totalVolume;
-
- @ApiModelProperty("退保总额(占位字段,后端暂无数据来源,恒为 null)")
- @Excel(name = "退保总额")
- private BigDecimal depositRefundAmount;
-
- @ApiModelProperty("出仓日期(出仓日期为空时依次兜底完成时间/创建时间)")
- @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd")
- @Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd")
- private Date outboundDate;
-}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankTotalPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankTotalPO.java
index 355295a34..9ce960473 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankTotalPO.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundDetailRankTotalPO.java
@@ -8,16 +8,16 @@ import java.io.Serializable;
import java.math.BigDecimal;
/**
- * 出库排名统计(明细)合计PO
+ * 出库排名统计合计PO
*
* 当前筛选条件下不分页的全量合计,随分页列表一起返回
- * (totalPieceCount/totalGrossWeightTon/totalVolume/totalOrderCount)
+ * (totalPieceCount/totalGrossWeightTon/totalVolume/totalOrderCount/totalLineCount)
*
* @author rcx
* @date 2026-08-31
*/
@Data
-@ApiModel(value = "出库排名统计明细合计对象", description = "出库排名统计明细合计响应对象")
+@ApiModel(value = "出库排名统计合计对象", description = "出库排名统计合计响应对象")
public class ExecutionOutboundDetailRankTotalPO implements Serializable {
private static final long serialVersionUID = 1L;
@@ -33,4 +33,7 @@ public class ExecutionOutboundDetailRankTotalPO implements Serializable {
@ApiModelProperty("仓单数合计(去重出库单数)")
private Long totalOrderCount;
+
+ @ApiModelProperty("线路数合计(去重线路数,线路排名使用)")
+ private Long totalLineCount;
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundLineRankPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundLineRankPO.java
new file mode 100644
index 000000000..a1beead56
--- /dev/null
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundLineRankPO.java
@@ -0,0 +1,59 @@
+package com.mhd.oms.domain.outboundRank.repository.po;
+
+import com.mhd.common.core.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 线路出库排名PO(一行 = 线路×货品,日期区间内汇总)
+ *
+ * 按线路+物料编码合并:多张出库单合并为一行,单据级字段(种类/仓单编号/入库单号/客户编号/收货人/出仓日期)不提供;
+ * 仅统计带线路的出库单(line_code 为 2026-08-20 新增冗余字段,历史单为空,不参与线路排名);
+ * 件数 = SUM(CHECK_QUANTITY) 复核确认的实际出库量(与入库排名的实际上架量对称);
+ * 退保总额为占位字段,后端暂无对应数据来源,恒为 null
+ *
+ * @author rcx
+ * @date 2026-08-31
+ */
+@Data
+@ApiModel(value = "线路出库排名对象", description = "线路出库排名响应对象")
+public class ExecutionOutboundLineRankPO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty("线路编码")
+ @Excel(name = "线路编码")
+ private String lineCode;
+
+ @ApiModelProperty("线路")
+ @Excel(name = "线路")
+ private String lineName;
+
+ @ApiModelProperty("商品货号")
+ @Excel(name = "商品货号")
+ private String materialCode;
+
+ @ApiModelProperty("货名")
+ @Excel(name = "货名")
+ private String materialName;
+
+ @ApiModelProperty("件数(复核确认的实际出库量合计,与入库排名的实际上架量对称)")
+ @Excel(name = "件数")
+ private BigDecimal pieceCount;
+
+ @ApiModelProperty("毛重(吨)")
+ @Excel(name = "毛重(吨)")
+ private BigDecimal grossWeightTon;
+
+ @ApiModelProperty("体积(CBM)")
+ @Excel(name = "体积(CBM)")
+ private BigDecimal totalVolume;
+
+ @ApiModelProperty("退保总额(占位字段,后端暂无数据来源,恒为 null)")
+ @Excel(name = "退保总额")
+ private BigDecimal depositRefundAmount;
+}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundMaterialRankPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundMaterialRankPO.java
new file mode 100644
index 000000000..497b9a205
--- /dev/null
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/repository/po/ExecutionOutboundMaterialRankPO.java
@@ -0,0 +1,50 @@
+package com.mhd.oms.domain.outboundRank.repository.po;
+
+import com.mhd.common.core.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 商品出库排名PO(一行 = 一个货品,日期区间内跨出库单汇总)
+ *
+ * 按物料编码合并:一个货品会走多条线路/多张单,单据级字段(种类/仓单编号/入库单号/客户编号/收货人/出仓日期)与
+ * 线路字段均无单值可返,不提供;件数 = SUM(CHECK_QUANTITY) 复核确认的实际出库量(与入库排名的实际上架量对称);
+ * 退保总额为占位字段,后端暂无对应数据来源,恒为 null
+ *
+ * @author rcx
+ * @date 2026-08-31
+ */
+@Data
+@ApiModel(value = "商品出库排名对象", description = "商品出库排名响应对象")
+public class ExecutionOutboundMaterialRankPO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty("商品货号")
+ @Excel(name = "商品货号")
+ private String materialCode;
+
+ @ApiModelProperty("货名")
+ @Excel(name = "货名")
+ private String materialName;
+
+ @ApiModelProperty("件数(复核确认的实际出库量合计,与入库排名的实际上架量对称)")
+ @Excel(name = "件数")
+ private BigDecimal pieceCount;
+
+ @ApiModelProperty("毛重(吨)")
+ @Excel(name = "毛重(吨)")
+ private BigDecimal grossWeightTon;
+
+ @ApiModelProperty("体积(CBM)")
+ @Excel(name = "体积(CBM)")
+ private BigDecimal totalVolume;
+
+ @ApiModelProperty("退保总额(占位字段,后端暂无数据来源,恒为 null)")
+ @Excel(name = "退保总额")
+ private BigDecimal depositRefundAmount;
+}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankApplicationService.java
index 2d68567c0..6b705c399 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankApplicationService.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankApplicationService.java
@@ -4,8 +4,9 @@ import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.StringUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
-import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankPO;
import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankTotalPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundLineRankPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundMaterialRankPO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +15,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
- * 出库排名统计(明细)应用服务
+ * 出库排名统计应用服务
*
* 负责登录用户组织隔离注入、日期区间校验,查询逻辑在 ExecutionOutboundRankDomainService → ExecutionOutboundRankMapper.xml(跨库取 WMS 出库数据)
*
@@ -29,26 +30,49 @@ public class ExecutionOutboundRankApplicationService {
private ExecutionOutboundRankDomainService executionOutboundRankDomainService;
/**
- * 分页查询出库明细列表
+ * 分页查询商品出库排名列表(货品聚合)
*/
- public List queryDetailList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ public List queryMaterialRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
fillLoginContext(executionOutboundRankDO);
- return executionOutboundRankDomainService.queryDetailList(executionOutboundRankDO);
+ return executionOutboundRankDomainService.queryMaterialRankList(executionOutboundRankDO);
}
/**
- * 出库明细合计(当前筛选条件全量,不分页)
+ * 商品出库排名合计(当前筛选条件全量,不分页)
*/
- public ExecutionOutboundDetailRankTotalPO queryDetailTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
- return executionOutboundRankDomainService.queryDetailTotal(executionOutboundRankDO);
+ public ExecutionOutboundDetailRankTotalPO queryMaterialRankTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankDomainService.queryMaterialRankTotal(executionOutboundRankDO);
}
/**
- * 导出出库明细(不分页全量)
+ * 导出商品出库排名(不分页全量)
*/
- public List exportDetailList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ public List exportMaterialRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
fillLoginContext(executionOutboundRankDO);
- return executionOutboundRankDomainService.queryDetailList(executionOutboundRankDO);
+ return executionOutboundRankDomainService.queryMaterialRankList(executionOutboundRankDO);
+ }
+
+ /**
+ * 分页查询线路出库排名列表(线路×货品聚合)
+ */
+ public List queryLineRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ fillLoginContext(executionOutboundRankDO);
+ return executionOutboundRankDomainService.queryLineRankList(executionOutboundRankDO);
+ }
+
+ /**
+ * 线路出库排名合计(当前筛选条件全量,不分页)
+ */
+ public ExecutionOutboundDetailRankTotalPO queryLineRankTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankDomainService.queryLineRankTotal(executionOutboundRankDO);
+ }
+
+ /**
+ * 导出线路出库排名(不分页全量)
+ */
+ public List exportLineRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ fillLoginContext(executionOutboundRankDO);
+ return executionOutboundRankDomainService.queryLineRankList(executionOutboundRankDO);
}
/**
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankDomainService.java
index 7966fe6bd..95b54e602 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankDomainService.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/outboundRank/service/ExecutionOutboundRankDomainService.java
@@ -1,8 +1,9 @@
package com.mhd.oms.domain.outboundRank.service;
import com.mhd.oms.domain.outboundRank.repository.facade.IExecutionOutboundRankService;
-import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankPO;
import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankTotalPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundLineRankPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundMaterialRankPO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -11,7 +12,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
- * 出库排名统计(明细)领域服务
+ * 出库排名统计领域服务
*
* @author rcx
* @date 2026-08-31
@@ -24,16 +25,30 @@ public class ExecutionOutboundRankDomainService {
private IExecutionOutboundRankService executionOutboundRankService;
/**
- * 出库明细列表
+ * 商品出库排名列表(货品聚合)
*/
- public List queryDetailList(ExecutionOutboundRankDO executionOutboundRankDO) {
- return executionOutboundRankService.queryDetailList(executionOutboundRankDO);
+ public List queryMaterialRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankService.queryMaterialRankList(executionOutboundRankDO);
}
/**
- * 出库明细合计(不分页)
+ * 商品出库排名合计(不分页)
*/
- public ExecutionOutboundDetailRankTotalPO queryDetailTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
- return executionOutboundRankService.queryDetailTotal(executionOutboundRankDO);
+ public ExecutionOutboundDetailRankTotalPO queryMaterialRankTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankService.queryMaterialRankTotal(executionOutboundRankDO);
+ }
+
+ /**
+ * 线路出库排名列表(线路×货品聚合)
+ */
+ public List queryLineRankList(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankService.queryLineRankList(executionOutboundRankDO);
+ }
+
+ /**
+ * 线路出库排名合计(不分页)
+ */
+ public ExecutionOutboundDetailRankTotalPO queryLineRankTotal(ExecutionOutboundRankDO executionOutboundRankDO) {
+ return executionOutboundRankService.queryLineRankTotal(executionOutboundRankDO);
}
}
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java
index 364e0bb55..175f9f3dc 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java
@@ -232,4 +232,19 @@ public class ReservationMaterialInventoryPO extends MaterialBasePO {
@ApiModelProperty("LOT编号")
@Excel(name = "LOT编号")
private String lotNumber;
+
+ // 入库时间(createTime)/更新时间(updateTime)继承自 BaseVOEntity,默认带时分秒;
+ // 库存查询导出复用 /list 接口,前端取 JSON 值直接进 Excel,这里覆盖 getter 只保留年月日。
+ // 不改 BaseVOEntity(全系统基类,其他模块时间列仍需时分秒),仅收窄本 PO 的序列化格式(与 WMS 库存查询一致)
+ @Override
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ public Date getCreateTime() {
+ return super.getCreateTime();
+ }
+
+ @Override
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ public Date getUpdateTime() {
+ return super.getUpdateTime();
+ }
}
\ No newline at end of file
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java
index 9d7774ba5..21ed397d6 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java
@@ -297,16 +297,39 @@ public class ReservationStockInOrderImpl extends ServiceImpl problems = new ArrayList<>();
- if (!missingMaterials.isEmpty()) {
- problems.add("物料[" + String.join("、", missingMaterials) + "]不存在,请先维护物料信息");
+ // ====== 第三步:物料/客户/库存三类校验全部完成后统一报错(不再分阶段各自中断) ======
+ List problems = new ArrayList<>();
+ if (!missingMaterials.isEmpty()) {
+ problems.add("物料[" + String.join("、", missingMaterials) + "]不存在,请先维护物料信息");
+ }
+ if (!missingCustomers.isEmpty()) {
+ problems.add("客户[" + String.join("、", missingCustomers) + "]不存在,请先维护客户信息");
+ }
+
+ // 库存预检:只对已存在的物料比较批次库存(不存在的物料问题已收集),不足的同样收集
+ if (!productDetailList.isEmpty()) {
+ Set insufficientMaterials = new HashSet<>();
+ for (ProductDetail productDetail : productDetailList) {
+ // materialCache 的 key 是 trim 过的编码,取用时同样 trim,避免 Excel 编号带空格导致校验被静默跳过
+ String productCode = productDetail.getProductCode() == null ? "" : productDetail.getProductCode().trim();
+ MaterialBaseInfoPO materialBaseInfoPO = materialCache.get(productCode);
+ if (materialBaseInfoPO == null) {
+ continue; // 物料不存在的问题已收集
+ }
+ BigDecimal requireQty = new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP);
+ List inventoryList = stockInOrderMapper.getkcId(
+ materialBaseInfoPO.getMaterialBaseInfoId(), requireQty, warehouseId);
+ if (inventoryList == null || inventoryList.isEmpty()) {
+ insufficientMaterials.add(productCode);
+ }
}
- if (!missingCustomers.isEmpty()) {
- problems.add("客户[" + String.join("、", missingCustomers) + "]不存在,请先维护客户信息");
+ if (!insufficientMaterials.isEmpty()) {
+ problems.add("物料[" + String.join("、", insufficientMaterials) + "]"
+ + (warehouseId != null && warehouseId > 0 ? "在当前仓库" : "") + "批次库存数量少于出库数量");
}
- throw new Exception(String.join(";", problems) + ",维护完成后重新导入");
+ }
+ if (!problems.isEmpty()) {
+ throw new Exception(String.join(";", problems) + ",请处理后重新导入");
}
// ====== 后续处理(编号均已存在):货主归属校验、建单落库 ======
@@ -332,28 +355,6 @@ public class ReservationStockInOrderImpl extends ServiceImpl insufficientMaterials = new HashSet<>();
- for (ProductDetail productDetail : productDetailList) {
- MaterialBaseInfoPO materialBaseInfoPO = materialCache.get(productDetail.getProductCode());
- if (materialBaseInfoPO == null) {
- continue; // 存在性已在前面统一校验
- }
- BigDecimal requireQty = new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP);
- List inventoryList = stockInOrderMapper.getkcId(
- materialBaseInfoPO.getMaterialBaseInfoId(), requireQty, warehouseId);
- if (inventoryList == null || inventoryList.isEmpty()) {
- insufficientMaterials.add(productDetail.getProductCode());
- }
- }
- if (!insufficientMaterials.isEmpty()) {
- throw new Exception("物料[" + String.join("、", insufficientMaterials) + "]"
- + (warehouseId != null && warehouseId > 0 ? "在当前仓库" : "") + "批次库存数量少于出库数量!");
- }
- }
-
ReservationStockOutOrderDO reservationStockOutOrderDO = new ReservationStockOutOrderDO();
// 生成出库业务单号
String orderNumber = reservationStockOutOrderApplicationService.generateReserveOrderNumber();
@@ -407,8 +408,9 @@ public class ReservationStockInOrderImpl extends ServiceImpl().lambda()
+ .eq(ExecutionStockOutOrder::getBusinessOutOrderNumber, inOrderNumber)
+ .eq(ExecutionStockOutOrder::getDelFlag, 1));
+ if (activeExecutionCount > 0) {
+ throw new ServiceException("出库单[" + inOrderNumber + "]已下发,请勿重复下发;如需重新下发请先取消下发");
+ }
List executionInOrderNumbers = new ArrayList<>();
List materialDetailList = outMaterialDetailService.list(new QueryWrapper().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
diff --git a/mhd_oms/src/main/java/com/mhd/oms/infrastructure/feign/ThirdPartyServiceFeign.java b/mhd_oms/src/main/java/com/mhd/oms/infrastructure/feign/ThirdPartyServiceFeign.java
index ca93d3312..376500b1c 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/infrastructure/feign/ThirdPartyServiceFeign.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/infrastructure/feign/ThirdPartyServiceFeign.java
@@ -22,7 +22,7 @@ import java.util.Map;
/**
* 三方服务 Feign
*/
-@FeignClient(contextId = "thirdPartyServiceFeign",url = "http://10.102.192.30:8012", value = ServiceNameConstants.THIRDPARTY_CENTER, configuration = FeignAutoConfiguration.class)
+@FeignClient(contextId = "thirdPartyServiceFeign",url = "http://10.33.0.129:8012", value = ServiceNameConstants.THIRDPARTY_CENTER, configuration = FeignAutoConfiguration.class)
public interface ThirdPartyServiceFeign {
//查询当前组织所有三方接口信息
diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inboundRank/ExecutionInboundRankApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inboundRank/ExecutionInboundRankApi.java
index f97d23e57..5fa9b0fe0 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inboundRank/ExecutionInboundRankApi.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inboundRank/ExecutionInboundRankApi.java
@@ -30,7 +30,9 @@ import java.util.List;
* 故数据源跨库取 WMS 入库表(NGWL_TEST_WMS.stock_in_order/in_material_detail,与 OMS 出库排名跨库修法一致);
* 口径与 WMS 端 /inboundRankApi 完全一致,两边数字一致:仅已入库(5) + 明细 level=1 主行 +
* 入仓日期(为空的历史单按建档时间兜底) + 件数=实际上架量(SHELVES_QUANTITY);
- * 一行 = 某仓单内某货品的合计,按件数降序排名。
+ * 一行 = 一个物料的合计(按物料编码合并区间内全部已入库仓单),按件数降序排名,件数为0的物料不返回。
+ * 返回字段:物料编码/货名/规格型号/单位/件数/毛重(吨)/投保总额/体积(CBM);
+ * 仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件,不返回。
* 字段:入仓日期/仓单编号/客户编号/存货人/货名/件数/毛重(吨)/投保总额/体积(CBM)。
* 与出库排名(/executionOutboundRankApi)配对,前端用 tab 页区分
*
diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/outboundRank/ExecutionOutboundRankApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/outboundRank/ExecutionOutboundRankApi.java
index 81ae1b67a..e723269a6 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/outboundRank/ExecutionOutboundRankApi.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/outboundRank/ExecutionOutboundRankApi.java
@@ -4,8 +4,9 @@ import com.github.pagehelper.PageInfo;
import com.mhd.common.core.constant.HttpStatus;
import com.mhd.common.core.utils.PageUtils;
import com.mhd.common.core.utils.poi.ExcelUtil;
-import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankPO;
import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundDetailRankTotalPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundLineRankPO;
+import com.mhd.oms.domain.outboundRank.repository.po.ExecutionOutboundMaterialRankPO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDO;
import com.mhd.oms.domain.outboundRank.repository.todo.ExecutionOutboundRankDTO;
import com.mhd.oms.domain.outboundRank.service.ExecutionOutboundRankApplicationService;
@@ -26,11 +27,14 @@ import java.util.List;
/**
* 出库排名统计Api
*
- * 按日期区间筛选出库明细列表(一行 = 仓单×货品,件数/毛重/体积按行汇总,按件数(实际复核出库量)降序,出仓日期/单号次之)。
- * OMS 库出库单状态不流转(无"已出库"数据),数据源跨库取 WMS 库出库表(NGWL_TEST_WMS.stock_out_order / out_material_detail),
- * 口径与 WMS 端 /outboundRankApi 完全一致,两边数字一致;统计条件:出库单创建时间 + 已出库及之后状态(9,12,13),明细仅取 level=1 主行。
- * 商品/线路两个 tab 各自独立接口,内部为同一份明细查询:商品接口忽略线路筛选参数,线路接口忽略商品筛选参数。
- * 字段:种类/仓单编号/入库单号/客户编号/收货人/货名/线路/件数/毛重(吨)/体积(CBM)/退保总额(占位null)/出仓日期
+ * 按日期区间筛选出库量统计排名,按出库数量(实际复核出库量)降序。
+ * 商品tab:一行 = 一个货品(货号/货名/件数/毛重(吨)/体积(CBM)/退保总额占位),跨出库单汇总,忽略线路筛选参数;
+ * 线路tab:一行 = 线路×货品(线路编码/线路/货号/货名/件数/毛重(吨)/体积(CBM)/退保总额占位),按线路+物料编码合并,
+ * 仅统计带线路的单,商品/线路筛选参数均生效;
+ * 统计口径:出库单创建时间 + 已出库及之后状态(9,12,13),明细仅取 level=1 主行;
+ * 件数 = SUM(CHECK_QUANTITY) 复核确认的实际出库量(与入库排名的实际上架量对称);
+ * 数据源跨库取 WMS 库出库表,口径与 WMS 端 /outboundRankApi 完全一致,两边数字一致;
+ * 退保总额后端暂无对应数据来源,恒为 null
*
* @author rcx
* @date 2026-08-31
@@ -58,25 +62,22 @@ public class ExecutionOutboundRankApi {
executionOutboundRankDO.setLineCode(null);
executionOutboundRankDO.setLineName(null);
startPage();
- List list = executionOutboundRankApplicationService.queryDetailList(executionOutboundRankDO);
- ExecutionOutboundDetailRankTotalPO total = executionOutboundRankApplicationService.queryDetailTotal(executionOutboundRankDO);
+ List list = executionOutboundRankApplicationService.queryMaterialRankList(executionOutboundRankDO);
+ ExecutionOutboundDetailRankTotalPO total = executionOutboundRankApplicationService.queryMaterialRankTotal(executionOutboundRankDO);
return getDataTableWithTotal(list, total);
}
/**
- * 分页查询线路出库排名列表(含合计行,线路tab;忽略商品筛选参数)
+ * 分页查询线路出库排名列表(含合计行,线路tab;一行=线路×货品,仅统计带线路的单)
*/
@ApiOperation("分页查询线路出库排名列表")
@GetMapping("/queryLineRankList")
public HashMap queryLineRankList(ExecutionOutboundRankDTO executionOutboundRankDTO) {
- //转换实体
+ //转换实体(线路tab:商品/线路筛选参数均生效,按线路+物料编码合并)
ExecutionOutboundRankDO executionOutboundRankDO = executionOutboundRankAssembler.toDO(executionOutboundRankDTO);
- //线路tab:忽略商品筛选参数
- executionOutboundRankDO.setMaterialCode(null);
- executionOutboundRankDO.setMaterialName(null);
startPage();
- List list = executionOutboundRankApplicationService.queryDetailList(executionOutboundRankDO);
- ExecutionOutboundDetailRankTotalPO total = executionOutboundRankApplicationService.queryDetailTotal(executionOutboundRankDO);
+ List list = executionOutboundRankApplicationService.queryLineRankList(executionOutboundRankDO);
+ ExecutionOutboundDetailRankTotalPO total = executionOutboundRankApplicationService.queryLineRankTotal(executionOutboundRankDO);
return getDataTableWithTotal(list, total);
}
@@ -91,41 +92,38 @@ public class ExecutionOutboundRankApi {
//商品tab:忽略线路筛选参数
executionOutboundRankDO.setLineCode(null);
executionOutboundRankDO.setLineName(null);
- List list = executionOutboundRankApplicationService.exportDetailList(executionOutboundRankDO);
+ List list = executionOutboundRankApplicationService.exportMaterialRankList(executionOutboundRankDO);
String fileName = URLEncoder.encode("商品出库排名", "UTF-8").replaceAll("\\+", "%20");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
- ExcelUtil util = new ExcelUtil<>(ExecutionOutboundDetailRankPO.class);
+ ExcelUtil util = new ExcelUtil<>(ExecutionOutboundMaterialRankPO.class);
util.exportExcel(response, list, "商品出库排名");
}
/**
- * 导出线路出库排名Excel(线路tab;忽略商品筛选参数)
+ * 导出线路出库排名Excel(线路tab;一行=线路×货品,仅统计带线路的单)
*/
@ApiOperation("导出线路出库排名Excel")
@GetMapping("/exportLineRank")
public void exportLineRank(HttpServletResponse response, ExecutionOutboundRankDTO executionOutboundRankDTO) throws Exception {
- //转换实体(不分页,导出全量)
+ //转换实体(不分页,导出全量;线路tab:商品/线路筛选参数均生效,按线路+物料编码合并)
ExecutionOutboundRankDO executionOutboundRankDO = executionOutboundRankAssembler.toDO(executionOutboundRankDTO);
- //线路tab:忽略商品筛选参数
- executionOutboundRankDO.setMaterialCode(null);
- executionOutboundRankDO.setMaterialName(null);
- List list = executionOutboundRankApplicationService.exportDetailList(executionOutboundRankDO);
+ List list = executionOutboundRankApplicationService.exportLineRankList(executionOutboundRankDO);
String fileName = URLEncoder.encode("线路出库排名", "UTF-8").replaceAll("\\+", "%20");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
- ExcelUtil util = new ExcelUtil<>(ExecutionOutboundDetailRankPO.class);
+ ExcelUtil util = new ExcelUtil<>(ExecutionOutboundLineRankPO.class);
util.exportExcel(response, list, "线路出库排名");
}
/**
- * 分页结果 + 合计行:data/total/code/msg 之外追加 totalPieceCount/totalGrossWeightTon/totalVolume/totalOrderCount
+ * 分页结果 + 合计行:data/total/code/msg 之外追加合计字段(商品tab含 totalOrderCount,线路tab含 totalOrderCount/totalLineCount)
*/
private HashMap getDataTableWithTotal(List> list, ExecutionOutboundDetailRankTotalPO total) {
HashMap result = new HashMap<>();
@@ -137,7 +135,12 @@ public class ExecutionOutboundRankApi {
result.put("totalPieceCount", total.getTotalPieceCount());
result.put("totalGrossWeightTon", total.getTotalGrossWeightTon());
result.put("totalVolume", total.getTotalVolume());
- result.put("totalOrderCount", total.getTotalOrderCount());
+ if (total.getTotalOrderCount() != null) {
+ result.put("totalOrderCount", total.getTotalOrderCount());
+ }
+ if (total.getTotalLineCount() != null) {
+ result.put("totalLineCount", total.getTotalLineCount());
+ }
}
return result;
}
diff --git a/mhd_oms/src/main/resources/bootstrap.yml b/mhd_oms/src/main/resources/bootstrap.yml
index ee058f0f6..88471e390 100644
--- a/mhd_oms/src/main/resources/bootstrap.yml
+++ b/mhd_oms/src/main/resources/bootstrap.yml
@@ -18,15 +18,15 @@ spring:
discovery:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
-# server-addr: 10.33.0.129:6010
- server-addr: 10.102.192.30:6848
+ server-addr: 10.33.0.129:6010
+# server-addr: 10.102.192.30:6848
username: nacos
password: manhuoda@2023
config:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
-# server-addr: 10.33.0.129:6010
- server-addr: 10.102.192.30:6848
+ server-addr: 10.33.0.129:6010
+# server-addr: 10.102.192.30:6848
username: nacos
password: manhuoda@2023
#线上正式环境
diff --git a/mhd_oms/src/main/resources/mapper/inboundRank/ExecutionInboundRankMapper.xml b/mhd_oms/src/main/resources/mapper/inboundRank/ExecutionInboundRankMapper.xml
index e6b76eb0d..f73e13eea 100644
--- a/mhd_oms/src/main/resources/mapper/inboundRank/ExecutionInboundRankMapper.xml
+++ b/mhd_oms/src/main/resources/mapper/inboundRank/ExecutionInboundRankMapper.xml
@@ -15,8 +15,8 @@
口径与 WMS 端 /inboundRankApi 完全一致,两边数字一致;
条件:b.status = 5已入库(排除已取消(6)/已关闭(7)及未完成单据);
日期筛选按入仓单入仓日期 b.warehouse_date(与列表"入仓日期"列同源,为空的历史单按建档时间兜底);
- 一行 = 某仓单(b.in_order_number)内某货品(a.material_code)的合计,
- 按件数(实际上架量 SUM(a.SHELVES_QUANTITY))降序排名
+ 一行 = 一个物料的合计(按物料编码合并,区间内全部已入库仓单),按件数(实际上架量 SUM(a.SHELVES_QUANTITY))降序排名,
+ 件数为0的物料不返回(HAVING过滤);仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件不返回
-->
a.del_flag = 1
@@ -57,14 +57,10 @@
left join NGWL_TEST_WMS.material_base_info c on a.material_base_info_id = c.material_base_info_id
-
+
-
+
diff --git a/mhd_oms/src/main/resources/mapper/outboundRank/ExecutionOutboundRankMapper.xml b/mhd_oms/src/main/resources/mapper/outboundRank/ExecutionOutboundRankMapper.xml
index 62df4931f..260bf0f80 100644
--- a/mhd_oms/src/main/resources/mapper/outboundRank/ExecutionOutboundRankMapper.xml
+++ b/mhd_oms/src/main/resources/mapper/outboundRank/ExecutionOutboundRankMapper.xml
@@ -5,15 +5,17 @@
a.del_flag = 1
@@ -62,50 +64,70 @@
join NGWL_TEST_WMS.stock_out_order b on a.out_order_number = b.out_order_number and b.del_flag = 1
-
-
diff --git a/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml
index a83d8f6e9..aec1a3b05 100644
--- a/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml
+++ b/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml
@@ -471,15 +471,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ 客户编码只认 USER.USER_MEMBER_CODE(客户编码);
+ 2026-09-03 起不再放行 USER_SHIPPER.CUSTOMER_NC_CODE(NC客户代码),避免会员/NC编码撞车导致不存在的客户编号误通过 -->
select max(u.user_id) as user_id, max(u.user_name) as user_name, max(u.user_member_code) as user_member_code
from NGWL_TEST_USER."USER" u
- left join NGWL_TEST_USER.USER_SHIPPER us
- on us.USER_ID = u.USER_ID and us.DEL_FLAG = 1
where u.ORGANIZATION_ID = #{organizationId} and u.DEL_FLAG = 1
- and (u.USER_MEMBER_CODE = #{userMemberCode} or us.CUSTOMER_NC_CODE = #{userMemberCode})
+ and u.USER_MEMBER_CODE = #{userMemberCode}
diff --git a/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml
index 7ce415d78..d057676f2 100644
--- a/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml
+++ b/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml
@@ -361,6 +361,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
@@ -452,7 +454,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select
- b.*
+ b.*, a.status, a.issue_status
from reserve_stock_out_order a left join reserve_out_material_detail b on a.OUT_ORDER_NUMBER = b.OUT_ORDER_NUMBER
diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/outboundRank/OutboundRankApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/outboundRank/OutboundRankApplicationService.java
index 0082a8ed4..d6980900f 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/application/service/outboundRank/OutboundRankApplicationService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/outboundRank/OutboundRankApplicationService.java
@@ -6,8 +6,9 @@ import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
import com.mhd.system.api.model.LoginUser;
-import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankPO;
import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankTotalPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundLineRankPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundMaterialRankPO;
import com.mhd.wms.domain.outboundRank.repository.todo.OutboundRankDO;
import com.mhd.wms.domain.outboundRank.service.OutboundRankDomainService;
import lombok.extern.slf4j.Slf4j;
@@ -17,7 +18,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
- * 出库排名统计(明细)应用服务
+ * 出库排名统计应用服务
*
* 负责登录用户组织隔离注入、日期区间校验,查询逻辑在 OutboundRankDomainService → OutboundRankMapper.xml
*
@@ -32,26 +33,49 @@ public class OutboundRankApplicationService {
private OutboundRankDomainService outboundRankDomainService;
/**
- * 分页查询出库明细列表
+ * 分页查询商品出库排名列表(货品聚合)
*/
- public List queryDetailList(OutboundRankDO outboundRankDO) {
+ public List queryMaterialRankList(OutboundRankDO outboundRankDO) {
fillLoginContext(outboundRankDO);
- return outboundRankDomainService.queryDetailList(outboundRankDO);
+ return outboundRankDomainService.queryMaterialRankList(outboundRankDO);
}
/**
- * 出库明细合计(当前筛选条件全量,不分页)
+ * 商品出库排名合计(当前筛选条件全量,不分页)
*/
- public OutboundDetailRankTotalPO queryDetailTotal(OutboundRankDO outboundRankDO) {
- return outboundRankDomainService.queryDetailTotal(outboundRankDO);
+ public OutboundDetailRankTotalPO queryMaterialRankTotal(OutboundRankDO outboundRankDO) {
+ return outboundRankDomainService.queryMaterialRankTotal(outboundRankDO);
}
/**
- * 导出出库明细(不分页全量)
+ * 导出商品出库排名(不分页全量)
*/
- public List exportDetailList(OutboundRankDO outboundRankDO) {
+ public List exportMaterialRankList(OutboundRankDO outboundRankDO) {
fillLoginContext(outboundRankDO);
- return outboundRankDomainService.queryDetailList(outboundRankDO);
+ return outboundRankDomainService.queryMaterialRankList(outboundRankDO);
+ }
+
+ /**
+ * 分页查询线路出库排名列表(线路×货品聚合)
+ */
+ public List queryLineRankList(OutboundRankDO outboundRankDO) {
+ fillLoginContext(outboundRankDO);
+ return outboundRankDomainService.queryLineRankList(outboundRankDO);
+ }
+
+ /**
+ * 线路出库排名合计(当前筛选条件全量,不分页)
+ */
+ public OutboundDetailRankTotalPO queryLineRankTotal(OutboundRankDO outboundRankDO) {
+ return outboundRankDomainService.queryLineRankTotal(outboundRankDO);
+ }
+
+ /**
+ * 导出线路出库排名(不分页全量)
+ */
+ public List exportLineRankList(OutboundRankDO outboundRankDO) {
+ fillLoginContext(outboundRankDO);
+ return outboundRankDomainService.queryLineRankList(outboundRankDO);
}
/**
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/mapper/InboundRankMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/mapper/InboundRankMapper.java
index 5c95d09fa..bb30997d2 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/mapper/InboundRankMapper.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/mapper/InboundRankMapper.java
@@ -15,7 +15,7 @@ import java.util.List;
public interface InboundRankMapper {
/**
- * 商品入库排名列表(仓单+货品汇总,按件数降序)
+ * 商品入库排名列表(按物料编码合并,按件数降序,过滤0件行)
*/
List queryMaterialRankList(InboundRankDO inboundRankDO);
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundMaterialRankPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundMaterialRankPO.java
index 3044767a9..0805c433c 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundMaterialRankPO.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundMaterialRankPO.java
@@ -1,22 +1,19 @@
package com.mhd.wms.domain.inboundRank.repository.po;
-import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
-import java.util.Date;
/**
- * 入库排名统计PO(一行 = 某仓单内某货品的合计,按件数降序排名)
+ * 入库排名统计PO(一行 = 一个物料的合计(按物料编码合并,查询区间内全部已入库仓单),按件数降序排名)
*
- * 字段口径:入仓日期=入仓单入仓日期(为空兜底建档时间);仓单编号=入库单号;客户编号/存货人=入仓单货主;
- * 件数/毛重/体积=仓单内该货品明细合计(件数取实际上架量 SHELVES_QUANTITY);毛重(吨)=明细总毛重KG/1000;
- * 投保总额=货品档案保额(material_base_info.insure_amount,组内取MAX防多批次明细行重复累加)
+ * 字段口径:件数=实际上架量(SHELVES_QUANTITY)合计;毛重(吨)=明细总毛重KG/1000;体积=明细合计;
+ * 投保总额=货品档案保额(material_base_info.insure_amount,物料维度单一值取MAX,不跨仓单累加);
+ * 仓单编号/客户编号/存货人/入仓日期为单据级字段,按物料合并后单值失真,仅作查询条件不返回
*
* @author rcx
* @date 2026-08-31
@@ -27,26 +24,8 @@ public class InboundMaterialRankPO implements Serializable {
private static final long serialVersionUID = 1L;
- @ApiModelProperty("入仓日期")
- @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd")
- @Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
- private Date warehouseDate;
-
- @ApiModelProperty("仓单编号(入库单号)")
- @Excel(name = "仓单编号")
- private String inOrderNumber;
-
- @ApiModelProperty("客户编号")
- @Excel(name = "客户编号")
- private String shipperCode;
-
- @ApiModelProperty("存货人(客户名称)")
- @Excel(name = "存货人")
- private String shipperName;
-
- @ApiModelProperty("商品货号")
- @Excel(name = "商品货号")
+ @ApiModelProperty("物料编码(合并依据)")
+ @Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("货名/商品名称")
@@ -61,19 +40,19 @@ public class InboundMaterialRankPO implements Serializable {
@Excel(name = "单位")
private String unitName;
- @ApiModelProperty("件数(仓单内该货品实际上架量合计 SHELVES_QUANTITY,排名依据)")
+ @ApiModelProperty("件数(该物料实际上架量合计 SHELVES_QUANTITY,排名依据)")
@Excel(name = "件数")
private BigDecimal pieceCount;
- @ApiModelProperty("毛重(吨)(仓单内该货品合计,KG/1000)")
+ @ApiModelProperty("毛重(吨)(该物料合计,KG/1000)")
@Excel(name = "毛重(吨)")
private BigDecimal grossWeightTon;
- @ApiModelProperty("投保总额(货品档案保额)")
+ @ApiModelProperty("投保总额(货品档案保额,物料维度单一值)")
@Excel(name = "投保总额")
private BigDecimal insureAmount;
- @ApiModelProperty("体积(CBM)(仓单内该货品合计)")
+ @ApiModelProperty("体积(CBM)(该物料合计)")
@Excel(name = "体积(CBM)")
private BigDecimal totalVolume;
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundRankTotalPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundRankTotalPO.java
index f7433e5af..59ac8006b 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundRankTotalPO.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inboundRank/repository/po/InboundRankTotalPO.java
@@ -28,12 +28,12 @@ public class InboundRankTotalPO implements Serializable {
@ApiModelProperty("毛重(吨)合计")
private BigDecimal totalGrossWeightTon;
- @ApiModelProperty("投保总额合计(各仓单+货品行保额之和)")
+ @ApiModelProperty("投保总额合计(各物料保额之和,每物料计一次)")
private BigDecimal totalInsureAmount;
@ApiModelProperty("体积(CBM)合计")
private BigDecimal totalVolume;
- @ApiModelProperty("仓单数合计")
+ @ApiModelProperty("涉及仓单数(当前筛选条件下去重统计)")
private Long totalOrderCount;
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java
index f785b7190..6a1bc7539 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java
@@ -240,4 +240,19 @@ public class MaterialInventoryPO extends MaterialBasePO {
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
+
+ // 入库时间(createTime)/更新时间(updateTime)继承自 BaseVOEntity,默认带时分秒;
+ // 库存查询导出复用 /list 接口,前端取 JSON 值直接进 Excel,这里覆盖 getter 只保留年月日。
+ // 不改 BaseVOEntity(全系统基类,其他模块时间列仍需时分秒),仅收窄本 PO 的序列化格式(与 OMS 库存查询一致)
+ @Override
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ public Date getCreateTime() {
+ return super.getCreateTime();
+ }
+
+ @Override
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ public Date getUpdateTime() {
+ return super.getUpdateTime();
+ }
}
\ No newline at end of file
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/facade/IOutboundRankService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/facade/IOutboundRankService.java
index f20e1a989..2bc25d4a3 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/facade/IOutboundRankService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/facade/IOutboundRankService.java
@@ -1,13 +1,14 @@
package com.mhd.wms.domain.outboundRank.repository.facade;
-import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankPO;
import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankTotalPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundLineRankPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundMaterialRankPO;
import com.mhd.wms.domain.outboundRank.repository.todo.OutboundRankDO;
import java.util.List;
/**
- * 出库排名统计(明细)Service接口
+ * 出库排名统计Service接口
*
* @author rcx
* @date 2026-08-31
@@ -15,12 +16,22 @@ import java.util.List;
public interface IOutboundRankService {
/**
- * 出库明细列表
+ * 商品出库排名列表(货品聚合)
*/
- List queryDetailList(OutboundRankDO outboundRankDO);
+ List queryMaterialRankList(OutboundRankDO outboundRankDO);
/**
- * 出库明细合计(不分页)
+ * 商品出库排名合计(不分页)
*/
- OutboundDetailRankTotalPO queryDetailTotal(OutboundRankDO outboundRankDO);
+ OutboundDetailRankTotalPO queryMaterialRankTotal(OutboundRankDO outboundRankDO);
+
+ /**
+ * 线路出库排名列表(线路×货品聚合)
+ */
+ List queryLineRankList(OutboundRankDO outboundRankDO);
+
+ /**
+ * 线路出库排名合计(不分页)
+ */
+ OutboundDetailRankTotalPO queryLineRankTotal(OutboundRankDO outboundRankDO);
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/mapper/OutboundRankMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/mapper/OutboundRankMapper.java
index ee09b891f..ff5f702d8 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/mapper/OutboundRankMapper.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/mapper/OutboundRankMapper.java
@@ -1,13 +1,14 @@
package com.mhd.wms.domain.outboundRank.repository.mapper;
-import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankPO;
import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankTotalPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundLineRankPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundMaterialRankPO;
import com.mhd.wms.domain.outboundRank.repository.todo.OutboundRankDO;
import java.util.List;
/**
- * 出库排名统计(明细)Mapper接口
+ * 出库排名统计Mapper接口
*
* @author rcx
* @date 2026-08-31
@@ -15,12 +16,22 @@ import java.util.List;
public interface OutboundRankMapper {
/**
- * 出库明细列表(一行=仓单×货品,按件数倒序)
+ * 商品出库排名列表(一行=一个货品,跨单汇总,按实际出库量降序)
*/
- List queryDetailList(OutboundRankDO outboundRankDO);
+ List queryMaterialRankList(OutboundRankDO outboundRankDO);
/**
- * 出库明细合计(不分页,当前筛选条件全量合计)
+ * 商品出库排名合计(不分页,当前筛选条件全量合计)
*/
- OutboundDetailRankTotalPO queryDetailTotal(OutboundRankDO outboundRankDO);
+ OutboundDetailRankTotalPO queryMaterialRankTotal(OutboundRankDO outboundRankDO);
+
+ /**
+ * 线路出库排名列表(一行=线路×货品,按实际出库量降序,仅统计带线路的单)
+ */
+ List queryLineRankList(OutboundRankDO outboundRankDO);
+
+ /**
+ * 线路出库排名合计(不分页,当前筛选条件全量合计)
+ */
+ OutboundDetailRankTotalPO queryLineRankTotal(OutboundRankDO outboundRankDO);
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/persistence/OutboundRankImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/persistence/OutboundRankImpl.java
index 4108d2dd4..6555dc647 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/persistence/OutboundRankImpl.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/persistence/OutboundRankImpl.java
@@ -2,8 +2,9 @@ package com.mhd.wms.domain.outboundRank.repository.persistence;
import com.mhd.wms.domain.outboundRank.repository.facade.IOutboundRankService;
import com.mhd.wms.domain.outboundRank.repository.mapper.OutboundRankMapper;
-import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankPO;
import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankTotalPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundLineRankPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundMaterialRankPO;
import com.mhd.wms.domain.outboundRank.repository.todo.OutboundRankDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -11,7 +12,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
- * 出库排名统计(明细)Service业务层处理
+ * 出库排名统计Service业务层处理
*
* @author rcx
* @date 2026-08-31
@@ -23,12 +24,22 @@ public class OutboundRankImpl implements IOutboundRankService {
private OutboundRankMapper outboundRankMapper;
@Override
- public List queryDetailList(OutboundRankDO outboundRankDO) {
- return outboundRankMapper.queryDetailList(outboundRankDO);
+ public List queryMaterialRankList(OutboundRankDO outboundRankDO) {
+ return outboundRankMapper.queryMaterialRankList(outboundRankDO);
}
@Override
- public OutboundDetailRankTotalPO queryDetailTotal(OutboundRankDO outboundRankDO) {
- return outboundRankMapper.queryDetailTotal(outboundRankDO);
+ public OutboundDetailRankTotalPO queryMaterialRankTotal(OutboundRankDO outboundRankDO) {
+ return outboundRankMapper.queryMaterialRankTotal(outboundRankDO);
+ }
+
+ @Override
+ public List queryLineRankList(OutboundRankDO outboundRankDO) {
+ return outboundRankMapper.queryLineRankList(outboundRankDO);
+ }
+
+ @Override
+ public OutboundDetailRankTotalPO queryLineRankTotal(OutboundRankDO outboundRankDO) {
+ return outboundRankMapper.queryLineRankTotal(outboundRankDO);
}
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankPO.java
deleted file mode 100644
index 4be88b6a7..000000000
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankPO.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.mhd.wms.domain.outboundRank.repository.po;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.mhd.common.core.annotation.Excel;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * 出库排名统计(明细)PO(一行 = 仓单×货品,件数/毛重/体积按行汇总)
- *
- * 字段口径:种类=出库单据类型;仓单编号=出库单号;收货人=出库单 TO 栏(为空取联系人);
- * 毛重(吨)=明细总毛重KG/1000;出仓日期=出仓日期(为空依次兜底完成时间/创建时间);
- * 退保总额为占位字段,后端暂无对应数据来源,恒为 null(候选:货品档案保额 insure_amount,确认后可补)
- *
- * @author rcx
- * @date 2026-08-31
- */
-@Data
-@ApiModel(value = "出库排名统计明细对象", description = "出库排名统计明细响应对象")
-public class OutboundDetailRankPO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @ApiModelProperty("种类(出库单据类型)")
- @Excel(name = "种类")
- private String orderTypeName;
-
- @ApiModelProperty("仓单编号(出库单号)")
- @Excel(name = "仓单编号")
- private String outOrderNumber;
-
- @ApiModelProperty("入库单号")
- @Excel(name = "入库单号")
- private String inOrderNumber;
-
- @ApiModelProperty("客户编号")
- @Excel(name = "客户编号")
- private String customerCode;
-
- @ApiModelProperty("收货人(出库单 TO 栏,为空取联系人)")
- @Excel(name = "收货人")
- private String receiver;
-
- @ApiModelProperty("商品货号(辅助字段,不导出)")
- private String materialCode;
-
- @ApiModelProperty("货名")
- @Excel(name = "货名")
- private String materialName;
-
- @ApiModelProperty("线路编码(辅助字段,不导出)")
- private String lineCode;
-
- @ApiModelProperty("线路")
- @Excel(name = "线路")
- private String lineName;
-
- @ApiModelProperty("件数(复核确认的实际出库量合计,与入库排名的实际上架量对称)")
- @Excel(name = "件数")
- private BigDecimal pieceCount;
-
- @ApiModelProperty("毛重(吨)")
- @Excel(name = "毛重(吨)")
- private BigDecimal grossWeightTon;
-
- @ApiModelProperty("体积(CBM)")
- @Excel(name = "体积(CBM)")
- private BigDecimal totalVolume;
-
- @ApiModelProperty("退保总额(占位字段,后端暂无数据来源,恒为 null)")
- @Excel(name = "退保总额")
- private BigDecimal depositRefundAmount;
-
- @ApiModelProperty("出仓日期(出仓日期为空时依次兜底完成时间/创建时间)")
- @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
- @DateTimeFormat(pattern = "yyyy-MM-dd")
- @Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd")
- private Date outboundDate;
-}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankTotalPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankTotalPO.java
index 5b37776c7..397126046 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankTotalPO.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundDetailRankTotalPO.java
@@ -33,4 +33,7 @@ public class OutboundDetailRankTotalPO implements Serializable {
@ApiModelProperty("仓单数合计(去重出库单数)")
private Long totalOrderCount;
+
+ @ApiModelProperty("线路数合计(去重线路数,线路排名使用)")
+ private Long totalLineCount;
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundLineRankPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundLineRankPO.java
new file mode 100644
index 000000000..38b7ecc4a
--- /dev/null
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundLineRankPO.java
@@ -0,0 +1,59 @@
+package com.mhd.wms.domain.outboundRank.repository.po;
+
+import com.mhd.common.core.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 线路出库排名PO(一行 = 线路×货品,日期区间内汇总)
+ *
+ * 按线路+物料编码合并:多张出库单合并为一行,单据级字段(种类/仓单编号/入库单号/客户编号/收货人/出仓日期)不提供;
+ * 仅统计带线路的出库单(line_code 为 2026-08-20 新增冗余字段,历史单为空,不参与线路排名);
+ * 件数 = SUM(CHECK_QUANTITY) 复核确认的实际出库量(与入库排名的实际上架量对称);
+ * 退保总额为占位字段,后端暂无对应数据来源,恒为 null
+ *
+ * @author rcx
+ * @date 2026-08-31
+ */
+@Data
+@ApiModel(value = "线路出库排名对象", description = "线路出库排名响应对象")
+public class OutboundLineRankPO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty("线路编码")
+ @Excel(name = "线路编码")
+ private String lineCode;
+
+ @ApiModelProperty("线路")
+ @Excel(name = "线路")
+ private String lineName;
+
+ @ApiModelProperty("商品货号")
+ @Excel(name = "商品货号")
+ private String materialCode;
+
+ @ApiModelProperty("货名")
+ @Excel(name = "货名")
+ private String materialName;
+
+ @ApiModelProperty("件数(复核确认的实际出库量合计,与入库排名的实际上架量对称)")
+ @Excel(name = "件数")
+ private BigDecimal pieceCount;
+
+ @ApiModelProperty("毛重(吨)")
+ @Excel(name = "毛重(吨)")
+ private BigDecimal grossWeightTon;
+
+ @ApiModelProperty("体积(CBM)")
+ @Excel(name = "体积(CBM)")
+ private BigDecimal totalVolume;
+
+ @ApiModelProperty("退保总额(占位字段,后端暂无数据来源,恒为 null)")
+ @Excel(name = "退保总额")
+ private BigDecimal depositRefundAmount;
+}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundMaterialRankPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundMaterialRankPO.java
new file mode 100644
index 000000000..d58cac1d5
--- /dev/null
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/repository/po/OutboundMaterialRankPO.java
@@ -0,0 +1,50 @@
+package com.mhd.wms.domain.outboundRank.repository.po;
+
+import com.mhd.common.core.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 商品出库排名PO(一行 = 一个货品,日期区间内跨出库单汇总)
+ *
+ * 按物料编码合并:一个货品会走多条线路/多张单,单据级字段(种类/仓单编号/入库单号/客户编号/收货人/出仓日期)与
+ * 线路字段均无单值可返,不提供;件数 = SUM(CHECK_QUANTITY) 复核确认的实际出库量(与入库排名的实际上架量对称);
+ * 退保总额为占位字段,后端暂无对应数据来源,恒为 null
+ *
+ * @author rcx
+ * @date 2026-08-31
+ */
+@Data
+@ApiModel(value = "商品出库排名对象", description = "商品出库排名响应对象")
+public class OutboundMaterialRankPO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty("商品货号")
+ @Excel(name = "商品货号")
+ private String materialCode;
+
+ @ApiModelProperty("货名")
+ @Excel(name = "货名")
+ private String materialName;
+
+ @ApiModelProperty("件数(复核确认的实际出库量合计,与入库排名的实际上架量对称)")
+ @Excel(name = "件数")
+ private BigDecimal pieceCount;
+
+ @ApiModelProperty("毛重(吨)")
+ @Excel(name = "毛重(吨)")
+ private BigDecimal grossWeightTon;
+
+ @ApiModelProperty("体积(CBM)")
+ @Excel(name = "体积(CBM)")
+ private BigDecimal totalVolume;
+
+ @ApiModelProperty("退保总额(占位字段,后端暂无数据来源,恒为 null)")
+ @Excel(name = "退保总额")
+ private BigDecimal depositRefundAmount;
+}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/service/OutboundRankDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/service/OutboundRankDomainService.java
index 0b21ed65e..18af50291 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/service/OutboundRankDomainService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outboundRank/service/OutboundRankDomainService.java
@@ -1,8 +1,9 @@
package com.mhd.wms.domain.outboundRank.service;
import com.mhd.wms.domain.outboundRank.repository.facade.IOutboundRankService;
-import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankPO;
import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankTotalPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundLineRankPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundMaterialRankPO;
import com.mhd.wms.domain.outboundRank.repository.todo.OutboundRankDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -11,7 +12,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
- * 出库排名统计(明细)领域服务
+ * 出库排名统计领域服务
*
* @author rcx
* @date 2026-08-31
@@ -24,16 +25,30 @@ public class OutboundRankDomainService {
private IOutboundRankService outboundRankService;
/**
- * 出库明细列表
+ * 商品出库排名列表(货品聚合)
*/
- public List queryDetailList(OutboundRankDO outboundRankDO) {
- return outboundRankService.queryDetailList(outboundRankDO);
+ public List queryMaterialRankList(OutboundRankDO outboundRankDO) {
+ return outboundRankService.queryMaterialRankList(outboundRankDO);
}
/**
- * 出库明细合计(不分页)
+ * 商品出库排名合计(不分页)
*/
- public OutboundDetailRankTotalPO queryDetailTotal(OutboundRankDO outboundRankDO) {
- return outboundRankService.queryDetailTotal(outboundRankDO);
+ public OutboundDetailRankTotalPO queryMaterialRankTotal(OutboundRankDO outboundRankDO) {
+ return outboundRankService.queryMaterialRankTotal(outboundRankDO);
+ }
+
+ /**
+ * 线路出库排名列表(线路×货品聚合)
+ */
+ public List queryLineRankList(OutboundRankDO outboundRankDO) {
+ return outboundRankService.queryLineRankList(outboundRankDO);
+ }
+
+ /**
+ * 线路出库排名合计(不分页)
+ */
+ public OutboundDetailRankTotalPO queryLineRankTotal(OutboundRankDO outboundRankDO) {
+ return outboundRankService.queryLineRankTotal(outboundRankDO);
}
}
diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inboundRank/InboundRankDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inboundRank/InboundRankDTO.java
index e7c812636..a73386995 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inboundRank/InboundRankDTO.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inboundRank/InboundRankDTO.java
@@ -9,7 +9,8 @@ import java.io.Serializable;
* 入库排名统计入参DTO
*
* 按入仓日期区间筛选商品入库量统计排名,统计口径:入仓日期 + 仅已入库状态(5) + 明细仅取 level=1 主行;
- * 一行 = 某仓单内某货品的合计,按件数降序排名
+ * 一行 = 一个物料的合计(按物料编码合并),按件数降序排名;
+ * 仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件,返回列不含这些字段
*
* @author rcx
* @date 2026-08-31
diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/inboundRank/InboundRankApi.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/inboundRank/InboundRankApi.java
index bde6855dd..a60b9308a 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/inboundRank/InboundRankApi.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/inboundRank/InboundRankApi.java
@@ -26,8 +26,10 @@ import java.util.List;
* 入库排名统计Api
*
* 按入仓日期区间筛选商品入库量统计排名。统计口径:入仓日期(为空的历史单按建档时间兜底) + 仅已入库状态(5),
- * 明细仅取 level=1 主行;一行 = 某仓单内某货品的合计,按件数(实际上架量 SHELVES_QUANTITY)降序排名。
- * 字段:入仓日期/仓单编号/客户编号/存货人/货名/件数/毛重(吨)/投保总额/体积(CBM)。
+ * 明细仅取 level=1 主行;一行 = 一个物料的合计(按物料编码合并区间内全部已入库仓单),
+ * 按件数(实际上架量 SHELVES_QUANTITY)降序排名,件数为0的物料不返回。
+ * 返回字段:物料编码/货名/规格型号/单位/件数/毛重(吨)/投保总额/体积(CBM);
+ * 仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件,不返回。
* 与出库排名(/outboundRankApi)配对,前端用 tab 页区分
*
* @author rcx
diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/outboundRank/OutboundRankApi.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/outboundRank/OutboundRankApi.java
index a7cccda65..649e3906a 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/outboundRank/OutboundRankApi.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/outboundRank/OutboundRankApi.java
@@ -5,8 +5,9 @@ import com.mhd.common.core.constant.HttpStatus;
import com.mhd.common.core.utils.PageUtils;
import com.mhd.common.core.utils.poi.ExcelUtil;
import com.mhd.wms.application.service.outboundRank.OutboundRankApplicationService;
-import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankPO;
import com.mhd.wms.domain.outboundRank.repository.po.OutboundDetailRankTotalPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundLineRankPO;
+import com.mhd.wms.domain.outboundRank.repository.po.OutboundMaterialRankPO;
import com.mhd.wms.domain.outboundRank.repository.todo.OutboundRankDO;
import com.mhd.wms.interfaces.assember.outboundRank.OutboundRankAssembler;
import com.mhd.wms.interfaces.dto.outboundRank.OutboundRankDTO;
@@ -25,10 +26,13 @@ import java.util.List;
/**
* 出库排名统计Api
*
- * 按日期区间筛选出库明细列表(一行 = 仓单×货品,件数/毛重/体积按行汇总,按件数(实际复核出库量)降序,出仓日期/单号次之)。
- * 统计口径:出库单创建时间 + 已出库及之后状态(9,12,13),明细仅取 level=1 主行。
- * 商品/线路两个 tab 各自独立接口,内部为同一份明细查询:商品接口忽略线路筛选参数,线路接口忽略商品筛选参数。
- * 字段:种类/仓单编号/入库单号/客户编号/收货人/货名/线路/件数/毛重(吨)/体积(CBM)/退保总额(占位null)/出仓日期
+ * 按日期区间筛选出库量统计排名,按出库数量(实际复核出库量)降序。
+ * 商品tab:一行 = 一个货品(货号/货名/件数/毛重(吨)/体积(CBM)/退保总额占位),跨出库单汇总,忽略线路筛选参数;
+ * 线路tab:一行 = 线路×货品(线路编码/线路/货号/货名/件数/毛重(吨)/体积(CBM)/退保总额占位),按线路+物料编码合并,
+ * 仅统计带线路的单,商品/线路筛选参数均生效;
+ * 统计口径:出库单创建时间 + 已出库及之后状态(9,12,13),明细仅取 level=1 主行;
+ * 件数 = SUM(CHECK_QUANTITY) 复核确认的实际出库量(与入库排名的实际上架量对称);
+ * 退保总额后端暂无对应数据来源,恒为 null
*
* @author rcx
* @date 2026-08-31
@@ -55,25 +59,22 @@ public class OutboundRankApi {
outboundRankDO.setLineCode(null);
outboundRankDO.setLineName(null);
startPage();
- List list = outboundRankApplicationService.queryDetailList(outboundRankDO);
- OutboundDetailRankTotalPO total = outboundRankApplicationService.queryDetailTotal(outboundRankDO);
+ List list = outboundRankApplicationService.queryMaterialRankList(outboundRankDO);
+ OutboundDetailRankTotalPO total = outboundRankApplicationService.queryMaterialRankTotal(outboundRankDO);
return getDataTableWithTotal(list, total);
}
/**
- * 分页查询线路出库排名列表(含合计行,线路tab;忽略商品筛选参数)
+ * 分页查询线路出库排名列表(含合计行,线路tab;一行=线路×货品,仅统计带线路的单)
*/
@ApiOperation("分页查询线路出库排名列表")
@GetMapping("/queryLineRankList")
public HashMap queryLineRankList(OutboundRankDTO outboundRankDTO) {
- //转换实体
+ //转换实体(线路tab:商品/线路筛选参数均生效,按线路+物料编码合并)
OutboundRankDO outboundRankDO = outboundRankAssembler.toDO(outboundRankDTO);
- //线路tab:忽略商品筛选参数
- outboundRankDO.setMaterialCode(null);
- outboundRankDO.setMaterialName(null);
startPage();
- List list = outboundRankApplicationService.queryDetailList(outboundRankDO);
- OutboundDetailRankTotalPO total = outboundRankApplicationService.queryDetailTotal(outboundRankDO);
+ List list = outboundRankApplicationService.queryLineRankList(outboundRankDO);
+ OutboundDetailRankTotalPO total = outboundRankApplicationService.queryLineRankTotal(outboundRankDO);
return getDataTableWithTotal(list, total);
}
@@ -88,41 +89,38 @@ public class OutboundRankApi {
//商品tab:忽略线路筛选参数
outboundRankDO.setLineCode(null);
outboundRankDO.setLineName(null);
- List list = outboundRankApplicationService.exportDetailList(outboundRankDO);
+ List list = outboundRankApplicationService.exportMaterialRankList(outboundRankDO);
String fileName = URLEncoder.encode("商品出库排名", "UTF-8").replaceAll("\\+", "%20");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
- ExcelUtil util = new ExcelUtil<>(OutboundDetailRankPO.class);
+ ExcelUtil util = new ExcelUtil<>(OutboundMaterialRankPO.class);
util.exportExcel(response, list, "商品出库排名");
}
/**
- * 导出线路出库排名Excel(线路tab;忽略商品筛选参数)
+ * 导出线路出库排名Excel(线路tab;一行=线路×货品,仅统计带线路的单)
*/
@ApiOperation("导出线路出库排名Excel")
@GetMapping("/exportLineRank")
public void exportLineRank(HttpServletResponse response, OutboundRankDTO outboundRankDTO) throws Exception {
- //转换实体(不分页,导出全量)
+ //转换实体(不分页,导出全量;线路tab:商品/线路筛选参数均生效,按线路+物料编码合并)
OutboundRankDO outboundRankDO = outboundRankAssembler.toDO(outboundRankDTO);
- //线路tab:忽略商品筛选参数
- outboundRankDO.setMaterialCode(null);
- outboundRankDO.setMaterialName(null);
- List list = outboundRankApplicationService.exportDetailList(outboundRankDO);
+ List list = outboundRankApplicationService.exportLineRankList(outboundRankDO);
String fileName = URLEncoder.encode("线路出库排名", "UTF-8").replaceAll("\\+", "%20");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
- ExcelUtil util = new ExcelUtil<>(OutboundDetailRankPO.class);
+ ExcelUtil util = new ExcelUtil<>(OutboundLineRankPO.class);
util.exportExcel(response, list, "线路出库排名");
}
/**
- * 分页结果 + 合计行:data/total/code/msg 之外追加 totalPieceCount/totalGrossWeightTon/totalVolume/totalOrderCount
+ * 分页结果 + 合计行:data/total/code/msg 之外追加合计字段(商品tab含 totalOrderCount,线路tab含 totalOrderCount/totalLineCount)
*/
private HashMap getDataTableWithTotal(List> list, OutboundDetailRankTotalPO total) {
HashMap result = new HashMap<>();
@@ -134,7 +132,12 @@ public class OutboundRankApi {
result.put("totalPieceCount", total.getTotalPieceCount());
result.put("totalGrossWeightTon", total.getTotalGrossWeightTon());
result.put("totalVolume", total.getTotalVolume());
- result.put("totalOrderCount", total.getTotalOrderCount());
+ if (total.getTotalOrderCount() != null) {
+ result.put("totalOrderCount", total.getTotalOrderCount());
+ }
+ if (total.getTotalLineCount() != null) {
+ result.put("totalLineCount", total.getTotalLineCount());
+ }
}
return result;
}
diff --git a/mhd_wms/src/main/resources/bootstrap.yml b/mhd_wms/src/main/resources/bootstrap.yml
index 52ade270d..39eb710cb 100644
--- a/mhd_wms/src/main/resources/bootstrap.yml
+++ b/mhd_wms/src/main/resources/bootstrap.yml
@@ -14,18 +14,18 @@ spring:
nacos:
discovery:
# server-addr: 127.0.0.1:8848
-# server-addr: 10.33.0.129:6010
+ server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
- server-addr: 10.102.192.31:6848
+# server-addr: 10.102.192.30:6848
username: nacos
password: manhuoda@2023
#线上正式环境
# server-addr: 10.102.192.105:6848
config:
# server-addr: 127.0.0.1:8848
-# server-addr: 10.33.0.129:
+ server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
- server-addr: 10.102.192.31:6848
+# server-addr: 10.102.192.30:6848
username: nacos
password: manhuoda@2023
#线上正式环境
diff --git a/mhd_wms/src/main/resources/mapper/inboundRank/InboundRankMapper.xml b/mhd_wms/src/main/resources/mapper/inboundRank/InboundRankMapper.xml
index 63f9a07e0..f4c34136c 100644
--- a/mhd_wms/src/main/resources/mapper/inboundRank/InboundRankMapper.xml
+++ b/mhd_wms/src/main/resources/mapper/inboundRank/InboundRankMapper.xml
@@ -10,7 +10,8 @@
left join 货品档案 material_base_info(c,取保额作投保总额)
口径:b.status = 5已入库(排除已取消(6)/已关闭(7)及未完成单据);
日期筛选按入仓单入仓日期 b.warehouse_date(与列表"入仓日期"列同源,为空的历史单按建档时间兜底);
- 一行 = 某仓单(b.in_order_number)内某货品(a.material_code)的合计,按件数(实际上架量 SUM(a.SHELVES_QUANTITY))降序排名
+ 一行 = 一个物料的合计(按物料编码合并,区间内全部已入库仓单),按件数(实际上架量 SUM(a.SHELVES_QUANTITY))降序排名,
+ 件数为0的物料不返回(HAVING过滤);仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件不返回
-->
a.del_flag = 1
@@ -54,14 +55,10 @@
left join material_base_info c on a.material_base_info_id = c.material_base_info_id
-
+
select
- IFNULL(MAX(b.warehouse_date), MAX(b.create_time)) AS warehouseDate,
- b.in_order_number AS inOrderNumber,
- MAX(b.shipper_code) AS shipperCode,
- MAX(b.shipper_name) AS shipperName,
a.material_code AS materialCode,
MAX(a.material_name) AS materialName,
MAX(a.SPECIFICATION_MODEL) AS specificationModel,
@@ -74,11 +71,13 @@
- GROUP BY b.in_order_number, a.material_code
- order by pieceCount desc, warehouseDate desc, inOrderNumber desc
+ GROUP BY a.material_code
+ HAVING pieceCount > 0
+ order by pieceCount desc, materialCode
-
+
select
@@ -86,10 +85,14 @@
ROUND(IFNULL(SUM(t.grossWeightKG), 0) / 1000, 3) AS totalGrossWeightTon,
IFNULL(SUM(t.insureAmount), 0) AS totalInsureAmount,
IFNULL(SUM(t.totalVolume), 0) AS totalVolume,
- COUNT(DISTINCT t.inOrderNumber) AS totalOrderCount
+ (select COUNT(DISTINCT b.in_order_number)
+
+
+
+ ) AS totalOrderCount
from (
select
- b.in_order_number AS inOrderNumber,
+ a.material_code AS materialCode,
IFNULL(SUM(a.SHELVES_QUANTITY), 0) AS pieceCount,
IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) AS grossWeightKG,
MAX(IFNULL(c.insure_amount, 0)) AS insureAmount,
@@ -98,7 +101,7 @@
- GROUP BY b.in_order_number, a.material_code
+ GROUP BY a.material_code
) t
diff --git a/mhd_wms/src/main/resources/mapper/outboundRank/OutboundRankMapper.xml b/mhd_wms/src/main/resources/mapper/outboundRank/OutboundRankMapper.xml
index 095d5eba0..b35a01337 100644
--- a/mhd_wms/src/main/resources/mapper/outboundRank/OutboundRankMapper.xml
+++ b/mhd_wms/src/main/resources/mapper/outboundRank/OutboundRankMapper.xml
@@ -5,12 +5,13 @@
a.del_flag = 1
@@ -62,50 +63,70 @@
join stock_out_order b on a.out_order_number = b.out_order_number and b.del_flag = 1
-
-
+
+
select
- MAX(b.ORDER_TYPE_NAME) AS orderTypeName,
- b.out_order_number AS outOrderNumber,
- MAX(a.in_order_number) AS inOrderNumber,
- MAX(b.customer_code) AS customerCode,
- MAX(IFNULL(b."TO", b.contact_person)) AS receiver,
a.material_code AS materialCode,
MAX(a.material_name) AS materialName,
- MAX(b.line_code) AS lineCode,
- MAX(b.line_name) AS lineName,
IFNULL(SUM(a.CHECK_QUANTITY), 0) AS pieceCount,
ROUND(IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) / 1000, 3) AS grossWeightTon,
- IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume,
- MAX(IFNULL(b.OUTBOUND_DATE, IFNULL(b.COMPLETE_TIME, b.create_time))) AS outboundDate
+ IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume
- GROUP BY b.out_order_number, a.material_code
- order by pieceCount desc, outboundDate desc, outOrderNumber desc
+ GROUP BY a.material_code
+ order by pieceCount desc, materialCode asc
-
-
+
select
- IFNULL(SUM(t.pieceCount), 0) AS totalPieceCount,
- ROUND(IFNULL(SUM(t.grossWeightKG), 0) / 1000, 3) AS totalGrossWeightTon,
- IFNULL(SUM(t.totalVolume), 0) AS totalVolume,
- COUNT(DISTINCT t.outOrderNumber) AS totalOrderCount
- from (
- select
- b.out_order_number AS outOrderNumber,
- IFNULL(SUM(a.CHECK_QUANTITY), 0) AS pieceCount,
- IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) AS grossWeightKG,
- IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume
-
-
-
-
- GROUP BY b.out_order_number, a.material_code
- ) t
+ IFNULL(SUM(a.CHECK_QUANTITY), 0) AS totalPieceCount,
+ ROUND(IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) / 1000, 3) AS totalGrossWeightTon,
+ IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume,
+ COUNT(DISTINCT a.out_order_number) AS totalOrderCount
+
+
+
+
+
+
+
+
+ select
+ b.line_code AS lineCode,
+ MAX(b.line_name) AS lineName,
+ a.material_code AS materialCode,
+ MAX(a.material_name) AS materialName,
+ IFNULL(SUM(a.CHECK_QUANTITY), 0) AS pieceCount,
+ ROUND(IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) / 1000, 3) AS grossWeightTon,
+ IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume
+
+
+
+ and b.line_code is not null and b.line_code != ''
+
+ GROUP BY b.line_code, a.material_code
+ order by pieceCount desc, lineCode asc, materialCode asc
+
+
+
+
+ select
+ IFNULL(SUM(a.CHECK_QUANTITY), 0) AS totalPieceCount,
+ ROUND(IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) / 1000, 3) AS totalGrossWeightTon,
+ IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume,
+ COUNT(DISTINCT b.line_code) AS totalLineCount,
+ COUNT(DISTINCT b.out_order_number) AS totalOrderCount
+
+
+
+ and b.line_code is not null and b.line_code != ''
+