Browse Source

✨ feat(mes): 新增库存物资记录编号字段及相关逻辑

YunaiV 4 months ago
parent
commit
e93ba841e4

+ 3 - 0
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/line/MesWmSalesNoticeLineRespVO.java

@@ -19,6 +19,9 @@ public class MesWmSalesNoticeLineRespVO {
     @Schema(description = "物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
     private Long itemId;
 
+    @Schema(description = "库存物资记录编号", example = "1")
+    private Long materialStockId;
+
     @Schema(description = "物料编码", example = "M001")
     private String itemCode;
 

+ 3 - 0
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/line/MesWmSalesNoticeLineSaveReqVO.java

@@ -22,6 +22,9 @@ public class MesWmSalesNoticeLineSaveReqVO {
     @NotNull(message = "物料编号不能为空")
     private Long itemId;
 
+    @Schema(description = "库存物资记录编号", example = "1")
+    private Long materialStockId;
+
     @Schema(description = "批次编号", example = "1")
     private Long batchId;
 

+ 6 - 0
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/salesnotice/MesWmSalesNoticeLineDO.java

@@ -39,6 +39,12 @@ public class MesWmSalesNoticeLineDO extends BaseDO {
      * 关联 {@link MesMdItemDO#getId()}
      */
     private Long itemId;
+    /**
+     * 库存物资记录编号
+     *
+     * 关联 {@link cn.iocoder.yudao.module.mes.dal.dataobject.wm.materialstock.MesWmMaterialStockDO#getId()}
+     */
+    private Long materialStockId;
     /**
      * 批次编号
      */

+ 2 - 1
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/salesnotice/MesWmSalesNoticeLineServiceImpl.java

@@ -17,6 +17,7 @@ import java.util.List;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
+import static cn.iocoder.yudao.module.mes.enums.wm.MesWmSalesNoticeStatusEnum.PREPARE;
 
 /**
  * MES 发货通知单行 Service 实现类
@@ -102,7 +103,7 @@ public class MesWmSalesNoticeLineServiceImpl implements MesWmSalesNoticeLineServ
         if (notice == null) {
             throw exception(WM_SALES_NOTICE_NOT_EXISTS);
         }
-        if (ObjUtil.notEqual(0, notice.getStatus())) {
+        if (ObjUtil.notEqual(PREPARE.getStatus(), notice.getStatus())) {
             throw exception(WM_SALES_NOTICE_STATUS_NOT_ALLOW_UPDATE);
         }
     }