From 990807a09cf35a73b20e213a4df82acddec40f4b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 04 三月 2025 00:58:15 +0800
Subject: [PATCH] 雅达-更改多个文件中的数据类型和属性

---
 Tiger.Model.Net/Entitys/WMS/BIZ_ERP_PROD_IN_BTH.cs                    |    2 +
 Tiger.Business.MES/iERP/MES_U9C.cs                                    |   23 ++++++++++-
 Tiger.Api/Language.db                                                 |    0 
 Tiger.Business.MES/Transaction/InStoreOrderNo.cs                      |    4 +-
 Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs           |    6 +-
 Tiger.Model.Net/Entitys/WMS/Api/RePrint_Entitys.cs                    |    7 +++
 Tiger.Business.WMS/Transaction/PrintSemiProdLabel.cs                  |   35 +++++++++--------
 Tiger.Business.WMS/Transaction/In_SemiProd.cs                         |   15 ++++---
 Tiger.Controllers.WMS/Controllers/WMSController.PrintSemiProdLabel.cs |   12 +++---
 9 files changed, 68 insertions(+), 36 deletions(-)

diff --git a/Tiger.Api/Language.db b/Tiger.Api/Language.db
index 0ac8e81..9fd5097 100644
--- a/Tiger.Api/Language.db
+++ b/Tiger.Api/Language.db
Binary files differ
diff --git a/Tiger.Business.MES/Transaction/InStoreOrderNo.cs b/Tiger.Business.MES/Transaction/InStoreOrderNo.cs
index ad37121..e0b0bd4 100644
--- a/Tiger.Business.MES/Transaction/InStoreOrderNo.cs
+++ b/Tiger.Business.MES/Transaction/InStoreOrderNo.cs
@@ -271,8 +271,8 @@
                             WorkOrder = item.WORK_ORDER,
                             ItemCode = item.ITEM_CODE,
                             WhCode = "10105",
-                            PkgQty = item.SCAN_QTY.ToInt32(),
-                            CompleteQty = item.SCAN_QTY.ToInt32(),
+                            PkgQty = item.SCAN_QTY,
+                            CompleteQty = item.SCAN_QTY,
                             OutputType = 0,
                             StorageType = 4,
                             DocState = 1,
diff --git a/Tiger.Business.MES/iERP/MES_U9C.cs b/Tiger.Business.MES/iERP/MES_U9C.cs
index c1e76dd..409c02d 100644
--- a/Tiger.Business.MES/iERP/MES_U9C.cs
+++ b/Tiger.Business.MES/iERP/MES_U9C.cs
@@ -59,10 +59,29 @@
                 //    item.Status = "Y";
                 //    if (!ErpProdInBth.IsNullOrEmpty())
                 //    {
-                //        ErpProdInBth.ORDER_NO = $"YDRKD24120000{5+i}";
+                //        ErpProdInBth.ORDER_NO = $"YDRKD24120000{5 + i}";
                 //        ErpProdInBth.IS_HANDLED = "Y";
                 //        ErpProdInBth.HANDLED_DATE = DateTime.Now;
                 //    }
+                //    List<RcvRptDocCreateParam> param = new() {
+                //                    new() {
+                //                        CompleteList = new(){
+                //                           new CompleteList
+                //                           {
+                //                                MOKey = new MOKey { DocNo = item.WorkOrder },
+                //                                Wh = new Wh { Code = item.WhCode },
+                //                                DescFlexField = new DescFlexField { PrivateDescSeg1 = item.PkgQty.ToString() },
+                //                                Item = new Item { Code = item.ItemCode },
+                //                                CompleteQty = item.CompleteQty,
+                //                                OutputType = item.OutputType,
+                //                                StorageType = item.StorageType,
+                //                                DocState = item.DocState,
+                //                           }
+                //                        },
+                //                        Remark = "鎺ュ彛鐢熸垚",
+                //                        BusinessDate = DateTime.Now,
+                //                    }
+                //                };
                 //    foreach (var p in input.PrintJsons)
                 //    {
                 //        var d = p.Items.Where(q => q.WORK_ORDER == item.WorkOrder).FirstOrDefault();
@@ -83,7 +102,7 @@
                 //{
                 //    action.CatchExceptionWithLog(_dbTran.ErrorException, $"鏁版嵁澶勭悊澶辫触");
                 //    Logger.Interface.Error(action.Message);
