From 5ab19c977cfb0551a88b3885b0648183fbfff672 Mon Sep 17 00:00:00 2001
From: libo <Administrator@DESKTOP-1A6QMNS>
Date: 星期一, 31 三月 2025 10:10:12 +0800
Subject: [PATCH] 调整wms出入库、返库逻辑,调整与比亚迪接口对接的类型和方法,调整配置参数,写入服务器上数据库密码

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json                             |    5 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                         |  228 +++++++++++---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs          |   28 +
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs                 |   39 +
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs                        |  359 ++++++++++++-----------
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs      |   14 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs                 |   62 +++
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs  |    9 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs    |   60 ++--
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs |   10 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs          |   80 ++++-
 11 files changed, 580 insertions(+), 314 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs"
index 67ee1f5..58ddd4e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs"
@@ -14,6 +14,7 @@
 using WIDESEA_Core.BaseServices;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
+using WIDESEA_Core.LogHelper;
 using WIDESEA_Core.Utilities;
 using WIDESEA_DTO;
 using WIDESEA_DTO.Inbound;
@@ -53,81 +54,120 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
+
+                //Logger.Write_Log("System/test", "", "2.0 ", "");
+
                 materielGroupDTO.OrderNo = GetOrderNo();
+                //Logger.Write_Log("System/test", "", "2.1 ", "");
                 Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode);
+
+                //Logger.Write_Log("System/test", "", "2.2 ", "");
                 (bool, string, object?) result = CheckMaterielGroupParam(materielGroupDTO, stockInfo);
                 if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                 if (stockInfo == null)
                 {
+                    //Logger.Write_Log("System/test", "", "2.2.1 ", "");
                     stockInfo = new Dt_StockInfo();
                     stockInfo.PalletCode = materielGroupDTO.PalletCode;
                     stockInfo.StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt();
                     stockInfo.Creater = "绔嬪簱WMS";
                     stockInfo.Details = new List<Dt_StockInfoDetail>();
-                   
+
                 }
+
+                //Logger.Write_Log("System/test", "", "2.3 ", "");
                 List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>();
                 List<Dt_LabelMaster> notExistLabels = new List<Dt_LabelMaster>();
                 foreach (var lablel in materielGroupDTO.SerialNumbers)
                 {
                     Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel);
-                    if(labmaster == null)
+                    if (labmaster == null)
                     {
+
+                        //Logger.Write_Log("System/test", "", "2.3.1 lablel=" + lablel);
                         //閫氳繃鏉$爜鎺ュ彛鍚屾鏉$爜涓绘暟鎹�
-                        var res= _sys_JobService.GetLabMaster(lablel);
+                        var res = _sys_JobService.GetLabMaster(lablel);
                         if (res != null && res.Status)
                         {
+                            //Logger.Write_Log("System/test", "", "2.3.2 res.Status=" + res.Status.ToString());
                             labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel);
                             if (labmaster == null)
                             {
+                                //Logger.Write_Log("System/test", "", "2.3.3 ", "");
                                 notExistLabels.Add(labmaster);
                             }
                         }
                         else
                         {
-                          return  content = WebResponseContent.Instance.Error("缁勭洏鏉$爜鍦ㄤ笂娓竁MS绯荤粺涓笉瀛樺湪!");
-                        }    
-                    } 
-                    if(labmaster!=null)
+
+                            //Logger.Write_Log("System/test", "", "2.3.4 ", "");
+                            return content = WebResponseContent.Instance.Error("缁勭洏鏉$爜鍦ㄤ笂娓竁MS绯荤粺涓笉瀛樺湪!");
+                        }
+                    }
+                    if (labmaster != null)
                     {
+                        //Logger.Write_Log("System/test", "", "2.3.5 ", "");
                         //涓绘暟鎹潯鐮佺姸鎬佸厑璁哥粍鐩橈細01宸叉敹鏂欏緟璐ㄦ锛�02宸叉敹鏂欐棤闇�璐ㄦ锛�03寰呰繘浠撳凡璐ㄦ锛�09宸蹭笅鏋讹紱
                         //涓绘暟鎹潯鐮佺姸鎬佷笉鍏佽缁勭洏锛�00鍒涘缓锛�04宸茶川妫�寰呴��璐э紝05鏀舵枡鎴块��璐э紝06搴撴埧閫�璐э紝07宸茶繘浠擄紝08宸蹭笂鏋讹紝10宸插嚭搴擄紝11宸插喕缁擄紝12宸查攣瀹氾紝20鍏抽棴鐨勶紱
-                        if (labmaster.LABEL_STATUS=="00"|| labmaster.LABEL_STATUS == "04" || labmaster.LABEL_STATUS == "05"|| labmaster.LABEL_STATUS == "06" || labmaster.LABEL_STATUS == "07" || labmaster.LABEL_STATUS == "08" || labmaster.LABEL_STATUS == "10" || labmaster.LABEL_STATUS == "11" || labmaster.LABEL_STATUS == "12" || labmaster.LABEL_STATUS == "20")
+                        if (labmaster.LABEL_STATUS == "00" || labmaster.LABEL_STATUS == "04" || labmaster.LABEL_STATUS == "05" || labmaster.LABEL_STATUS == "06" || labmaster.LABEL_STATUS == "07" || labmaster.LABEL_STATUS == "08" || labmaster.LABEL_STATUS == "10" || labmaster.LABEL_STATUS == "11" || labmaster.LABEL_STATUS == "12" || labmaster.LABEL_STATUS == "20")
                         {
-                            return content = WebResponseContent.Instance.Error("涓绘暟鎹潯鐮佺姸鎬佷笉鍏佽缁勭洏!鏉$爜鐘舵�侊細"+ labmaster.LABEL_STATUS);
+
+                            //Logger.Write_Log("System/test", "", "2.3.6 LABEL_STATUS=" + labmaster.LABEL_STATUS);
+                            return content = WebResponseContent.Instance.Error("涓绘暟鎹潯鐮佺姸鎬佷笉鍏佽缁勭洏!鏉$爜鐘舵�侊細" + labmaster.LABEL_STATUS);
                         }
                     }
                 }
+
+                //Logger.Write_Log("System/test", "", "2.4 ", "");
+
                 if (notExistLabels.Count == 0)
                 {
+
+                    //Logger.Write_Log("System/test", "", "2.4.1 ", "");
                     foreach (var item in materielGroupDTO.SerialNumbers)
                     {
+
+                        //Logger.Write_Log("System/test", "", "2.4.2 "+ item);
+                        //Logger.Write_Log("System/test", "", "2.4.2.0 ", "");
                         Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item);
+
                         Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail();
                         dt_StockInfoDetail.Status = 0;
+
+                        //Logger.Write_Log("System/test", "", "2.4.2.1 ", "");
                         dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo;
                         dt_StockInfoDetail.StockId = stockInfo.Id != 0 ? stockInfo.Id : 0;
                         dt_StockInfoDetail.MaterielCode = labmaster.MATNR;
                         dt_StockInfoDetail.MaterielName = labmaster.MAKTX;
                         dt_StockInfoDetail.BatchNo = labmaster.BATCH;
                         dt_StockInfoDetail.SerialNumber = labmaster.LABEL_NO;
-                        dt_StockInfoDetail.StockQuantity = int.Parse(labmaster.BOX_QTY);
+                        //Logger.Write_Log("System/test", "", "2.4.2.2 "+ labmaster.BOX_QTY);
+                        dt_StockInfoDetail.StockQuantity = (int)Convert.ToDouble(labmaster.BOX_QTY);
                         dt_StockInfoDetail.OutboundQuantity = 0;
                         dt_StockInfoDetail.Creater = "System";
+
+                        //Logger.Write_Log("System/test", "", "2.4.2.3 ", "");
                         stockInfoDetails.Add(dt_StockInfoDetail);
-                        stockInfo.Details.AddRange(stockInfoDetails);     
+
+                        //Logger.Write_Log("System/test", "", "2.4.2.4 ", "");
+                        stockInfo.Details.AddRange(stockInfoDetails);
+
+                        //Logger.Write_Log("System/test", "", "2.4.2.5 ", "");
                     }
                     content = MaterielGroupUpdateData(stockInfo);
 
                 }
                 else
                 {
+
+                    //Logger.Write_Log("System/test", "", "2.4.3 ", "");
                     content = WebResponseContent.Instance.Error("缁勭洏鏉$爜鍦ㄤ笂娓竁MS绯荤粺涓笉瀛樺湪!");
-                }      
+                }
 
             }
             catch (Exception ex)
             {
+                //Logger.Write_Log("System/test", "", "2.4.4 " + ex.ToString());
                 content = WebResponseContent.Instance.Error(ex.Message);
             }
             finally
@@ -164,7 +204,7 @@
 
                 foreach (var item in inventoryRequest.DATA)
                 {
-                  
+
                     Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail();
                     dt_StockInfoDetail.Status = 0;
                     dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo;
@@ -173,7 +213,7 @@
                     dt_StockInfoDetail.MaterielName = "";
                     dt_StockInfoDetail.BatchNo = "";
                     dt_StockInfoDetail.SerialNumber = item.LABEL_NO;
-                    dt_StockInfoDetail.StockQuantity = int.Parse(item.QTY);
+                    dt_StockInfoDetail.StockQuantity = (int)Convert.ToDouble(item.QTY);
                     dt_StockInfoDetail.OutboundQuantity = 0;
                     dt_StockInfoDetail.Creater = "WMS";
                     stockInfoDetails.Add(dt_StockInfoDetail);
@@ -205,12 +245,12 @@
 
             new LogFactory().GetLog("WMS鎺ュ彛").InfoFormat(true, "returnInventory", "浣欐枡閫�鍥炰俊鎭�", $"{inventoryRequeststr}");
             ReturnInventoryRequest inventoryRequest = JsonConvert.DeserializeObject<ReturnInventoryRequest>(inventoryRequeststr);
-            ReturnInventoryResponse response= new ReturnInventoryResponse();
+            ReturnInventoryResponse response = new ReturnInventoryResponse();
             MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO();
             materielGroupDTO.PalletCode = inventoryRequest.TPNUM;
             materielGroupDTO.OrderNo = inventoryRequest.IZLID; //閫�璐у叆搴撴寚浠�
             List<string> SerialNumbers = new List<string>();
-            Dt_MainReturnInventory dt_MainReturnInventoryOld =  _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO);
+            Dt_MainReturnInventory dt_MainReturnInventoryOld = _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO);
             if (dt_MainReturnInventoryOld == null)
             {
                 //淇濆瓨鍥為��鏁版嵁鍒版湰鍦�
@@ -289,9 +329,9 @@
             try
             {
                 Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(PalletCode);
-                if(stockInfo != null)
+                if (stockInfo != null)
                 {
-                    if(stockInfo.StockStatus!= (int)StockStatusEmun.缁勭洏鏆傚瓨)
+                    if (stockInfo.StockStatus != (int)StockStatusEmun.缁勭洏鏆傚瓨)
                     {
                         return content = WebResponseContent.Instance.Error("缁勭洏鏆傚瓨鐘舵�佹墠鍙互鎾ら攢缁勭洏锛�");
                     }
@@ -305,12 +345,12 @@
                     }
                     content = MaterielGroupUpdateData(stockInfo);
 
-                } 
+                }
                 else
                 {
                     return content = WebResponseContent.Instance.Error("缁勭洏淇℃伅涓嶅瓨鍦紒");
                 }
