yuanrf 3 months ago
parent
commit
f48eecae4f
1 changed files with 9 additions and 2 deletions
  1. 9 2
      OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

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

@@ -2052,12 +2052,19 @@ namespace OASystem.API.Controllers
         /// 员工绩效组成结构获取
         /// </summary>
         /// <param name="userid"></param>
+        /// <param name="date"></param>
         /// <returns></returns>
         [HttpGet]
-        public IActionResult GetPerformanceList(int userid)
+        public IActionResult GetPerformanceList(int userid,string date)
         {
             var jw = JsonView(false);
 
+            if (!DateTime.TryParse(date,out DateTime date_Dt))
+            {
+                jw.Msg = "日期格式有误!";
+                return Ok(jw);
+            }
+
             string sql_CTE = $@"-- 定义递归查询的CTE
 WITH PerAssessmentSettingsCTE AS (
     -- 选择指定ID的记录作为起点
@@ -2108,7 +2115,7 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
 
             var List = _sqlSugar.Queryable<Per_AssessmentSetting>()
                         .LeftJoin<Per_AssessmentContentSetting>((a, b) => a.Id == b.AssessmentSettingId && b.IsDel == 0)
-                        .LeftJoin<Per_AssessmentScore>((a, b,c) => b.Id == c.AssessmentContentSettingId && c.IsDel == 0)
+                        .LeftJoin<Per_AssessmentScore>((a, b,c) => b.Id == c.AssessmentContentSettingId && c.IsDel == 0 && c.YearMonth.Year == date_Dt.Year && c.YearMonth.Month == date_Dt.Month)
                         .Where((a, b) => a.IsDel == 0 && ids.Contains(a.Id))
                         .Select((a, b, c) => new TreeNode
                         {