From 3b787c15c3d1640d1e6bbe3147206b852a47741f Mon Sep 17 00:00:00 2001
From: zyf <1071160500@qq.com>
Date: 星期五, 12 九月 2025 18:24:45 +0800
Subject: [PATCH] 未首检的工单现在不会出现在巡检创建选项中

---
 MESApplication/bin/Debug/net8.0/MESApplication.pdb |    0 
 MESApplication/bin/Debug/net8.0/MESApplication.exe |    0 
 MES.Service/service/QC/XJService.cs                |   36 ++++++++++++++++++++++++++++++------
 MESApplication/bin/Debug/net8.0/MES.Service.pdb    |    0 
 MESApplication/bin/Debug/net8.0/MESApplication.dll |    0 
 MES.Service/bin/Debug/net8.0/MES.Service.dll       |    0 
 MESApplication/bin/Debug/net8.0/MES.Service.dll    |    0 
 MES.Service/bin/Debug/net8.0/MES.Service.pdb       |    0 
 MESApplication/bin/Debug/net8.0/log/2025062315.log |    3 +++
 9 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.dll b/MES.Service/bin/Debug/net8.0/MES.Service.dll
index 6c9309a..29128d4 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.dll
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.pdb b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
index 7c7ed16..7eede57 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.pdb
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MES.Service/service/QC/XJService.cs b/MES.Service/service/QC/XJService.cs
index 62d6fe8..d80e07d 100644
--- a/MES.Service/service/QC/XJService.cs
+++ b/MES.Service/service/QC/XJService.cs
@@ -73,7 +73,7 @@
     public List<Womdaa> getDaa001(string daa020, string item)
     {
         var db = SqlSugarHelper.GetInstance();
-        return db.Queryable<Womdaa, MesItems>((a, b) =>
+        /*return db.Queryable<Womdaa, MesItems>((a, b) =>
                 new JoinQueryInfos(JoinType.Inner, a.Daa002 == b.Id.ToString()))
             .Where((a, b) =>
                 a.Daa015 == daa020 &&
@@ -85,16 +85,40 @@
                 Daa001 = a.Daa001,
                 Daa003 = a.Daa003,
                 Daa008 = a.Daa008
-            }).ToList();
+            }).ToList();*/
+        var list = db.Queryable<Womdaa, MesItems, QsItemIpiReq>(
+                (a, b, c) => new JoinQueryInfos(
+                    JoinType.Inner, a.Daa002 == b.Id.ToString(),
+                    JoinType.Left, a.Id == c.Pbaid
+                )
+            )
+            .Where((a, b, c) =>
+                a.Daa015 == daa020 &&
+                b.ItemNo == item &&
+                statusArray.Contains(a.Daa018) && (c.Id > 0) //鍙煡璇㈡湁棣栨鍗曟嵁鐨勫伐鍗�
+            )
+            .GroupBy((a, b) => new { a.Id, a.Daa001, a.Daa003, a.Daa008 })
+            .Select((a, b) => new Womdaa
+            {
+                Id = a.Id,
+                Daa001 = a.Daa001,
+                Daa003 = a.Daa003,
+                Daa008 = a.Daa008
+            })
+            .ToList();
+        return list;
     }
 
     public List<MesItems> getBoardItem(string lineNo)
     {
         var db = SqlSugarHelper.GetInstance();
-        return db.Queryable<Womdaa, MesItems>((a, b) =>
-                new JoinQueryInfos(JoinType.Inner, a.Daa002 == b.Id.ToString()))
-            .Where((a, b) => statusArray.Contains(a.Daa018) &&
-                             a.Daa015 == lineNo)
+        return db.Queryable<Womdaa, MesItems, QsItemIpiReq>((a, b, c) =>
+                new JoinQueryInfos(
+                    JoinType.Inner, a.Daa002 == b.Id.ToString(),
+                    JoinType.Left, a.Id == c.Pbaid))
+            .Where((a, b, c) => statusArray.Contains(a.Daa018) &&
+                             a.Daa015 == lineNo && statusArray.Contains(a.Daa018) && (c.Id > 0))
+            .GroupBy((a, b) => new { b.Id, b.ItemNo, b.ItemName, b.ItemModel })
             .OrderBy((a, b) => b.ItemName)
             .Select<MesItems>((a, b) =>
                 new MesItems
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.dll b/MESApplication/bin/Debug/net8.0/MES.Service.dll
index 6c9309a..29128d4 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.dll
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.pdb b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
index 7c7ed16..7eede57 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.pdb
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.dll b/MESApplication/bin/Debug/net8.0/MESApplication.dll
index 1dabfe2..525b95a 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.dll
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.exe b/MESApplication/bin/Debug/net8.0/MESApplication.exe
index 3fe0959..a3527bc 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.exe
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.pdb b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
index 0ef1a45..7495b3e 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.pdb
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/log/2025062315.log b/MESApplication/bin/Debug/net8.0/log/2025062315.log
new file mode 100644
index 0000000..3117f0e
--- /dev/null
+++ b/MESApplication/bin/Debug/net8.0/log/2025062315.log
@@ -0,0 +1,3 @@
+2025-06-23 15:58:06:562 鎺ュ彛寮傚父锛歿"ClassName":"System.NullReferenceException","Message":"Object reference not set to an instance of an object.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"   at MESApplication.Controllers.QC.BaseController.getByFid(JObject data) in C:\\Users\\qewqer\\Desktop\\MES\\SG\\StandardPda\\MESApplication\\Controllers\\QC\\BaseController.cs:line 64\r\n   at lambda_method104(Closure, Object, Object[])\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467261,"Source":"MESApplication","WatsonBuckets":null}
+2025-06-23 15:58:06:569 寮傚父鎻愮ず淇℃伅锛�"Object reference not set to an instance of an object."
+==================================================================================================================================

--
Gitblit v1.9.3