From 5c45b5f97c1365b6f89da2a0897a7c93fe16cb63 Mon Sep 17 00:00:00 2001
From: kyy <3283105747@qq.com>
Date: 星期三, 17 十二月 2025 18:09:01 +0800
Subject: [PATCH] 首检巡检

---
 WebApi/GS.QC/Service/IpqcShouManager.cs |  117 ++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 88 insertions(+), 29 deletions(-)

diff --git a/WebApi/GS.QC/Service/IpqcShouManager.cs b/WebApi/GS.QC/Service/IpqcShouManager.cs
index 225158f..fbb8fd0 100644
--- a/WebApi/GS.QC/Service/IpqcShouManager.cs
+++ b/WebApi/GS.QC/Service/IpqcShouManager.cs
@@ -132,42 +132,101 @@
             return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "璇诲彇澶辫触锛�");
         }
 
+        /*        /// <summary>
+                ///     璇诲彇
+                /// </summary>
+                /// <param name="guid"></param>
+                /// <returns></returns>
+                [RequestMethod(RequestMethods.POST)]
+                public ReturnDto<ExpandoObject> GetModel12([FromBody] dynamic model)
+                {
+                    Guid guid = model.guid;
+                    string parentGuid = model.parentGuid;
+                    dynamic m = new ExpandoObject();
+                    m.list = new List<dynamic>();
+                    m.list2 = new List<dynamic>();
+                    StringBuilder sb = new StringBuilder();
+                    sb.Append("select * from  MES_QA_ITEMS_DETECT_DETAIL12 where parent_guid='" + guid + "' order by fstand asc");
+                    sb.Append("   select d13.*,d5.fcheck_item as  fcheckItemd5,d5.ybsl from  MES_QA_ITEMS_DETECT_DETAIL13 d13 left join[dbo].[MES_QA_ITEMS_DETECT_DETAIL5] d5 on d13.parent_guid = d5.guid");
+                    sb.Append("  where d13.parent_guid = '" + guid + "'");
+                    sb.Append(" order by d13.fcheck_item asc");
+                    try
+                    {
+                        DataSet dset = new DataSet();
+                        dset = DbHelperSQL.Query(sb.ToString());
+                        var _tb = dset.Tables[0].TableToDynamicList();
+                        m.list = _tb;
+                        var _tb2 = dset.Tables[1].TableToDynamicList();
+                        m.list2 = _tb2;
+                    }
+                    catch (Exception ex)
+                    {
+                        LogHelper.Debug(ToString(), "GetModel12 error锛�" + ex.Message);
+                    }
+                    if (m != null)
+                        return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
+                            "璇诲彇鎴愬姛锛�");
+                    return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
+                        "璇诲彇澶辫触锛�");
+                }
+        */
+
         /// <summary>
-        ///     璇诲彇
+        /// 褰曞叆妫�楠岀粨鏋�
         /// </summary>
-        /// <param name="guid"></param>
+        /// <param name="model"></param>
         /// <returns></returns>
         [RequestMethod(RequestMethods.POST)]
-        public ReturnDto<ExpandoObject> GetModel12([FromBody] dynamic model)
+        public ReturnDto<int?> EdtModel12([FromBody] dynamic model)
         {
-            Guid guid = model.guid;
-            string parentGuid = model.parentGuid;
-            dynamic m = new ExpandoObject();
-            m.list = new List<dynamic>();
-            m.list2 = new List<dynamic>();
-            StringBuilder sb = new StringBuilder();
-            sb.Append("select * from  MES_QA_ITEMS_DETECT_DETAIL12 where parent_guid='" + guid + "' order by fstand asc");
-            sb.Append("   select d13.*,d5.fcheck_item as  fcheckItemd5,d5.ybsl from  MES_QA_ITEMS_DETECT_DETAIL13 d13 left join[dbo].[MES_QA_ITEMS_DETECT_DETAIL5] d5 on d13.parent_guid = d5.guid");
-            sb.Append("  where d13.parent_guid = '" + guid + "'");
-            sb.Append(" order by d13.fcheck_item asc");
-            try
+            string inOrderGuid1 = model.inOrderGuid1; //杩欐槸妫�楠屽崟guid
+            string inOrderGuid5 = model.inOrderGuid5; //杩欐槸鎶芥牱鐨刧uid
+            string inP1 = model.inP1; //杩欐槸9锛屾湁鍙兘鏄�19锛屾垨鑰�0k-19,鎴栬�卬g-19
+            var _outMsg = "";
+            int? _outSum = -1;
+            using (var conn = new SqlConnection(DbHelperSQL.strConn))
             {
-                DataSet dset = new DataSet();
-                dset = DbHelperSQL.Query(sb.ToString());
-                var _tb = dset.Tables[0].TableToDynamicList();
-                m.list = _tb;
-                var _tb2 = dset.Tables[1].TableToDynamicList();
-                m.list2 = _tb2;
+                using (var cmd = new SqlCommand("[ipqc_detect01_panding]", conn))
+                {
+                    try
+                    {
+                        conn.Open();
+                        cmd.CommandType = CommandType.StoredProcedure;
+                        SqlParameter[] parameters =
+                        {
+                        new("@outMsg", SqlDbType.NVarChar, 300),
+                        new("@outSum", SqlDbType.Int),
+                        new("@inEdtUserGuid", _userGuid),
+                        new("@inOrderGuid1", inOrderGuid1),
+                        new("@inOrderGuid5", inOrderGuid5),
+                        new("@inP1", inP1),
+                    };
+                        parameters[0].Direction = ParameterDirection.Output;
+                        parameters[1].Direction = ParameterDirection.Output;
+                        foreach (var parameter in parameters)
+                            cmd.Parameters.Add(parameter);
+                        cmd.ExecuteNonQuery();
+                        _outMsg = parameters[0].Value.ToString();
+                        _outSum = int.Parse(parameters[1].Value.ToString());
+                    }
+                    catch (Exception ex)
+                    {
+                        LogHelper.Debug(ToString(),
+                            "prc_iqc_panding error锛�" + ex.Message);
+                        _outMsg = ex.Message;
+                        _outSum = -1;
+                    }
+                    finally
+                    {
+                        conn.Close();
+                    }
+                }
             }
-            catch (Exception ex)
-            {
-                LogHelper.Debug(ToString(), "GetModel12 error锛�" + ex.Message);
-            }
-            if (m != null)
-                return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success,
-                    "璇诲彇鎴愬姛锛�");
-            return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default,
-                "璇诲彇澶辫触锛�");
+            if (_outSum <= 0)
+                return ReturnDto<string>.QuickReturn(_outSum,
+                    ReturnCode.Exception, _outMsg);
+            return ReturnDto<string>.QuickReturn(_outSum,
+                ReturnCode.Success, _outMsg);
         }
 
         /// <summary>

--
Gitblit v1.9.3