From 5610ce8f05f45e8da7bffa286c6db5c61ea06a79 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 16 十月 2025 17:00:12 +0800
Subject: [PATCH] 改为按采集时间查询采集数

---
 Services/MesOrderStaManager.cs |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Services/MesOrderStaManager.cs b/Services/MesOrderStaManager.cs
index 055ecd4..89adf53 100644
--- a/Services/MesOrderStaManager.cs
+++ b/Services/MesOrderStaManager.cs
@@ -111,7 +111,11 @@
             var automaticIpqcFirstCheck =
                 mesQaItemsDetect02Manager
                     .AutomaticIpqcFirstCheck(womdaa.Daa001);
-            if (!automaticIpqcFirstCheck) throw new Exception("棣栨鐢熸垚澶辫触");
+            if (!automaticIpqcFirstCheck)
+            {
+                Console.WriteLine($"鑷姩棣栨澶辫触锛屽伐鍗曞彿锛歿womdaa.Daa001}");
+                throw new Exception("棣栨鐢熸垚澶辫触");
+            }
 
             // 鑾峰彇褰撳墠鏃堕棿
             var s1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@@ -134,7 +138,7 @@
         var editDate = DateTime.Now.ToString("yyyy-MM-dd");
 
         // 鍙戦�丠TTP璇锋眰鍒版暟鎹埛鏂版帴鍙�
-        MesNumerical mesNumerical = null;
+        MesNumericalBycl mesNumerical = null;
         try
         {
             using (var httpClient = new HttpClient())
@@ -161,7 +165,7 @@
                     if (responseObj != null && responseObj.code == 200)
                     {
                         // 璇锋眰鎴愬姛锛岃幏鍙朚esNumerical鏁版嵁
-                        mesNumerical = Db.Queryable<MesNumerical>()
+                        mesNumerical = Db.Queryable<MesNumericalBycl>()
                             .Where(s => s.EditDate == editDate
                                         && s.MachineNo == entity.MachineNo)
                             .OrderByDescending(s => s.Id)
@@ -203,6 +207,9 @@
             // 濡傛灉鏈夎皟鏈哄紑濮嬫椂闂村垯鏇存柊
             .SetColumnsIF(entity.MaStartTime != null,
                 s => s.MaStartTime == entity.MaStartTime)
+            // 濡傛灉鏈夎皟鏈哄畬鎴愭椂闂村垯鏇存柊
+            .SetColumnsIF(entity.MaEndTime != null,
+                s => s.MaEndTime == entity.MaEndTime)
             // 濡傛灉鏍囪涓�1鍒欐洿鏂板娉ㄤ俊鎭�
             .SetColumnsIF(entity.Flag == 1,
                 s => s.remark == "浜�" + entity.MaShoutTime + "鏃堕棿鏈変竴娆¢�佹")
@@ -448,7 +455,7 @@
                         // var reportingOkQty =
                         //     Convert.ToDecimal(vOrder.todayOutput) -
                         //     reporting.OkQty;
-                        var CjQty = Db.Queryable<MesNumerical>()
+                        var CjQty = Db.Queryable<MesNumericalBycl>()
                             .Where(s => s.MachineNo == entity.MachineNo && s.EditDate == date)
                             .OrderByDescending(s=>s.CjTiem)
                             .Select<long?>(s=>s.CjNum).First();
@@ -580,7 +587,7 @@
 
         if (binding)
             return Db.Updateable<MesOrderSta>()
-                .SetColumns(s => s.MaEndTime == endDate)
+                .SetColumns(s => s.MaEndTime == endDate) // 鑷姩鍐欏叆璋冩満瀹屾垚鏃堕棿
                 .SetColumns(s => s.StartTime == entity.MaShoutTime)
                 .Where(s => s.OrderId == query.OrderId).ExecuteCommand() > 0;
 

--
Gitblit v1.9.3