-              
+
             }
             catch (Exception ex)
             {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs"
index e9673c7..2359e14 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs"
@@ -8,9 +8,12 @@
 {
     public class PickAndPostRequest
     {
-        public string WH_NUMBER { get; set; }
-        public string SYSNOD { get; set; }
         public string WERKS { get; set; }
+        public string WH_NUMBER { get; set; }
+        //public string SYSNOD { get; set; }
+        //public string REQUIREMENT_NO { get; set; }
+        //public string BUSINESS_NAME { get; set; }
+        //public string BUSINESS_CODE { get; set; }
         public List<PickAndPost> ITEMDATA { get; set; }
 
 
@@ -77,9 +80,9 @@
     {
         public string REQUIREMENT_NO { get; set; }
         public string REQUIREMENT_ITEM_NO { get; set; }
-        public string WERKS { get; set; }
+        public string ORDERCODE { get; set; }
+        public string ORDERCODE_ITEM_NO { get; set; }
         public string SYSNOD { get; set; }
-
         public string MATNR { get; set; }
         public string LIFNR { get; set; }
         public string QTY { get; set; }
@@ -90,9 +93,12 @@
         public string STATION { get; set; }
         public string  SPLIT { get; set; }
         public string  LABEL_NO { get; set; }
+        public string Pack_LABEL_NO { get; set; }
+        public string pallet_label_no { get; set; }
         public string CREATE_DATE { get; set; }
         public string UPDATE_DATE { get; set; }
         public string STATUS { get; set; }
+        public string MO_NO { get; set; }
 
         // /// <summary>
         // /// 闇�姹傝
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs"
index 56d4d42..5699edb 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs"
@@ -8,20 +8,28 @@
 {
     public class PutAwayReturnRequest
     {
-       
+
+        /// <summary>
+        /// 浠撳簱缂栧彿锛堢郴缁熸爣璇嗭級
+        /// </summary>
+        public string WH_NUMBER { get; set; }
+        /// <summary>
+        /// 涓氬姟绫诲瀷鍚嶇О
+        /// </summary>
+        public string BUSINESS_NAME { get; set; }
         /// <summary>
         /// 宸ュ巶浠g爜
         /// </summary>
         public string WERKS { get; set; }
         /// <summary>
-        /// 浠撳簱缂栧彿锛堢郴缁熸爣璇嗭級
+        /// 鐩爣搴撳瓨鍦扮偣
         /// </summary>
-        public string WH_NUMBER { get; set; }
-
+        public string LGORT { get; set; }
+        public string TOTAL_RETURN_QTY { get; set; }
         /// <summary>
-        /// 鍏ュ簱鎸囦护
+        /// 涓氬姟绫诲瀷浠g爜
         /// </summary>
-        public string IZLID { get; set; }
+        public string BUSINESS_CODE { get; set; }
         /// <summary>
         /// 閫�璐у崟鍙�
         /// </summary>
@@ -30,45 +38,37 @@
         /// 閫�璐у崟琛岄」鐩�
         /// </summary>
         public string RETURN_ITEM_NO { get; set; }
-
-        /// <summary>
-        /// 涓氬姟绫诲瀷鍚嶇О
-        /// </summary>
-        public  string  BUSINESS_NAME { get; set; }
-
-        /// <summary>
-        /// 涓氬姟绫诲瀷浠g爜
-        /// </summary>
-        public string BUSINESS_CODE {  get; set; }
-
         /// <summary>
         /// 鎵樼洏鍙�
         /// </summary>
         public string TPNUM { get; set; }
-
-        /// <summary>
-        /// 鐩爣搴撳瓨鍦扮偣
-        /// </summary>
-        public string LGORT { get; set; }
-       
-        public string MO_NO { get; set; }
-
+        public string YLZD5 { get; set; }
         public List<PutAwayReturn> DATA { get; set; }
+        /// <summary>
+        /// 鍏ュ簱鎸囦护
+        /// </summary>
+        public string IZLID { get; set; }
+        public string MO_NO { get; set; }
+        public string YLZD3 { get; set; }
+        public string YLZD4 { get; set; }
+        public string YLZD1 { get; set; }
+        public string YLZD2 { get; set; }
+        public string SYSNOD { get; set; }
+
     }
 
     public class PutAwayReturn
     {
         public string LABEL_NO { get; set; }
-        public string SOBKZ { get; set; }
         public string UNIT { get; set; }
+        public string SOBKZ { get; set; }
         public string LGORT { get; set; }
-        public string TOTAL_RETURN_QTY { get; set; }
+        public string QTY { get; set; }
+
         public string F_LGORT { get; set; }
-        public string MO_NO { get; set; }
         public string LIFNR { get; set; }
+        public string MO_NO { get; set; }
        
         public string MATNR { get; set; }
-
-        public string BATCH { get; set;}
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs"
index a66699c..01829d1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs"
@@ -21,26 +21,27 @@
 
         public string TPNUM { get; set; }  
         public string YLZD5 { get; set; }
+        public List<ReturnInventory> DATA { get; set; }
         public string IZLID { get; set; }
-        public string SYSNOD { get; set; }
         public string MO_NO { get; set; }
+        public string SYSNOD { get; set; }
         public string YLZD3 { get; set; }
         public string YLZD4 { get; set; }
         public string YLZD1 { get; set; }
         public string YLZD2 { get; set; }
 
-        public List<ReturnInventory> DATA { get; set; }
     }
 
     public class ReturnInventory
     {
         public string LABEL_NO { get; set; }
-        public string SOBKZ { get; set; }
         public string UNIT { get; set; }
+        public string SOBKZ { get; set; }
         public string LGORT { get; set; }
         public string QTY { get; set; }
-        public string LIFNR { get; set; }
         public string F_LGORT { get; set; }
+        public string LIFNR { get; set; }
+        public string MO_NO { get; set; }
         public string MATNR { get; set; }
 
     }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs"
index 5699ba4..3e05f02 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs"
@@ -12,14 +12,14 @@
         public string WH_NUMBER { get; set; }
         public string MATNR { get; set; }
         public string BATCH { get; set; }
-        public string FREEZE_TYPE { get; set; }
+        public string YWLX { get; set; }
 
-        public string EFFECT_DATE { get; set; }
+        public string VALTO { get; set; }
 
-        public string REASON_CODE { get; set; }
+        //public string REASON_CODE { get; set; }
 
-        public string REASON { get; set; }
-        public string EDITOR { get; set; }
+        //public string REASON { get; set; }
+        //public string EDITOR { get; set; }
 
     }
     
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs"
index 67d309a..e06c147 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs"
@@ -24,7 +24,7 @@
     public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository
     {
         private readonly ILabelMasterRepository _labelMasterRepository;
-        public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage,ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage)
+        public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage)
         {
             _labelMasterRepository = labelMasterRepository;
         }
@@ -78,15 +78,15 @@
         /// </summary>
         /// <param name="materielCode"></param>
         /// <returns></returns>
-        public List<Dt_StockInfo> GetStockInfos(string materielCode,string batchNo)
+        public List<Dt_StockInfo> GetStockInfos(string materielCode, string batchNo)
         {
-            return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode&&v.BatchNo==batchNo)).ToList();       
+            return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == batchNo)).ToList();
         }
 
         public List<Dt_StockInfo> GetStockInfos(string materielCode, List<string> locationCodes)
         {
             //淇敼鍙幏鍙栧凡涓婃灦鐘舵�佺殑搴撳瓨
-            return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)&&x.StockStatus== (int)StockStatusEmun.宸蹭笂鏋�).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList();
+            return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == (int)StockStatusEmun.宸蹭笂鏋�).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList();
 
 
             //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode));
@@ -118,9 +118,9 @@
         {
             //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode);
             return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.宸插叆搴�.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First();
-        
+
         }
