From 675d712b82ff244b5b05934cc54d7d389dc032c7 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 16 八月 2024 17:19:44 +0800
Subject: [PATCH] 增加PDA设备签到单保存方法

---
 WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs |  147 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 118 insertions(+), 29 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
index caba032..9e1745f 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
@@ -68,6 +68,56 @@
         }
         #endregion
 
+        #region 鍣ㄥ叿鐐规瑙勭▼鍗曞垪琛�
+        [Route("Sc_MouldDotCheckRuleBill/Sc_MouldDotCheckRuleListPDA")]
+        [HttpGet]
+        public object Sc_MouldDotCheckRuleListPDA(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+                //HlpBill com = JsonConvert.DeserializeObject<HlpBill>(sWhere.ToString());
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckRuleBillList", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = "select * from h_v_Sc_MouldDotCheckRuleListByMould where 1 = 1" + sWhere + " order by hmainid desc";
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckRuleListByMould");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+              
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 鍣ㄥ叿鐐规瑙勭▼ 淇濆瓨/缂栬緫
         /// <summary>
         /// 淇濆瓨妯″叿缁翠慨鍗�
@@ -83,8 +133,7 @@
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
-            string msg4 = sArray[2].ToString();
-            string msg5 = sArray[3].ToString();
+            string msg5 = sArray[2].ToString();
 
             string UserName = "";
             ListModels oListModels = new ListModels();
@@ -147,35 +196,35 @@
                     item.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
                     item.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
                     item.HRelationQty = 0;     //鍏宠仈鏁伴噺
-                    oBill.DetailCol.Add(item);
+                    oBill.DetailColl.Add(item);
 
                 }
 
 
-                //閰嶄欢椤硅〃浣撴暟鎹�
-                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
-                msg4 = msg4.Substring(1, msg4.Length - 2);
-                msg4 = msg4.Replace("\\", "");
-                msg4 = msg4.Replace("\n", "");  //\n
-                                                //msg2 = msg2.Replace("'", "鈥�");
-                List<Model.ClsSc_MouldDotCheckRuleBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckRuleBillSub_Item>();
-                ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckRuleBillSub_Item(msg4);
-                int j = 0;
-                foreach (Model.ClsSc_MouldDotCheckRuleBillSub_Item oItemSub in ls1)
-                {
+                ////閰嶄欢椤硅〃浣撴暟鎹�
+                ////鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                //msg4 = msg4.Substring(1, msg4.Length - 2);
+                //msg4 = msg4.Replace("\\", "");
+                //msg4 = msg4.Replace("\n", "");  //\n
+                //                                //msg2 = msg2.Replace("'", "鈥�");
+                //List<Model.ClsSc_MouldDotCheckRuleBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckRuleBillSub_Item>();
+                //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckRuleBillSub_Item(msg4);
+                //int j = 0;
+                //foreach (Model.ClsSc_MouldDotCheckRuleBillSub_Item oItemSub in ls1)
+                //{
 
-                    j++;
-                    oItemSub.HEntryID = j;
-                    //oItemSub.HCloseMan = "";       //琛屽叧闂�
-                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
-                    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+                //    j++;
+                //    oItemSub.HEntryID = j;
+                //    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                //    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                //    oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
 
-                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
-                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                //    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                //    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
 
-                    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
-                    oBill.DetailColl.Add(oItemSub);
-                }
+                //    oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                //    oBill.DetailColl.Add(oItemSub);
+                //}
 
 
                 //淇濆瓨
@@ -255,18 +304,19 @@
                 }
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鑾峰彇鐐规椤圭洰缂栬緫鏁版嵁
-                string sql = "select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰浠g爜 HDotCheckItemNumber,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜哄悕绉� HManagerName,瀛愬娉�2 HRemark from h_v_Sc_MouldDotCheckRuleBillSub where 1 = 1 " + Swhere + "";
+                string sql = "select * from h_v_Sc_MouldDotCheckRuleBillSub where 1 = 1 " + Swhere + "";
                 ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckRuleBillSub");
-                //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
-                string sql1 = "select 閰嶄欢ID HMaterID,閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,瀛愬娉�1 HRemark,鏍囧噯鐢ㄩ噺 HQtyMust from h_v_Sc_MouldDotCheckRuleBillSub_Item where 1 = 1 " + Swhere + "";
-                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldDotCheckRuleBillSub_Item");
+                ////鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                //string sql1 = "select 閰嶄欢ID HMaterID,閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,璁¢噺鍗曚綅浠g爜 HUnitNumber,璁¢噺鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,瀛愬娉�1 HRemark,鏍囧噯鐢ㄩ噺 HQtyMust from h_v_Sc_MouldDotCheckRuleBillSub_Item where 1 = 1 " + Swhere + "";
+                //ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldDotCheckRuleBillSub_Item");
 
                 list.Add(ds.Tables[0]);
-                list.Add(ds1.Tables[0]);
+                //list.Add(ds1.Tables[0]);
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
                 objJsonResult.list = list;
+                objJsonResult.data = ds.Tables[0];
             }
             catch (Exception e)
             {
@@ -342,5 +392,44 @@
             }
         }
         #endregion
+
+        #region[鍣ㄥ叿鐐规璁板綍琛紝閫夌偣妫�璁″垝鑾峰彇鐐规璁″垝娓呭崟淇℃伅]
+        [Route("Sc_MouldDotCheckPlanBill/Sc_MouldDotCheckPlanBill_PlanList")]
+        [HttpGet]
+        public object Sc_MouldDotCheckPlanBill_PlanList(string HInterID, string HDate)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheck_GetPlanList " + HInterID + ",'" + HDate + "'", "h_p_Sc_MouldDotCheck_GetPlanList");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹俊鎭紒";
+                    objJsonResult.data = ds.Tables[0];
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍙戠敓寮傚父锛屾病鏈夎繑鍥炰换浣曡鍒掞紒" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1