From 71bd2d5c009d05ebade8dcbe77a71cd6c13d5d08 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 19 一月 2026 16:01:43 +0800
Subject: [PATCH] 新增 个推 消息推送 调用接口
---
WebAPI/Controllers/WebAPIController.cs | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 231 insertions(+), 2 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index c590ab1..e83bff7 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1424,6 +1424,48 @@
}
}
+ /// <summary>
+ /// 鑾峰彇鐢熶骇璧勬簮鍒楄〃涓嬫媺妗�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetSouceList_Select")]
+ [HttpGet]
+ public object GetSouceList_Select(string HMaterID,Int64 HOrgID)
+ {
+ sWhere = " and HStopFlag=0 and HUSEORGID =" + HOrgID + "";
+ try
+ {
+ string sql = "EXEC h_p_Gy_SouceList_PC " + HMaterID + ",'" + sWhere + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_Gy_SouceList_PC");
+
+ 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>
/// 鑾峰彇鑱屽憳鍒楄〃
@@ -20028,7 +20070,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");
//娣诲姞鍒楀悕
@@ -20245,6 +20287,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";
@@ -20840,6 +20930,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>
@@ -20875,6 +21039,9 @@
case "XJ":
HView = "h_v_Sb_EquipPatrolCheckBillList";
break;
+ case "PG": // 璁惧缁翠慨娲惧伐鍗�
+ HView = "h_v_Sb_EquipRepairSendWorkBillList";
+ break;
default:
objjson.code = "0";
objjson.count = 0;
@@ -20893,7 +21060,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)
@@ -23008,5 +23175,67 @@
}
}
#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
+ {
+ LogService.Write($@"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");
+ 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
}
}
--
Gitblit v1.9.1