-        public Dt_StockInfo GetPalletStockInfo(string roadwayNo,string strayType)
+        public Dt_StockInfo GetPalletStockInfo(string roadwayNo, string strayType)
         {
             //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode);
             if (strayType == "1")
@@ -161,7 +161,7 @@
                             stockItem.LGORT = "0030";//搴撲綅
                             if (labelMaster != null)
                             {
-                                if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WH_NUMBER)
+                                if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WERKS)
                                 {
                                     stockItem.LIFNR = labelMaster.LIFNR;
                                     stockItem.LIKTX = labelMaster.LIKTX;
@@ -170,7 +170,20 @@
                                     stockItem.MATNR = labelMaster.MATNR;
                                     stockItem.MEINS = labelMaster.UNIT;
                                     stockItem.QTY = labelMaster.BOX_QTY;
-                                    stockItem.SOBKZ = labelMaster.SOBKZ;
+                                    var sobkz = "闈為檺鍒�";
+                                    if (labelMaster.SOBKZ == "0")
+                                    {
+                                        sobkz = "闈為檺鍒�";
+                                    }
+                                    else if (labelMaster.SOBKZ == "1")
+                                    {
+                                        sobkz = "鍐荤粨";
+                                    }
+                                    else if (labelMaster.SOBKZ == "2")
+                                    {
+                                        sobkz = "寰呰川妫�";
+                                    }
+                                    stockItem.SOBKZ = sobkz;
                                     stockItem.TPNUM = view.PalletCode;
                                     stockItem.WERKS = labelMaster.WERKS;//宸ュ巶
                                     stockItem.WH_NUMBER = labelMaster.WH_NUMBER;//浠撳簱鍙�
@@ -206,18 +219,20 @@
         /// </summary>
         /// <param name="freezeByCustomerResponse"></param>
         /// <returns></returns>
-        public freezeByCustomerResponse freezeByCustomer(string  freezeRequeststr)
+        public freezeByCustomerResponse freezeByCustomer(string freezeRequeststr)
         {
-          
+
             freezeByCustomerResponse freezeResponse = new freezeByCustomerResponse();
             try
             {
                 freezeByCustomerRequest freezeRequest = JsonConvert.DeserializeObject<freezeByCustomerRequest>(freezeRequeststr);
-                if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["SYSNO"])
+                if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["WERKS"])
                 {
                     //鏍规嵁鎵规鍜岀墿鏂欏彿鏌ユ壘瀵瑰簲鐨勬墭鐩樺彿锛屽喕缁撳簱瀛橈紝鍙湁鍏ュ簱鎴愬姛浜嗭紝鎵嶈兘琚喕缁�
                     List<Dt_StockInfo> stockInfos = GetStockInfos(freezeRequest.MATNR, freezeRequest.BATCH);
-                    if (freezeRequest.FREEZE_TYPE == "00")//00鍐荤粨 
+
+                    List<Dt_LabelMaster> labelInfos = _labelMasterRepository.QueryData(x => x.MATNR == freezeRequest.MATNR && x.BATCH == freezeRequest.BATCH);
+                    if (freezeRequest.YWLX == "00")//00鍐荤粨 
                     {
                         foreach (var item in stockInfos)
                         {
@@ -227,10 +242,17 @@
                                 UpdateData(item);
                             }
                         }
+
+                        foreach (var li in labelInfos)
+                        {
+                            li.SOBKZ = "1";
+                        }
+                        _labelMasterRepository.UpdateData(labelInfos);
+
                         freezeResponse.MSGTY = "S";
                         freezeResponse.MSGTX = "";
                     }
-                    else if (freezeRequest.FREEZE_TYPE == "01") //01瑙e喕
+                    else if (freezeRequest.YWLX == "01") //01瑙e喕
                     {
                         foreach (var item in stockInfos)
                         {
@@ -240,6 +262,20 @@
                                 UpdateData(item);
                             }
                         }
+
+                        foreach (var li in labelInfos)
+                        {
+                            //if (li.LABEL_STATUS == "01")
+                            //{
+                            //    li.SOBKZ = "2";
+                            //}
+                            //else
+                            //{
+                            li.SOBKZ = "0";
+                            //}
+                        }
+                        _labelMasterRepository.UpdateData(labelInfos);
+
                         freezeResponse.MSGTY = "S";
                         freezeResponse.MSGTX = "";
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs"
index 9fbff0a..1c6c22a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs"
@@ -22,6 +22,7 @@
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
 using WIDESEA_Core.Log;
+using WIDESEA_Core.LogHelper;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.System;
 using WIDESEA_IBasicRepository;
@@ -94,11 +95,14 @@
                            Dt_LabelMaster labMaster =  _labelMasterRepository.QueryFirst(x=>x.LABEL_NO == item.LABEL_NO);
                             if (labMaster != null)//鏇存柊鐘舵��
                             {
+                                labMaster.RECEIPT_NO = item.RECEIPT_NO;
+                                labMaster.QC_RESULT_CODE = item.QC_RESULT_CODE;
                                 labMaster.LABEL_STATUS = item.LABEL_STATUS;
                                 _labelMasterRepository.UpdateData(labMaster);
                             }
                             else
                             {
+                                item.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                                 _labelMasterRepository.AddData(item);
                             }
                         }
@@ -183,12 +187,14 @@
                 
                 string inparam = JsonConvert.SerializeObject(putAway);
                 new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPutAway", "璇锋眰", $"{inparam}");
+                //Logger.Write_Log("System/test_in", "", "inparam =  " + inparam);
                 string response = likuClient.putaway(inparam);
