From 083d4e94b5fb490b40fb6b7d534b7fed6da2aa60 Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期五, 27 十二月 2024 09:38:26 +0800
Subject: [PATCH] 增加新的barcode规则验证

---
 Tiger.Business.WMS/WMS_ITEM_Biz.cs |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/Tiger.Business.WMS/WMS_ITEM_Biz.cs b/Tiger.Business.WMS/WMS_ITEM_Biz.cs
index 624e351..3f5ae9e 100644
--- a/Tiger.Business.WMS/WMS_ITEM_Biz.cs
+++ b/Tiger.Business.WMS/WMS_ITEM_Biz.cs
@@ -53,18 +53,18 @@
                         result.Flag = Result.Flags.Failed;
                         result.LocaleMsg = new("WMS.WmsItem.Barcode.IllegalFailure");
                     }
-                    else if (barcode.Qty <= 0)
-                    {
-                        result.Flag = Result.Flags.Failed;
-                        result.LocaleMsg = new("鏁伴噺涓嶈兘灏忎簬绛変簬闆讹紝璇锋鏌ヤ簩缁寸爜锛�");
-                    }
+                    //else if (barcode.Qty <= 0)
+                    //{
+                    //    result.Flag = Result.Flags.Failed;
+                    //    result.LocaleMsg = new("鏁伴噺涓嶈兘灏忎簬绛変簬闆讹紝璇锋鏌ヤ簩缁寸爜锛�");
+                    //}
                     else
                     {
                         var query = Biz.Db.Queryable<WMS_ITEM_PKG>().ByAuth(option).Where(q => q.SN == barcode.SN).IncludesAllFirstLayer().First();
                         //var query = Biz.Db.Queryable<WMS_ITEM_PKG>().Where(q => q.SN == barcode.SN).IncludesAllFirstLayer().First();//.ByAuth(option)
 
                         //鍖呰琛ㄤ腑鎵惧埌鏉$爜
-                        if (!query.IsNullOrEmpty() && query.QTY > 0)
+                        if (!query.IsNullOrEmpty())// && query.QTY > 0)
                         {
                             inv.SN = barcode.SN;
                             inv.Barcode = barcode;
@@ -74,8 +74,8 @@
                             inv.Region = query.Region;
                             inv.Shelf = query.Shelf;
                             inv.Location = query.Location;
-                            inv.Packages = Biz.Db.Ado.UseStoredProcedure().SqlQuery<WMS_ITEM_PKG>("pkg_wms_get_item_pkg", new SugarParameter("root", barcode.SN));
-                            inv.Items = Biz.Db.Ado.UseStoredProcedure().SqlQuery<WMS_ITEM>("pkg_wms_get_items", new SugarParameter("root", barcode.SN));
+                            inv.Packages = Biz.Db.Ado.UseStoredProcedure().SqlQuery<WMS_ITEM_PKG>("sp_wms_get_item_pkg", new SugarParameter("root", barcode.SN));
+                            inv.Items = Biz.Db.Ado.UseStoredProcedure().SqlQuery<WMS_ITEM>("sp_wms_get_items", new SugarParameter("root", barcode.SN));
                             inv.ItemsExt = Biz.Db.Queryable<WMS_ITEM_EXT>().Where(q => inv.Items.Any(s => s.SN == q.SN)).ToList();
                             //var data = inv.Items.Select(i => i.SN).ToList().Except(inv.ItemsExt.Select(i => i.SN).ToList());
                             var data = inv.Items.Where(q => !inv.ItemsExt.Any(s => s.SN == q.SN)).ToList();
@@ -86,7 +86,6 @@
                                     inv.ItemsExt.Add(new()
                                     {
                                         SN = item.SN,
-                                        SUPP_ITEM_CODE = barcode.OEMItemCode,
                                         META_SN = barcode.MetaSn,
                                         QR_CODE = barcode.MetaSn
                                     });
@@ -199,7 +198,6 @@
                                     inv.ItemsExt.Add(new()
                                     {
                                         SN = item.SN,
-                                        SUPP_ITEM_CODE = barcode.OEMItemCode,
                                         META_SN = barcode.MetaSn,
                                         QR_CODE = barcode.MetaSn
                                     });
@@ -293,7 +291,6 @@
                         {
                             item.AUTH_ORG = option.OrgCode;
                             item.SN = inv.Barcode.SN;
-                            item.SUPP_ITEM_CODE = inv.Barcode.OEMItemCode;
                         }
 
                         result.Data.Items = inventory.Items;

--
Gitblit v1.9.3