From d6fbacc14f592f7fb8ce2afa854227e9ce98f84e Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期五, 27 二月 2026 10:09:11 +0800
Subject: [PATCH] 1
---
WebAPI/Service/GeTuiService.cs | 76 ++++++++++++++++++++++++++++++++++----
1 files changed, 68 insertions(+), 8 deletions(-)
diff --git a/WebAPI/Service/GeTuiService.cs b/WebAPI/Service/GeTuiService.cs
index 0e7b281..4dab471 100644
--- a/WebAPI/Service/GeTuiService.cs
+++ b/WebAPI/Service/GeTuiService.cs
@@ -9,7 +9,7 @@
using Newtonsoft.Json;
using com.igetui.api.openservice.igetui.template;
using com.igetui.api.openservice.igetui;
-using WebApiWithFleck;
+using System.Collections.Concurrent;
namespace WebAPI.Service
{
@@ -29,6 +29,9 @@
// 鎺ㄩ�佹湇鍔″疄渚�
private static IGtPush push = new IGtPush(HOST, APPKEY, MASTERSECRET);
+ private static Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+
+
// 鍗曟潯娑堟伅鎺ㄩ��
public static void PubishSingle(int HInterID)
{
@@ -43,6 +46,21 @@
select * from Gy_UserClientIdRelation
", "h_v_OA_WorkLinkBillAllList");
NotificationTemplate template = null;
+ ConcurrentDictionary<string, List<string>> userClientIDDictionary = new ConcurrentDictionary<string, List<string>>();
+ // 灏嗙敤鎴疯澶囧叧鑱旇〃 鏀堕泦涓� Map
+ if (ds.Tables[1].Rows.Count > 0)
+ {
+ foreach (DataRow row in ds.Tables[1].Rows)
+ {
+ if (userClientIDDictionary.ContainsKey(row["HUserName"].ToString())){
+ userClientIDDictionary[row["HUserName"].ToString()].Add(row["HClientID"].ToString());
+ }
+ else
+ {
+ userClientIDDictionary.TryAdd(row["HUserName"].ToString(), new List<string>() { row["HClientID"].ToString() });
+ }
+ }
+ }
if(ds.Tables[0].Rows.Count > 0)
{
string title = ds.Tables[0].Rows[0]["涓婚"].ToString();
@@ -53,20 +71,62 @@
// 骞挎挱
if(ds.Tables[0].Rows[0]["鍙戦�佺被鍨�"].ToString() == "鍏叡")
{
- // 閬嶅巻 鍏ㄦ帹閫�
- foreach(DataRow row in ds.Tables[1].Rows)
+ string sReturn = "";
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
{
- pushSuccess = PushMessageToSingle(template, row["HClientID"].ToString());
+ if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+ {
+ // 鎺ㄩ�佺粰鎺ユ敹浜� 鍜� 鎶勯�佷汉
+ foreach (DataRow row in ds.Tables[0].Rows)
+ {
+ List<string> clientIDList = new List<string>();
+ if (userClientIDDictionary.ContainsKey(row["鎺ユ敹浜�"].ToString()))
+ {
+ clientIDList = userClientIDDictionary[row["鎺ユ敹浜�"].ToString()];
+ }
+ else if (userClientIDDictionary.ContainsKey(row["鎶勯�佹帴鏀朵汉"].ToString()))
+ {
+ clientIDList = userClientIDDictionary[row["鎶勯�佹帴鏀朵汉"].ToString()];
+ }
+
+
+ foreach(string clientID in clientIDList)
+ {
+ pushSuccess = PushMessageToSingle(template, clientID);
+
+ }
+ }
+ }
+ else
+ {
+ // 閬嶅巻 鍏ㄦ帹閫�
+ foreach (DataRow row in ds.Tables[1].Rows)
+ {
+ pushSuccess = PushMessageToSingle(template, row["HClientID"].ToString());
+ }
+ }
}
}else // 鍗曠嫭鎺ㄩ��
{
// 鎺ㄩ�佺粰鎺ユ敹浜� 鍜� 鎶勯�佷汉
- foreach (DataRow row in ds.Tables[1].Rows)
+ foreach (DataRow row in ds.Tables[0].Rows)
{
- if(ds.Tables[0].Rows[0]["鎺ユ敹浜�"].ToString() == row["HUserName"].ToString()
- || ds.Tables[0].Rows[0]["鎶勯�佹帴鏀朵汉"].ToString() == row["HUserName"].ToString())
+ List<string> clientIDList = new List<string>();
+ if (userClientIDDictionary.ContainsKey(row["鎺ユ敹浜�"].ToString()))
{
- pushSuccess = PushMessageToSingle(template, row["HClientID"].ToString());
+ clientIDList = userClientIDDictionary[row["鎺ユ敹浜�"].ToString()];
+ }
+ else if (userClientIDDictionary.ContainsKey(row["鎶勯�佹帴鏀朵汉"].ToString()))
+
+ {
+ clientIDList = userClientIDDictionary[row["鎶勯�佹帴鏀朵汉"].ToString()];
+ }
+
+
+ foreach (string clientID in clientIDList)
+ {
+ pushSuccess = PushMessageToSingle(template, clientID);
+
}
}
}
--
Gitblit v1.9.1