Bläddra i källkod

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

leiy 11 månader sedan
förälder
incheckning
dbbf44c429

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

@@ -7,6 +7,7 @@ using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.Hub.Hubs;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
+using OASystem.API.OAMethodLib.Quartz.Business;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.PersonnelModule;
 using OASystem.Domain.Entities.Groups;
@@ -1706,6 +1707,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile _dto)
         {
+            DeleReminderMessage.PostMessageByWebhook();
             //GroupStatus_UserSimplelistView list = await _qiYeWeChatApiService.GroupStatus_GetUserList();
 
             //创建群聊

+ 17 - 6
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs

@@ -84,7 +84,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 
 <font color='comment'>- </font>当前团组费用待审核数量: {6}
 
-[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.QueueCount,info.TitleStr);
+[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/) ", info.TeamName, info.PriceModule, info.PriceName, info.Price, info.CreateUser, info.CreateDt, info.QueueCount, info.TitleStr);
 
             return result;
         }
@@ -173,22 +173,33 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             if (list_7day.Count > 0)
             {
                 teamNames1 = "";
-                list_7day.ForEach(s => teamNames1 += ">" + s.TeamName + "\n\n");
+                foreach (var item in list_7day)
+                {
+                    string startDt = item.VisitStartDate.ToString("yyyy-MM-dd");
+                    teamNames1 += ">(" + startDt + ")" + item.TeamName + " \n\n";
+                }
+
+                //list_7day.ForEach(s => teamNames1 += ">" + s.TeamName + "\n\n");
             }
 
             if (list_3day.Count > 0)
             {
                 teamNames2 = "";
-                list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");
+                foreach (var item in list_3day)
+                {
+                    string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
+                    teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";
+                }
+                //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");
             }
 
 
             string result = string.Format(@" `团组状态提醒`  
 
-><font color='warning'> - 下列团组将于7天出发:</font>
+><font color='warning'> - 下列团组将于7天出发:</font>
 {0}
 
-><font color='warning'> - 下列团组将于3天结束:</font>
+><font color='warning'> - 下列团组将于3天结束:</font>
 {1}
 
 <font color='info'>请注意检查合同、尾款状态</font>
@@ -367,7 +378,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <summary>
         /// [更新]一项费用待审核
         /// </summary>
-        public string TitleStr { get; set; } = "[新增]一项费用待审核"; 
+        public string TitleStr { get; set; } = "[新增]一项费用待审核";
     }
 
     public class GroupStatus_CreateModel

+ 12 - 6
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/DeleReminderMessage.cs

@@ -92,14 +92,20 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
         public static async void PostMessageByWebhook()
         {
             DateTime dtNow = DateTime.Now;
-            string add3day = dtNow.AddDays(3).ToString("yyyy-MM-dd"); //结束出访前3天
-            string add7day = dtNow.AddDays(7).ToString("yyyy-MM-dd"); //开始出访前1周
+            string now = dtNow.ToString("yyyy-MM-dd");
+            string add3day = dtNow.AddDays(2).ToString("yyyy-MM-dd"); //结束出访前3天(含今天)
+            string add7day = dtNow.AddDays(6).ToString("yyyy-MM-dd"); //开始出访7天内(含今天)
 
-            string sql = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) Where IsDel=0 And VisitEndDate ='{0}' Or VisitStartDate='{1}' ", add3day, add7day);
-            List<Grp_DelegationInfo> list_source = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
+            //string sql = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) Where IsDel=0 And VisitEndDate ='{0}' Or VisitStartDate='{1}' ", add3day, add7day);
+            //List<Grp_DelegationInfo> list_source = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
 
-            List<Grp_DelegationInfo> listAdd7day = list_source.Where(s => s.VisitStartDate.Equals(add7day)).ToList();
-            List<Grp_DelegationInfo> listAdd3day = list_source.Where(s => s.VisitEndDate.Equals(add3day)).ToList();
+
+
+            string sql7day = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) where IsDel = 0 And VisitStartDate Between '{0} 00:00:00' And  '{1} 23:59:59' Order By VisitStartDate Asc ", now, add7day);
+            string sql3day = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) where IsDel = 0 And VisitEndDate Between '{0} 00:00:00' And  '{1} 23:59:59' Order By VisitEndDate Asc ", now, add3day);
+
+            List<Grp_DelegationInfo> listAdd7day = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql7day).ToList();
+            List<Grp_DelegationInfo> listAdd3day = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql3day).ToList();
 
             await AppNoticeLibrary.SendChatMsg_GroupRemindersToCaiwu(listAdd7day, listAdd3day, QiyeWeChatEnum.CaiWuChat);