feat(wms,oms):入库排名统计改为按物料编码合并(一行=一个物料在区间内全部已入库仓单的合计):返回列裁剪为物料编码/货名/规格型号/单位/件数(实际上架量)/毛重(吨)/投保总额(货品档案保额取MAX不跨仓单累加)/体积;仓单编号/客户编号/存货人/入仓日期为单据级字段单值失真,移出返回列仅保留为查询条件;HAVING过滤0件行;合计行投保总额=各物料保额之和(每物料计一次),totalOrderCount=涉及仓单数;OMS/WMS两端口径数字一致;查询参数与返回结构外层不变

This commit is contained in:
rcx
2026-09-03 15:57:44 +08:00
parent 4ad31a870a
commit c9c3062789
11 changed files with 65 additions and 97 deletions
@@ -15,7 +15,7 @@ import java.util.List;
public interface InboundRankMapper {
/**
* 商品入库排名列表(仓单+货品汇总,按件数降序
* 商品入库排名列表(按物料编码合并,按件数降序,过滤0件行
*/
List<InboundMaterialRankPO> queryMaterialRankList(InboundRankDO inboundRankDO);
@@ -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(一行 = 一个物料的合计(按物料编码合并,查询区间内全部已入库仓单),按件数降序排名)
*
* <p>字段口径:入仓日期=入仓单入仓日期(为空兜底建档时间);仓单编号=入库单号;客户编号/存货人=入仓单货主
* 件数/毛重/体积=仓单内该货品明细合计(件数取实际上架量 SHELVES_QUANTITY);毛重(吨)=明细总毛重KG/1000
* 投保总额=货品档案保额(material_base_info.insure_amount,组内取MAX防多批次明细行重复累加)</p>
* <p>字段口径:件数=实际上架量(SHELVES_QUANTITY)合计;毛重(吨)=明细总毛重KG/1000;体积=明细合计
* 投保总额=货品档案保额(material_base_info.insure_amount,物料维度单一值取MAX,不跨仓单累加)
* 仓单编号/客户编号/存货人/入仓日期为单据级字段,按物料合并后单值失真,仅作查询条件不返回</p>
*
* @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;
}
@@ -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;
}
@@ -9,7 +9,8 @@ import java.io.Serializable;
* 入库排名统计入参DTO
*
* <p>按入仓日期区间筛选商品入库量统计排名,统计口径:入仓日期 + 仅已入库状态(5) + 明细仅取 level=1 主行;
* 一行 = 某仓单内某货品的合计,按件数降序排名</p>
* 一行 = 一个物料的合计(按物料编码合并),按件数降序排名
* 仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件,返回列不含这些字段</p>
*
* @author rcx
* @date 2026-08-31
@@ -26,8 +26,10 @@ import java.util.List;
* 入库排名统计Api
*
* <p>按入仓日期区间筛选商品入库量统计排名。统计口径:入仓日期(为空的历史单按建档时间兜底) + 仅已入库状态(5),
* 明细仅取 level=1 主行;一行 = 某仓单内某货品的合计,按件数(实际上架量 SHELVES_QUANTITY)降序排名。
* 字段:入仓日期/仓单编号/客户编号/存货人/货名/件数/毛重(吨)/投保总额/体积(CBM)
* 明细仅取 level=1 主行;一行 = 一个物料的合计(按物料编码合并区间内全部已入库仓单),
* 按件数(实际上架量 SHELVES_QUANTITY)降序排名,件数为0的物料不返回
* 返回字段:物料编码/货名/规格型号/单位/件数/毛重(吨)/投保总额/体积(CBM);
* 仓单编号/客户编号/存货人/入仓日期为单据级字段仅作查询条件,不返回。
* 与出库排名(/outboundRankApi)配对,前端用 tab 页区分</p>
*
* @author rcx