From c5eecec4c618a9f0a981fdb99c5f6875973969c8 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 10 二月 2025 16:55:54 +0800
Subject: [PATCH] 职员,班组,工序,生产资源,工艺路线页面优化

---
 WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 112 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs
index 8c58423..5073cc8 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs
@@ -33,7 +33,7 @@
                 List<object> columnNameList = new List<object>();
 
                 //鏌ョ湅鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Check", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Query", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -67,6 +67,59 @@
                 objJsonResult.Message = "Sucess锛�";
                 objJsonResult.data = ds.Tables[0];
                 objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 璁惧寮�鏈哄崟鍒嗛〉鏌ヨ
+        [Route("Sb_EquipBeginBill/get锘縎b_EquipBeginBillListPage")]
+        [HttpGet]
+        public object Sb_EquipBeginBillListPage(string sWhere, string user, int page, int size)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                sWhere = sWhere.Replace("'", "''");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipBeginBillMainListPage " + page + "," + size + ",''", "h_p_Sb_EquipBeginBillMainListPage");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipBeginBillMainListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipBeginBillMainListPage");
+                }
+
+                //娣诲姞鍒楀悕
+                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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
                 return objJsonResult;
             }
             catch (Exception e)
@@ -210,7 +263,7 @@
 
                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                     oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
-                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now);
 
                     if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                     {
@@ -738,7 +791,63 @@
         }
         #endregion
 
-       
+        #region 璁惧寮�鏈哄崟鍒楄〃PDA 鏌ヨ       
+        [Route("Sb_EquipBeginBill/锘縎b_EquipBeginBillList_PDA")]
+        [HttpGet]
+        public object Sb_EquipBeginBillList_PDA(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
 
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ヨ澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipBeginBillList_PDA order by 鍗曟嵁鍙� desc", "锘縣_v_Sb_EquipBeginBillList_PDA");
+                }
+                else
+                {
+                    string sql1 = "select * from  h_v_Sb_EquipBeginBillList_PDA  where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+                    ds = oCN.RunProcReturn(sql, "锘縣_v_Sb_EquipBeginBillList_PDA");
+                }
+
+                //娣诲姞鍒楀悕
+                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 e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1