From 981e65a58c087f16fcff1777ea82f23759e84e5d Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 28 十月 2024 17:57:24 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs |   71 ++++++++++++++++++++++++++++++++++-
 1 files changed, 68 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
index 40649b5..c08f545 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
@@ -75,6 +75,70 @@
         }
         #endregion
 
+        #region 璁惧淇濆吇瑙勭▼鍗曞垪琛≒DA
+        [Route("Sb_EquipMaintainRuleBill/GetEquipMaintainRuleListPDA")]
+        [HttpGet]
+        public object GetEquipMaintainRuleListPDA(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainRuleBillList", 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_GetMaintainRuleListByEquip " + sWhere, "h_v_Sb_GetMaintainRuleListByEquip");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sb_GetMaintainRuleListByEquip where 1 = 1";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Sb_GetMaintainRuleListByEquip");
+                }
+
+                //娣诲姞鍒楀悕
+                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鍒楀璞$殑鍒楀悕
+                }
+                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 璁惧淇濆吇瑙勭▼璁板綍鍒犻櫎鍔熻兘
         [Route("Sb_EquipMaintainRuleBill/DeleteEquipMaintainRuleBillList")]
         [HttpGet]
@@ -99,9 +163,10 @@
                 return objJsonResult;
             }
             DLL.ClsSb_EquipMaintainRuleBill oBill = new DLL.ClsSb_EquipMaintainRuleBill();
-            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            ds = oCN.RunProcReturn("select * from Sb_EquipMaintainRuleBillMain where HInterID=" + HInterID, "Sb_EquipMaintainRuleBillMain");
+            if (ds.Tables[0].Rows.Count > 0)
             {
-                if (oBill.omodel.HBillStatus > 1)
+                if (DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -109,7 +174,7 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                if (oBill.omodel.HChecker != ""&& oBill.omodel.HChecker != null)
+                if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;

--
Gitblit v1.9.1