From 50de6a1901a72e5a70f405d9a24a54d7a67f4a7f Mon Sep 17 00:00:00 2001
From: wyb <1qaz@123>
Date: 星期五, 21 五月 2021 16:07:15 +0800
Subject: [PATCH] 1. LAYUI版:增加 电脑端 巡检记录单 单据编辑(新增修改删除功能)。 2.LAYUI版:增加 电脑端 首件检验单 单据编辑(新增修改删除功能)。
---
WebAPI/Controllers/WebAPIController.cs | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 204 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index a50a8aa..0ed6fa9 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -855,6 +855,55 @@
}
/// <summary>
+ /// 鑾峰彇宸ュ簭鍒楄〃
+ /// <summary>
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Web/GetProcList_Json")]
+ [HttpGet]
+ public object GetProcList_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 = sWhere + " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ ds = oCN.RunProcReturn("Select HItemID,HNumber 宸ュ簭浠g爜,HName 宸ュ簭 from Gy_Process where HStopflag=0 " + sWhere + " Order by HItemID ", "Gy_Process");
+ 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>
/// <returns></returns>
@@ -884,6 +933,161 @@
return objjson; ;
}
}
+
+ /// <summary>
+ /// 鑾峰彇涓嶈壇鍘熷洜鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetBadReasonList_Json")]
+ [HttpGet]
+ public object GetBadReasonList_Json(string BadReason)
+ {
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1";
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+ if (BadReason != "")
+ {
+ sWhere = sWhere + " and ( HNumber like '%" + BadReason + "%' or HName like '%" + BadReason + "%' ) ";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+
+ {
+ ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_BadReason where HStopflag=0 Order by HItemID ", "Gy_BadReason");
+ }
+ else
+ {
+ string sql1 = "Select HItemID,HNumber ,HName from Gy_BadReason where HStopflag=0 and HEndFlag=1 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "Gy_BadReason");
+ }
+
+ //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+
+
+ 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 = "0";
+ 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/GetPlanList_Json")]
+ [HttpGet]
+ public object GetPlanList_Json(string Billno)
+ {
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1";
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+ if (Billno != "")
+ {
+ sWhere = sWhere + " and ( 鍗曟嵁鍙� like '%" + Billno + "%' ) ";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+
+ {
+ ds = oCN.RunProcReturn("select hmainid,hsubid,鍗曟嵁鍙�,HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,HCenterID,宸ヤ綔涓績,瑙勬牸鍨嬪彿,璁″垝鏁伴噺 from h_v_Sc_ProcessPlanList", "h_v_Sc_ProcessPlanList");
+ }
+ else
+ {
+ string sql1 = "select hmainid,hsubid,鍗曟嵁鍙�,HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,HCenterID,宸ヤ綔涓績,瑙勬牸鍨嬪彿,璁″垝鏁伴噺 from h_v_Sc_ProcessPlanList where 1=1 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList");
+ }
+
+ //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+
+
+ 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 = "0";
+ 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/GetOrganizations")]
+ [HttpGet]
+ public object GetOrganizations()
+ {
+ try
+ {
+ ClsCN oCn = new ClsCN();
+ DataSet oDs = new DataSet();
+ //==========
+ oDs = oCn.RunProcReturn("select HItemID ID,Hname Name,HStopflag Stopflag from Xt_ORGANIZATIONS", "Xt_ORGANIZATIONS");
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛锛�";
+ objjson.data = oDs.Tables[0];
+ return objjson; ;
+ }
+ catch (Exception e)
+ {
+
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触锛佸紓甯�" + e.ToString();
+ objjson.data = null;
+ return objjson; ;
+ }
+ }
+
+
+
#endregion
}
--
Gitblit v1.9.1