From 87bdc068d2135c27fa23732bab14ac297787e6e5 Mon Sep 17 00:00:00 2001
From: 如洲 陈 <1278080563@qq.com>
Date: 星期四, 30 十月 2025 08:35:11 +0800
Subject: [PATCH] 单位转换接口和委外工单变更修改

---
 MESApplication/Controllers/QC/SJController.cs |   97 ++++++++++++++++++++++++++----------------------
 1 files changed, 52 insertions(+), 45 deletions(-)

diff --git a/MESApplication/Controllers/QC/SJController.cs b/MESApplication/Controllers/QC/SJController.cs
index 107d6b9..5848463 100644
--- a/MESApplication/Controllers/QC/SJController.cs
+++ b/MESApplication/Controllers/QC/SJController.cs
@@ -12,27 +12,6 @@
 [ApiController]
 public class SJController : ControllerBase
 {
-    [HttpPost("GetMaxBillNo")]
-    public ResponseResult GetMaxBillNo()
-    {
-        try
-        {
-            dynamic resultInfos = new ExpandoObject();
-            var tbBillList =
-                new SJService().getMaxBillNo();
-            resultInfos.tbBillList = tbBillList;
-            return new ResponseResult
-            {
-                status = 0,
-                message = "OK",
-                data = resultInfos
-            };
-        }
-        catch (Exception ex)
-        {
-            return ResponseResult.ResponseError(ex);
-        }
-    }
 
 
     [HttpPost("GetPage")]
@@ -41,14 +20,15 @@
         try
         {
             dynamic resultInfos = new ExpandoObject();
-            var tbBillList =
-                new SJService().getPage(queryObj);
+            var service = new SJService();
+            var (tbBillList, totalCount) = service.getPageWithTotal(queryObj);
             resultInfos.tbBillList = tbBillList;
             return new ResponseResult
             {
                 status = 0,
                 message = "OK",
-                data = resultInfos
+                data = resultInfos,
+                TotalCount = totalCount
             };
         }
         catch (Exception ex)
@@ -82,27 +62,6 @@
         }
     }
 
-    [HttpPost("Save")]
-    public ResponseResult Save([FromBody] QsItem item)
-    {
-        try
-        {
-            dynamic resultInfos = new ExpandoObject();
-            var tbBillList = new SJService();
-            var detail021 = tbBillList.Save(item);
-            resultInfos.tbBillList = detail021;
-            return new ResponseResult
-            {
-                status = 0,
-                message = "OK",
-                data = resultInfos
-            };
-        }
-        catch (Exception ex)
-        {
-            return ResponseResult.ResponseError(ex);
-        }
-    }
 
     //SaveItem
     [HttpPost("SaveItem")]
@@ -319,4 +278,52 @@
             return ResponseResult.ResponseError(ex);
         }
     }
+
+    [HttpPost("SJQaSubmit")]
+    public ResponseResult SJQaSubmit([FromBody] JObject data)
+    {
+        var userNo = data["userNo"]?.ToString();
+        var id = Convert.ToDecimal(data["id"]?.ToString());
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new SJService().SJQaSubmit(userNo, id);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("GenUpdateSJ")]
+    public ResponseResult GenUpdateSJ([FromBody] JObject data)
+    {
+        var id = Convert.ToDecimal(data["id"]?.ToString());
+        var no = data["no"]?.ToString();
+        var userNo = data["userNo"]?.ToString();
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var service = new SJService();
+            var (code, msg) = service.GenUpdateSJ(id, no, userNo);
+            resultInfos.tbBillList = new { result = code, message = msg };
+            return new ResponseResult
+            {
+                status = code,
+                message = msg,
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3