+                //Logger.Write_Log("System/test_in", "", "response =  " + response);
                 new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPutAway", "鍝嶅簲", $"{response}");
                 if (response != null)
                 {
                     PutAwayResponse res = JsonConvert.DeserializeObject<PutAwayResponse>(response);
-                    if (res != null && res.MSGTX == "S")
+                    if (res != null && res.MSGTY == "S")
                     {
                         content = WebResponseContent.Instance.OK("涓婃灦鍥炰紶鎴愬姛");
                         new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPutAway", "鍝嶅簲", $"涓婃灦鍥炰紶鎴愬姛锛�");
@@ -227,11 +233,13 @@
 
                 string inparam = JsonConvert.SerializeObject(putAwayReturn);
                 new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPutAwayReturn", "璇锋眰", $"{inparam}");
+                //Logger.Write_Log("System/test_re", "", "inparam = "+ inparam);
                 string response = likuClient.putAwayReturn(inparam);
+                //Logger.Write_Log("System/test_re", "", "response = " + response);
                 if (response != null)
                 {
                     PutAwayReturnResponse res = JsonConvert.DeserializeObject<PutAwayReturnResponse>(response);
-                    if (res != null && res.MSGTX == "S")
+                    if (res != null && res.MSGTY == "S")
                     {
                         content = WebResponseContent.Instance.OK("涓婃灦鍥炰紶鎴愬姛锛�");
                         new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPutAwayReturn", "鍝嶅簲", $"涓婃灦鍥炰紶鎴愬姛锛�");
@@ -267,155 +275,191 @@
                 outStoreOrder.WERKS = AppSettings.Configuration["WERKS"];
                 outStoreOrder.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                 string inparam = JsonConvert.SerializeObject(outStoreOrder);
-                //string response = client.selectOutStoreOrder(inparam);
-                string response = "{\r\n    \"MSGTY\": \"S\",\r\n    \"DATA\": \"[{REQUIREMENT_NO=XAXQGX25012005354, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:瀹嬪瓙瓒�, CREATE_DATE=2024-12-18 11:36:17, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}, {REQUIREMENT_NO=XAXQGX25012005353, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:瀹嬪瓙瓒�, CREATE_DATE=2024-12-18 11:35:22, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}]\",\r\n    \"MSGTX\": \"success\"\r\n}";
+                string response = client.selectOutStoreOrder(inparam);
+                //string response = "{\r\n    \"MSGTY\": \"S\",\r\n    \"DATA\": \"[{REQUIREMENT_NO=XAXQGX25012005354, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:瀹嬪瓙瓒�, CREATE_DATE=2024-12-18 11:36:17, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}, {REQUIREMENT_NO=XAXQGX25012005353, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:瀹嬪瓙瓒�, CREATE_DATE=2024-12-18 11:35:22, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}]\",\r\n    \"MSGTX\": \"success\"\r\n}";
                 if (response != null)
                 {
                     SelectOutStoreOrderResponse res = JsonConvert.DeserializeObject<SelectOutStoreOrderResponse>(response);
-                    if (res != null && res.MSGTY == "S"&&!string.IsNullOrEmpty(res.DATA))
+                    if (res != null && res.MSGTY == "S")
                     {
-                        string data = stringToJson(res.DATA);
-                        string newdata = data.Replace("},\"", "},").Replace("\" ", "\"");
-                        List<OutStoreData> outStoreList = JsonConvert.DeserializeObject<List<OutStoreData>>(newdata);
-                        foreach (var item in outStoreList)
+                        if (string.IsNullOrEmpty(res.DATA) || res.DATA == "[]")
                         {
-                            Dt_OutBoundOrderBYD bydOrder = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO);
-                            if (bydOrder != null)//鏇存柊
-                            {
-
-                                bydOrder.REQUIREMENT_NO = item.REQUIREMENT_NO;
-                                bydOrder.WRKS = item.WERKS;
-                                bydOrder.WH_NUMBER = item.WH_NUMBER;
-                                bydOrder.SYSNOD = item.SYSNOD;
-                                bydOrder.BUSINESS_CODE = item.BUSINESS_CODE;
-                                bydOrder.BUSINESS_NAME = item.BUSINESS_NAME;
-                                bydOrder.LGORT = item.LGORT;
-                                bydOrder.STATION = item.STATION;
-                                bydOrder.MO_NO = item.MO_NO;
-                                bydOrder.SAP_OUT_NO = item.SAP_OUT_NO;
-                                bydOrder.RECEIVE_LGORT = item.RECEIVE_LGORT;
-                                bydOrder.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
-                                bydOrder.SPLIT = item.SPLIT;
-                                bydOrder.STATUS = item.STATUS;
-                                bydOrder.CREATE_PERSON = item.CREATE_PERSON;
-                                bydOrder.CREATE_DATE = item.CREATE_DATE;
-                                _outBoundOrderBYDRepository.UpdateData(bydOrder);
-                                foreach (var detail in item.ITEMS)
-                                {
-                                    Dt_OutboundOrderDetailBYD byddetail = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.REQUIREMENT_ITEM_NO);
-                                    if (byddetail != null)
-                                    {
-                                        byddetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
-                                        byddetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
-                                        byddetail.MATNR = detail.MATNR;
-                                        byddetail.BATCH = detail.BATCH;
-                                        byddetail.BATCH = detail.BATCH;
-                                        byddetail.QTY = detail.QTY;
-                                        byddetail.GEAR = detail.GEAR;
-                                        byddetail.PI_NO = detail.PI_NO;
-                                        _outboundOrderDetailByDRepository.UpdateData(byddetail);
-                                    }
-                                    else
-                                    {
-                                        Dt_OutboundOrderDetailBYD newdetail = new Dt_OutboundOrderDetailBYD();
-                                        newdetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
-                                        newdetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
-                                        newdetail.MATNR = detail.MATNR;
-                                        newdetail.BATCH = detail.BATCH;
-                                        newdetail.BATCH = detail.BATCH;
-                                        newdetail.QTY = detail.QTY;
-                                        newdetail.GEAR = detail.GEAR;
-                                        newdetail.PI_NO = detail.PI_NO;
-                                        _outboundOrderDetailByDRepository.AddData(newdetail);
-                                    }
-
-                                }
-                               
-
-                            }
-                            else
-                            {
-                                Dt_OutBoundOrderBYD outBoundOrderBYD = new Dt_OutBoundOrderBYD();
-                                outBoundOrderBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
-                                outBoundOrderBYD.WRKS = item.WERKS;
-                                outBoundOrderBYD.WH_NUMBER = item.WH_NUMBER;
-                                outBoundOrderBYD.SYSNOD = item.SYSNOD;
-                                outBoundOrderBYD.BUSINESS_CODE = item.BUSINESS_CODE;
-                                outBoundOrderBYD.BUSINESS_NAME = item.BUSINESS_NAME;
-                                outBoundOrderBYD.LGORT = item.LGORT;
-                                outBoundOrderBYD.STATION = item.STATION;
-                                outBoundOrderBYD.MO_NO = item.MO_NO;
-                                outBoundOrderBYD.SAP_OUT_NO = item.SAP_OUT_NO;
-                                outBoundOrderBYD.RECEIVE_LGORT = item.RECEIVE_LGORT;
-                                outBoundOrderBYD.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
-                                outBoundOrderBYD.SPLIT = item.SPLIT;
-                                outBoundOrderBYD.STATUS = item.STATUS;
-                                outBoundOrderBYD.CREATE_PERSON = item.CREATE_PERSON;
-                                outBoundOrderBYD.CREATE_DATE = item.CREATE_DATE;
-                                _outBoundOrderBYDRepository.AddData(outBoundOrderBYD);
-                                foreach (var detail in item.ITEMS)
-                                {
-                                    Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = new Dt_OutboundOrderDetailBYD();
-                                    outboundOrderDetailBYD.REQUIREMENT_NO = outBoundOrderBYD.REQUIREMENT_NO;
-                                    outboundOrderDetailBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
-                                    outboundOrderDetailBYD.MATNR = detail.MATNR;
-                                    outboundOrderDetailBYD.BATCH = detail.BATCH;
-                                    outboundOrderDetailBYD.QTY = detail.QTY;
-                                    outboundOrderDetailBYD.GEAR = detail.GEAR;
-                                    outboundOrderDetailBYD.PI_NO = detail.PI_NO;
-                                    _outboundOrderDetailByDRepository.AddData(outboundOrderDetailBYD);
-                                    foreach (var label in detail.LABELS)
-                                    {
-                                        if (label != null)
-                                        {
-                                            Dt_OutboundOrderDetail_LabelsBYD outboundOrderDetail_LabelsBYD = new Dt_OutboundOrderDetail_LabelsBYD();
-                                            outboundOrderDetail_LabelsBYD.LABEL_NO = label.LABLEL_NO;
-                                            outboundOrderDetail_LabelsBYD.CONTENT_LABEL_NO = label.CONTENT_LABLEL_NO;
-                                            outboundOrderDetail_LabelsBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
-                                            outboundOrderDetail_LabelsBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
-                                            _outboundOrderDetailLabelsByDRepository.AddData(outboundOrderDetail_LabelsBYD);
-                                        }
-                                    }
-                                }
-                            }
+                            content = WebResponseContent.Instance.Error("鍑哄簱鍗曟暟鎹负绌�");
                         }
-
-                        //鍚屾鍒癢MS鍑哄簱鍗曚腑
-                        foreach(var item in outStoreList)
+                        else
                         {
-                            if (item != null)
+                            string data = stringToJson(res.DATA);
+                            string newdata = data.Replace("},\"", "},").Replace("\" ", "\"");
+                            List<OutStoreData> outStoreList = JsonConvert.DeserializeObject<List<OutStoreData>>(newdata);
+                            foreach (var item in outStoreList)
                             {
-                                Dt_OutboundOrder outOrder =_outboundOrderRepository.QueryFirst(x=>x.OrderNo==item.REQUIREMENT_NO);
-                                if (outOrder != null)
+                                Dt_OutBoundOrderBYD bydOrder = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO);
+                                if (bydOrder != null)//鏇存柊
                                 {
-                                    outOrder.OrderNo = item.REQUIREMENT_NO;
-                                    outOrder.UpperOrderNo = "";
-                                    outOrder.OrderType = (int)OutOrderTypeEnum.Issue;
-                                    outOrder.OrderStatus = (int)OutboundStatusEnum.鏈紑濮�;
-                                    outOrder.CreateType = (int)CreateType.UpperSystemPush;
-                                    outOrder.Creater = "System";
-                                    
-                                    _outboundOrderRepository.UpdateData(outOrder);
-                                    foreach (var orderdetail in item.ITEMS)
+
+                                    bydOrder.REQUIREMENT_NO = item.REQUIREMENT_NO;
+                                    bydOrder.WRKS = item.WERKS;
+                                    bydOrder.WH_NUMBER = item.WH_NUMBER;
+                                    bydOrder.SYSNOD = item.SYSNOD;
+                                    bydOrder.BUSINESS_CODE = item.BUSINESS_CODE;
+                                    bydOrder.BUSINESS_NAME = item.BUSINESS_NAME;
+                                    bydOrder.LGORT = item.LGORT;
+                                    bydOrder.STATION = item.STATION;
+                                    bydOrder.MO_NO = item.MO_NO;
+                                    bydOrder.SAP_OUT_NO = item.SAP_OUT_NO;
+                                    bydOrder.RECEIVE_LGORT = item.RECEIVE_LGORT;
+                                    bydOrder.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
+                                    bydOrder.SPLIT = item.SPLIT;
+                                    bydOrder.STATUS = item.STATUS;
+                                    bydOrder.CREATE_PERSON = item.CREATE_PERSON;
+                                    bydOrder.CREATE_DATE = item.CREATE_DATE;
+                                    _outBoundOrderBYDRepository.UpdateData(bydOrder);
+                                    foreach (var detail in item.ITEMS)
                                     {
-                                        Dt_OutboundOrderDetail detail = _outboundOrderDetailRepository.QueryFirst(x => x.OrderId == outOrder.Id && x.Remark == orderdetail.REQUIREMENT_ITEM_NO);
-                                        if (detail != null)
+                                        Dt_OutboundOrderDetailBYD byddetail = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.REQUIREMENT_ITEM_NO);
+                                        if (byddetail != null)
                                         {
-                                            detail.OrderId = outOrder.Id;
-                                            detail.MaterielCode = orderdetail.MATNR;
-                                            detail.BatchNo = orderdetail.BATCH;
-                                            detail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
-                                            detail.LockQuantity = 0;
-                                            detail.OverOutQuantity = 0;
-                                            detail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
-                                            detail.Creater = "System";
-                                            detail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
-                                            _outboundOrderDetailRepository.UpdateData(detail);
+                                            byddetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
+                                            byddetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
+                                            byddetail.MATNR = detail.MATNR;
+                                            byddetail.BATCH = detail.BATCH;
+                                            byddetail.BATCH = detail.BATCH;
+                                            byddetail.QTY = detail.QTY;
+                                            byddetail.GEAR = detail.GEAR;
+                                            byddetail.PI_NO = detail.PI_NO;
+                                            _outboundOrderDetailByDRepository.UpdateData(byddetail);
                                         }
                                         else
                                         {
+                                            Dt_OutboundOrderDetailBYD newdetail = new Dt_OutboundOrderDetailBYD();
+                                            newdetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
+                                            newdetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
+                                            newdetail.MATNR = detail.MATNR;
+                                            newdetail.BATCH = detail.BATCH;
+                                            newdetail.BATCH = detail.BATCH;
+                                            newdetail.QTY = detail.QTY;
+                                            newdetail.GEAR = detail.GEAR;
+                                            newdetail.PI_NO = detail.PI_NO;
+                                            _outboundOrderDetailByDRepository.AddData(newdetail);
+                                        }
+
+                                    }
+
+
+                                }
+                                else
+                                {
+                                    Dt_OutBoundOrderBYD outBoundOrderBYD = new Dt_OutBoundOrderBYD();
+                                    outBoundOrderBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
+                                    outBoundOrderBYD.WRKS = item.WERKS;
+                                    outBoundOrderBYD.WH_NUMBER = item.WH_NUMBER;
+                                    outBoundOrderBYD.SYSNOD = item.SYSNOD;
+                                    outBoundOrderBYD.BUSINESS_CODE = item.BUSINESS_CODE;
+                                    outBoundOrderBYD.BUSINESS_NAME = item.BUSINESS_NAME;
+                                    outBoundOrderBYD.LGORT = item.LGORT;
+                                    outBoundOrderBYD.STATION = item.STATION;
+                                    outBoundOrderBYD.MO_NO = item.MO_NO;
+                                    outBoundOrderBYD.SAP_OUT_NO = item.SAP_OUT_NO;
+                                    outBoundOrderBYD.RECEIVE_LGORT = item.RECEIVE_LGORT;
+                                    outBoundOrderBYD.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
+                                    outBoundOrderBYD.SPLIT = item.SPLIT;
+                                    outBoundOrderBYD.STATUS = item.STATUS;
+                                    outBoundOrderBYD.CREATE_PERSON = item.CREATE_PERSON;
+                                    outBoundOrderBYD.CREATE_DATE = item.CREATE_DATE;
+                                    _outBoundOrderBYDRepository.AddData(outBoundOrderBYD);
+                                    foreach (var detail in item.ITEMS)
+                                    {
+                                        Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = new Dt_OutboundOrderDetailBYD();
+                                        outboundOrderDetailBYD.REQUIREMENT_NO = outBoundOrderBYD.REQUIREMENT_NO;
+                                        outboundOrderDetailBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
+                                        outboundOrderDetailBYD.MATNR = detail.MATNR;
+                                        outboundOrderDetailBYD.BATCH = detail.BATCH;
+                                        outboundOrderDetailBYD.QTY = detail.QTY;
+                                        outboundOrderDetailBYD.GEAR = detail.GEAR;
+                                        outboundOrderDetailBYD.PI_NO = detail.PI_NO;
+                                        _outboundOrderDetailByDRepository.AddData(outboundOrderDetailBYD);
+                                        foreach (var label in detail.LABELS)
+                                        {
+                                            if (label != null)
+                                            {
+                                                Dt_OutboundOrderDetail_LabelsBYD outboundOrderDetail_LabelsBYD = new Dt_OutboundOrderDetail_LabelsBYD();
+                                                outboundOrderDetail_LabelsBYD.LABEL_NO = label.LABLEL_NO;
+                                                outboundOrderDetail_LabelsBYD.CONTENT_LABEL_NO = label.CONTENT_LABLEL_NO;
+                                                outboundOrderDetail_LabelsBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
+                                                outboundOrderDetail_LabelsBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
+                                                _outboundOrderDetailLabelsByDRepository.AddData(outboundOrderDetail_LabelsBYD);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+
+                            //鍚屾鍒癢MS鍑哄簱鍗曚腑
+                            foreach (var item in outStoreList)
+                            {
+                                if (item != null)
+                                {
+                                    Dt_OutboundOrder outOrder = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO);
+                                    if (outOrder != null)
+                                    {
+                                        outOrder.OrderNo = item.REQUIREMENT_NO;
+                                        outOrder.UpperOrderNo = "";
+                                        outOrder.OrderType = (int)OutOrderTypeEnum.Issue;
+                                        outOrder.OrderStatus = (int)OutboundStatusEnum.鏈紑濮�;
+                                        outOrder.CreateType = (int)CreateType.UpperSystemPush;
+                                        outOrder.Creater = "System";
+
+                                        _outboundOrderRepository.UpdateData(outOrder);
+                                        foreach (var orderdetail in item.ITEMS)
+                                        {
+                                            Dt_OutboundOrderDetail detail = _outboundOrderDetailRepository.QueryFirst(x => x.OrderId == outOrder.Id && x.Remark == orderdetail.REQUIREMENT_ITEM_NO);
+                                            if (detail != null)
+                                            {
+                                                detail.OrderId = outOrder.Id;
+                                                detail.MaterielCode = orderdetail.MATNR;
+                                                detail.BatchNo = orderdetail.BATCH;
+                                                detail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
+                                                detail.LockQuantity = 0;
+                                                detail.OverOutQuantity = 0;
+                                                detail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
+                                                detail.Creater = "System";
+                                                detail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
+                                                _outboundOrderDetailRepository.UpdateData(detail);
+                                            }
+                                            else
+                                            {
+                                                Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
+                                                outboundOrderDetail.OrderId = outOrder.Id;
+                                                outboundOrderDetail.MaterielCode = orderdetail.MATNR;
+                                                outboundOrderDetail.BatchNo = orderdetail.BATCH;
+                                                outboundOrderDetail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
+                                                outboundOrderDetail.LockQuantity = 0;
+                                                outboundOrderDetail.OverOutQuantity = 0;
+                                                outboundOrderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
+                                                outboundOrderDetail.Creater = "System";
+                                                outboundOrderDetail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
+                                                _outboundOrderDetailRepository.AddData(outboundOrderDetail);
+
+                                            }
+                                        }
+
+                                    }
+                                    else
+                                    {
+
+                                        Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder();
+                                        outboundOrder.OrderNo = item.REQUIREMENT_NO;
+                                        outboundOrder.UpperOrderNo = "";
+                                        outboundOrder.OrderType = (int)OutOrderTypeEnum.Issue;
+                                        outboundOrder.OrderStatus = (int)OutboundStatusEnum.鏈紑濮�;
+                                        outboundOrder.CreateType = (int)CreateType.UpperSystemPush;
+                                        outboundOrder.Creater = "System";
+                                        _outboundOrderRepository.AddData(outboundOrder);
+                                        Dt_OutboundOrder outOrdertemp = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO);
+                                        foreach (var orderdetail in item.ITEMS)
+                                        {
                                             Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
-                                            outboundOrderDetail.OrderId = outOrder.Id;
+                                            outboundOrderDetail.OrderId = outOrdertemp.Id;
                                             outboundOrderDetail.MaterielCode = orderdetail.MATNR;
                                             outboundOrderDetail.BatchNo = orderdetail.BATCH;
                                             outboundOrderDetail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
@@ -427,45 +471,16 @@
                                             _outboundOrderDetailRepository.AddData(outboundOrderDetail);
 
                                         }
-                                    }
-
-                                }
-                                else
-                                {
-                                   
-                                    Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder();
-                                    outboundOrder.OrderNo = item.REQUIREMENT_NO;
-                                    outboundOrder.UpperOrderNo = "";
-                                    outboundOrder.OrderType = (int)OutOrderTypeEnum.Issue;
-                                    outboundOrder.OrderStatus = (int)OutboundStatusEnum.鏈紑濮�;
-                                    outboundOrder.CreateType = (int)CreateType.UpperSystemPush;
-                                    outboundOrder.Creater = "System";
-                                    _outboundOrderRepository.AddData(outboundOrder);
-                                    Dt_OutboundOrder outOrdertemp = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO);
-                                    foreach (var orderdetail in item.ITEMS)
-                                    {
-                                        Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
-                                        outboundOrderDetail.OrderId = outOrdertemp.Id;
-                                        outboundOrderDetail.MaterielCode = orderdetail.MATNR;
-                                        outboundOrderDetail.BatchNo = orderdetail.BATCH;
-                                        outboundOrderDetail.OrderQuantity =Convert.ToDecimal(orderdetail.QTY);
-                                        outboundOrderDetail.LockQuantity = 0;
-                                        outboundOrderDetail.OverOutQuantity = 0;
-                                        outboundOrderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
-                                        outboundOrderDetail.Creater="System";
-                                        outboundOrderDetail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
-                                        _outboundOrderDetailRepository.AddData(outboundOrderDetail);
 
                                     }
-                                   
                                 }
                             }
+
+                            content = WebResponseContent.Instance.OK();
                         }
 
-                        content = WebResponseContent.Instance.OK();
-                    }
 
-                    
+                    }
                 }
 
             }
