Bläddra i källkod

1.合并OCR冲突部分

leiy 9 månader sedan
förälder
incheckning
209fc73392

+ 13 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -7275,6 +7275,19 @@ namespace OASystem.API.Controllers
                     }
                     else
                     {
+                        #region 企微通知对应岗位用户
+                        try
+                        {
+                            AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.Diid);
+                        }
+                        catch (Exception ex)
+                        {
+
+                        }
+                        
+
+                        #endregion
+
                         msg = "通知成功,其他模块操作人员可见此成本信息!";
                     }
 

+ 2 - 0
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -1711,6 +1711,8 @@ namespace OASystem.API.Controllers
             //List<string> templist = new List<string>() { 234.ToString() };
             //await AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(14090, templist, QiyeWeChatEnum.TestChat);
 
+            await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(_dto.DiId); ;
+
 
             //DeleReminderMessage.PostMessageByWebhook();
             //GroupStatus_UserSimplelistView list = await _qiYeWeChatApiService.GroupStatus_GetUserList();

+ 31 - 0
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs

@@ -295,11 +295,42 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return result;
         }
 
+
+        /// <summary>
+        /// 成本通知发送给用户
+        /// </summary>
+        /// <returns></returns>
+        public static string GroupShare_ToUser(GroupShare_ToUserModel info)
+        {
+            string result = string.Format(@" `成本通知`  
+
+<font color='info'>团组成本费用已更新</font>
+
+>团组名称:{0}
+>更新时间:<font color='warning'>{1}</font>
+
+><font color='comment'>请注意在费用录入页面中核对成本信息</font>
+
+><font color='comment'>若无对应团组权限请联系国交部经理或信息部人员</font>
+
+ ", info.TeamName, info.RefreshDate);
+
+
+
+            return result;
+        }
+
     }
 
 
     #region 实体类
 
+    public class GroupShare_ToUserModel
+    {
+        public string TeamName { get; set; }
+        public string RefreshDate { get; set; }
+    }
+
     public class DailyPayReminder_Pay_ToUserModel
     {
         public string PriceName { get; set; }

+ 39 - 1
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs

@@ -641,7 +641,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 
             Sys_Users user = _grpDeleRep.Query<Sys_Users>(s => s.Id == fin_DailyFeePayment.CreateUserId).First();
             Sys_JobPost job = _grpDeleRep.Query<Sys_JobPost>(s => s.Id == user.JobPostId).First();
-            string users = string.Format(@"{0}-{1}", job.JobName, user.CnName );
+            string users = string.Format(@"{0}-{1}", job.JobName, user.CnName);
 
             string[] companyArr = new string[] { "未知", "成都泛美商务有限公司", "四川泛美交流有限公司", "成都纽茵教育科技有限公司", "成都鸿企中元科技有限公司", "测试公司1" };
             string companyStr = "未知";
@@ -782,6 +782,44 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return true;
         }
 
+        #endregion
+
+        #region 成本通知
+
+        /// <summary>
+        /// 成本通知发送给对应岗位用户
+        /// </summary>
+        /// <param name="diId"></param>
+        /// <returns></returns>
+        public static async Task<bool> SendUserMsg_GroupShare_ToJob(int diId)
+        {
+            Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
+            List<Sys_Users> list_user = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && (s.JobPostId == 24 || s.JobPostId == 25 || s.JobPostId == 28)).ToList();
+            //List<Sys_Users> list_user = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && (s.JobPostId == 40 || s.JobPostId == 41)).ToList();
+            List<string> userIds = new List<string>();
+            list_user.ForEach(s => userIds.Add(s.Id.ToString()));
+            List<string> qwUserIdList = GetQiyeChatUserIdList(userIds);
+
+            GroupShare_ToUserModel info = new GroupShare_ToUserModel()
+            {
+                RefreshDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
+                TeamName = groupInfo.TeamName
+            };
+
+            if (qwUserIdList.Count > 0)
+            {
+                ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendMessage_ToUser_Markdown(qwUserIdList, MarkdownLib.GroupShare_ToUser(info));
+                if (result.errcode != 0)
+                {
+                    //抄送日志 
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+
         #endregion
 
         #region Helper