| | |
| | | { |
| | | JObject NameMsgKVP = new JObject(); |
| | | ds = oCN.RunProcReturn($@" |
| | | select * from h_v_OA_WorkLinkBillAllList where hmainid = {HInterID} |
| | | select |
| | | CASE WHEN a.HBillStatus <= 1 THEN '创建' WHEN a.HBillStatus = 2 THEN '已审核' WHEN a.HBillStatus = 3 THEN '已关闭' |
| | | WHEN a.HBillStatus = 4 THEN '已作废' WHEN a.HBillStatus = 9 THEN '已完成' ELSE '' END AS 单据状态, |
| | | a.HBillNo AS 单据号, a.HBillType AS 单据类型, CONVERT(varchar(10), a.HDate, 120) AS 日期, a.HRemark AS 表头备注, |
| | | a.HDeptID, |
| | | a.HSendMan AS 发送人, a.HReceiveMan AS 接收人, |
| | | a.HCopyMan AS 所有抄送人, a.HHasten AS 催促次数, a.HLevel AS 紧急程度, |
| | | a.HContext AS 主题, a.HDescription AS 内容, a.HSendType AS 发送类型, a.HEvaluateStatusID, |
| | | a.HCommDate AS 建议完成日期, |
| | | a.HRelationInterID AS 关联单据内码, a.HRelationEntryID AS 关联单据子内码, a.HRelationBillType AS 关联单据类型, |
| | | a.HRelationBillNo AS 关联单据号, a.HMaker AS 制单人, a.HMakeDate AS 制单日期, a.HChecker AS 审核人, |
| | | a.HCheckDate AS 审核日期, a.HUpDater AS 修改人, a.HUpDateDate AS 修改日期, a.HCloseMan AS 关闭人, |
| | | a.HCloseDate AS 关闭日期, a.HDeleteMan AS 作废人, a.HDeleteDate AS 作废日期, a.HBillType |
| | | from OA_WorkLinkBillMain a where HInterID = {HInterID} |
| | | select * from Gy_UserClientIdRelation |
| | | ", "h_v_OA_WorkLinkBillAllList"); |
| | | ", "OA_WorkLinkBillMain"); |
| | | NotificationTemplate template = null; |
| | | ConcurrentDictionary<string, List<string>> userClientIDDictionary = new ConcurrentDictionary<string, List<string>>(); |
| | | // 将用户设备关联表 收集为 Map |
| | |
| | | { |
| | | 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()]; |
| | | } |
| | | // 获取接收人和抄送人数组 |
| | | string HReceiveMan = ds.Tables[0].Rows[0]["接收人"].ToString(); |
| | | string[] HCopyManList = ds.Tables[0].Rows[0]["所有抄送人"].ToString().Split(','); |
| | | // 推送给接收人 和 抄送人 |
| | | |
| | | List<string> clientIDList = new List<string>(); |
| | | if (userClientIDDictionary.ContainsKey(HReceiveMan)) |
| | | { |
| | | clientIDList.AddRange(userClientIDDictionary[HReceiveMan]); |
| | | } |
| | | |
| | | foreach(string clientID in clientIDList) |
| | | foreach(string HCopyMan in HCopyManList) |
| | | { |
| | | // 接收人 和 抄送人相同时, 不重复发送 |
| | | if(HCopyMan == HReceiveMan) |
| | | { |
| | | pushSuccess = PushMessageToSingle(template, clientID); |
| | | |
| | | continue; |
| | | } |
| | | } |
| | | if (userClientIDDictionary.ContainsKey(HCopyMan)) |
| | | { |
| | | clientIDList.AddRange(userClientIDDictionary[HCopyMan]); |
| | | } |
| | | } |
| | | foreach(string clientID in clientIDList) |
| | | { |
| | | pushSuccess = PushMessageToSingle(template, clientID); |
| | | |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | }else // 单独推送 |
| | | { |
| | | // 获取接收人和抄送人数组 |
| | | string HReceiveMan = ds.Tables[0].Rows[0]["接收人"].ToString(); |
| | | string[] HCopyManList = ds.Tables[0].Rows[0]["抄送人"].ToString().Split(','); |
| | | // 推送给接收人 和 抄送人 |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | |
| | | List<string> clientIDList = new List<string>(); |
| | | if (userClientIDDictionary.ContainsKey(HReceiveMan)) |
| | | { |
| | | List<string> clientIDList = new List<string>(); |
| | | if (userClientIDDictionary.ContainsKey(row["接收人"].ToString())) |
| | | clientIDList.AddRange(userClientIDDictionary[HReceiveMan]); |
| | | } |
| | | |
| | | foreach (string HCopyMan in HCopyManList) |
| | | { |
| | | if (userClientIDDictionary.ContainsKey(HCopyMan)) |
| | | { |
| | | clientIDList = userClientIDDictionary[row["接收人"].ToString()]; |
| | | clientIDList.AddRange(userClientIDDictionary[HCopyMan]); |
| | | } |
| | | else if (userClientIDDictionary.ContainsKey(row["抄送接收人"].ToString())) |
| | | } |
| | | |
| | | { |
| | | clientIDList = userClientIDDictionary[row["抄送接收人"].ToString()]; |
| | | } |
| | | foreach (string clientID in clientIDList) |
| | | { |
| | | pushSuccess = PushMessageToSingle(template, clientID); |
| | | |
| | | |
| | | foreach (string clientID in clientIDList) |
| | | { |
| | | pushSuccess = PushMessageToSingle(template, clientID); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |