From 5e11da1d662cd0c629ab2d854de2e5babb399ca3 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期日, 22 九月 2024 09:14:51 +0800
Subject: [PATCH] 来料检验的分页

---
 MES.Service/service/QC/LljService.cs |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/MES.Service/service/QC/LljService.cs b/MES.Service/service/QC/LljService.cs
index 2d9397c..afbfdf1 100644
--- a/MES.Service/service/QC/LljService.cs
+++ b/MES.Service/service/QC/LljService.cs
@@ -1,5 +1,4 @@
 锘縰sing System.Data;
-using System.Dynamic;
 using MES.Service.DB;
 using MES.Service.Dto.service;
 using MES.Service.Modes;
@@ -12,13 +11,15 @@
 
 public class LljService
 {
-    public List<LtsLlj> GetPage(XJPageResult queryObj)
+    public (List<LtsLlj> item, int TotalCount) GetPage(XJPageResult queryObj)
     {
         var db = SqlSugarHelper.GetInstance();
 
         var id = Convert.ToDecimal(queryObj.id);
 
-        return db.Queryable<LtsLlj>()
+        var totalCount = 0;
+
+        var pageList = db.Queryable<LtsLlj>()
             .WhereIF(
                 StringUtil.IsNotNullOrEmpty(queryObj.result) &&
                 "鏈畬鎴�".Equals(queryObj.result),
@@ -27,9 +28,11 @@
                 StringUtil.IsNotNullOrEmpty(queryObj.result) &&
                 !"鏈畬鎴�".Equals(queryObj.result),
                 a => a.FcheckResu != null)
-            .WhereIF(id > 0, (a) => a.Id == id)
-            .OrderByDescending(a=>a.Id)
-            .ToPageList(queryObj.PageIndex, queryObj.Limit);
+            .WhereIF(id > 0, a => a.Id == id)
+            .OrderByDescending(a => a.Id)
+            .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
+
+        return (pageList, totalCount);
     }
 
     //鏍规嵁妫�楠屾爣鍑嗘潵璁$畻妫�楠屼釜鏁�
@@ -66,7 +69,7 @@
                     // FcheckItemDesc = "0",
                     // FcheckResu = "0",
                     FcheckTool = b.FcheckTool,
-                    FspecRequ = b.FspecRequ,
+                    FspecRequ = b.FspecRequ
                     // FtextType = "0",
                     // Funit = "0",
                     // LastupdateBy = "0",
@@ -176,17 +179,11 @@
                 .Where(x1 => x1.MainId == s.Id).Count();
 
             if (ifck > s.FreQty && s.CheckQyt == count)
-            {
                 s.FcheckResu = "涓嶅悎鏍�";
-            }
             else if (ifck < s.FreQty && s.CheckQyt == count)
-            {
                 s.FcheckResu = "鍚堟牸";
-            }
             else
-            {
                 s.FcheckResu = "鏈畬鎴�";
-            }
 
 
             var detail = new MesQaItemsDetectDetail12();
@@ -590,10 +587,7 @@
             var resultValue = outputResult.Value?.ToString();
             var messageValue = outputMessage.Value?.ToString();
 
-            if ("1".Equals(resultValue))
-            {
-                throw new Exception(messageValue);
-            }
+            if ("1".Equals(resultValue)) throw new Exception(messageValue);
 
             return true;
         }

--
Gitblit v1.9.3