Browse Source

修复抽问抽答完成趋势对比-TEAM类型scopeType未处理导致返回大队级别数据

simonlll 3 days ago
parent
commit
c667b73568

+ 6 - 1
airport-admin/src/main/java/com/sundot/airport/web/controller/exam/DailyExamComparisonController.java

@@ -58,7 +58,7 @@ public class DailyExamComparisonController {
58 58
      * @param year               年份,默认当前年
59 59
      * @param quarter            季度 1-4,dateRangeQueryType=QUARTER 时有效
60 60
      * @param month              月份 1-12,dateRangeQueryType=MONTH 时有效
61
-     * @param scopeType          统计范围:STATION/BRIGADE/MANAGER/USER,不传则按登录角色自动判断
61
+     * @param scopeType          统计范围:STATION/BRIGADE/MANAGER/TEAM/USER,不传则按登录角色自动判断
62 62
      * @param scopeId            统计范围ID(deptId 或 userId)
63 63
      */
64 64
     @GetMapping("/completion-comparison")
@@ -228,6 +228,11 @@ public class DailyExamComparisonController {
228 228
         } else if ("BRIGADE".equals(scopeType) && scopeId != null) {
229 229
             return buildBrigadeSeriesList(scopeId, periods, hasChain, currentIdx);
230 230
 
231
+        } else if ("TEAM".equals(scopeType) && scopeId != null) {
232
+            List<Integer> counts = countByPeriods(periods, r -> countCompletedByDepartmentId(scopeId, r[0], r[1]));
233
+            return Collections.singletonList(
234
+                    buildSeriesItem(getDeptName(scopeId), scopeId, null, counts, currentIdx, hasChain));
235
+
231 236
         } else {
232 237
             Long stationDeptId = ("STATION".equals(scopeType) && scopeId != null) ? scopeId : userDeptId;
233 238
             if (isStation || "STATION".equals(scopeType)) {