@@ -487,16 +502,18 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
-                StereoServiceReference.WhStereoWebServiceClient client = new StereoServiceReference.WhStereoWebServiceClient();
+                LikuServiceReference.WmsStereoWhServiceClient likuClient = new LikuServiceReference.WmsStereoWhServiceClient();
 
                 string inparam = JsonConvert.SerializeObject(pickAndPost);
+                //Logger.Write_Log("System/test_out", "", "inparam= "+ inparam);
                 new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPickAndPost", "璇锋眰", $"{inparam}");
-                string response = client.pickAndPost(inparam);
+                string response = likuClient.pickAndPost(inparam);
                 new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPickAndPost", "鍝嶅簲", $"{response}");
+                //Logger.Write_Log("System/test_out", "", "response= " + response);
                 if (response != null)
                 {
                     PickAndPostResponse res = JsonConvert.DeserializeObject<PickAndPostResponse>(response);
-                    if (res != null && res.MSGTX == "S")
+                    if (res != null && res.MSGTY == "S")
                     {
                         content = WebResponseContent.Instance.OK("鍑哄簱鍥炰紶鎴愬姛锛�");
                         new LogFactory().GetLog("BYD_WMS鎺ュ彛").InfoFormat(true, "CallPickAndPost", "鍝嶅簲", $"鍑哄簱鍥炰紶鎴愬姛锛�");
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
index 2c2445f..8f11034 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
@@ -12,6 +12,7 @@
 using System.Net.Http.Headers;
 using System.Security.Policy;
 using Newtonsoft.Json;
+using WIDESEA_Core.LogHelper;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -77,10 +78,16 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
+
+                //Logger.Write_Log("System/test_in", "", "1.0 ", "");
                 Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode);
+                //Logger.Write_Log("System/test_in", "", "1.1 ", "");
                 (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo);
+                //Logger.Write_Log("System/test_in", "", "1.2 ", "");
                 if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
+                //Logger.Write_Log("System/test_in", "", "1.3 ", "");
                 content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo);
+                //Logger.Write_Log("System/test_in", "", "1.4 ", "");
             }
             catch (Exception ex)
             {
@@ -129,10 +136,15 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
+                //Logger.Write_Log("System/test_in", "", "2.0 ");
                 _unitOfWorkManage.BeginTran();
                 Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType,palletCode);
+
+                //Logger.Write_Log("System/test_in", "", "2.1 ");
                 if (locationInfo != null)
                 {
+
+                    //Logger.Write_Log("System/test_in", "", "2.2 ");
                     List<Dt_Task> tasks = new List<Dt_Task>();
                     Dt_Task task = new()
                     {
@@ -151,16 +163,22 @@
                     BaseDal.AddData(task);
                     int beforeStatus = locationInfo.LocationStatus;
 
+                    //Logger.Write_Log("System/test_in", "", "2.3 ");
                     if (isUpdateStock)
                     {
+                        //Logger.Write_Log("System/test_in", "", "2.3.1 ");
                         locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
                         if (locationInfo.Depth == 2)
                         {
+                            //Logger.Write_Log("System/test_in", "", "2.3.1.1 ");
                             _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
                         }
 
+                        //Logger.Write_Log("System/test_in", "", "2.3.1.2 ");
                         if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0)
                         {
+
+                            //Logger.Write_Log("System/test_in", "", "2.3.1.3 ");
                             orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? "";
 
                             stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
@@ -168,11 +186,14 @@
                         }
                         else
                         {
+
+                            //Logger.Write_Log("System/test_in", "", "2.3.1.4 ");
                             return content = WebResponseContent.Instance.Error("鏈壘鍒板簱瀛樹俊鎭�");
                         }
                     }
                     else
                     {
+                        //Logger.Write_Log("System/test_in", "", "2.3.2 ");
                         locationInfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt();
                         if (locationInfo.Depth == 2)
                         {
@@ -180,19 +201,26 @@
                         }
                         task.Grade = 1;
                     }
+
+                    //Logger.Write_Log("System/test_in", "", "2.4 ");
                     _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                      
                     tasks.Add(task);
                     _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
 
+                    //Logger.Write_Log("System/test_in", "", "2.5 ");
                     var response = HttpHelper.Post<WebResponseContent>(url + "ReceiveTask/", tasks, "鍏ュ簱浠诲姟涓嬪彂");
                     if (!response.Status)
                     {
                         _unitOfWorkManage.RollbackTran();
                         return content = WebResponseContent.Instance.Error($"{response.Message}");
                     }
+
                     _unitOfWorkManage.CommitTran();
+
+                    //Logger.Write_Log("System/test_in", "", "2.6 ");
                     return content = WebResponseContent.Instance.OK();
+
                 }
                 return content = WebResponseContent.Instance.Error("鏈壘鍒板彲鍒嗛厤璐т綅");
             }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 7c9584a..16c340d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -38,6 +38,7 @@
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
 using WIDESEA_Core.Log;
+using WIDESEA_Core.LogHelper;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Stock;
 using WIDESEA_IBasicRepository;
@@ -87,12 +88,12 @@
 
         private Dictionary<string, OrderByType> _OutLockOrderBy = new Dictionary<string, OrderByType>()
         {
-         
+
             { nameof(Dt_OutStockLockInfo.CreateDate), OrderByType.Desc },
 
         };
 
-        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository,IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal)
+        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository, IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -114,7 +115,7 @@
             _outboundOrderDetail_HtyRepository = outboundOrderDetail_HtyRepository;
             _returnInventoryDetailRepository = returnInventoryDetailRepository;
             _mainReturnInventoryRepository = mainReturnInventoryRepository;
