From 1be2fc056943ba8b9e62328430e15beee03e8a9f Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期一, 02 六月 2025 13:46:48 +0800
Subject: [PATCH] 1.生产补料优化 2.首检开发-v1

---
 service/QC/LljService.cs |   69 +++++++++++++++++++++++++++-------
 1 files changed, 54 insertions(+), 15 deletions(-)

diff --git a/service/QC/LljService.cs b/service/QC/LljService.cs
index b4f51a4..a6573b0 100644
--- a/service/QC/LljService.cs
+++ b/service/QC/LljService.cs
@@ -1,9 +1,11 @@
-锘縰sing Microsoft.IdentityModel.Tokens;
+锘縰sing MES.Service.Models;
+using Microsoft.IdentityModel.Tokens;
 using NewPdaSqlServer.DB;
 using NewPdaSqlServer.Dto.service;
 using NewPdaSqlServer.entity;
 using NewPdaSqlServer.util;
 using SqlSugar;
+using static Azure.Core.HttpHeader;
 
 namespace NewPdaSqlServer.service.QC;
 
@@ -23,17 +25,26 @@
         var totalCount = 0;
 
         var pageList = Db.Queryable<LLJView>()
-            .WhereIF(
-                StringUtil.IsNotNullOrEmpty(queryObj.result) &&
-                "鏈畬鎴�".Equals(queryObj.result),
-                a => (a.STATUS ?? "") != "宸叉彁浜�")
-                //a => (a.FcheckResu ?? "") == ""|| (a.FcheckResu ?? "") == "妫�楠屼腑")
-            .WhereIF(
-                StringUtil.IsNotNullOrEmpty(queryObj.result) &&
-                !"鏈畬鎴�".Equals(queryObj.result),
-                a => (a.STATUS ?? "") == "宸叉彁浜�")
+            //.WhereIF(
+            //    StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+            //    "鏈畬鎴�".Equals(queryObj.result),
+            //    a => (a.STATUS ?? "") != "宸叉彁浜�")
+            //    //a => (a.FcheckResu ?? "") == ""|| (a.FcheckResu ?? "") == "妫�楠屼腑")
+            //.WhereIF(
+            //    StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+            //    !"鏈畬鎴�".Equals(queryObj.result),
+            //    a => (a.STATUS ?? "") == "宸叉彁浜�")
+
+            .WhereIF(!string.IsNullOrWhiteSpace(queryObj.keyword), a =>
+                a.ItemNo.Contains(queryObj.keyword) ||
+                a.ItemName.Contains(queryObj.keyword) ||
+                a.LotNo.Contains(queryObj.keyword) ||
+                a.ReleaseNo.Contains(queryObj.keyword) ||
+                a.SuppName.Contains(queryObj.keyword) 
+            )
             .WhereIF(UtilityHelper.CheckGuid(parsedGuid),
-                a => a.guid == parsedGuid)
+                a => a.guid == parsedGuid )
+            .Where(a => (a.fsubmit ?? 0) == 0)
             .OrderByDescending(a => a.CreateDate)
             .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
 
@@ -60,7 +71,7 @@
                     FcheckItem = b.FcheckItem,
                     FdownAllow = b.FdownAllow,
                     FcheckLevel = b.FREQUENCY,
-                    Fstand = Convert.ToInt32(b.FSTAND),
+                    Fstand = b.FSTAND,
                     FupAllow = b.FupAllow,
                     SampleSizeNo = b.SampleSizeNo,
                     FenterQty = 0,
@@ -220,7 +231,9 @@
                 a.FspecRequ,
                 a.FreQty,
                 a.CheckQyt,
-                a.FcheckResu
+                a.FcheckResu,
+                a.Order,
+                a.Ybsl
             }).Select((a, b) => new MesQaItemsDetectDetail5
             {
                 Guid = a.Guid,
@@ -240,8 +253,11 @@
                 Factory = "1000",
                 Company = "1000",
                 FenterQty = SqlFunc.AggregateCount(b.Guid),
-                FcheckResu = a.FcheckResu
-            }).ToList();
+                FcheckResu = a.FcheckResu,
+                Order = a.Order,
+                Ybsl = a.Ybsl,
+            }).OrderBy(a => a.Order)
+            .ToList();
     }
 
     public int SetQSItemDetail(MesQaItemsDetectDetail12 detail)
@@ -708,4 +724,27 @@
 
         return [isNullCount, isNotNullCount];
     }
+
+
+
+    //鍒犻櫎鐗瑰緛鍊� 
+    public int deleteDetail13(LLJDto dto)
+    {
+        var withOracle = Db.Deleteable<MesQaItemsDetectDetail13>()
+                .Where(s => s.Guid.ToString() == dto.id13)
+                .ExecuteCommand();
+
+        return withOracle;
+    }
+
+    //鏇存柊涓嶅悎鏍兼弿杩�
+    public int updateRemarks(LLJDto dto)
+    {
+        var withOracle = Db.Updateable<MesQaItemsDetect01>()
+                .SetColumns(s => s.FngDesc == dto.Remarks)
+                .Where(s => s.Guid.ToString() == dto.gid)
+                .ExecuteCommand();
+
+        return withOracle;
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3