-                //    IsSuccessed = false;
+                //    //IsSuccessed = false;
                 //}
 
                 //淇濆瓨鎴愬姛锛岃皟鐢║9C鎺ュ彛
diff --git a/Tiger.Business.WMS/Transaction/In_SemiProd.cs b/Tiger.Business.WMS/Transaction/In_SemiProd.cs
index c05caa6..17dbcef 100644
--- a/Tiger.Business.WMS/Transaction/In_SemiProd.cs
+++ b/Tiger.Business.WMS/Transaction/In_SemiProd.cs
@@ -81,7 +81,9 @@
                     action.LocaleMsg = Biz.L("WMS.InSemiProd.ScanItem.WoEmptyFailure", input.SN); // $"宸ュ崟[{input.SN}]涓嶅瓨鍦�"
                     return action;
                 }
-                
+
+                var semiTemplateQty = (input.Data ?? "").JsonToObject<SemiTemplateQty>() ?? new SemiTemplateQty();
+
                 InStoreInfo Info = new()
                 {
                     ErpProdInBth = new()
@@ -92,7 +94,8 @@
                         ITEM_CODE = wo.ITEM_CODE,
                         ITEM_NAME = wo.ItemInfo?.ITEM_DESC,
                         SapCode = wo.ItemInfo?.ExtInfo?.SapCode,
-                        SCAN_QTY = input.Data.ToInt32(),
+                        SCAN_QTY = semiTemplateQty.PackQty,
+                        CompleteQty = semiTemplateQty.CompleteQty,
                         IS_HANDLED = "N" //Y-宸茬敓鎴愶紝N-鏈敓鎴愶紝F-澶辫触
                     },
                     InStoreScanInfo = new()
@@ -101,7 +104,7 @@
                         SALES_ORDER = wo.SALES_ORDER,
                         WORK_ORDER = wo.ORDER_NO,
                         BATCH_NO = "",
-                        SCAN_QTY = input.Data.ToInt32()
+                        SCAN_QTY = semiTemplateQty.PackQty.ToDouble()
                     }
                 };
 
@@ -273,7 +276,7 @@
             ErpProdInBths.Clear();
             InStoreScanInfos.Clear();
             RcvRptInput.ErpProdInBths = Biz.Db.Queryable<BIZ_ERP_PROD_IN_BTH>()
-                .Where(q => q.BATCH_NO == SqlFunc.Subqueryable<BIZ_ERP_PROD_IN_BTH>().Where(s => s.ORDER_NO == UserCode && s.GHOST_ROW == false).Select(s => s.BATCH_NO))
+                .Where(q => q.BATCH_NO == SqlFunc.Subqueryable<BIZ_ERP_PROD_IN_BTH>().Where(s => s.ORDER_NO == UserCode && s.GHOST_ROW == false).Select(s => s.BATCH_NO) && q.IS_HANDLED == "N")
                 .IncludesAllFirstLayer().ToList();
             foreach (var item in RcvRptInput.ErpProdInBths)
             {
@@ -376,8 +379,8 @@
                             WorkOrder = item.WORK_ORDER,
                             ItemCode = item.ITEM_CODE,
                             WhCode = "10105",
-                            PkgQty = item.SCAN_QTY.ToInt32(),
-                            CompleteQty = item.SCAN_QTY.ToInt32(),
+                            PkgQty = item.SCAN_QTY,
+                            CompleteQty = item.CompleteQty,
                             OutputType = 0,
                             StorageType = 4,
                             DocState = 1,
diff --git a/Tiger.Business.WMS/Transaction/PrintSemiProdLabel.cs b/Tiger.Business.WMS/Transaction/PrintSemiProdLabel.cs
index 1003d1e..23f0ebe 100644
--- a/Tiger.Business.WMS/Transaction/PrintSemiProdLabel.cs
+++ b/Tiger.Business.WMS/Transaction/PrintSemiProdLabel.cs
@@ -68,13 +68,14 @@
                     var temp = new SemiTemplateInput
                     {
                         RcvRptDocId = item.ID.ToString(),
-                        ItemCode= item.ItemCode,
-                        ItemDesc= item.ItemDescription,
-                        SapItemCode= "",
-                        PackQty= item.PackQty.ToDecimal(),
-                        Qty=0,
-                        DocNo= item.DocNo,
-                        WorkOrder= item.Mo
+                        ItemCode = item.ItemCode,
+                        ItemDesc = item.ItemDescription,
+                        SapItemCode = "",
+                        WoBatch = item.LotCode,
+                        PackQty = item.PackQty.ToDecimal(),
+                        Qty = item.RcvQtyByWhUOM.ToDecimal(),
+                        DocNo = item.DocNo,
+                        WorkOrder = item.Mo
                     };
                     temps.Add(temp);
                 }
