|
@@ -1339,6 +1339,72 @@ DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region 日服申请
|
|
|
+ /// <summary>
|
|
|
+ /// 日服申请、编辑通知
|
|
|
+ /// 接收者:指定接收者
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dataId"></param>
|
|
|
+ /// <param name="operationId">操作人Id</param>
|
|
|
+ /// <param name="recipients">接收者Id集合</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<bool> SendUserMsg_CompanyShare_ToDailtPay(int dataId, int operationId,List<string> recipients)
|
|
|
+ {
|
|
|
+ //企微通知
|
|
|
+ var userIds = recipients;
|
|
|
+
|
|
|
+ string operationName = _grpDeleRep._sqlSugar.Queryable<Sys_Users>().First(x => x.IsDel
|
|
|
+ == 0 && x.Id == operationId).CnName ?? "Unknown";
|
|
|
+
|
|
|
+ var dailyPaymentInfo = await _grpDeleRep._sqlSugar.Queryable<Fin_DailyFeePayment>()
|
|
|
+ .FirstAsync(x => x.IsDel == 0 && x.Id == dataId);
|
|
|
+
|
|
|
+ var details = await _grpDeleRep._sqlSugar.Queryable<Fin_DailyFeePaymentContent>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.DFPId == dataId)
|
|
|
+ .Select(x => new { x.PriceName, x.Quantity, x.Price })
|
|
|
+ .ToListAsync();
|
|
|
+ var detailsMsg = new StringBuilder();
|
|
|
+ foreach (var info in details)
|
|
|
+ {
|
|
|
+ detailsMsg.AppendLine($">- {info.PriceName}:{info.Quantity:#0.00} * {info.Price:#0.00} = {info.Quantity * info.Price:#0.00} 元");
|
|
|
+ }
|
|
|
+ if (detailsMsg.Length == 0 || detailsMsg == null)
|
|
|
+ {
|
|
|
+ detailsMsg.Append("无费用明细");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //普通物品审批消息通知
|
|
|
+ string resMsg = string.Format(@" ` 日付申请通知 `
|
|
|
+
|
|
|
+> ` {0} `提交费用申请:
|
|
|
+
|
|
|
+>**费用明细**
|
|
|
+{1}
|
|
|
+
|
|
|
+>总金额:<font color='comment'>{2} 元</font>
|
|
|
+>申请说明:<font color='comment'>{3}</font>
|
|
|
+>申请时间:<font color='comment'>{4}</font>
|
|
|
+
|
|
|
+[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ",
|
|
|
+operationName,
|
|
|
+detailsMsg.ToString(),
|
|
|
+dailyPaymentInfo?.SumPrice.ToString("#0.00") ?? "0.00",
|
|
|
+dailyPaymentInfo?.Instructions ?? "无申请说明",
|
|
|
+DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
|
|
|
+
|
|
|
+ List<string> qwUserIdList = GetQiyeChatUserIdList(recipients);
|
|
|
+ ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendMessage_ToUser_Markdown(qwUserIdList, resMsg);
|
|
|
+ if (result.errcode != 0)
|
|
|
+ {
|
|
|
+ //抄送日志
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region Helper
|
|
|
|
|
|
private static string getClientNameStr(List<SimplClientInfo> list, string origin)
|