From 0f43321b90ce37e6174fbc8f0e5ad5559f4c50fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Thu, 5 Mar 2026 17:07:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(notify):=20=E4=BC=98=E5=8C=96=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在SOIssueNotifyOrderMaterialList实体中新增partNo、partQuery、partDesc、lotSize字段 - 添加isInWh和availableQty字段用于库存状态管理 - 实现PartAttributeAware接口以支持零件属性查询 - 优化partQuery字段赋值逻辑,优先使用componentPartNo作为查询条件 - 集成partAttributeUtil工具批量填充isInWh和availableQty字段 - 移除调试相关的System.out.println代码 --- .../controller/IssureNotifyController.java | 27 +++++++++++- .../SOIssueNotifyOrderMaterialList.java | 43 ++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java b/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java index 992e680..79d50b2 100644 --- a/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java +++ b/src/main/java/com/gaotao/modules/notify/controller/IssureNotifyController.java @@ -432,7 +432,32 @@ public class IssureNotifyController { @PostMapping(value="/getNoOrderMaterialList") @ResponseBody public R getNoOrderMaterialList(@RequestBody SOIssueNotifyOrderMaterialList data) { - List rows = issureNotifyService.getNoOrderMaterialList(data); + List rows = issureNotifyService.getNoOrderMaterialList(data); + + // 设置partQuery字段用于查询 - rqrq + for (NoOrderMaterialListVo row : rows) { + // 优化:确保partQuery有值,优先使用componentPartNo - rqrq + if (row.getPartQuery() == null || row.getPartQuery().isEmpty()) { + if (row.getComponentPartNo() != null && !row.getComponentPartNo().isEmpty()) { + row.setPartQuery(row.getComponentPartNo()); + } else if (row.getPartNo() != null && !row.getPartNo().isEmpty()) { + row.setPartQuery(row.getPartNo()); + } + } + } + + // 批量填充isInWh和availableQty字段 - rqrq + partAttributeUtil.fillIsInWh(rows); + + // System.out.println("getNoOrderMaterialList返回数据,共" + rows.size() + "条 - rqrq"); + // if (!rows.isEmpty()) { + // NoOrderMaterialListVo first = rows.get(0); + // System.out.println("第一条数据:componentPartNo=" + first.getComponentPartNo() + // + ", partQuery=" + first.getPartQuery() + // + ", isInWh=" + first.getIsInWh() + // + ", availableQty=" + first.getAvailableQty() + " - rqrq"); + // } + return R.ok().put("rows", rows); } diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java index 5bc8b7a..44088e0 100644 --- a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialList.java @@ -2,13 +2,14 @@ package com.gaotao.modules.notify.entity; import com.baomidou.mybatisplus.annotation.TableName; +import com.gaotao.common.utils.PartAttributeAware; import lombok.Data; import java.math.BigDecimal; @Data @TableName(value = "SOIssueNotifyOrderMaterialList") -public class SOIssueNotifyOrderMaterialList { +public class SOIssueNotifyOrderMaterialList implements PartAttributeAware { /** * */ @@ -55,5 +56,45 @@ public class SOIssueNotifyOrderMaterialList { private String orderType; private String batchNo; private BigDecimal qtyIssuedHis; + + + private String partNo; + private String partQuery; + private String partDesc; + private int lotSize; + + /** + * 是否进立库标识(Y=是, N=否)- rqrq + */ + private String isInWh; + + /** + * 可用库存数量 - rqrq + */ + private BigDecimal availableQty; + + @Override + public String getPartQuery() { + // 优先使用partQuery,其次componentPartNo,最后partNo - rqrq + if (partQuery != null && !partQuery.isEmpty()) { + return partQuery; + } + if (componentPartNo != null && !componentPartNo.isEmpty()) { + return componentPartNo; + } + return partNo; + } + + @Override + public void setIsInWh(String isInWh) { + this.isInWh = isInWh; // 修复:实际设置字段 - rqrq + } + + @Override + public void setAvailableQty(BigDecimal availableQty) { + this.availableQty = availableQty; // 修复:实际设置字段 - rqrq + } + + }