-            
+
         }
 
 
@@ -164,7 +165,7 @@
             }
             finally
             {
-                WriteLog.GetLog("浠诲姟瀹屾垚").Write($"鎿嶄綔浜猴細{(App.User.UserId>0? App.User.UserName: "System")}{ Environment.NewLine}浠诲姟鍙凤細{taskNum}{Environment.NewLine}{ JsonConvert.SerializeObject(content)}", "浠诲姟瀹屾垚");
+                WriteLog.GetLog("浠诲姟瀹屾垚").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "System")}{Environment.NewLine}浠诲姟鍙凤細{taskNum}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "浠诲姟瀹屾垚");
             }
         }
         public WebResponseContent TaskCancel(int taskNum)
@@ -175,7 +176,7 @@
                 Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                 if (task == null)
                 {
-                    return content=WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
+                    return content = WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
                 }
                 _unitOfWorkManage.BeginTran();
                 MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCancel");
@@ -192,22 +193,22 @@
                                 if (!response.Status)
                                 {
                                     _unitOfWorkManage.RollbackTran();
-                                    return content=WebResponseContent.Instance.Error(response.Message);
+                                    return content = WebResponseContent.Instance.Error(response.Message);
                                 }
                                 _unitOfWorkManage.CommitTran();
-                                return content=responseContent;
+                                return content = responseContent;
                             }
                             _unitOfWorkManage.CommitTran();
-                            return content=responseContent;
+                            return content = responseContent;
                         }
                     }
                 }
-                return content=WebResponseContent.Instance.Error("鏈壘鍒颁换鍔$被鍨嬪搴斾笟鍔″鐞嗛�昏緫");
+                return content = WebResponseContent.Instance.Error("鏈壘鍒颁换鍔$被鍨嬪搴斾笟鍔″鐞嗛�昏緫");
             }
             catch (Exception ex)
             {
                 _unitOfWorkManage.RollbackTran();
-                return content=WebResponseContent.Instance.Error(ex.Message);
+                return content = WebResponseContent.Instance.Error(ex.Message);
             }
             finally
             {
@@ -270,7 +271,7 @@
                 task.Modifier = App.User.UserId > 0 ? App.User.UserName : "System";
                 BaseDal.UpdateData(task);
                 _unitOfWorkManage.CommitTran();
-                 return content = WebResponseContent.Instance.OK();
+                return content = WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
             {
@@ -282,33 +283,58 @@
         {
             try
             {
-                
+                //Logger.Write_Log("System/test_in", "", "3.0 ");
+
                 _unitOfWorkManage.BeginTran();
                 decimal beforeQuantity = 0;
                 Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                 Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
+                //Logger.Write_Log("System/test_in", "", "3.1 ");
                 CheckCompleted(stockInfo, locationInfo);
+                //Logger.Write_Log("System/test_in", "", "3.2 ");
 
                 stockInfo.LocationCode = locationInfo.LocationCode;
                 stockInfo.StockStatus = StockStatusEmun.宸插叆搴�.ObjToInt();
                 _stockService.StockInfoService.Repository.UpdateData(stockInfo);
 
+                //Logger.Write_Log("System/test_in", "", "3.3 ");
                 beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
+
+                foreach (Dt_StockInfoDetail detail in stockInfo.Details)
+                {
+                    //0 - 闈為檺鍒讹紙鍦ㄥ簱姝e父鐨勭墿鏂欙級
+                    //1 - 鍐荤粨锛堝湪搴撳凡鍐荤粨鐨勭墿鏂欙級
+                    //2 - 寰呰川妫�锛堝凡涓婃灦绔嬪簱锛岃繕鏈川妫�鎴栧凡璐ㄦ涓嶅悎鏍肩殑鐗╂枡锛�
+                    Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber);
+                    if (labMaster.LABEL_STATUS == "01")
+                    {
+                        labMaster.SOBKZ = "0";
+                    }
+                    else
+                    {
+                        labMaster.SOBKZ = "2";
+                    }
+                    _labelMasterRepository.UpdateData(labMaster);
+                }
 
                 int beforeStatus = locationInfo.LocationStatus;
                 locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                 _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
 
+                //Logger.Write_Log("System/test_in", "", "3.4 ");
                 _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                 task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
 
+                //Logger.Write_Log("System/test_in", "", "3.5 ");
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
 
+                //Logger.Write_Log("System/test_in", "", "3.6 ");
                 _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
-                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound,task.TaskNum);
+                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound, task.TaskNum);
                 _unitOfWorkManage.CommitTran();
 
-             
+                //Logger.Write_Log("System/test_in", "", "3.7 ");
+
             }
             catch (Exception ex)
             {
@@ -320,27 +346,33 @@
             #region 鍥炰紶閫昏緫澶勭悊
             try
             {
+
+                //Logger.Write_Log("System/test_in", "", "3.8 ");
                 PutAwayRequest request = new PutAwayRequest();
                 List<PutAway> itemData = new List<PutAway>();
                 request.ITEMDATA = itemData;
                 request.WERKS = AppSettings.Configuration["WERKS"];
-                request.WH_NUMBER = AppSettings.Configuration["WERKS"];
-                request.IZLID = request.WERKS + request.WH_NUMBER+ DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString();
+                request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
+                request.IZLID = request.WERKS + request.WH_NUMBER + DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString();
                 request.CREATE_DATE = task.CreateDate.ToString("yyyy-MM-dd HH:mm:ss");
                 request.PSTNG_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                 request.INBOUND_NO = "";//todo:鍗曞彿瑕佷粠鏉$爜涓绘暟鎹腑鑾峰彇锛屼笉鐒跺洖浼犱細鎻愮ず锛氳鏉$爜鏃犺繘浠撳崟鏁版嵁锛�
                 request.RECEIPT_NO = "";//todo:鍗曞彿瑕佷粠鏉$爜涓绘暟鎹腑锛屼笉鐒跺洖浼犱細鎻愮ず锛氳鏉$爜鏃犺繘浠撳崟鏁版嵁锛�
+                //Logger.Write_Log("System/test_in", "", "3.9 ");
                 Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
+                //Logger.Write_Log("System/test_in", "", "3.10 ");
                 foreach (Dt_StockInfoDetail detail in stockInfo.Details)
                 {
+                    //Logger.Write_Log("System/test_in", "", "3.11 ");
                     Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber);
                     if (labMaster != null)
                     {
-                        if (request.INBOUND_NO == "")
+                        //Logger.Write_Log("System/test_in", "", "3.12 ");
+                        if (string.IsNullOrWhiteSpace(request.INBOUND_NO))
                         {
                             request.INBOUND_NO = labMaster.INBOUND_NO;
                         }
-                        if (request.RECEIPT_NO == "")
+                        if (string.IsNullOrWhiteSpace(request.RECEIPT_NO))
                         {
                             request.RECEIPT_NO = labMaster.RECEIPT_NO;
                         }
@@ -363,24 +395,34 @@
                         putAway.RECEIPT_ITEM_NO = labMaster.RECEIPT_ITEM_NO;
                         putAway.INBOUND_NO = task.TaskNum.ToString();
                         //LABEL _STATUS 鏉$爜鐘舵��  02宸叉敹鏂�(鏃犻渶璐ㄦ)03 寰呰繘浠�(宸茶川妫�)锛屽苟涓旓紝QC RESULT CODE璐ㄦ鐘舵�佷负鈥�02鈥� 鎵嶅厑璁′笂鏋�
-                        if (labMaster.QC_RESULT_CODE=="02"&&(labMaster.LABEL_STATUS=="02"|| labMaster.LABEL_STATUS == "03"))
+                        //Logger.Write_Log("System/test_in", "", "3.13 ");
+                        if (labMaster.QC_RESULT_CODE == "02" && (labMaster.LABEL_STATUS == "02" || labMaster.LABEL_STATUS == "03"))
                         {
+                            //Logger.Write_Log("System/test_in", "", "3.14 ");
                             itemData.Add(putAway);
                         }
-                       
+
                     }
                 }
                 if (itemData.Count > 0)
                 {
-                   WebResponseContent content=  _sys_JobService.CallPutAway(request);
-                   if (content != null&&content.Message== "涓婃灦鍥炰紶鎴愬姛") //濡傛灉涓婃灦鎴愬姛锛屼慨鏀瑰簱瀛樼姸鎬佷负宸蹭笂鏋�
+                    //Logger.Write_Log("System/test_in", "", "3.15 ");
+                    WebResponseContent content = _sys_JobService.CallPutAway(request);
+                    //Logger.Write_Log("System/test_in", "", "3.16 ");
+                    if (content != null && content.Message == "涓婃灦鍥炰紶鎴愬姛") //濡傛灉涓婃灦鎴愬姛锛屼慨鏀瑰簱瀛樼姸鎬佷负宸蹭笂鏋�
                     {
+                        //Logger.Write_Log("System/test_in", "", "3.17 ");
                         stockInfo.StockStatus = StockStatusEmun.宸蹭笂鏋�.ObjToInt();
                         _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                     }
+                    else
+                    {
+
+                        //Logger.Write_Log("System/test_in", "", "3.18 " + content.Message);
+                    }
                 }
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 return WebResponseContent.Instance.Error(ex.Message);
             }
@@ -449,15 +491,20 @@
             try
             {
 
+                //Logger.Write_Log("System/test_re", "", "3.0 ");
                 _unitOfWorkManage.BeginTran();
                 decimal beforeQuantity = 0;
                 Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+                //Logger.Write_Log("System/test_re", "", "3.1 ");
                 Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
+                //Logger.Write_Log("System/test_re", "", "3.2 ");
                 CheckCompleted(stockInfo, locationInfo);
+                //Logger.Write_Log("System/test_re", "", "3.3 ");
 
                 stockInfo.LocationCode = locationInfo.LocationCode;
                 stockInfo.StockStatus = StockStatusEmun.宸插叆搴�.ObjToInt();
                 _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+                //Logger.Write_Log("System/test_re", "", "3.4 ");
 
                 beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
 
@@ -465,14 +512,20 @@
                 locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                 _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
 
+                //Logger.Write_Log("System/test_re", "", "3.5 ");
                 _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                 task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
 
+                //Logger.Write_Log("System/test_re", "", "3.6 ");
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
 
+                //Logger.Write_Log("System/test_re", "", "3.7 ");
                 _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
+                //Logger.Write_Log("System/test_re", "", "3.8 ");
                 _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound, task.TaskNum);
