From 5283fa35215bc599aba8d4914d4ccb868da99596 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期五, 06 三月 2026 11:22:06 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/WebAPIController.cs | 489 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 482 insertions(+), 7 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 34d9c10..08a39b6 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1150,7 +1150,52 @@
}
}
+ /// <summary>
+ /// 鑾峰彇浠撳簱鍒楄〃 --娣诲姞妯″叿浠撳簱鏉′欢 鐢ㄤ簬鍙煡璇㈡ā鍏蜂粨搴�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetWarehouseList_Json_MJ")]
+ [HttpGet]
+ public object GetWarehouseList_Json_MJ(string Warehouse, Int64 HOrgID)
+ {
+ sWhere = " Where HStopFlag=0 and HEndFlag=1 and HWarehouseType='妯″叿浠撳簱' and HUSEORGID =" + HOrgID + "";
+ //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+ if (Warehouse != "")
+ {
+ sWhere = sWhere + " and ( HNumber like '%" + Warehouse + "%' or HName like '%" + Warehouse + "%' or HUSEORGID like '%" + Warehouse + "%' ) ";
+ }
+ try
+ {
+ WebS.WebService1 oWeb = new WebS.WebService1();
+ ds = oWeb.GetWarehouseList(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>
/// 鑾峰彇浠撲綅鍒楄〃
@@ -1466,14 +1511,68 @@
}
}
+ #region 鑾峰彇鑱屽憳鍒楄〃 (娣诲姞杞﹂棿绛涢��)
+ [Route("Web/GetEmployeeList_Json")]
+ [HttpGet]
+ public object GetEmployeeList_Json3(string Employee, Int64 HGroupID, Int64 HDeptID = -1)
+ {
+ // 缁欓儴闂�(杞﹂棿)ID璁剧疆榛樿鍊硷紝褰撴病鏈変紶鍏ュ�兼垨鑰呭�间负0鐨勬椂鍊欙紝璧版棫鏈夌殑鍑芥暟锛屽惁鍒欒蛋鏂扮殑閫昏緫
+ if(HDeptID == -1 || HDeptID == 0)
+ {
+ return GetEmployeeList_Json2(Employee, HGroupID);
+ }else
+ {
+ sWhere = $" Where HStopFlag=0 and HEndFlag=1 and HDeptID=${HDeptID}";
+
+ if(Employee != "")
+ {
+ sWhere += " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' )";
+ }
+ if(HGroupID != 0)
+ {
+ sWhere += " and HGroupID=" + HGroupID.ToString();
+ }
+
+ try
+ {
+ string sql = $"Select * from h_v_IF_Emp {sWhere} Order by HNumber";
+ ds = oCN.RunProcReturn(sql, "h_v_IF_Emp");
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ // 濡傛灉 閫掑叆 閮ㄩ棬娌℃湁缁存姢浜哄憳鍒楄〃 鍒欓檷绾т娇鐢ㄨ�佹柟妗�
+ return GetEmployeeList_Json2(Employee, HGroupID);
+ }
+ 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;
+ }
+
+ }
+ }
+ #endregion
+
/// <summary>
/// 鑾峰彇鑱屽憳鍒楄〃
/// </summary>
/// <returns></returns>
- [Route("Web/GetEmployeeList_Json")]
- [HttpGet]
- public object GetEmployeeList_Json(string Employee, Int64 HGroupID)
+ // [Route("Web/GetEmployeeList_Json")]
+ // [HttpGet]
+ public object GetEmployeeList_Json2(string Employee, Int64 HGroupID)
{
sWhere = " Where HStopFlag=0 and HEndFlag=1";
//sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
@@ -1492,11 +1591,11 @@
{
if (Employee != "")
{
- sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
+ sWhere = " Where HStopFlag=0 and HGroupID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
}
else
{
- sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString();
+ sWhere = " Where HStopFlag=0 and HGroupID=" + HGroupID.ToString();
}
}
try
@@ -1531,6 +1630,7 @@
}
}
+
/// <summary>
/// 鑾峰彇鐝鍒楄〃
@@ -20070,7 +20170,7 @@
List<object> columnNameList = new List<object>();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 " + sWhere + "Order by hmainid ";
+ string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 and HUSEORGID = "+OrganizationID + sWhere + "Order by hmainid ";
ds = oCN.RunProcReturn(sql, "h_v_Gy_GetSampleSchemeListView");
//娣诲姞鍒楀悕
@@ -20287,6 +20387,54 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
string sql = "exec h_p_Gy_GetQCCheckItemByProject " + CheckProjectID + "," + HBatchQty + "," + HMaterID + ",'" + HBillType + "'";
ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject");
+ 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>
+ /// 鏍规嵁妫�楠屾柟妗堜富鍐呯爜鑾峰彇妫�楠岄」鐩�,鍓嶉潰鐨勪細鎶婂厛鑾峰彇鐗╂枡鐨勯粯璁よ川妫�鏂规锛孉PP鍙牴鎹楠屾柟妗圛D鑾峰彇瀵瑰簲妫�楠岄」鐩�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetCheckItemByCheckProjectID_Sec")]
+ [HttpGet]
+ public object GetCheckItemByCheckProjectID_Sec(int CheckProjectID, int HBatchQty, int HMaterID, string HBillType)
+ {
+ //if (CheckProjectID <= 0)
+ //{
+ // objjson.code = "0";
+ // objjson.count = 0;
+ // objjson.Message = "妫�楠屾柟妗堟湭閫夋嫨";
+ // objjson.data = null;
+ // return objjson;
+ //}
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = "exec h_p_Gy_GetQCCheckItemByProject_Sec " + CheckProjectID + "," + HBatchQty + "," + HMaterID + ",'" + HBillType + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject_Sec");
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
objjson.code = "0";
@@ -20882,6 +21030,80 @@
}
}
+ #region
+ [Route("Web/GetMouldBillsList")]
+ [HttpGet]
+ public object GetMouldBillsList(string sWhere, string Type, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ string HView = "";
+ switch (Type)
+ {
+ case "RC": // 妯″叿缁翠慨妫�楠屽崟
+ HView = "h_v_Sc_MouldRepairCheckBillList";
+ break;
+ case "PG": // 妯″叿缁翠慨娲惧伐鍗�
+ HView = "h_v_Sc_MouldRepairSendWorkBill";
+ break;
+ default:
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "璁惧妯″潡绫诲瀷閿欒锛�";
+ objjson.data = null;
+ return objjson;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
+ if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"]) //鏄惁绠$悊鍛�
+ {
+ //涓嶆槸绠$悊鍛�
+ sWhere += " and 鍒跺崟浜� = '" + user + "'";
+ }
+
+
+ string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc, hmainid desc");
+ 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 = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇澶辫触,鏌ユ棤鏁版嵁";
+ 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;
+ }
+ }
+ #endregion
+
/// <summary>
/// 鏌ヨ鍚勭被璁惧鍗曟嵁鍒楄〃锛堣澶囩偣妫�锛岃澶囩淮淇紝璁惧淇濆吇......锛�
/// </summary>
@@ -20917,6 +21139,9 @@
case "XJ":
HView = "h_v_Sb_EquipPatrolCheckBillList";
break;
+ case "PG": // 璁惧缁翠慨娲惧伐鍗�
+ HView = "h_v_Sb_EquipRepairSendWorkBillList";
+ break;
default:
objjson.code = "0";
objjson.count = 0;
@@ -20935,7 +21160,7 @@
}
- string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere);
+ string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc, hmainid desc");
ds = oCN.RunProcReturn(sql, HView);
//娣诲姞鍒楀悕
foreach (DataColumn col in ds.Tables[0].Columns)
@@ -23050,5 +23275,255 @@
}
}
#endregion
+
+ #region 鐢ㄤ簬杩炴帴鐨勫仴搴峰害妫�楠岋紝鍙鑳借闂�氳繖涓帴鍙o紝鍒欒〃鏄庤繛鎺ュ彲鐢�
+ [Route("Health")]
+ [HttpGet]
+ public IHttpActionResult CheckHealth()
+ {
+ // 杩斿洖 200 鐘舵�佺爜 纭鍋ュ悍鐘舵��
+ return Ok();
+ }
+ #endregion
+
+ #region 鐧诲綍鐢ㄦ埛涓庤澶嘋lientID 鐨勫叧绯� 鍐欏叆鏁版嵁搴�
+ [Route("Web/SetGy_UserClientIdConnection")]
+ [HttpPost]
+ public object SetGy_UserClientIdConnection([FromBody] JObject msg)
+ {
+ DataSet ds;
+ oCN.BeginTran();
+ try
+ {
+ ds = oCN.RunProcReturn($@"exec h_p_SetGy_UserClientIdRelation
+ @HUserbm=N'{msg["HUserbm"].ToString()}',
+ @HUserName=N'{msg["HUserName"].ToString()}',
+ @HClientID=N'{msg["HClientID"].ToString()}',
+ @HOnline={msg["HOnline"].ToString()}
+ ", "h_p_SetGy_UserClientIdRelation");
+
+ if(ds.Tables[0].Rows[0]["HStatus"].ToString() == "1")
+ {
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨璁惧淇℃伅鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨璁惧淇℃伅澶辫触锛�" + ds.Tables[0].Rows[0]["msg"];
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }catch(Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨璁惧淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region APP 鏍规嵁妯″潡鑾峰彇璇ユā鍧椾笅闇�瑕佹樉绀烘秷鎭爣璇嗙殑瀛愭ā鍧�
+ [Route("Web/getMessageIdentified")]
+ [HttpGet]
+ public object getMessageIdentified(string user, string moduleName)
+ {
+ DataSet oDs = oCN.RunProcReturn($"exec h_p_getMessageIdentifier_APP '{user}', '{moduleName}'", "h_p_getMessageIdentifier_APP");
+ if(oDs == null || oDs.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇娑堟伅鏍囪瘑澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇娑堟伅鏍囪瘑鎴愬姛锛�";
+ objJsonResult.data = oDs.Tables[0];
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 妯″叿寰呬笂妯℃煡璇� 鑾峰彇
+ [Route("Web/getSc_MouldUpperAwaitQuery")]
+ [HttpGet]
+ public object getSc_MouldUpperAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
+ {
+ if(HBeginDate == "") // 榛樿7澶╅棿璺�
+ {
+ HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
+ }
+
+ if(HEndDate == "")
+ {
+ HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
+ }
+ List<object> columnNameList = new List<object>();
+ try
+ {
+ DataSet oDs = oCN.RunProcReturn($" exec h_p_Sc_MouldUpperAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Sc_MouldUpperAwaitQuery");
+ if(oDs == null || oDs.Tables[0].Rows.Count == 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触, 鍗曟嵁鏃犺繑鍥炲��!";
+ objjson.data = null;
+ return objjson;
+ }else
+ {
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in oDs.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = oDs.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+
+ }catch(Exception ex)
+ {
+ LogService.Write(ex.ToString());
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.Message.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+ #endregion
+
+ #region 寰呭紑宸ュ垪琛� 鑾峰彇
+ [Route("Web/getCj_StationInBillAwaitQuery")]
+ [HttpGet]
+ public object getCj_StationInBillAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
+ {
+ if (HBeginDate == "") // 榛樿7澶╅棿璺�
+ {
+ HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
+ }
+
+ if (HEndDate == "")
+ {
+ HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
+ }
+ List<object> columnNameList = new List<object>();
+ try
+ {
+ DataSet oDs = oCN.RunProcReturn($" exec h_p_Cj_StationInBillAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Cj_StationInBillAwaitQuery");
+ if (oDs == null || oDs.Tables[0].Rows.Count == 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触, 鍗曟嵁鏃犺繑鍥炲��!";
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in oDs.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = oDs.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+
+ }
+ catch (Exception ex)
+ {
+ LogService.Write(ex.ToString());
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.Message.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+ #endregion
+
+ #region 妯″叿寰呬笅妯℃煡璇� 鑾峰彇
+ [Route("Web/getSc_MouldLowerBillAwaitQuery")]
+ [HttpGet]
+ public object getSc_MouldLowerBillAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
+ {
+ if (HBeginDate == "") // 榛樿7澶╅棿璺�
+ {
+ HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
+ }
+
+ if (HEndDate == "")
+ {
+ HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
+ }
+ List<object> columnNameList = new List<object>();
+ try
+ {
+ DataSet oDs = oCN.RunProcReturn($" exec h_p_Sc_MouldLowerBillAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Sc_MouldLowerBillAwaitQuery");
+ if (oDs == null || oDs.Tables[0].Rows.Count == 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触, 鍗曟嵁鏃犺繑鍥炲��!";
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in oDs.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = oDs.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+
+ }
+ catch (Exception ex)
+ {
+ LogService.Write(ex.ToString());
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.Message.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+ #endregion
}
}
--
Gitblit v1.9.1