@@ -100,13 +101,6 @@
             var action = new ApiAction<ScanOutput>(new ScanOutput());
             try
             {
-                if (input.SN.IsNullOrEmpty())
-                {
-                    action.IsSuccessed = false;
-                    //action.LocaleMsg = Biz.L("鏉$爜涓嶈兘涓虹┖");
-                    action.LocaleMsg = Biz.L("WMS.Default.ScanItem.SnEmptyFailure");
-                    return SetOutPutMqttMsg(action, input.Locale);
-                }
                 var semiTemplate = (input.Data ?? "").JsonToObject<SemiTemplateInput>() ?? new SemiTemplateInput();
 
                 //鐢熸垚鏉$爜
@@ -116,12 +110,19 @@
                     userId = input.AuthOption.UserId,
                     token = "",
                     IsLogin = true,
-                    CreateBarCodeItemQty = semiTemplate.PackQty,
-                    LabelQty = semiTemplate.Qty,
+                    CreateBarCodeItemQty = semiTemplate.Qty,
+                    LabelQty = semiTemplate.PackQty,
                 };
-               
+
                 var snList = await _IMES_U9C.U9CCreateBarCodeByAssignQty(barcodeCreateInput);
                 action.Data.Data = snList;
+                //action.Data.Data = new List<string> {
+                //    "YDRKD241200014/10/20051210.0013.00/YDMB241254400/0001",
+                //    "YDRKD241200014/10/20051210.0013.00/YDMB241254400/0002",
+                //    "YDRKD241200014/10/20051210.0013.00/YDMB241254400/0003",
+                //    "YDRKD241200014/10/20051210.0013.00/YDMB241254400/0004"
+
+                //};
             }
             catch (Exception ex)
             {
diff --git a/Tiger.Controllers.WMS/Controllers/WMSController.PrintSemiProdLabel.cs b/Tiger.Controllers.WMS/Controllers/WMSController.PrintSemiProdLabel.cs
index ab16c30..f88a034 100644
--- a/Tiger.Controllers.WMS/Controllers/WMSController.PrintSemiProdLabel.cs
+++ b/Tiger.Controllers.WMS/Controllers/WMSController.PrintSemiProdLabel.cs
@@ -13,7 +13,7 @@
     {
         /// <summary>
         /// GetTransaction(ApiAction(Data:UserId))
-        /// 鏍规嵁ApiAction鐨刬d杩斿洖涓�涓煡璇㈠偍浣嶈ˉ鍗版潯鐮佷簨鍔�
+        /// 鏍规嵁ApiAction鐨刬d杩斿洖涓�涓墦鍗板崐鎴愬搧鏉$爜浜嬪姟
         /// </summary>
         /// <param name="action"></param>
         /// <returns></returns>
@@ -72,16 +72,16 @@
                         {
                             lock (trans.TransLock) { response = action.GetResponse(trans.Close()); }
                         }
-                        response.Message = $"鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜浜嬪姟[ID:{action.ID}]鍏抽棴{(response.IsSuccessed ? "鎴愬姛" : "澶辫触")}";
+                        response.Message = $"鎵撳嵃鍗婃垚鍝佹潯鐮佷簨鍔ID:{action.ID}]鍏抽棴{(response.IsSuccessed ? "鎴愬姛" : "澶辫触")}";
                     }
                     else
                     {
-                        response = action.GetResponse($"Transaction Error: 鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴", false);
+                        response = action.GetResponse($"Transaction Error: 鎵撳嵃鍗婃垚鍝佹潯鐮佷簨鍔ID:{action.ID}]宸茬粡鍏抽棴", false);
                     }
                 }
                 else
                 {
-                    response = action.GetResponse($"Transaction Error: 鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴", false);
+                    response = action.GetResponse($"Transaction Error: 鎵撳嵃鍗婃垚鍝佹潯鐮佷簨鍔ID:{action.ID}]宸茬粡鍏抽棴", false);
                 }
             }
             catch (System.Exception ex)
