|
@@ -1188,7 +1188,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
|
|
|
|
|
|
/// <summary>
|
|
|
/// 物资领用通知
|
|
|
- /// 接收者:人事相关人员
|
|
|
+ /// 接收者:审核节点相关审核人
|
|
|
/// </summary>
|
|
|
/// <param name="dataId"></param>
|
|
|
/// <param name="diId"></param>
|
|
@@ -1202,6 +1202,37 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
|
|
|
"208", //雷怡
|
|
|
"374", //罗颖
|
|
|
};
|
|
|
+
|
|
|
+ var isCheckValuable = false;
|
|
|
+ var valuableUserNames = new List<string>();
|
|
|
+
|
|
|
+ //根据审核节点的审核人,发送通知
|
|
|
+ var flow = _grpDeleRep._sqlSugar.Queryable<Sys_AuditFlow>().First(x => x.IsDel == 0 && x.BusinessType == 1 && x.BusinessId == dataId);
|
|
|
+ if (flow != null)
|
|
|
+ {
|
|
|
+ var auditNode = _grpDeleRep._sqlSugar
|
|
|
+ .Queryable<Sys_AuditTemplateNode>()
|
|
|
+ .First(x => x.IsDel == 0 && x.TemplateId == flow.TemplateId && x.Id == flow.CurrentNodeId);
|
|
|
+ if (auditNode != null)
|
|
|
+ {
|
|
|
+ var auditUserList = _grpDeleRep._sqlSugar.Queryable<Sys_AuditTemplateNodeUser>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.NodeId == auditNode.Id)
|
|
|
+ .Select(x => new {
|
|
|
+ x.UserId,
|
|
|
+ x.UserName
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
+ if (auditUserList.Any())
|
|
|
+ {
|
|
|
+ if (auditUserList.Count() > 1) isCheckValuable = true;
|
|
|
+
|
|
|
+ userIds.AddRange(auditUserList.Select(x => x.UserId.ToString()).ToList());
|
|
|
+ userIds = userIds.Distinct().ToList();
|
|
|
+ valuableUserNames.AddRange( auditUserList.Select(x => x.UserName).ToList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
|
|
|
var operationName = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && s.Id == operationId).First()?.CnName ?? "Unknown";
|
|
|
|
|
@@ -1233,14 +1264,20 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
|
|
|
foreach (var info in receiveDetails)
|
|
|
{
|
|
|
goodsMsg.AppendLine($">- {info.Name}:{info.Quantity:#0.00} {info.Unit}");
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
+ var groupLabel = string.Empty;
|
|
|
+ if (string.IsNullOrEmpty(groupName) || !groupName.Equals("-"))
|
|
|
+ {
|
|
|
+ groupLabel = $">团组归属:<font color='info'>{groupName}</font>";
|
|
|
+ }
|
|
|
|
|
|
+ //普通物品审批消息通知
|
|
|
string resMsg = string.Format(@" ` 物资领用申请通知 `
|
|
|
|
|
|
> ` {0} `提交物资领用申请:
|
|
|
|
|
|
->团组归属:<font color='info'>{1}</font>
|
|
|
+{1}
|
|
|
|
|
|
>**物资明细**
|
|
|
{2}
|
|
@@ -1249,11 +1286,47 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
|
|
|
|
|
|
[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ",
|
|
|
operationName,
|
|
|
-groupInfo?.TeamName ?? "-",
|
|
|
+groupLabel,
|
|
|
goodsMsg,
|
|
|
receiveInfo.Reason,
|
|
|
DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
|
|
|
|
|
|
+ //贵重物品审批消息通知
|
|
|
+ if (isCheckValuable)
|
|
|
+ {
|
|
|
+ var auditUserLabel = string.Empty;
|
|
|
+ foreach (var userName in valuableUserNames)
|
|
|
+ {
|
|
|
+ auditUserLabel += $"@{userName} ";
|
|
|
+ }
|
|
|
+
|
|
|
+ resMsg = string.Format(@" ` 【或签审批】物资领用(任一人审批即可)通知 `
|
|
|
+
|
|
|
+>{0}
|
|
|
+> ` {1} `提交物资领用申请,您被列为或签审批人:
|
|
|
+
|
|
|
+**或签规则**
|
|
|
+• 您与其他{2}人并行审批
|
|
|
+• 任意一人通过即视为本环节通过
|
|
|
+• 任意一人拒绝即视为终止流程
|
|
|
+
|
|
|
+{3}
|
|
|
+
|
|
|
+>**物资明细**
|
|
|
+{4}
|
|
|
+>用途:<font color='comment'>{5}</font>
|
|
|
+>申请时间:<font color='comment'>{6}</font>
|
|
|
+
|
|
|
+[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ",
|
|
|
+auditUserLabel,
|
|
|
+operationName,
|
|
|
+valuableUserNames.Count() - 1 ,
|
|
|
+groupLabel,
|
|
|
+goodsMsg,
|
|
|
+receiveInfo.Reason,
|
|
|
+DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
|
|
|
+ }
|
|
|
+
|
|
|
List<string> qwUserIdList = GetQiyeChatUserIdList(userIds);
|
|
|
ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendMessage_ToUser_Markdown(qwUserIdList, resMsg);
|
|
|
if (result.errcode != 0)
|
|
@@ -1272,7 +1345,7 @@ DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
|
|
|
{
|
|
|
string result = origin;
|
|
|
|
|
|
- if (Regex.Match(origin, @"\d+,?").Value.Length > 0)
|
|
|
+ if (Regex.Match(origin, @"\d +,?").Value.Length > 0)
|
|
|
{
|
|
|
string[] temparr = origin.Split(',');
|
|
|
string fistrStr = temparr[0];
|