ソースを参照

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

Lyyyi 23 時間 前
コミット
0f845eea0c

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

@@ -3130,9 +3130,10 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
         /// <param name="start"></param>
         /// <param name="end"></param>
         /// <param name="createUserId"></param>
+        /// <param name="isMonthData"></param>
         /// <returns></returns>
         [HttpGet]
-        public async Task<IActionResult> AiPerformanceAnalysis_AllDepartmentAsync(int userId, DateTime start, DateTime end, int createUserId)
+        public async Task<IActionResult> AiPerformanceAnalysis_AllDepartmentAsync(int userId, DateTime start, DateTime end, int createUserId, bool isMonthData = false)
         {
             var jw = JsonView(false, "该员工暂无生成逻辑!");
             var user = await _sqlSugar.Queryable<Sys_Users>()
@@ -3176,7 +3177,14 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
             //职位
             if (jobHandlers.Keys.Contains(user.JobName))
             {
-                return await jobHandlers[user.JobName]();
+                if (isMonthData)
+                {
+                    return await this.AiPerformanceAnalysis_GuoJiaoAsync(userId, start, end, createUserId);
+                }
+                else
+                {
+                    return await jobHandlers[user.JobName]();
+                }
             }
 
             //部门

+ 3 - 2
OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/PerformanceJob.cs

@@ -45,7 +45,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Jobs
                 var now = DateTime.Now;
                 var lastMonth = now.AddMonths(-1);
                 var startDate = new DateTime(lastMonth.Year, lastMonth.Month, 1);
-                var endDate = new DateTime(lastMonth.Year, lastMonth.Month, DateTime.DaysInMonth(lastMonth.Year, lastMonth.Month), 23, 59, 59);
+                var endDate = new DateTime(now.Year, now.Month, 1);
 
                 _logger.LogInformation($"开始生成绩效数据,时间范围:{startDate:yyyy-MM-dd HH:mm:ss} 至 {endDate:yyyy-MM-dd HH:mm:ss}");
 
@@ -109,7 +109,8 @@ namespace OASystem.API.OAMethodLib.Quartz.Jobs
                             { "userId", user.Id.ToString() },
                             { "start", startDate.ToString("yyyy-MM-dd HH:mm:ss") },
                             { "end", endDate.ToString("yyyy-MM-dd HH:mm:ss") },
-                            { "createUserId", createUserId.ToString() }
+                            { "createUserId", createUserId.ToString() },
+                            { "isMonthData", "true" }
                         };
 
                         // 构建完整URL

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/Quartz/QuartzFactory.cs

@@ -1,4 +1,4 @@
-using OASystem.API.OAMethodLib.Quartz.Jobs;
+using OASystem.API.OAMethodLib.Quartz.Jobs;
 using Quartz;
 using Quartz.Spi;
 
@@ -47,7 +47,7 @@ namespace QuzrtzJob.Factory
                  .Build();
 
             var performanceTrigger = TriggerBuilder.Create()
-                .WithCronSchedule("0 0 5 1 * ?") //每月1号5点执行
+                .WithCronSchedule("0 0 8 3 * ?") // 每月3号8点执行
                 .Build();
 
             //5、创建任务