+                //Logger.Write_Log("System/test_re", "", "3.9 ");
                 _unitOfWorkManage.CommitTran();
+                //Logger.Write_Log("System/test_re", "", "3.10 ");
 
 
             }
@@ -486,46 +539,85 @@
             #region 鍥炰紶閫昏緫澶勭悊
             try
             {
+                //Logger.Write_Log("System/test_re", "", "3.11 ");
                 PutAwayReturnRequest request = new PutAwayReturnRequest();
                 List<PutAwayReturn> DATA = new List<PutAwayReturn>();
-                request.DATA = DATA;
-                request.WERKS = AppSettings.Configuration["WERKS"];
-                request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
-                request.IZLID = task.OrderNo;//杩欎釜鍊间細鍦ㄦ帴鏀朵笂娓稿洖搴撶粍鐩樹俊鎭椂锛屽瓨鍦ㄥ簱瀛樿〃涓紝鍐嶅瓨鍒颁换鍔¤〃涓�
-                Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.IZLID == task.OrderNo);
+                //request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
+                //request.WERKS = AppSettings.Configuration["WERKS"];
+                //request.IZLID = task.OrderNo;//杩欎釜鍊间細鍦ㄦ帴鏀朵笂娓稿洖搴撶粍鐩樹俊鎭椂锛屽瓨鍦ㄥ簱瀛樿〃涓紝鍐嶅瓨鍒颁换鍔¤〃涓�
+
+                Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.TPNUM == task.PalletCode && x.YLZD4 != "1");
                 if (mainReturnInventory != null)
                 {
-                    request.RETURN_NO = mainReturnInventory.RETURN_NO;
-                    request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO;
+                    //Logger.Write_Log("System/test_re", "", "3.12 ");
+                    request.WH_NUMBER = mainReturnInventory.WH_NUMBER;
                     request.BUSINESS_NAME = mainReturnInventory.BUSINESS_NAME;
-                    request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE;
-                    request.TPNUM = mainReturnInventory.TPNUM;
+                    request.WERKS = mainReturnInventory.WERKS;
                     request.LGORT = mainReturnInventory.LGORT;
-                    request.MO_NO = mainReturnInventory.MO_NO;
+                    request.TOTAL_RETURN_QTY = mainReturnInventory.TOTAL_RETURN_QTY;
+                    request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE;
+                    request.RETURN_NO = mainReturnInventory.RETURN_NO;
 
+                    request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO;
+                    request.TPNUM = mainReturnInventory.TPNUM;
+                    request.YLZD5 = mainReturnInventory.YLZD5;
+                    request.IZLID = mainReturnInventory.IZLID;
+                    request.MO_NO = mainReturnInventory.MO_NO;
+                    request.YLZD3 = mainReturnInventory.YLZD3;
+                    request.YLZD4 = mainReturnInventory.YLZD4;
+                    request.YLZD1 = mainReturnInventory.YLZD1;
+                    request.YLZD2 = mainReturnInventory.YLZD2;
+                    request.SYSNOD = mainReturnInventory.SYSNOD;
+
+                    //Logger.Write_Log("System/test_re", "", "3.13 ");
                     Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
+                    List<Dt_ReturnInventoryDetail> returnInventoryDetails = new List<Dt_ReturnInventoryDetail>();
                     foreach (Dt_StockInfoDetail detail in stockInfo.Details)
                     {
-                        Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber);
+                        //Logger.Write_Log("System/test_re", "", "3.14 ");
+                        Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber && x.SOBKZ == "Z");
                         if (dt_ReturnInventoryDetail != null)
                         {
+                            //Logger.Write_Log("System/test_re", "", "3.15 ");
                             PutAwayReturn putAwayReturn = new PutAwayReturn();
                             putAwayReturn.LABEL_NO = dt_ReturnInventoryDetail.LABEL_NO;
-                            putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ;
                             putAwayReturn.UNIT = dt_ReturnInventoryDetail.UNIT;
+                            putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ;
                             putAwayReturn.LGORT = dt_ReturnInventoryDetail.LGORT;
-                            putAwayReturn.TOTAL_RETURN_QTY = dt_ReturnInventoryDetail.QTY;
+                            putAwayReturn.QTY = dt_ReturnInventoryDetail.QTY;
                             putAwayReturn.F_LGORT = dt_ReturnInventoryDetail.F_LGORT;
-                            putAwayReturn.MO_NO = mainReturnInventory.MO_NO;
                             putAwayReturn.LIFNR = dt_ReturnInventoryDetail.LIFNR;
+                            putAwayReturn.MO_NO = mainReturnInventory.MO_NO;
                             putAwayReturn.MATNR = dt_ReturnInventoryDetail.MATNR;
-                            putAwayReturn.BATCH = "";
                             DATA.Add(putAwayReturn);
+                            //Logger.Write_Log("System/test_re", "", "3.16 ");
+
+                            returnInventoryDetails.Add(dt_ReturnInventoryDetail);
                         }
                     }
-                    if(DATA.Count>0)
+                    request.DATA = DATA;
+                    if (DATA.Count > 0)
                     {
-                        _sys_JobService.CallPutAwayReturn(request);//浣欐枡閫�搴撳洖浼�
+                        //Logger.Write_Log("System/test_re", "", "3.17 ");
+                        var res = _sys_JobService.CallPutAwayReturn(request);//浣欐枡閫�搴撳洖浼�
+                        if (res.Status)
+                        {
+                            //Logger.Write_Log("System/test_re", "", "3.18 ");
+                            mainReturnInventory.YLZD4 = "1";
+                            _mainReturnInventoryRepository.UpdateData(mainReturnInventory);
+
+                            foreach (var li in returnInventoryDetails)
+                            {
+                                li.SOBKZ = "0";
+                                _returnInventoryDetailRepository.UpdateData(li);
+
+                            }
+                        }
+                        else
+                        {
+
+                            //Logger.Write_Log("System/test_re", "", "3.19 ");
+                        }
                     }
                 }
             }
@@ -565,28 +657,35 @@
 
         public WebResponseContent OutboundTaskCompleted(Dt_Task task)
         {
+            //Logger.Write_Log("System/test_out", "", "3.0 ");
             Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
             Dt_StockInfo stockInfoCatch = stockInfo;//鍏堢紦瀛樿捣鏉ワ紝渚涘悗闈㈢殑鍥炰紶鎺ュ彛璋冪敤
+            //Logger.Write_Log("System/test_out", "", "3.1 ");
             try
             {
                 _unitOfWorkManage.BeginTran();
                 decimal beforeQuantity = 0;
-              
+
                 //Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                 //Dt_StockInfo stockInfoCatch = stockInfo;//鍏堢紦瀛樿捣鏉ワ紝渚涘悗闈㈢殑鍥炰紶鎺ュ彛璋冪敤
 
                 Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
 
+                //Logger.Write_Log("System/test_out", "", "3.2 ");
                 CheckCompleted(stockInfo, locationInfo);
+                //Logger.Write_Log("System/test_out", "", "3.3 ");
 
                 stockInfo.LocationCode = locationInfo.LocationCode;
                 stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
                 _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+                //Logger.Write_Log("System/test_out", "", "3.4 ");
                 int beforeStatus = locationInfo.LocationStatus;
                 if (locationInfo.Depth == 2)
                 {
+                    //Logger.Write_Log("System/test_out", "", "3.5 ");
                     if (DepthTask(locationInfo) == false)
                     {
+                        //Logger.Write_Log("System/test_out", "", "3.6 ");
                         _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false);
 
                     }
@@ -594,18 +693,24 @@
                 locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                 _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
 
+                //Logger.Write_Log("System/test_out", "", "3.7 ");
                 task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt();
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+                //Logger.Write_Log("System/test_out", "", "3.8 ");
                 _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
                 _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
 
+                //Logger.Write_Log("System/test_out", "", "3.9 ");
                 beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
 
                 _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
+                //Logger.Write_Log("System/test_out", "", "3.10 ");
                 _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) - beforeQuantity, StockChangeType.Outbound, task.TaskNum);
+                //Logger.Write_Log("System/test_out", "", "3.11 ");
 
                 _unitOfWorkManage.CommitTran();
-               
+                //Logger.Write_Log("System/test_out", "", "3.12 ");
+
             }
             catch (Exception ex)
             {
@@ -618,35 +723,43 @@
             #region 鍥炰紶閫昏緫澶勭悊
             try
             {
+                //Logger.Write_Log("System/test_out", "", "3.13 ");
                 PickAndPostRequest request = new PickAndPostRequest();
                 List<PickAndPost> itemData = new List<PickAndPost>();
                 request.ITEMDATA = itemData;
                 request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
-                request.SYSNOD = AppSettings.Configuration["SYSNO"];
-                request.WERKS = AppSettings.Configuration["CallMaterialID"];
-              
+                request.WERKS = AppSettings.Configuration["WERKS"];
+
                 Dt_OutboundOrderDetail_Hty detail = _outboundOrderDetail_HtyRepository.QueryFirst(x => x.SourceId.ToString() == task.Remark);// task.Remark瀛橀渶姹傛槑缁咺D
                 if (detail != null)
                 {
+                    //Logger.Write_Log("System/test_out", "", "3.14 ");
                     Dt_OutboundOrder_Hty outboundOrder = _outboundOrder_HtyRepository.QueryFirst(x => x.SourceId == detail.OrderId);
                     if (outboundOrder != null)
                     {
+                        //Logger.Write_Log("System/test_out", "", "3.15 ");
                         Dt_OutBoundOrderBYD outboundOrderBYD = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == outboundOrder.OrderNo);
                         if (outboundOrderBYD != null)
                         {
+                            //Logger.Write_Log("System/test_out", "", "3.16 ");
 
                             Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == outboundOrderBYD.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.Remark);//detail.Remark 瀛橀渶姹傝
                             //鏍规嵁鎵樼洏鍙锋煡绔嬪簱鐨勬潯鐮佸拰鎵规杩涜鍥炰紶
                             foreach (var item in stockInfoCatch.Details)
                             {
+                                //Logger.Write_Log("System/test_out", "", "3.17 ");
+
+                                Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item.SerialNumber);
+
                                 PickAndPost pickpost = new PickAndPost();
                                 pickpost.REQUIREMENT_NO = outboundOrderDetailBYD.REQUIREMENT_NO;
                                 pickpost.REQUIREMENT_ITEM_NO = outboundOrderDetailBYD.REQUIREMENT_ITEM_NO;
-                                pickpost.WERKS = outboundOrderBYD.WRKS;
+                                pickpost.ORDERCODE = request.WERKS + request.WH_NUMBER + DateTime.Now.ToString("yyyyMMdd") + outboundOrderDetailBYD.Id.ToString("D6");
+                                pickpost.ORDERCODE_ITEM_NO = "1";
                                 pickpost.SYSNOD = outboundOrderBYD.SYSNOD;
                                 pickpost.MATNR = outboundOrderDetailBYD.MATNR;
                                 pickpost.LIFNR = "";//娌℃湁杩斿洖锛屾殏鏃惰浆绌�
-                                pickpost.QTY = outboundOrderDetailBYD.QTY;
+                                pickpost.QTY = labMaster.BOX_QTY ?? outboundOrderDetailBYD.QTY;
                                 pickpost.BATCH = item.BatchNo;//鍙栫珛搴撳叆搴撳簱瀛樼殑鏉$爜
                                 pickpost.LGORT = outboundOrderBYD.LGORT;
                                 pickpost.BUSINESS_CODE = outboundOrderBYD.BUSINESS_CODE;
@@ -654,24 +767,29 @@
                                 pickpost.STATION = outboundOrderBYD.STATION;
                                 pickpost.SPLIT = outboundOrderBYD.SPLIT;
                                 pickpost.LABEL_NO = item.SerialNumber;//鍙栫珛搴撳叆搴撳簱瀛樼殑鏉$爜
+                                pickpost.Pack_LABEL_NO = null;
+                                pickpost.pallet_label_no = null;
                                 pickpost.CREATE_DATE = outboundOrderBYD.CREATE_DATE;
                                 pickpost.UPDATE_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                 pickpost.STATUS = outboundOrderBYD.STATUS;
+                                pickpost.MO_NO = null;
                                 itemData.Add(pickpost);
 
+                                //Logger.Write_Log("System/test_out", "", "3.18 ");
                             }
                             _sys_JobService.CallPickAndPost(request);//鍥炰紶
+                            //Logger.Write_Log("System/test_out", "", "3.19 ");
                         }
 
                     }
 
                 }
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 return WebResponseContent.Instance.Error(ex.Message);
             }
