From c42507edbe94f0c71044cf7c69d1b5698d194217 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 31 十月 2024 09:40:34 +0800
Subject: [PATCH] 增加设备工艺参数点检表查询方法,

---
 WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs |   55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
index 66285b6..2ef736a 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -83,7 +83,7 @@
                 return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
-            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MESBeginWorkBillList_NEW  where hmainid= " + HID + " ", "h_v_Sc_MESBeginWorkBillList_NEW");
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MESBeginWorkBillList_Edit  where hmainid= " + HID + " ", "h_v_Sc_MESBeginWorkBillList_Edit");
             if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                 return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ紑宸ュ崟鍙�" };
 
@@ -735,8 +735,9 @@
             string msg1 = _value.ToString();
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
-            string UserName = sArray[1].ToString();
-            string refSav = sArray[2].ToString();
+            string msg3 = sArray[1].ToString();
+            string UserName = sArray[2].ToString();
+            string refSav = sArray[3].ToString();
             DBUtility.ClsPub.CurUserName = UserName;
             //淇濆瓨鏉冮檺
             if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Edit", 1, false, DBUtility.ClsPub.CurUserName))
@@ -848,13 +849,33 @@
                     oBill.omodel = oItem;
                 }
 
+                // 琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                List<Models.ClsSc_MESBeginWorkBillSub_RelationBill> ls = new List<Models.ClsSc_MESBeginWorkBillSub_RelationBill>();
+                ls = oListModels.getObjectByJson_Sc_MESBeginWorkBillSub_RelationBill(msg3);
+                int i = 0;
+                foreach (Models.ClsSc_MESBeginWorkBillSub_RelationBill oItemSub in ls)
+                {
+                    i++;
+                    oItemSub.HEntryID = i;
+
+
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+
+                    oBill.DetailCol2.Add(oItemSub);
+
+                }
                 //淇濆瓨
                 //淇濆瓨瀹屾瘯鍚庡鐞�
                 bool bResult;
                 if (oBill.omodel.HInterID == 0)
                 {
 
-                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                        bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                     if (bResult)
                     {
                         objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
@@ -862,14 +883,15 @@
                         string sReturn = "";
                         if (oSystemParameter.ShowBill(ref sReturn) == true)
                         {
-                            if (oSystemParameter.omodel.Sc_ICMOBillWorkQtyStatus_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
-                            {
-                                objJsonResult.Verify = "Y";
-                            }
-                            else
-                            {
-                                objJsonResult.Verify = "N";
-                            }
+                            objJsonResult.Verify = "Y";
+                            //if (oSystemParameter.omodel.Sc_ICMOBillWorkQtyStatus_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
+                            //{
+                            //    objJsonResult.Verify = "Y";
+                            //}
+                            //else
+                            //{
+                            //    objJsonResult.Verify = "N";
+                            //}
                         }
                     }
 
@@ -923,7 +945,14 @@
         {
             try
             {
-                ds = new SQLHelper.ClsCN().RunProcReturn("select * from Sc_ICMOBillStatus_Tmp" + sWhere, "Sc_ICMOBillStatus_Tmp");
+                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+                string HSourceID = dic["HSourceID"].ToString();
+                string HICMOBillNo = dic["HICMOBillNo"].ToString();
+                string HInterID = dic["HInterID"].ToString();
+                string Type = dic["type"].ToString();
+
+                ds = new SQLHelper.ClsCN().RunProcReturn("exec h_p_IpadIndexButton  '"+ HSourceID + "','" + HICMOBillNo + "','" + HInterID + "','" + Type + "'", "h_p_IpadIndexButton");
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     objJsonResult.code = "1";

--
Gitblit v1.9.1