From 8c65f898ed6e5b0c7a94c792c4562f6ec831dccd Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 07 十一月 2026 08:50:53 +0800
Subject: [PATCH] feat: 完善质检、生产、销售、财务与人事模块并接入审批流程

---
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transaction/MesWmTransactionServiceImpl.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transaction/MesWmTransactionServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transaction/MesWmTransactionServiceImpl.java
index 775a75e..eadb221 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transaction/MesWmTransactionServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/transaction/MesWmTransactionServiceImpl.java
@@ -31,6 +31,8 @@
 import java.time.LocalDateTime;
 import java.util.List;
 
+import cn.iocoder.yudao.framework.common.exception.ServiceException;
+
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
 
@@ -89,12 +91,15 @@
             if (materialStock == null) {
                 throw exception(WM_MATERIAL_STOCK_NOT_EXISTS);
             }
-            // 鏍¢獙鐗╂枡銆佹壒娆°�佷粨搴撶瓑缁村害涓�鑷达紙闃叉浼犲叆閿欒鐨� materialStockId锛�
+            // 鏍¢獙鐗╂枡銆佹壒娆°�佷粨搴撶瓑缁村害涓�鑷达紙闃叉浼犲叆閿欒鐨� materialStockId锛夈��
+            // 鑻ユ澶勪笉涓�鑷达紝閫氬父鏄搴撳瓨宸茶绉诲簱/鍚堝苟/鎷嗗垎锛岄渶閫�鍥為噸鏂版嫞璐э紝鏁呯粰鍑洪拡瀵规�ф彁绀�
             if (ObjUtil.notEqual(materialStock.getItemId(), reqDTO.getItemId())
                     || ObjUtil.notEqual(materialStock.getWarehouseId(), reqDTO.getWarehouseId())
                     || ObjUtil.notEqual(materialStock.getLocationId(), reqDTO.getLocationId())
-                    || ObjUtil.notEqual(materialStock.getAreaId(), reqDTO.getAreaId())) {
-                throw exception(WM_MATERIAL_STOCK_SELECTION_MISMATCH);
+                    || ObjUtil.notEqual(materialStock.getAreaId(), reqDTO.getAreaId())
+                    || ObjUtil.notEqual(materialStock.getBatchId(), reqDTO.getBatchId())) {
+                throw new ServiceException(WM_MATERIAL_STOCK_SELECTION_MISMATCH.getCode(),
+                        "璇ュ簱瀛樿褰曞凡鍙樺姩锛堝彲鑳借绉诲簱/鍚堝苟/鎷嗗垎锛夛紝涓庡嚭搴撴槑缁嗕笉涓�鑷达紝鏃犳硶鎵e噺锛岃閫�鍥為噸鏂版嫞璐�");
             }
         } else if (isInbound) {
             // 鍏ュ簱浜嬪姟锛氭牴鎹� forceCreateNewStock 鏍囧織鍐冲畾鏄垱寤烘柊璁板綍杩樻槸鏌ユ壘/鍒涘缓
@@ -139,6 +144,7 @@
                 .itemId(reqDTO.getItemId()).batchId(reqDTO.getBatchId()).batchCode(reqDTO.getBatchCode())
                 .warehouseId(reqDTO.getWarehouseId()).locationId(reqDTO.getLocationId()).areaId(reqDTO.getAreaId())
                 .bizType(reqDTO.getBizType()).bizId(reqDTO.getBizId()).bizCode(reqDTO.getBizCode()).bizLineId(reqDTO.getBizLineId())
+                .workOrderId(reqDTO.getWorkOrderId())
                 .materialStockId(materialStock.getId()).relatedTransactionId(reqDTO.getRelatedTransactionId())
                 .build();
         transactionMapper.insert(transaction);

--
Gitblit v1.9.3