@@ -121,12 +121,12 @@
                     }
                     else
                     {
-                        response = action.GetResponse($"Transaction Error: 鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴锛岃閲嶆柊鎵撳紑鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜鍔熻兘", false);
+                        response = action.GetResponse($"Transaction Error: 鎵撳嵃鍗婃垚鍝佹潯鐮佷簨鍔ID:{action.ID}]宸茬粡鍏抽棴锛岃閲嶆柊鎵撳紑鎵撳嵃鍗婃垚鍝佹潯鐮佸姛鑳�", false);
                     }
                 }
                 else
                 {
-                    response = action.GetResponse($"Transaction Error: 鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜浜嬪姟[ID:{action.ID}]鏁版嵁涓㈠け锛岃閲嶆柊鎵撳紑鏌ヨ鍌ㄤ綅琛ュ嵃鏉$爜鍔熻兘", false);
+                    response = action.GetResponse($"Transaction Error: 鎵撳嵃鍗婃垚鍝佹潯鐮佷簨鍔ID:{action.ID}]鏁版嵁涓㈠け锛岃閲嶆柊鎵撳紑鎵撳嵃鍗婃垚鍝佹潯鐮佸姛鑳�", false);
                 }
             }
             catch (System.Exception ex)
diff --git a/Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs b/Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs
index 4d036ae..2098cf9 100644
--- a/Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs
+++ b/Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs
@@ -70,8 +70,8 @@
         public string WorkOrder { get; set; }
         public string ItemCode { get; set; }
         public string WhCode { get; set; } = "10105";
-        public int PkgQty { get; set; }
-        public int CompleteQty { get; set; }
+        public double PkgQty { get; set; }
+        public double CompleteQty { get; set; }
         public int OutputType { get; set; } = 0;
         public int StorageType { get; set; } = 4;
         public int DocState { get; set; } = 1;
@@ -91,7 +91,7 @@
         public Wh Wh { get; set; }
         public Item Item { get; set; }
         public DescFlexField DescFlexField { get; set; }
-        public int CompleteQty { get; set; }
+        public double CompleteQty { get; set; }
         public int OutputType { get; set; } = 0;
         public int StorageType { get; set; } = 4;
         public int DocState { get; set; } = 1;
diff --git a/Tiger.Model.Net/Entitys/WMS/Api/RePrint_Entitys.cs b/Tiger.Model.Net/Entitys/WMS/Api/RePrint_Entitys.cs
index 747ca89..af6ed48 100644
--- a/Tiger.Model.Net/Entitys/WMS/Api/RePrint_Entitys.cs
+++ b/Tiger.Model.Net/Entitys/WMS/Api/RePrint_Entitys.cs
@@ -34,7 +34,14 @@
         public string ItemDesc { get; set; }
         public string DocNo { get; set; }
         public string WorkOrder { get; set; }
+        public string WoBatch { get; set; }
         public decimal PackQty { get; set; }
         public decimal Qty { get; set; }
     }
+
+    public class SemiTemplateQty
+    {
+        public double PackQty { get; set; }
+        public double CompleteQty { get; set; }
+    }
 }
diff --git a/Tiger.Model.Net/Entitys/WMS/BIZ_ERP_PROD_IN_BTH.cs b/Tiger.Model.Net/Entitys/WMS/BIZ_ERP_PROD_IN_BTH.cs
index 29f4e00..ac2f164 100644
--- a/Tiger.Model.Net/Entitys/WMS/BIZ_ERP_PROD_IN_BTH.cs
+++ b/Tiger.Model.Net/Entitys/WMS/BIZ_ERP_PROD_IN_BTH.cs
@@ -118,6 +118,8 @@
 
         [SugarColumn(IsIgnore = true)]
         public int CartonQty { get; set; }
+        [SugarColumn(IsIgnore = true)]
+        public double CompleteQty { get; set; }
         #endregion
 
         #region 澶栭敭灞炴��

--
Gitblit v1.9.3