From e6ca4a95488e106d948fbc170993e006a4e5d55d Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期四, 05 十二月 2024 08:30:25 +0800
Subject: [PATCH] 消息中心的后台优化

---
 service/QC/LljService.cs |   48 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/service/QC/LljService.cs b/service/QC/LljService.cs
index 64962c0..a38eb54 100644
--- a/service/QC/LljService.cs
+++ b/service/QC/LljService.cs
@@ -26,11 +26,11 @@
             .WhereIF(
                 StringUtil.IsNotNullOrEmpty(queryObj.result) &&
                 "鏈畬鎴�".Equals(queryObj.result),
-                a => a.FcheckResu == null)
+                a => (a.FcheckResu ?? "") == "")
             .WhereIF(
                 StringUtil.IsNotNullOrEmpty(queryObj.result) &&
                 !"鏈畬鎴�".Equals(queryObj.result),
-                a => a.FcheckResu != null)
+                a => (a.FcheckResu ?? "") != "")
             .WhereIF(UtilityHelper.CheckGuid(parsedGuid),
                 a => a.guid == parsedGuid)
             .OrderByDescending(a => a.CreateDate)
@@ -144,7 +144,7 @@
         {
             foreach (var item in items) item.ReleaseNo = rkjDto.releaseNo;
 
-            return db.Insertable(items).ExecuteCommand();
+            return db.Insertable(items).IgnoreColumns(true).ExecuteCommand();
         });
 
         rkjDto.items = GetItems(rkjDto.releaseNo, null);
@@ -186,16 +186,27 @@
     }
 
     public List<MesQaItemsDetectDetail5> GetItems(string? releaseNo,
-        decimal? id)
+        string? id)
     {
+        var parsedGuid = Guid.Empty;
+
+        if (id != null)
+        {
+            var isValid = Guid.TryParse(id, out parsedGuid);
+            if (!isValid)
+                throw new ApplicationException("GUID杞崲閿欒");
+        }
+
         return Db.Queryable<MesQaItemsDetectDetail5, MesQaItemsDetectDetail12>(
                 (a, b) =>
                     new JoinQueryInfos(JoinType.Left, a.Guid == b.ParentGuid))
             .Where((a, b) => a.ReleaseNo == releaseNo)
-            // .WhereIF(id > 0, (a, b) => a.Id == id)
+            .WhereIF(UtilityHelper.CheckGuid(parsedGuid),
+                (a, b) => a.Guid == parsedGuid)
             .GroupBy((a, b) => new
             {
                 a.Guid,
+                a.ParentGuid,
                 a.ReleaseNo,
                 a.FacLevel,
                 a.FcheckItem,
@@ -212,6 +223,7 @@
             }).Select((a, b) => new MesQaItemsDetectDetail5
             {
                 Guid = a.Guid,
+                ParentGuid = a.ParentGuid,
                 ReleaseNo = a.ReleaseNo,
                 CheckQyt = a.CheckQyt,
                 FacLevel = a.FacLevel,
@@ -240,6 +252,7 @@
             {
                 var item = new MesQaItemsDetectDetail12();
                 item.ParentGuid = detail.ParentGuid;
+                item.GrandpaGuid = detail.GrandpaGuid;
                 item.Fstand = detail.Fstand;
                 item.FcheckResu = detail.FcheckResu;
                 item.CreateBy = detail.LastupdateBy;
@@ -247,7 +260,7 @@
                 result.Add(item);
             }
 
-            return db.Insertable(result).ExecuteCommand();
+            return db.Insertable(result).IgnoreColumns(true).ExecuteCommand();
         });
 
         detail.CreateBy = detail.LastupdateBy;
@@ -430,6 +443,18 @@
         rkjDto.ItemXj02s = Db.Queryable<MesQaItemsDetectDetail12>()
             .Where(s => s.ParentGuid == parsedGuid)
             .ToList();
+
+        foreach (var mesQaItemsDetectDetail12 in rkjDto.ItemXj02s)
+        {
+            //this.formData.fupAllow && this.formData.fdownAllow && this.formData.fstand
+            mesQaItemsDetectDetail12.isNumber = true;
+            if (qsItemOqcItem.FupAllow.IsNullOrEmpty()
+                && qsItemOqcItem.FdownAllow.IsNullOrEmpty()
+                && qsItemOqcItem.Fstand == null)
+            {
+                mesQaItemsDetectDetail12.isNumber = false;
+            }
+        }
 
         return rkjDto;
     }
@@ -671,4 +696,15 @@
 
         return com > 0;
     }
+
+    public int[] getBadge()
+    {
+        var isNullCount = Db.Queryable<MesQaItemsDetect01>()
+            .Where(a => (a.FcheckResu ?? "") == "").Count();
+
+        var isNotNullCount = Db.Queryable<MesQaItemsDetect01>()
+            .Where(a => (a.FcheckResu ?? "") != "").Count();
+
+        return [isNullCount, isNotNullCount];
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3