瀏覽代碼

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

Lyyyi 18 小時之前
父節點
當前提交
8f3bec631e

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

@@ -495,7 +495,7 @@ namespace OASystem.API.Controllers
                 userInfo.CnName, dto.CurrUserId, validGroupIds.Count, successCount);
 
             // 10. 操作成功 返回成功视图
-            var result = await GetGroupNamesByUserId(dto.CurrUserId,dto.DaysAgo);
+            var result = await GetGroupNamesByUserId(dto.CurrUserId, dto.DaysAgo);
 
             if (result is OkObjectResult okObjectResult)
             {
@@ -547,7 +547,7 @@ namespace OASystem.API.Controllers
             var existingFeeRecords = await _sqlSugar.Queryable<Grp_CreditCardPayment>()
                 .Where(x => x.DIId == dto.GroupId && x.IsDel == 0)
                 .Where(x => feeTypeIds.Contains(x.CTable))
-                .Select(x => new { x.CTable }) 
+                .Select(x => new { x.CTable })
                 .ToListAsync();
 
             if (existingFeeRecords.Count > 0)
@@ -1317,7 +1317,7 @@ namespace OASystem.API.Controllers
                     }
                 }
 
-                x.OperatorLabel = operatorNames.ToString().TrimEnd('\n', '\r'); 
+                x.OperatorLabel = operatorNames.ToString().TrimEnd('\n', '\r');
 
                 // 设置背景颜色为红色
                 // C表没数据并且没点提醒确认按钮(无成本费用按钮)的团组该行显示红色
@@ -9070,7 +9070,7 @@ FROM
                         var remarkLable = new StringBuilder();
                         //第二项描述
                         remarkLable.Append("备注:");
-                        if (!string.IsNullOrEmpty(_EnterExitCosts.TwoItemRemark)) remarkLable.AppendFormat( _EnterExitCosts.TwoItemRemark);
+                        if (!string.IsNullOrEmpty(_EnterExitCosts.TwoItemRemark)) remarkLable.AppendFormat(_EnterExitCosts.TwoItemRemark);
 
                         //汇率描述
                         if (peiceItemCurrencyInfos.Any())
@@ -9834,7 +9834,7 @@ FROM
 
                         //decimal cityTraffic =_EnterExitCosts.CityTranffic + _EnterExitCosts.CityTranffic1 + _EnterExitCosts.CityTranffic2;
                         designer.SetDataSource("cityTranffic", cityTrafficLabel);
-                       // designer.SetDataSource("sumCityTranffic", @$"{cityTraffic:#0.00} ");
+                        // designer.SetDataSource("sumCityTranffic", @$"{cityTraffic:#0.00} ");
 
                         string cell4Str1 = string.Empty;
                         if (_EnterExitCosts.SumJJC == 1) cell4Str1 += $"经济舱:{_EnterExitCosts.AirJJ:#0.00} 元/人;";
@@ -18322,6 +18322,8 @@ end as 'country'
                         try
                         {
                             await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.Diid);
