|
|
@@ -8,6 +8,7 @@ import com.sundot.airport.exam.dto.AccuracyStatisticsDTO;
|
|
8
|
8
|
import com.sundot.airport.exam.dto.AccuracyStatisticsQueryDTO;
|
|
9
|
9
|
import com.sundot.airport.exam.service.IAccuracyStatisticsService;
|
|
10
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
11
|
+import org.springframework.cache.annotation.Cacheable;
|
|
11
|
12
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
12
|
13
|
import org.springframework.web.bind.annotation.*;
|
|
13
|
14
|
|
|
|
@@ -28,6 +29,11 @@ public class AccuracyStatisticsController extends BaseController {
|
|
28
|
29
|
/**
|
|
29
|
30
|
* 获取当前用户或指定部门的正确率统计
|
|
30
|
31
|
*/
|
|
|
32
|
+ @Cacheable(
|
|
|
33
|
+ value = "statistics_data",
|
|
|
34
|
+ keyGenerator = "statisticsKeyGenerator",
|
|
|
35
|
+ unless = "!T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isSuccess(#result) || T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isEmptyData(#result)"
|
|
|
36
|
+ )
|
|
31
|
37
|
@GetMapping
|
|
32
|
38
|
public AjaxResult getAccuracyStatistics(AccuracyStatisticsQueryDTO query) {
|
|
33
|
39
|
try {
|
|
|
@@ -42,6 +48,11 @@ public class AccuracyStatisticsController extends BaseController {
|
|
42
|
48
|
/**
|
|
43
|
49
|
* 获取指定用户的正确率统计
|
|
44
|
50
|
*/
|
|
|
51
|
+ @Cacheable(
|
|
|
52
|
+ value = "statistics_data",
|
|
|
53
|
+ keyGenerator = "statisticsKeyGenerator",
|
|
|
54
|
+ unless = "!T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isSuccess(#result) || T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isEmptyData(#result)"
|
|
|
55
|
+ )
|
|
45
|
56
|
@GetMapping("/user/{userId}")
|
|
46
|
57
|
public AjaxResult getUserAccuracyStatistics(@PathVariable Long userId, AccuracyStatisticsQueryDTO query) {
|
|
47
|
58
|
try {
|
|
|
@@ -56,6 +67,11 @@ public class AccuracyStatisticsController extends BaseController {
|
|
56
|
67
|
/**
|
|
57
|
68
|
* 获取聚合统计数据(管理员视角)
|
|
58
|
69
|
*/
|
|
|
70
|
+ @Cacheable(
|
|
|
71
|
+ value = "statistics_data",
|
|
|
72
|
+ keyGenerator = "statisticsKeyGenerator",
|
|
|
73
|
+ unless = "!T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isSuccess(#result) || T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isEmptyData(#result)"
|
|
|
74
|
+ )
|
|
59
|
75
|
@PreAuthorize("@ss.hasPermi('exam:daily:statistics:admin') or @ss.hasRole('test') or @ss.hasRole('zhijianke')")
|
|
60
|
76
|
@GetMapping("/aggregate")
|
|
61
|
77
|
public AjaxResult getAggregateStatistics(AccuracyStatisticsQueryDTO query) {
|
|
|
@@ -71,6 +87,11 @@ public class AccuracyStatisticsController extends BaseController {
|
|
71
|
87
|
/**
|
|
72
|
88
|
* 获取首页正确率排名
|
|
73
|
89
|
*/
|
|
|
90
|
+ @Cacheable(
|
|
|
91
|
+ value = "statistics_data",
|
|
|
92
|
+ keyGenerator = "statisticsKeyGenerator",
|
|
|
93
|
+ unless = "!T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isSuccess(#result) || T(com.sundot.airport.common.cache.StatisticsCacheConditionUtil).isEmptyData(#result)"
|
|
|
94
|
+ )
|
|
74
|
95
|
@GetMapping("/ranking")
|
|
75
|
96
|
public AjaxResult getAccuracyRanking(BaseLargeScreenQueryParamDto dto) {
|
|
76
|
97
|
try {
|