From e4a50484f60a8859d5b705dae11f65fc9516bb1e Mon Sep 17 00:00:00 2001
From: 如洲 陈 <1278080563@qq.com>
Date: 星期五, 19 九月 2025 10:27:01 +0800
Subject: [PATCH] 巡检已提交显示修改

---
 MESApplication/Controllers/QC/XJController.cs |    5 +-
 MES.Service/service/QC/XJService.cs           |   56 ++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/MES.Service/service/QC/XJService.cs b/MES.Service/service/QC/XJService.cs
index 8c17a7f..23b9feb 100644
--- a/MES.Service/service/QC/XJService.cs
+++ b/MES.Service/service/QC/XJService.cs
@@ -136,6 +136,62 @@
             .ToPageList(queryObj.PageIndex, queryObj.Limit);
     }
 
+    //鑾峰彇鎵�鏈夋暟鎹垎椤碉紙鎼哄甫鎬绘暟锛�
+    public (List<QsQaItemXj> data, int totalCount) getPageWithTotal(XJPageResult queryObj)
+    {
+        var db = SqlSugarHelper.GetInstance();
+
+        var id = Convert.ToDecimal(queryObj.id);
+
+        // 鍙栨秷浜х嚎杩囨护锛屾樉绀烘墍鏈変骇绾跨殑鏁版嵁
+
+        int totalCount = 0;
+        var data = db
+            .Queryable<QsQaItemXj, Womdaa, MesLine,
+                MesItems>((s, a, c, b) =>
+                new JoinQueryInfos(
+                    JoinType.Inner, s.BillNo == a.Daa001,
+                    JoinType.Left, a.Daa015 == c.LineNo,
+                    JoinType.Left, s.ItemId == b.Id
+                )
+            )
+            .WhereIF(
+                StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+                "鏈畬鎴�".Equals(queryObj.result),
+                (s, a, c, b) => s.FcheckResu == null)
+            .WhereIF(
+                StringUtil.IsNotNullOrEmpty(queryObj.result) &&
+                !"鏈畬鎴�".Equals(queryObj.result),
+                (s, a, c, b) => s.FcheckResu != null)
+            .WhereIF(queryObj.fsubmit.HasValue && queryObj.fsubmit.Value == 1,
+                (s, a, c, b) => s.Fsubmit == 1)
+            .WhereIF(queryObj.fsubmit.HasValue && queryObj.fsubmit.Value == 0,
+                (s, a, c, b) => SqlFunc.IsNull(s.Fsubmit, 0) != 1)
+            .WhereIF(id > 0, (s, a, c, b) => s.Id == id)
+            .Select((s, a, c, b) => new QsQaItemXj
+            {
+                Daa020 = c.LineNo,
+                Id = s.Id,
+                PlanQty = a.Daa008,
+                CreateBy = s.CreateBy,
+                CreateDate = s.CreateDate,
+                ReleaseNo = s.ReleaseNo,
+                ItemNo = s.ItemNo,
+                BillNo = s.BillNo,
+                ItemName = b.ItemName,
+                ItemModel = b.ItemModel,
+                FcheckBy = s.FcheckBy,
+                FcheckResu = s.FcheckResu,
+                Remarks = s.Remarks,
+                Fsubmit = s.Fsubmit,
+                FsubmitBy = s.FsubmitBy,
+                FsubmitDate = s.FsubmitDate
+            }).OrderBy(s => s.CreateDate, OrderByType.Desc)
+            .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
+
+        return (data, totalCount);
+    }
+
 
     public List<QsQaItemXj01> setJYItem(string itemNo)
     {
diff --git a/MESApplication/Controllers/QC/XJController.cs b/MESApplication/Controllers/QC/XJController.cs
index b6c260d..b35b92e 100644
--- a/MESApplication/Controllers/QC/XJController.cs
+++ b/MESApplication/Controllers/QC/XJController.cs
@@ -217,9 +217,10 @@
         try
         {
             dynamic resultInfos = new ExpandoObject();
-            var tbBillList =
-                new XJService().getPage(queryObj);
+            var (tbBillList, totalCount) =
+                new XJService().getPageWithTotal(queryObj);
             resultInfos.tbBillList = tbBillList;
+            resultInfos.totalCount = totalCount;
             return new ResponseResult
             {
                 status = 0,

--
Gitblit v1.9.3