+                            //机票预算群通知
+                            await AppNoticeLibrary.SendChatMsg_AirCostChat(dto.Diid, QiyeWeChatEnum.AirCostChat01);
                         }
                         catch (Exception)
                         {
@@ -28465,8 +28467,9 @@ ORDER BY
                 .Where(x => x.IsDel == 0)
                 .Where(x => conferenceTypeIds.Contains(x.TeamDid))
                 .OrderByDescending(x => x.VisitDate)
-                .Select(x => new { 
-                    x.Id, 
+                .Select(x => new
+                {
+                    x.Id,
                     x.TeamName,
                     HasChildData = SqlFunc.Subqueryable<Grp_ConferenceProcedures>()
                         .Where(child => child.DiId == x.Id) // 替换关联条件
@@ -28516,11 +28519,12 @@ ORDER BY
                    .Where(x => x.IsDel == 0)
                    .Where(x => conferenceTypeIds.Contains(x.TeamDid))
                    .OrderByDescending(x => x.VisitDate)
-                   .Select(x => new {
+                   .Select(x => new
+                   {
                        x.Id,
                        x.TeamName,
                        HasChildData = SqlFunc.Subqueryable<Grp_ConferenceProcedures>()
-                           .Where(child => child.DiId == x.Id) 
+                           .Where(child => child.DiId == x.Id)
                            .Any() // 判断子表是否存在数据
                    })
                    .ToListAsync();

+ 50 - 50
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -1711,75 +1711,75 @@ WHERE
 
         #region 团组状态通知
 
-        ///// <summary>
-        ///// 测试
-        ///// </summary>
-        ///// <param name="dto"></param>
-        ///// <returns></returns>
-        //[HttpPost]
-        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        //public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile dto)
-        //{
-        //    //List<string> templist = new List<string>() { 234.ToString() };
-        //    //await AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(14090, templist, QiyeWeChatEnum.TestChat);
+        // ///// <summary>
+        // ///// 测试
+        // ///// </summary>
+        // ///// <param name="dto"></param>
+        // ///// <returns></returns>
+        // [HttpPost]
+        // [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        // public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile dto)
+        // {
+        //     //    //List<string> templist = new List<string>() { 234.ToString() };
+        //     //    //await AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(14090, templist, QiyeWeChatEnum.TestChat);
 
-        //    //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.DiId); ;
+        //     //    //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.DiId); ;
 
 
-        //    //DeleReminderMessage.PostMessageByWebhook();
-        //    //GroupStatus_UserSimplelistView list = await _qiYeWeChatApiService.GroupStatus_GetUserList();
+        //     //    //DeleReminderMessage.PostMessageByWebhook();
+        //     //    //GroupStatus_UserSimplelistView list = await _qiYeWeChatApiService.GroupStatus_GetUserList();
 
-        //    //创建群聊
+        //     //    //创建群聊
 
-        //    //List<string> userList1 = new List<string>() { "Feint", "amy.zhu@pan-american-intl.com", "judy.zeng@pan-american-intl.com", "FuHongJin" };
-        //    //List<string> userList2 = new List<string>() {  "Feint", "ZhaoYaQi", "LiaoWenYa" };
-        //    //List<string> userList3 = new List<string>() {  "Feint", "amy.zhu@pan-american-intl.com", "judy.zeng@pan-american-intl.com", "FuHongJin", "ZhaoYaQi", "LiaoWenYa" };
+        //     //    //List<string> userList1 = new List<string>() { "Feint", "amy.zhu@pan-american-intl.com", "judy.zeng@pan-american-intl.com", "FuHongJin" };
+        //     //    //List<string> userList2 = new List<string>() {  "Feint", "ZhaoYaQi", "LiaoWenYa" };
+        //     List<string> userList3 = new List<string>() { "rongfeng.yuan", "zhaiyang" };
 
-        //    //GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("团组通知", "Feint", userList1, "CaiWuChat01");
-        //    //GroupStatus_CreateChatView rst2 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-国交部", "Feint", userList2, "GuoJiaoLeader01");
-        //    //GroupStatus_CreateChatView rst3 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-团组(公司客户)", "Feint", userList3, "CompanyCRMChat01");
+        //     //    //GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("团组通知", "Feint", userList1, "CaiWuChat01");
+        //     //    //GroupStatus_CreateChatView rst2 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-国交部", "Feint", userList2, "GuoJiaoLeader01");
+        //     GroupStatus_CreateChatView rst3 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-机票预算", "rongfeng.yuan", userList3, "AirCostChat01");
 
-        //    //推送消息(模板)
+        //     //    //推送消息(模板)
 
-        //    //List<string> userList = new List<string>() { "Feint", "huaju.liu", "johnny.yang@pan-american-intl.com" };
-        //    //List<string> userList = new List<string>() { "Feint", "johnny.yang@pan-american-intl.com" };
-        //    //GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("团组费用提示", "Feint", userList, "GuoJiaoChat01");
+        //     //    //List<string> userList = new List<string>() { "Feint", "huaju.liu", "johnny.yang@pan-american-intl.com" };
+        //     //    //List<string> userList = new List<string>() { "Feint", "johnny.yang@pan-american-intl.com" };
+        //     //    GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("团组费用提示", "Feint", userList, "GuoJiaoChat01");
 
-        //    //团组出发
-        //    //AppNoticeLibrary.SendUserMsg_GroupStatus_Create(2358, userList);
+        //     //    //团组出发
+        //     //    //AppNoticeLibrary.SendUserMsg_GroupStatus_Create(2358, userList);
 
-        //    //费用审核
-        //    //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(dto.DiId, QiyeWeChatEnum.TestChat);
+        //     //    //费用审核
+        //     //    //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(dto.DiId, QiyeWeChatEnum.TestChat);
 
-        //    //费用审核结果通知(通过情况下发送财务群)
-        //    //List<string> userList = new List<string>() { "234" };
-        //    //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
+        //     //    //费用审核结果通知(通过情况下发送财务群)
+        //     //    //List<string> userList = new List<string>() { "234" };
+        //     //    //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
 
-        //    //4、财务付款时:(1)对应版块人员【单独发,状态为已付款才发】
-        //    //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(dto.DiId, userList);
+        //     //    //4、财务付款时:(1)对应版块人员【单独发,状态为已付款才发】
+        //     //    //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(dto.DiId, userList);
 
-        //    //团组提醒财务群
-        //    //DateTime dtNow = DateTime.Now;
-        //    //List<Grp_DelegationInfo> listSource = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
-        //    //List<Grp_DelegationInfo> listAdd7day = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
-        //    //List<Grp_DelegationInfo> listAdd3day = new List<Grp_DelegationInfo>() { };
+        //     //    //团组提醒财务群
+        //     //    //DateTime dtNow = DateTime.Now;
+        //     //    //List<Grp_DelegationInfo> listSource = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
+        //     //    //List<Grp_DelegationInfo> listAdd7day = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
+        //     //    //List<Grp_DelegationInfo> listAdd3day = new List<Grp_DelegationInfo>() { };
 
-        //    //AppNoticeLibrary.SendChatMsg_GroupRemindersToCaiwu(listAdd7day, listAdd3day, QiyeWeChatEnum.TestChat);
+        //     //机票预算群通知
+        //     await AppNoticeLibrary.SendChatMsg_AirCostChat(dto.DiId, QiyeWeChatEnum.AirCostChat01);
 
+        //     //    //日付申请提醒财务群
+        //     //    //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(dto.DiId, QiyeWeChatEnum.CaiWuChat02);
+        //     //    //日付申请结果推送用户、成功通知财务群
+        //     //    //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(dto.DiId, userList, QiyeWeChatEnum.TestChat);
+        //     //    //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dto.DiId, userList);
 
-        //    //日付申请提醒财务群
-        //    //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(dto.DiId, QiyeWeChatEnum.CaiWuChat02);
-        //    //日付申请结果推送用户、成功通知财务群
-        //    //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(dto.DiId, userList, QiyeWeChatEnum.TestChat);
-        //    //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dto.DiId, userList);
+        //     //    //string q = "";
 
-        //    //string q = "";
+        //     //    DeleReminderMessage.PostMessageByWebhook_CRMStatistics();
 
-        //    DeleReminderMessage.PostMessageByWebhook_CRMStatistics();
 
-
-        //    return Ok(JsonView(true, "操作成功!"));
-        //}
+        //     return Ok(JsonView(true, "操作成功!"));
+        // }
 
         #endregion
 

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

@@ -48,6 +48,12 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// </summary>
         [Description("GuoJiaoChat01")]
         GuoJiaoChat01,
+
+        /// <summary>
+        /// 预算通知-机票群(机票、主管)
+        /// </summary>
+        [Description("AirCostChat01")]
+        AirCostChat01,
     }
 
     public class MarkdownLib
@@ -407,6 +413,30 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return result;
         }
 
+        /// <summary>
+        /// 成本通知发送给用户
+        /// </summary>
+        /// <returns></returns>
+        public static string GroupShare_ToAirUser(GroupShare_ToAirUserModel info)
+        {
+            string result = string.Format(@" `成本通知`  
+
+<font color='info'>团组成本费用已更新</font>
+
+>团组名称:{0}
+>预算费用:<font color='warning'>{2}</font>
+>更新时间:<font color='warning'>{1}</font>
+
+
+><font color='comment'>请注意在费用录入页面中核对成本信息</font>
+
+><font color='comment'>若无对应团组权限请联系国交部经理或信息部人员</font>
+
+ ", info.TeamName, info.RefreshDate, info.AirCost);
+
+            return result;
+        }
+
         /// <summary>
         /// 出入境费用明细更改通知发送给用户
         /// </summary>
@@ -653,6 +683,13 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         public string RefreshDate { get; set; }
     }
 
+    public class GroupShare_ToAirUserModel
+    {
+        public string TeamName { get; set; }
+        public string RefreshDate { get; set; }
+        public string AirCost { get; set; }
+    }
+
     public class DailyPayReminder_Pay_ToUserModel
     {
         public string PriceName { get; set; }

+ 43 - 0
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs

@@ -1127,6 +1127,8 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             //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()));
+
+            userIds.Add("235");
             List<string> qwUserIdList = GetQiyeChatUserIdList(userIds);
 
             GroupShare_ToUserModel info = new GroupShare_ToUserModel()
@@ -1213,6 +1215,47 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return true;
         }
 
+
+        #region 机票群预算通知
+
+        /// <summary>
+        /// 机票群预算通知
+        /// </summary>
+        /// <param name="diId"></param>
+        /// <param name="qwEnum"></param>
+        /// <returns></returns>
+        public static async Task<bool> SendChatMsg_AirCostChat(int diId, QiyeWeChatEnum qwEnum)
+        {
+
+            string chatId = qwEnum.GetEnumDescription();
+            Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId && s.IsDel == 0).First();
+            var groupcost = _grpDeleRep.Query<Grp_GroupCostParameter>(s => s.DiId == diId && s.IsDel == 0 && s.CostType == "A").First();
+
+            var info = new GroupShare_ToAirUserModel()
+            {
+                TeamName = groupInfo.TeamName,
+                RefreshDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
+                AirCost = @$"
+经济舱:{groupcost.JJCCB}元/人   {groupcost.JJCRS}人   共:{groupcost.JJCCB * groupcost.JJCRS}元
+公务舱:{groupcost.GWCCB}元/人   {groupcost.GWCRS}人   共:{groupcost.GWCCB * groupcost.GWCRS}元"
+            };
+
+            ResponseBase result = await _qiYeWeChatApiService.
+            GroupStatus_SendChatMsg_Markdown(chatId,
+            MarkdownLib.GroupShare_ToAirUser(info));
+
+            if (result.errcode != 0)
+            {
+                //抄送日志 
+                return false;
+            }
+
+            return true;
+        }
+
+
+        #endregion
+
         #endregion
 
         #region 任务通知