From 7cf848238dc91916ebcd1b1de69b373bbf2357a3 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周四, 04 9月 2025 11:06:33 +0800
Subject: [PATCH] 修复入库不加信息的问题

---
 wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs b/wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs
index 1cf7c41..e439d9f 100644
--- a/wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs
+++ b/wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs
@@ -27,7 +27,7 @@
         /// <param name="productStocks"></param>
         /// <param name="currentTaskType"></param>
         public static void AddRecordForPersonDelete(dbmodel mod, OutInFlag _outInFlag, string remark,
-          System.Collections.Generic.List<productStockList> productStocks, productStock modfiyStock)
+          System.Collections.Generic.List<productStockList> productStocks, productStock modfiyStock, string positionName)
         {
             try
             {
@@ -43,7 +43,7 @@
                 Wms_outInStockRecord_V2_Mes log = new Wms_outInStockRecord_V2_Mes()
                 {
                     ID = Yitter.IdGenerator.YitIdHelper.NextId(),
-                    sourcePlace = "",
+                    sourcePlace = positionName,
                     toPlace = "",
                     containerCode = modfiyStock.containerCode,
 
@@ -83,6 +83,7 @@
                     {
                         ID = d_id,
                         mainId = log.ID,
+                        containerCode = log.containerCode,
                         productCode = item.productCode,
                         productName = item.productName,
                         serialNumber = item.serialNumber,
@@ -96,7 +97,7 @@
                 throw ex;
             }
         }
-        private static void AddRecord(dbmodel mod, OutInFlag _outInFlag, string sourcePlace, string toPlace, task _task, string remark,
+        public static void AddRecord(dbmodel mod, OutInFlag _outInFlag, string positionName, task _task, string remark,
             System.Collections.Generic.List<productStockList> productStocks, taskType currentTaskType)
         {
             try
@@ -113,8 +114,8 @@
                 Wms_outInStockRecord_V2_Mes log = new Wms_outInStockRecord_V2_Mes()
                 {
                     ID = Yitter.IdGenerator.YitIdHelper.NextId(),
-                    sourcePlace = sourcePlace,
-                    toPlace = toPlace,
+                    sourcePlace = positionName,
+                    toPlace = "",
                     containerCode = _task.containerCode,
 
                     LastModifier = _task.creator,
@@ -150,6 +151,7 @@
                     {
                         ID = Yitter.IdGenerator.YitIdHelper.NextId(),
                         mainId = log.ID,
+                        containerCode = log.containerCode,
                         productCode = item.productCode,
                         productName = item.productName,
                         serialNumber = item.serialNumber,
@@ -164,14 +166,14 @@
             }
         }
 
-        public static void AddRecord(dbmodel mod, OutInFlag _outInFlag, string sourcePlace, string toPlace, task _task, string remark,
+        public static void AddRecord(dbmodel mod, OutInFlag _outInFlag, string positionName, task _task, string remark,
          taskType currentTaskType)
         {
             var stock = mod.productStock.Where(a => a.containerCode == _task.containerCode).FirstOrDefault();
             if (stock != null)
             {
                 System.Collections.Generic.List<productStockList> productStocks = mod.productStockList.Where(a => a.stockId == stock.stockId).ToList();
-                AddRecord(mod, _outInFlag, sourcePlace, toPlace, _task, remark,
+                AddRecord(mod, _outInFlag, positionName, _task, remark,
                 productStocks, currentTaskType);
             }
         }

--
Gitblit v1.9.3