From 466de19b3db7e8003a4c8cf06dcd75366c844570 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 10 十一月 2023 13:53:37 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/WebAPIController.cs | 187 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 187 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 4e05ac2..6695dfb 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1838,6 +1838,57 @@
}
/// <summary>
+ /// 鑾峰彇閾惰鍒楄〃
+ /// <summary>
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Web/GetBankList_Json")]
+ [HttpGet]
+ public object GetBankList_Json(string sWhere)
+ {
+ DataSet ds;
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1";
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+ if (sWhere != "")
+ {
+ sWhere = " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = "select HItemID,HNumber 閾惰浠g爜,HName 閾惰鍚嶇О,HStopflag from Gy_Bank where 1=1 " + sWhere;
+ ds = oCN.RunProcReturn(sql, "Gy_Bank");
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触";
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "0";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception e)
+ {
+
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+
+ /// <summary>
/// 鑾峰彇鐗╂枡鍒楄〃
/// <summary>
///鍙傛暟锛歴tring sql銆�
@@ -4069,6 +4120,142 @@
return objjson;
}
}
+
+ /// <summary>
+ /// 鏍规嵁璁惧甯﹀嚭椤圭洰
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetItemByEquipFile")]
+ [HttpGet]
+ public object GetItemByEquipFile(int EquipProjectID,string Type)
+ {
+ if (EquipProjectID <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "浜у搧鍣ㄥ叿鏈�夋嫨";
+ objjson.data = null;
+ return objjson;
+ }
+ try
+ {
+ string HView = "";
+ switch (Type)
+ {
+ case "DJ":
+ HView = "h_v_Sb_GetDotCheckItemList";
+ break;
+ case "BY":
+ HView = "h_v_Sb_GetMaintainItemList";
+ break;
+ default:
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "璁惧妯″潡绫诲瀷閿欒锛�";
+ objjson.data = null;
+ return objjson;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
+ ds = oCN.RunProcReturn(sql, HView);
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触,鏌ユ棤鏁版嵁" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
+ /// 鏌ヨ鍚勭被璁惧鍗曟嵁鍒楄〃锛堣澶囩偣妫�锛岃澶囩淮淇紝璁惧淇濆吇......锛�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetEquipmentBillsList")]
+ [HttpGet]
+ public object GetEquipmentBillsList(string sWhere, string Type)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ string HView = "";
+ switch (Type)
+ {
+ case "DJ":
+ HView = "h_v_Sb_EquipDotCheckBillList";
+ break;
+ case "BY":
+ HView = "h_v_Sb_EquipMaintainBillList";
+ break;
+ case "WX":
+ HView = "h_v_Sb_EquipRepairCheckBillList";
+ break;
+ default:
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "璁惧妯″潡绫诲瀷閿欒锛�";
+ objjson.data = null;
+ return objjson;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = string.Format(@"select * from " + HView + " where 1 = 1 ");
+ ds = oCN.RunProcReturn(sql, HView);
+ //娣诲姞鍒楀悕
+ 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 == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触,鏌ユ棤鏁版嵁" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ objjson.list = columnNameList;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
/// <summary>
/// 鏍规嵁璁惧鐐规瑙勭▼鏄剧ず璁惧鐐规绋嬮」鐩�
/// </summary>
--
Gitblit v1.9.1