From 3f7693504fdb48ab76fd41029859d84774b42a28 Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期日, 03 八月 2025 13:38:42 +0800
Subject: [PATCH] 首检巡检修改

---
 StandardInterface/MESApplication/Controllers/QC/XJController.cs |  129 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 129 insertions(+), 0 deletions(-)

diff --git a/StandardInterface/MESApplication/Controllers/QC/XJController.cs b/StandardInterface/MESApplication/Controllers/QC/XJController.cs
index 40d2bdc..8068a2f 100644
--- a/StandardInterface/MESApplication/Controllers/QC/XJController.cs
+++ b/StandardInterface/MESApplication/Controllers/QC/XJController.cs
@@ -444,4 +444,133 @@
             return ResponseResult.ResponseError(ex);
         }
     }
+
+    //鍒锋柊妫�楠岄」鐩�
+    [HttpPost("GenUpdate")]
+    public ResponseResult GenUpdate([FromBody] JObject data)
+    {
+        try
+        {
+            decimal? id = data["id"]?.ToObject<decimal>();
+            string? no = data["no"]?.ToString();
+            string? user = data["user"]?.ToString();
+
+            var (result, message) = new XJService().GenUpdate(id, no, user);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.result = result;
+            resultInfos.message = message;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+    
+    //鎻愪氦妫�楠�
+    [HttpPost("SjSubmit")]
+    public ResponseResult SjSubmit([FromBody] SJDto sjDto)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new XJService().SjSubmit(sjDto);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 鑾峰彇鏈夌嚎浣撶殑閮ㄩ棬鍒楄〃
+    /// </summary>
+    [HttpPost("getDepartmentsWithLines")]
+    public ResponseResult GetDepartmentsWithLines()
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new XJService().GetDepartmentsWithLines();
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 淇濆瓨閮ㄩ棬閫夋嫨
+    /// </summary>
+    [HttpPost("saveDepartmentSelection")]
+    public ResponseResult SaveDepartmentSelection([FromBody] JObject data)
+    {
+        try
+        {
+            var id = Convert.ToDecimal(data["id"]);
+            var departmentId = data["departmentId"].ToString();
+            var departmentName = data["departmentName"].ToString();
+
+            dynamic resultInfos = new ExpandoObject();
+            var result = new XJService().SaveDepartmentSelection(id, departmentId, departmentName);
+            resultInfos.tbBillList = result;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 鏍规嵁閮ㄩ棬ID鑾峰彇璇ラ儴闂ㄤ笅鐨勭嚎浣撳垪琛�
+    /// </summary>
+    [HttpPost("getLinesByDepartment")]
+    public ResponseResult GetLinesByDepartment([FromBody] JObject data)
+    {
+        try
+        {
+            var departmentId = data["departmentId"].ToString();
+
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new XJService().GetLinesByDepartment(departmentId);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3