-          
+
             #endregion
             return WebResponseContent.Instance.OK();
         }
@@ -680,6 +798,7 @@
         {
             try
             {
+                //Logger.Write_Log("System/test_out", "empt ", "3.0 ");
                 _unitOfWorkManage.BeginTran();
                 Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
 
@@ -706,6 +825,7 @@
                 _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
 
                 _unitOfWorkManage.CommitTran();
+                //Logger.Write_Log("System/test_out", "empt ", "3.1 ");
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
@@ -835,7 +955,7 @@
             }
         }
 
-        
+
         public WebResponseContent OutboundTaskCancel(Dt_Task task)
         {
             try
@@ -914,7 +1034,7 @@
 
                 task.TaskStatus = OutTaskStatusEnum.OutCancel.ObjToInt();
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
-                
+
                 _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
 
                 _unitOfWorkManage.CommitTran();
@@ -940,7 +1060,7 @@
                 stockInfo.StockStatus = StockStatusEmun.宸插叆搴�.ObjToInt();
                 _stockService.StockInfoService.Repository.UpdateData(stockInfo);
 
-                locationEnd.LocationStatus= LocationStatusEnum.Free.ObjToInt();
+                locationEnd.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                 _basicService.LocationInfoService.RelocationFree(locationStart, task.TaskNum);
                 _basicService.LocationInfoService.Repository.UpdateData(locationEnd);
 
@@ -958,7 +1078,7 @@
         }
         public bool DepthTask(Dt_LocationInfo location)
         {
-            if (location != null )
+            if (location != null)
             {
                 Dt_LocationInfo locations = _locationInfoService.Repository.QueryFirst(x => x.RoadwayNo == location.RoadwayNo && x.Column == location.Column && x.Layer == location.Layer && x.Depth != location.Depth && x.Row != location.Row && (SqlFunc.Abs(x.Row - location.Row) == 1));
                 if (locations != null)
@@ -979,7 +1099,7 @@
                 {
                     expression = x => x.Creater == App.User.UserName;
                 }
-                var task = BaseDal.Db.Queryable<Dt_Task>().OrderByDescending(x => x.CreateDate).Take(10).Select(x => new Dt_Task { TaskNum = x.TaskNum, PalletCode=x.PalletCode, TaskType=x.TaskType,SourceAddress=x.SourceAddress,TargetAddress=x.TargetAddress }).ToList();
+                var task = BaseDal.Db.Queryable<Dt_Task>().OrderByDescending(x => x.CreateDate).Take(10).Select(x => new Dt_Task { TaskNum = x.TaskNum, PalletCode = x.PalletCode, TaskType = x.TaskType, SourceAddress = x.SourceAddress, TargetAddress = x.TargetAddress }).ToList();
                 content = WebResponseContent.Instance.OK(data: task);
             }
             catch (Exception ex)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs"
index 4c6cbb2..e354f2c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs"
@@ -12,6 +12,7 @@
 using WIDESEA_Model.Models;
 using System;
 using Newtonsoft.Json;
+using WIDESEA_Core.LogHelper;
 
 namespace WIDESEA_WMSServer.Controllers
 {
@@ -52,7 +53,7 @@
 
         [HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous]
         public async Task<WebResponseContent> UploadApk(IEnumerable<IFormFile> fileInput)
-         {
+        {
             // 妫�鏌ユ槸鍚︽湁鏂囦欢涓婁紶
             if (fileInput == null || !fileInput.Any())
             {
@@ -61,7 +62,7 @@
 
             var formFile = fileInput.First();
             var uploadFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Upload");
-            Directory.CreateDirectory(uploadFolder); 
+            Directory.CreateDirectory(uploadFolder);
 
             var fileName = $"WMS-PDA.apk";
             var filePath = Path.Combine(uploadFolder, fileName);
@@ -102,7 +103,7 @@
             }
             memory.Position = 0;
             var ext = Path.GetExtension(filePath).ToLowerInvariant();
-            return File(memory, new Dictionary<string, string>{{ ".apk", "application/vnd.android.package-archive" }}[ext], Path.GetFileName(filePath));
+            return File(memory, new Dictionary<string, string> { { ".apk", "application/vnd.android.package-archive" } }[ext], Path.GetFileName(filePath));
         }
 
         /// <summary>
@@ -113,7 +114,7 @@
         [HttpPost, Route("EmptyInBound"), AllowAnonymous]
         public WebResponseContent EmptyInBound(string PalletCode)
         {
-            return _taskService.PalletInboundRequest("R01-001-023-001",PalletCode);      
+            return _taskService.PalletInboundRequest("R01-001-023-001", PalletCode);
         }
 
 
@@ -126,7 +127,7 @@
         [HttpGet, Route("EmptyOutBound"), AllowAnonymous]
         public WebResponseContent EmptyOutBound(string trayType)
         {
-            return _taskService.PalletOutboundTask("R01", "R01-001-023-001",trayType);
+            return _taskService.PalletOutboundTask("R01", "R01-001-023-001", trayType);
 
         }
 
@@ -138,34 +139,50 @@
         [HttpPost, Route("MaterielGroup"), AllowAnonymous]
         public WebResponseContent MaterielGroup([FromBody] SaveModel saveModel)
         {
-            string PalletCode = saveModel.MainData["PalletCode"].ToString();  
-            string ReceviveSN = saveModel.MainData["SerialNumbers"].ToString();
-            List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN);
+            string PalletCode = saveModel.MainData["PalletCode"].ToString();
+            var ReceviveSN = saveModel.MainData["SerialNumbers"];
+
+            string str = "1.0 ReceviveSN=" + ReceviveSN;
+            //Logger.Write_Log("System/test", "", str);
+
+            List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN.ToString());
             List<string> SerialNumbers = new List<string>();
+            string code = "";
             foreach (var number in OldSerialNumbers)
             {
+
+                //Logger.Write_Log("System/test", "", "1.0.1 ");
                 if (number.Contains("S:"))
                 {
+
+                    //Logger.Write_Log("System/test", "", "1.0.1.1 ");
                     List<string> nums = number.Split(';').ToList();
                     foreach (var item in nums)
                     {
-                        if(item.Contains("S:"))
+                        if (item.Contains("S:"))
                         {
+                            //Logger.Write_Log("System/test", "", "1.0.1.2 ");
                             string SerialNumber = item.Replace("S:", "");
                             if (!string.IsNullOrEmpty(SerialNumber))
                             {
                                 SerialNumbers.Add(SerialNumber);
+                                code += SerialNumber;
                             }
 
                         }
                     }
-                    
+
                 }
                 else
                 {
+
+                    //Logger.Write_Log("System/test", "", "1.0.2 ");
                     SerialNumbers.Add(number);
+                    code += number;
                 }
             }
+
+            //Logger.Write_Log("System/test", "", "1.1 " + code);
 
             MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO();
             materielGroupDTO.SerialNumbers = SerialNumbers;
@@ -202,7 +219,7 @@
         /// <param name="PalletCode">鎵樼洏鍙�</param>
         /// <returns></returns>
         [HttpGet, Route("MaterielInBoundReturnConfirm"), AllowAnonymous]
-        public WebResponseContent MaterielInBoundReturnConfirm( string PalletCode)
+        public WebResponseContent MaterielInBoundReturnConfirm(string PalletCode)
         {
             return _taskService.ReturnInboundRequest("R01-001-023-001", PalletCode);
         }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
index 6ffed4d..943763b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
@@ -12,7 +12,8 @@
   "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
   //杩炴帴瀛楃涓�
   //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
-  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  "ConnectionString": "Data Source=193.169.10.200;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=1qaz@WSX;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=123;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
   //璺ㄥ煙
   "Cors": {
     "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
@@ -25,7 +26,7 @@
   "WCS": "http://localhost:9291/api/Task/",
   "WERKS": "GX25", //宸ュ巶
   "SYSNO": "G30", //绔嬪簱绯荤粺鏍囪瘑锛屽彂鏂欐爣璇�
-  "CallMaterialID": "W01",//鍙枡鏍囪瘑
+  "CallMaterialID": "W01", //鍙枡鏍囪瘑
   "ApiName": "WIDESEA",
   "ExpMinutes": 120,
   "QuartzJobAutoStart": true,

--
Gitblit v1.9.3