From 5f5d8997fb860e8554a9bbb4d627715ca66b17cc Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 19 十一月 2024 15:00:50 +0800
Subject: [PATCH] 变量获取更新,获取出货信息更新

---
 Tiger.Business.MES/BIZ/BIZ_MES_WO.cs |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs b/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
index 25765c6..29d2183 100644
--- a/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
+++ b/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
@@ -605,22 +605,34 @@
         /// </summary>
         /// <param name="wo"></param>
         /// <returns></returns>
-        public async Task<ApiAction> GetShipList(string wo, string orgCode)
+        public async Task<ApiAction<ShippingOutput>> GetShipList(string wo, string orgCode)
         {
-            var result = new ApiAction();
+            var result = new ApiAction<ShippingOutput>();
             try
             {
                 DbClient db = Biz.DataSource["YadaU9C"].Client;
-                var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q=>q.ORG_CODE == orgCode).FirstAsync();
-                var shipList = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && SqlFunc.DateIsSame(q.BusinessDate, DateTime.Now) && q.Status == 2 && q.Org == org.ID.ToInt64()).ToList();
-                if (shipList.Any())
+                var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q => q.ORG_CODE == orgCode).FirstAsync();
+                var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && q.Org == org.ID.ToInt64()).First();
+                if (!ship.IsNullOrEmpty())
                 {
-                    result.Data = shipList[0].ShipQty;
+                    result.Data = ship.BusinessDate.Date == DateTime.Now.Date ? new()
+                    {
+                        ShippingQty = ship.ShipQty,
+                        Tag = "Customer"
+                    } : new()
+                    {
+                        ShippingQty = ship.ShipQty,
+                        Tag = "InStoreLabel"
+                    };
                     result.LocaleMsg = new($"鍑鸿揣淇℃伅瀛樺湪锛�");
                 }
                 else
                 {
-                    result.Data = "InStoreLabel";
+                    result.Data = new()
+                    {
+                        ShippingQty = 0,
+                        Tag = "InStoreLabel"
+                    };
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3