From 10efbcfce9f0f17982f4714e76e8cad24fb8f982 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期二, 06 十二月 2022 09:25:16 +0800
Subject: [PATCH] SOP文件下拉列表排序

---
 VueWebApi/DLL/DAL/ProductionManagementDAL.cs |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index fd8112f..68a619c 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -776,6 +776,40 @@
         }
         #endregion
 
+        #region[MES宸ュ崟宸ュ簭浠诲姟鏌ョ湅SOP,鑾峰彇SOP鏂囦欢涓嬫媺鍒楄〃]
+        public static ToMessage SearchWorkStepSopList(string partcode, string routecode,string stepcode)
+        {
+            string sql = "";
+            var dynamicParams = new DynamicParameters();
+            try
+            {
+                //鑾峰彇SOP鏂囦欢淇℃伅
+                sql = @"select id,define_name,file_path   from TK_Sop_Matfile where materiel_code=@partcode and eqptype_code in(
+                        select distinct T.code  from TMateriel_Route A
+                        inner join TFlw_Rtdt B on A.route_code=B.rout_code
+                        inner join TFlw_Rteqp E on B.step_code=E.step_code
+                        inner join TEqpInfo  Q on E.eqp_code=Q.code
+                        inner join TEqpType T on Q.eqptype_code=T.code
+                        where A.materiel_code=@partcode and A.route_code=@routecode and B.step_code=@stepcode) order by file_version desc";
+                dynamicParams.Add("@partcode", partcode);
+                dynamicParams.Add("@routecode", routecode);
+                dynamicParams.Add("@stepcode", stepcode);
+                var data = DapperHelper.selectdata(sql, dynamicParams);
+                mes.code = "200";
+                mes.Message = "鏌ヨ鎴愬姛!";
+                mes.data = data;
+            }
+            catch (Exception e)
+            {
+                mes.code = "300";
+                mes.count = 0;
+                mes.Message = e.Message;
+                mes.data = null;
+            }
+            return mes;
+        }
+        #endregion
+
 
 
         #region[鐢熶骇寮�鎶ュ伐鎵爜鑾峰彇宸ュ崟瀵瑰簲宸ュ簭浠诲姟(鑷埗)]
@@ -2521,7 +2555,7 @@
 
                         }
                         //鏄惁鏈亾
-                        if (json[i].last_choke == "Y")
+                       else if (json[i].last_choke == "Y")
                         {
                             decimal this_reportqty = decimal.Parse(json[i].report_qty.ToString()); //鎶ュ伐鏁伴噺(鍚堟牸)
                             decimal this_ngqty = decimal.Parse(json[i].ng_qty.ToString()); //涓嶈壇鏁伴噺
@@ -3033,7 +3067,7 @@
                                 wo_code=json[i].wo_code.ToString(),
                                 step_seq=json[i].step_seq.ToString(),
                                 step_code=json[i].step_code.ToString(),
-                                repair_qty = decimal.Parse(json[i].report_qty),
+                                report_qty = decimal.Parse(json[i].report_qty),
                                 ng_qty = decimal.Parse(json[i].ng_qty),
                                 bad_qty = decimal.Parse(json[i].bad_qty),
                             }

--
Gitblit v1.9.3