Explorar o código

格式化代码

chenshudong hai 3 meses
pai
achega
3050e7000b
Modificáronse 27 ficheiros con 340 adicións e 251 borrados
  1. 3 2
      airport-common/src/main/java/com/sundot/airport/common/domain/portrait/BaseModuleIndicatorResult.java
  2. 21 9
      airport-common/src/main/java/com/sundot/airport/common/domain/portrait/IndicatorCalculateParams.java
  3. 8 5
      airport-common/src/main/java/com/sundot/airport/common/domain/portrait/ModularIndicatorResult.java
  4. 90 53
      airport-common/src/main/java/com/sundot/airport/common/enums/portrait/IndicatorType.java
  5. 23 17
      airport-common/src/main/java/com/sundot/airport/common/service/portrait/AbstractModuleIndicatorService.java
  6. 8 4
      airport-common/src/main/java/com/sundot/airport/common/service/portrait/Indicator.java
  7. 10 8
      airport-common/src/main/java/com/sundot/airport/common/service/portrait/ModuleIndicatorManager.java
  8. 4 2
      airport-common/src/main/java/com/sundot/airport/common/service/portrait/ModuleIndicatorService.java
  9. 9 9
      airport-item/src/main/java/com/sundot/airport/item/service/portrait/EffectiveSeizureCountIndicator.java
  10. 8 8
      airport-item/src/main/java/com/sundot/airport/item/service/portrait/ItemSeizureModuleIndicatorService.java
  11. 8 8
      airport-item/src/main/java/com/sundot/airport/item/service/portrait/ReferToPoliceCountIndicator.java
  12. 8 8
      airport-item/src/main/java/com/sundot/airport/item/service/portrait/WillfulConcealmentCountIndicator.java
  13. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/AdministrativePenaltyIndicator.java
  14. 16 9
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/AgeIndicator.java
  15. 16 15
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/AvailablePositionsIndicator.java
  16. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/EducationIndicator.java
  17. 16 9
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/PhysicalHealthIndicator.java
  18. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/PoliticalReviewIndicator.java
  19. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/PoliticalStatusIndicator.java
  20. 16 9
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/QualificationLevelIndicator.java
  21. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/SecurityWorkPositionIndicator.java
  22. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/SecurityWorkYearsIndicator.java
  23. 8 8
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/SystemModuleIndicatorService.java
  24. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/UserPortraitService.java
  25. 6 6
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/WorkPenaltiesIndicator.java
  26. 6 6
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/WorkRewardsIndicator.java
  27. 7 7
      airport-system/src/main/java/com/sundot/airport/system/service/portrait/WorkYearsIndicator.java

+ 3 - 2
airport-common/src/main/java/com/sundot/airport/common/domain/portrait/BaseModuleIndicatorResult.java

@@ -8,7 +8,7 @@ import lombok.Data;
8 8
  */
9 9
 @Data
10 10
 public class BaseModuleIndicatorResult {
11
-    
11
+
12 12
     /**
13 13
      * 模块名称
14 14
      */
@@ -21,7 +21,8 @@ public class BaseModuleIndicatorResult {
21 21
 
22 22
     /**
23 23
      * 设置指标错误信息
24
-     * @param name 指标名称
24
+     *
25
+     * @param name    指标名称
25 26
      * @param message 错误信息
26 27
      */
27 28
     public void setError(String name, String message) {

+ 21 - 9
airport-common/src/main/java/com/sundot/airport/common/domain/portrait/IndicatorCalculateParams.java

@@ -13,23 +13,33 @@ import java.util.List;
13 13
  */
14 14
 @Data
15 15
 public class IndicatorCalculateParams {
16
-    /** 用户ID */
16
+    /**
17
+     * 用户ID
18
+     */
17 19
     @ApiModelProperty(value = "用户ID")
18 20
     private Long userId;
19 21
 
20
-    /** 部门ID */
22
+    /**
23
+     * 部门ID
24
+     */
21 25
     @ApiModelProperty(value = "部门ID")
22 26
     private Long deptId;
23
-    
24
-    /** 用户类型 */
27
+
28
+    /**
29
+     * 用户类型
30
+     */
25 31
     @ApiModelProperty(value = "用户类型(personal:个人 team:班级 department:科级  station:站级 )")
26 32
     private String userTypeStr;
27 33
 
28
-    /** 计算开始时间 */
34
+    /**
35
+     * 计算开始时间
36
+     */
29 37
     @ApiModelProperty(value = "计算开始时间")
30 38
     private Date startTime;
31 39
 
32
-    /** 计算结束时间 */
40
+    /**
41
+     * 计算结束时间
42
+     */
33 43
     @ApiModelProperty(value = "计算结束时间")
34 44
     private Date endTime;
35 45
 
@@ -40,12 +50,14 @@ public class IndicatorCalculateParams {
40 50
     @ApiModelProperty(value = "指定要计算的模块列表(system,attendance,item)")
41 51
     private List<String> modules;
42 52
 
43
-    /** 用户类型枚举 */
53
+    /**
54
+     * 用户类型枚举
55
+     */
44 56
     private UserType userType;
45 57
 
46 58
     /**
47
-     *  指标类型列表,如果为空则计算所有指标
48
-     *  IndicatorType
59
+     * 指标类型列表,如果为空则计算所有指标
60
+     * IndicatorType
49 61
      */
50 62
     private List<String> indicatorTypes;
51 63
 

+ 8 - 5
airport-common/src/main/java/com/sundot/airport/common/domain/portrait/ModularIndicatorResult.java

@@ -11,34 +11,37 @@ import java.util.Map;
11 11
  */
12 12
 @Data
13 13
 public class ModularIndicatorResult {
14
-    
14
+
15 15
     /**
16 16
      * 模块指标结果映射
17 17
      * key: 模块名称
18 18
      * value: 模块指标结果
19 19
      */
20 20
     private Map<String, Object> moduleResults = new HashMap<>();
21
-    
21
+
22 22
     /**
23 23
      * 添加模块结果
24
+     *
24 25
      * @param moduleName 模块名称
25
-     * @param result 模块结果
26
+     * @param result     模块结果
26 27
      */
27 28
     public void addModuleResult(String moduleName, Object result) {
28 29
         this.moduleResults.put(moduleName, result);
29 30
     }
30
-    
31
+
31 32
     /**
32 33
      * 获取指定模块的结果
34
+     *
33 35
      * @param moduleName 模块名称
34 36
      * @return 模块结果
35 37
      */
36 38
     public Object getModuleResult(String moduleName) {
37 39
         return this.moduleResults.get(moduleName);
38 40
     }
39
-    
41
+
40 42
     /**
41 43
      * 获取所有模块结果
44
+     *
42 45
      * @return 模块结果映射
43 46
      */
44 47
     public Map<String, Object> getModuleResults() {

+ 90 - 53
airport-common/src/main/java/com/sundot/airport/common/enums/portrait/IndicatorType.java

@@ -4,83 +4,117 @@ package com.sundot.airport.common.enums.portrait;
4 4
  * 指标类型枚举
5 5
  */
6 6
 public enum IndicatorType {
7
-    
8
-    /** 资质等级 */
9
-    QUALIFICATION_LEVEL(1, "qualificationLevel", "资质等级","system"),
10
-    
11
-    /** 可上岗岗位 */
12
-    AVAILABLE_POSITIONS(2, "availablePositions", "可上岗岗位","system"),
13
-    
14
-    /** 政治面貌 */
15
-    POLITICAL_STATUS(3, "politicalStatus", "政治面貌","system"),
16
-    
17
-    /** 年龄 */
18
-    AGE(4, "age", "年龄","system"),
19
-    
20
-    /** 身体健康状况 */
21
-    PHYSICAL_HEALTH_STATUS(5, "physicalHealthStatus", "身体健康状况","system"),
22
-    
23
-    /** 政审通过情况 */
24
-    POLITICAL_REVIEW_STATUS(6, "politicalReviewStatus", "政审通过情况","system"),
25
-    
26
-    /** 行政类处罚情况 */
27
-    ADMINISTRATIVE_PENALTY(7, "administrativePenalty", "行政类处罚情况","system"),
28
-    
29
-    /** 学历情况 */
30
-    EDUCATION(8, "education", "学历情况","system"),
31
-    
32
-    /** 工作奖励 */
7
+
8
+    /**
9
+     * 资质等级
10
+     */
11
+    QUALIFICATION_LEVEL(1, "qualificationLevel", "资质等级", "system"),
12
+
13
+    /**
14
+     * 可上岗岗位
15
+     */
16
+    AVAILABLE_POSITIONS(2, "availablePositions", "可上岗岗位", "system"),
17
+
18
+    /**
19
+     * 政治面貌
20
+     */
21
+    POLITICAL_STATUS(3, "politicalStatus", "政治面貌", "system"),
22
+
23
+    /**
24
+     * 年龄
25
+     */
26
+    AGE(4, "age", "年龄", "system"),
27
+
28
+    /**
29
+     * 身体健康状况
30
+     */
31
+    PHYSICAL_HEALTH_STATUS(5, "physicalHealthStatus", "身体健康状况", "system"),
32
+
33
+    /**
34
+     * 政审通过情况
35
+     */
36
+    POLITICAL_REVIEW_STATUS(6, "politicalReviewStatus", "政审通过情况", "system"),
37
+
38
+    /**
39
+     * 行政类处罚情况
40
+     */
41
+    ADMINISTRATIVE_PENALTY(7, "administrativePenalty", "行政类处罚情况", "system"),
42
+
43
+    /**
44
+     * 学历情况
45
+     */
46
+    EDUCATION(8, "education", "学历情况", "system"),
47
+
48
+    /**
49
+     * 工作奖励
50
+     */
33 51
     WORK_REWARDS(9, "workRewards", "工作奖励", "system"),
34
-    
35
-    /** 工作处罚 */
52
+
53
+    /**
54
+     * 工作处罚
55
+     */
36 56
     WORK_PENALTIES(10, "workPenalties", "工作处罚", "system"),
37
-    
38
-    /** 工作年限 */
57
+
58
+    /**
59
+     * 工作年限
60
+     */
39 61
     WORK_YEARS(11, "workYears", "工作年限", "system"),
40
-    
41
-    /** 安检工作年限 */
62
+
63
+    /**
64
+     * 安检工作年限
65
+     */
42 66
     SECURITY_WORK_YEARS(12, "securityWorkYears", "安检工作年限", "system"),
43 67
 
44
-    /** 安检工作职务 */
68
+    /**
69
+     * 安检工作职务
70
+     */
45 71
     SECURITY_WORK_POSITION(13, "securityWorkPosition", "安检工作职务", "system"),
46
-    
47
-    /** 出勤天数 */
48
-    WORKING_DATE(14, "workingDate", "出勤天数",  "attendance"),
49
-    
50
-    /** 上岗时长 */
72
+
73
+    /**
74
+     * 出勤天数
75
+     */
76
+    WORKING_DATE(14, "workingDate", "出勤天数", "attendance"),
77
+
78
+    /**
79
+     * 上岗时长
80
+     */
51 81
     WORKING_HOURS(15, "workingHours", "上岗时长", "attendance"),
52
-    
53
-    /** 有效查获数量 */
82
+
83
+    /**
84
+     * 有效查获数量
85
+     */
54 86
     EFFECTIVE_SEIZURE_COUNT(16, "effectiveSeizureCount", "有效查获数量", "item"),
55
-    
56
-    /** 故意隐匿查获数量 */
87
+
88
+    /**
89
+     * 故意隐匿查获数量
90
+     */
57 91
     WILLFUL_CONCEALMENT_COUNT(17, "willfulConcealmentCount", "故意隐匿查获数量", "item"),
58
-    
59
-    /** 移交公安查获数量 */
60
-    REFER_TO_POLICE_COUNT(18, "referToPoliceCount", "移交公安查获数量", "item")
61 92
 
62
-    ;
63
-    
93
+    /**
94
+     * 移交公安查获数量
95
+     */
96
+    REFER_TO_POLICE_COUNT(18, "referToPoliceCount", "移交公安查获数量", "item");
97
+
64 98
     private final int id;
65 99
     private final String code;
66 100
     private final String description;
67 101
     private final String module;
68
-    
102
+
69 103
     IndicatorType(int id, String code, String description, String module) {
70 104
         this.id = id;
71 105
         this.code = code;
72 106
         this.description = description;
73 107
         this.module = module;
74 108
     }
75
-    
109
+
76 110
     public int getId() {
77 111
         return id;
78 112
     }
79
-    
113
+
80 114
     public String getCode() {
81 115
         return code;
82 116
     }
83
-    
117
+
84 118
     public String getDescription() {
85 119
         return description;
86 120
     }
@@ -88,9 +122,10 @@ public enum IndicatorType {
88 122
     public String getModule() {
89 123
         return module;
90 124
     }
91
-    
125
+
92 126
     /**
93 127
      * 根据代码获取枚举值
128
+     *
94 129
      * @param code 代码
95 130
      * @return 对应的枚举值,找不到返回null
96 131
      */
@@ -102,9 +137,10 @@ public enum IndicatorType {
102 137
         }
103 138
         return null;
104 139
     }
105
-    
140
+
106 141
     /**
107 142
      * 根据ID获取枚举值
143
+     *
108 144
      * @param id ID
109 145
      * @return 对应的枚举值,找不到返回null
110 146
      */
@@ -119,6 +155,7 @@ public enum IndicatorType {
119 155
 
120 156
     /**
121 157
      * 获取指定模块的指标类型列表
158
+     *
122 159
      * @param module 模块名称
123 160
      * @return 指标类型列表
124 161
      */

+ 23 - 17
airport-common/src/main/java/com/sundot/airport/common/service/portrait/AbstractModuleIndicatorService.java

@@ -18,47 +18,50 @@ import java.util.Set;
18 18
  * @param <T> 模块指标结果类型
19 19
  */
20 20
 public abstract class AbstractModuleIndicatorService<T extends BaseModuleIndicatorResult> implements ModuleIndicatorService {
21
-    
21
+
22 22
     private static final Logger log = LoggerFactory.getLogger(AbstractModuleIndicatorService.class);
23
-    
23
+
24 24
     /**
25 25
      * 创建模块特定的结果对象
26
+     *
26 27
      * @return 模块结果对象
27 28
      */
28 29
     protected abstract T createResult();
29
-    
30
+
30 31
     /**
31 32
      * 获取当前模块支持的指标类型
33
+     *
32 34
      * @return 指标类型列表
33 35
      */
34 36
     protected abstract Set<IndicatorType> getSupportedIndicatorTypes();
35
-    
37
+
36 38
     /**
37 39
      * 获取所有可用的指标
40
+     *
38 41
      * @return 指标集合
39 42
      */
40 43
     protected abstract Set<? extends Indicator<?>> getIndicators();
41
-    
44
+
42 45
     @Override
43 46
     public Object calculateIndicators(IndicatorCalculateParams params) {
44 47
         T result = createResult();
45 48
         result.setModuleName(getModuleName());
46
-        
49
+
47 50
         // 获取需要计算的指标类型列表
48 51
         List<IndicatorType> indicatorTypes = getIndicatorTypesToCalculate(params);
49
-        
52
+
50 53
         // 获取当前模块名称
51 54
         String currentModule = getModuleName();
52
-        
55
+
53 56
         // 检查是否指定了模块,如果指定了模块但不包含当前模块,则直接返回空结果
54
-        if (params.getModules() != null && !params.getModules().isEmpty() 
57
+        if (params.getModules() != null && !params.getModules().isEmpty()
55 58
                 && !params.getModules().contains(currentModule)) {
56 59
             return null;
57 60
         }
58
-        
61
+
59 62
         // 获取支持的指标类型
60 63
         Set<IndicatorType> supportedTypes = getSupportedIndicatorTypes();
61
-        
64
+
62 65
         for (IndicatorType indicatorType : indicatorTypes) {
63 66
             // 处理属于当前模块且被支持的指标类型
64 67
             if (currentModule.equals(indicatorType.getModule()) && supportedTypes.contains(indicatorType)) {
@@ -70,19 +73,20 @@ public abstract class AbstractModuleIndicatorService<T extends BaseModuleIndicat
70 73
                         // 注意:这里需要子类自己处理如何将指标值设置到结果对象中
71 74
                         setIndicatorResult(indicator, result);
72 75
                     } catch (Exception e) {
73
-                        log.error("指标计算出错: 指标名称={}, 模块={}, 错误信息={}", 
76
+                        log.error("指标计算出错: 指标名称={}, 模块={}, 错误信息={}",
74 77
                                 indicator.getName(), getModuleName(), e.getMessage(), e);
75 78
                         result.setError(indicator.getName(), e.getMessage());
76 79
                     }
77 80
                 }
78 81
             }
79 82
         }
80
-        
83
+
81 84
         return result;
82 85
     }
83
-    
86
+
84 87
     /**
85 88
      * 根据指标类型查找对应的指标实现
89
+     *
86 90
      * @param type 指标类型
87 91
      * @return 指标实现
88 92
      */
@@ -97,16 +101,18 @@ public abstract class AbstractModuleIndicatorService<T extends BaseModuleIndicat
97 101
         }
98 102
         return null;
99 103
     }
100
-    
104
+
101 105
     /**
102 106
      * 将指标值设置到结果对象中
107
+     *
103 108
      * @param indicator 指标
104
-     * @param result 结果对象
109
+     * @param result    结果对象
105 110
      */
106 111
     protected abstract void setIndicatorResult(Indicator<?> indicator, T result);
107
-    
112
+
108 113
     /**
109 114
      * 根据参数确定需要计算的指标类型列表
115
+     *
110 116
      * @param params 指标计算参数
111 117
      * @return 需要计算的指标类型列表
112 118
      */

+ 8 - 4
airport-common/src/main/java/com/sundot/airport/common/service/portrait/Indicator.java

@@ -7,31 +7,35 @@ import com.sundot.airport.common.domain.portrait.BaseModuleIndicatorResult;
7 7
 /**
8 8
  * 指标接口 - 所有具体指标类的父接口
9 9
  * 定义了指标类需要实现的基本方法
10
- * 
10
+ *
11 11
  * @param <T> 指标值的类型
12 12
  */
13 13
 public interface Indicator<T> {
14 14
     /**
15 15
      * 获取指标名称
16
+     *
16 17
      * @return 指标名称字符串
17 18
      */
18 19
     String getName();
19
-    
20
+
20 21
     /**
21 22
      * 获取指标值
23
+     *
22 24
      * @return 指标值
23 25
      */
24 26
     T getValue();
25 27
 
26
-    
28
+
27 29
     /**
28 30
      * 计算指标值(使用参数对象)
31
+     *
29 32
      * @param params 指标计算参数
30 33
      */
31
-     void calculate(IndicatorCalculateParams params);
34
+    void calculate(IndicatorCalculateParams params);
32 35
 
33 36
     /**
34 37
      * 将指标值设置到结果对象中
38
+     *
35 39
      * @param result 结果对象
36 40
      */
37 41
     void setResult(BaseModuleIndicatorResult result);

+ 10 - 8
airport-common/src/main/java/com/sundot/airport/common/service/portrait/ModuleIndicatorManager.java

@@ -17,28 +17,29 @@ import java.util.Set;
17 17
  */
18 18
 @Component
19 19
 public class ModuleIndicatorManager {
20
-    
20
+
21 21
     @Autowired
22 22
     private Set<ModuleIndicatorService> moduleIndicatorServices;
23
-    
23
+
24 24
     private Map<String, ModuleIndicatorService> moduleServiceMap = new HashMap<>();
25
-    
25
+
26 26
     @PostConstruct
27 27
     public void initModuleServiceMap() {
28 28
         for (ModuleIndicatorService service : moduleIndicatorServices) {
29 29
             moduleServiceMap.put(service.getModuleName(), service);
30 30
         }
31 31
     }
32
-    
32
+
33 33
     /**
34 34
      * 计算指定模块的指标
35
-     * @param params 指标计算参数
35
+     *
36
+     * @param params      指标计算参数
36 37
      * @param moduleNames 模块名称列表
37 38
      * @return 模块化指标结果
38 39
      */
39 40
     public ModularIndicatorResult calculateModuleIndicators(IndicatorCalculateParams params, List<String> moduleNames) {
40 41
         ModularIndicatorResult result = new ModularIndicatorResult();
41
-        
42
+
42 43
         if (moduleNames == null || moduleNames.isEmpty()) {
43 44
             // 计算所有模块的指标
44 45
             for (Map.Entry<String, ModuleIndicatorService> entry : moduleServiceMap.entrySet()) {
@@ -55,12 +56,13 @@ public class ModuleIndicatorManager {
55 56
                 }
56 57
             }
57 58
         }
58
-        
59
+
59 60
         return result;
60 61
     }
61
-    
62
+
62 63
     /**
63 64
      * 计算所有模块的指标
65
+     *
64 66
      * @param params 指标计算参数
65 67
      * @return 模块化指标结果
66 68
      */

+ 4 - 2
airport-common/src/main/java/com/sundot/airport/common/service/portrait/ModuleIndicatorService.java

@@ -7,15 +7,17 @@ import com.sundot.airport.common.domain.portrait.IndicatorCalculateParams;
7 7
  * 各个模块需要实现此接口来提供自己的指标计算服务
8 8
  */
9 9
 public interface ModuleIndicatorService {
10
-    
10
+
11 11
     /**
12 12
      * 获取模块名称
13
+     *
13 14
      * @return 模块名称
14 15
      */
15 16
     String getModuleName();
16
-    
17
+
17 18
     /**
18 19
      * 计算指标数据
20
+     *
19 21
      * @param params 指标计算参数
20 22
      * @return 指标结果
21 23
      */

+ 9 - 9
airport-item/src/main/java/com/sundot/airport/item/service/portrait/EffectiveSeizureCountIndicator.java

@@ -16,37 +16,37 @@ import java.util.Date;
16 16
 
17 17
 /**
18 18
  * 有效查获数量指标实现类
19
- * 个人:周期内数量    
19
+ * 个人:周期内数量
20 20
  * 组织:周期内总量
21 21
  */
22 22
 @Component
23 23
 public class EffectiveSeizureCountIndicator implements Indicator<Object> {
24
-    
24
+
25 25
     @Autowired
26 26
     private IItemSeizureStatsService itemSeizureStatsService;
27
-    
27
+
28 28
     private Object value;
29
-    
29
+
30 30
     @Override
31 31
     public String getName() {
32 32
         return IndicatorType.EFFECTIVE_SEIZURE_COUNT.getCode();
33 33
     }
34
-    
34
+
35 35
     @Override
36 36
     public Object getValue() {
37 37
         return value;
38 38
     }
39
-    
39
+
40 40
     @Override
41 41
     public void calculate(IndicatorCalculateParams params) {
42 42
         Long userId = params.getUserId();
43 43
         UserType userType = params.getUserType();
44 44
         Long deptId = params.getDeptId();
45
-        
45
+
46 46
         // 默认查询最近30天的数据
47 47
         Date endTime = params.getEndTime();
48 48
         Date startTime = params.getStartTime();
49
-        
49
+
50 50
         if (UserType.PERSONAL.equals(userType)) {
51 51
             // 个人:周期内数量
52 52
             this.value = itemSeizureStatsService.getPersonalEffectiveSeizureCount(userId, startTime, endTime);
@@ -64,7 +64,7 @@ public class EffectiveSeizureCountIndicator implements Indicator<Object> {
64 64
             this.value = itemSeizureStatsService.getTeamEffectiveSeizureCount(deptId, startTime, endTime);
65 65
         }
66 66
     }
67
-    
67
+
68 68
     @Override
69 69
     public void setResult(BaseModuleIndicatorResult result) {
70 70
         if (result instanceof ItemSeizureModuleIndicatorResult) {

+ 8 - 8
airport-item/src/main/java/com/sundot/airport/item/service/portrait/ItemSeizureModuleIndicatorService.java

@@ -16,17 +16,17 @@ import java.util.*;
16 16
  */
17 17
 @Service
18 18
 public class ItemSeizureModuleIndicatorService extends AbstractModuleIndicatorService<ItemSeizureModuleIndicatorResult> {
19
-    
19
+
20 20
     @Autowired
21 21
     private Set<Indicator<?>> indicators;
22
-    
22
+
23 23
     private Set<IndicatorType> supportedIndicatorTypes = new HashSet<>();
24
-    
24
+
25 25
     @Override
26 26
     public String getModuleName() {
27 27
         return "item";
28 28
     }
29
-    
29
+
30 30
     @PostConstruct
31 31
     public void initSupportedIndicatorTypes() {
32 32
         // 初始化支持的指标类型
@@ -39,22 +39,22 @@ public class ItemSeizureModuleIndicatorService extends AbstractModuleIndicatorSe
39 39
             }
40 40
         }
41 41
     }
42
-    
42
+
43 43
     @Override
44 44
     protected ItemSeizureModuleIndicatorResult createResult() {
45 45
         return new ItemSeizureModuleIndicatorResult();
46 46
     }
47
-    
47
+
48 48
     @Override
49 49
     protected Set<IndicatorType> getSupportedIndicatorTypes() {
50 50
         return supportedIndicatorTypes;
51 51
     }
52
-    
52
+
53 53
     @Override
54 54
     protected Set<Indicator<?>> getIndicators() {
55 55
         return indicators;
56 56
     }
57
-    
57
+
58 58
     @Override
59 59
     protected void setIndicatorResult(Indicator<?> indicator, ItemSeizureModuleIndicatorResult result) {
60 60
         // 直接调用指标的setResult方法,将值设置到结果对象中

+ 8 - 8
airport-item/src/main/java/com/sundot/airport/item/service/portrait/ReferToPoliceCountIndicator.java

@@ -16,33 +16,33 @@ import java.util.Date;
16 16
 
17 17
 /**
18 18
  * 移交公安查获数量指标实现类
19
- * 个人:周期内数量    
19
+ * 个人:周期内数量
20 20
  * 组织:周期内总量
21 21
  */
22 22
 @Component
23 23
 public class ReferToPoliceCountIndicator implements Indicator<Object> {
24
-    
24
+
25 25
     @Autowired
26 26
     private IItemSeizureStatsService itemSeizureStatsService;
27
-    
27
+
28 28
     private Object value;
29
-    
29
+
30 30
     @Override
31 31
     public String getName() {
32 32
         return IndicatorType.REFER_TO_POLICE_COUNT.getCode();
33 33
     }
34
-    
34
+
35 35
     @Override
36 36
     public Object getValue() {
37 37
         return value;
38 38
     }
39
-    
39
+
40 40
     @Override
41 41
     public void calculate(IndicatorCalculateParams params) {
42 42
         Long userId = params.getUserId();
43 43
         UserType userType = params.getUserType();
44 44
         Long deptId = params.getDeptId();
45
-        
45
+
46 46
         // 默认查询最近30天的数据
47 47
         Date endTime = params.getEndTime();
48 48
         Date startTime = params.getStartTime();
@@ -65,7 +65,7 @@ public class ReferToPoliceCountIndicator implements Indicator<Object> {
65 65
             this.value = itemSeizureStatsService.getTeamReferToPoliceCount(deptId, startTime, endTime);
66 66
         }
67 67
     }
68
-    
68
+
69 69
     @Override
70 70
     public void setResult(BaseModuleIndicatorResult result) {
71 71
         if (result instanceof ItemSeizureModuleIndicatorResult) {

+ 8 - 8
airport-item/src/main/java/com/sundot/airport/item/service/portrait/WillfulConcealmentCountIndicator.java

@@ -16,33 +16,33 @@ import java.util.Date;
16 16
 
17 17
 /**
18 18
  * 故意隐匿查获数量指标实现类
19
- * 个人:周期内数量    
19
+ * 个人:周期内数量
20 20
  * 组织:周期内总量
21 21
  */
22 22
 @Component
23 23
 public class WillfulConcealmentCountIndicator implements Indicator<Object> {
24
-    
24
+
25 25
     @Autowired
26 26
     private IItemSeizureStatsService itemSeizureStatsService;
27
-    
27
+
28 28
     private Object value;
29
-    
29
+
30 30
     @Override
31 31
     public String getName() {
32 32
         return IndicatorType.WILLFUL_CONCEALMENT_COUNT.getCode();
33 33
     }
34
-    
34
+
35 35
     @Override
36 36
     public Object getValue() {
37 37
         return value;
38 38
     }
39
-    
39
+
40 40
     @Override
41 41
     public void calculate(IndicatorCalculateParams params) {
42 42
         Long userId = params.getUserId();
43 43
         UserType userType = params.getUserType();
44 44
         Long deptId = params.getDeptId();
45
-        
45
+
46 46
         // 默认查询最近91天的数据
47 47
         Date endTime = params.getEndTime();
48 48
         Date startTime = params.getStartTime();
@@ -65,7 +65,7 @@ public class WillfulConcealmentCountIndicator implements Indicator<Object> {
65 65
             this.value = itemSeizureStatsService.getTeamWillfulConcealmentCount(deptId, startTime, endTime);
66 66
         }
67 67
     }
68
-    
68
+
69 69
     @Override
70 70
     public void setResult(BaseModuleIndicatorResult result) {
71 71
         if (result instanceof ItemSeizureModuleIndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/AdministrativePenaltyIndicator.java

@@ -19,26 +19,26 @@ import java.util.Objects;
19 19
  */
20 20
 @Component
21 21
 public class AdministrativePenaltyIndicator implements Indicator<Object> {
22
-    
22
+
23 23
     @Autowired
24 24
     private AdministrativePenaltyIndicatorMapper administrativePenaltyIndicatorMapper;
25
-    
25
+
26 26
     private Object value;
27
-    
27
+
28 28
     @Override
29 29
     public String getName() {
30 30
         return IndicatorType.ADMINISTRATIVE_PENALTY.getCode();
31 31
     }
32
-    
32
+
33 33
     @Override
34 34
     public Object getValue() {
35 35
         return value;
36 36
     }
37
-    
37
+
38 38
     @Override
39 39
     public void calculate(IndicatorCalculateParams params) {
40 40
         Long userId = params.getUserId();
41
-        UserType userType =params.getUserType();
41
+        UserType userType = params.getUserType();
42 42
         List<Long> userIds = params.getUserIds();
43 43
         if (UserType.PERSONAL.equals(userType)) {
44 44
             // 个人行政类处罚情况
@@ -48,7 +48,7 @@ public class AdministrativePenaltyIndicator implements Indicator<Object> {
48 48
             this.value = administrativePenaltyIndicatorMapper.queryOrgAdministrativePenaltyStats(userIds, userType);
49 49
         }
50 50
     }
51
-    
51
+
52 52
     @Override
53 53
     public void setResult(BaseModuleIndicatorResult result) {
54 54
         if (result instanceof IndicatorResult) {

+ 16 - 9
airport-system/src/main/java/com/sundot/airport/system/service/portrait/AgeIndicator.java

@@ -19,35 +19,42 @@ import java.util.List;
19 19
  */
20 20
 @Component
21 21
 public class AgeIndicator implements Indicator<Object> {
22
-    
23
-    /** 指标值 */
22
+
23
+    /**
24
+     * 指标值
25
+     */
24 26
     private Object value;
25
-    
26
-    /** 年龄数据访问对象 */
27
+
28
+    /**
29
+     * 年龄数据访问对象
30
+     */
27 31
     @Autowired
28 32
     private AgeIndicatorMapper mapper;
29
-    
33
+
30 34
     /**
31 35
      * 获取指标名称
36
+     *
32 37
      * @return 指标名称
33 38
      */
34 39
     @Override
35 40
     public String getName() {
36 41
         return IndicatorType.AGE.getCode();
37 42
     }
38
-    
43
+
39 44
     /**
40 45
      * 获取指标值
46
+     *
41 47
      * @return 指标值
42 48
      */
43 49
     @Override
44 50
     public Object getValue() {
45 51
         return value;
46 52
     }
47
-    
53
+
48 54
     /**
49 55
      * 计算指标值
50 56
      * 根据用户类型决定是计算个人年龄还是组织年龄统计
57
+     *
51 58
      * @param params 参数
52 59
      */
53 60
     @Override
@@ -60,10 +67,10 @@ public class AgeIndicator implements Indicator<Object> {
60 67
             this.value = mapper.queryPersonalAge(userId);
61 68
         } else {
62 69
             // 组织年龄统计
63
-            this.value = mapper.queryOrgAgeStats( userIds, userType);
70
+            this.value = mapper.queryOrgAgeStats(userIds, userType);
64 71
         }
65 72
     }
66
-    
73
+
67 74
     @Override
68 75
     public void setResult(BaseModuleIndicatorResult result) {
69 76
         if (result instanceof IndicatorResult) {

+ 16 - 15
airport-system/src/main/java/com/sundot/airport/system/service/portrait/AvailablePositionsIndicator.java

@@ -24,27 +24,27 @@ import java.util.stream.Collectors;
24 24
  */
25 25
 @Component
26 26
 public class AvailablePositionsIndicator implements Indicator<Object> {
27
-    
27
+
28 28
     @Autowired
29 29
     private AvailablePositionsIndicatorMapper availablePositionsIndicatorMapper;
30
-    
30
+
31 31
     private Object value;
32
-    
32
+
33 33
     @Override
34 34
     public String getName() {
35 35
         return IndicatorType.AVAILABLE_POSITIONS.getCode();
36 36
     }
37
-    
37
+
38 38
     @Override
39 39
     public Object getValue() {
40 40
         return value;
41 41
     }
42
-    
42
+
43 43
     @Override
44 44
     public void calculate(IndicatorCalculateParams params) {
45 45
         Long userId = params.getUserId();
46
-        UserType userType =params.getUserType();
47
-        List<Long> userIds =params.getUserIds();
46
+        UserType userType = params.getUserType();
47
+        List<Long> userIds = params.getUserIds();
48 48
         if (UserType.PERSONAL.equals(userType)) {
49 49
             // 个人可上岗岗位列表
50 50
             this.value = availablePositionsIndicatorMapper.queryPersonalAvailablePositions(userId);
@@ -53,9 +53,10 @@ public class AvailablePositionsIndicator implements Indicator<Object> {
53 53
             calculateOrgPositionCompetencyStats(userIds);
54 54
         }
55 55
     }
56
-    
56
+
57 57
     /**
58 58
      * 在服务层计算组织岗位胜任统计,避免复杂SQL
59
+     *
59 60
      * @param userIds 用户ID列表
60 61
      */
61 62
     private void calculateOrgPositionCompetencyStats(List<Long> userIds) {
@@ -64,34 +65,34 @@ public class AvailablePositionsIndicator implements Indicator<Object> {
64 65
         for (Long userId : userIds) {
65 66
             positionInfos.addAll(availablePositionsIndicatorMapper.queryPersonalAvailablePositions(userId));
66 67
         }
67
-        
68
+
68 69
         // 统计各岗位的胜任人数
69 70
         Map<String, Integer> positionCountMap = new HashMap<>();
70 71
         for (PositionInfo positionInfo : positionInfos) {
71 72
             String postName = positionInfo.getPostName();
72 73
             positionCountMap.put(postName, positionCountMap.getOrDefault(postName, 0) + 1);
73 74
         }
74
-        
75
+
75 76
         // 构造岗位胜任统计列表
76 77
         List<PositionCompetencyStats> stats = new ArrayList<>();
77 78
         int totalUserCount = userIds.size();
78
-        
79
+
79 80
         for (Map.Entry<String, Integer> entry : positionCountMap.entrySet()) {
80 81
             PositionCompetencyStats stat = new PositionCompetencyStats();
81 82
             stat.setPostName(entry.getKey());
82 83
             stat.setCompetentCount(entry.getValue());
83 84
             stat.setTotalCount(totalUserCount);
84
-            
85
+
85 86
             // 计算胜任比例
86 87
             double percentage = (double) entry.getValue() / totalUserCount;
87 88
             stat.setPercentage(Math.round(percentage * 100.0) / 100.0); // 保留两位小数
88
-            
89
+
89 90
             stats.add(stat);
90 91
         }
91
-        
92
+
92 93
         this.value = stats;
93 94
     }
94
-    
95
+
95 96
     @Override
96 97
     public void setResult(BaseModuleIndicatorResult result) {
97 98
         if (result instanceof IndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/EducationIndicator.java

@@ -18,26 +18,26 @@ import java.util.List;
18 18
  */
19 19
 @Component
20 20
 public class EducationIndicator implements Indicator<Object> {
21
-    
21
+
22 22
     @Autowired
23 23
     private EducationIndicatorMapper educationIndicatorMapper;
24
-    
24
+
25 25
     private Object value;
26
-    
26
+
27 27
     @Override
28 28
     public String getName() {
29 29
         return IndicatorType.EDUCATION.getCode();
30 30
     }
31
-    
31
+
32 32
     @Override
33 33
     public Object getValue() {
34 34
         return value;
35 35
     }
36
-    
36
+
37 37
     @Override
38 38
     public void calculate(IndicatorCalculateParams params) {
39 39
         Long userId = params.getUserId();
40
-        UserType userType =params.getUserType();
40
+        UserType userType = params.getUserType();
41 41
         List<Long> userIds = params.getUserIds();
42 42
         if (UserType.PERSONAL.equals(userType)) {
43 43
             // 个人学历情况
@@ -47,7 +47,7 @@ public class EducationIndicator implements Indicator<Object> {
47 47
             this.value = educationIndicatorMapper.queryOrgEducationStats(userIds, userType);
48 48
         }
49 49
     }
50
-    
50
+
51 51
     @Override
52 52
     public void setResult(BaseModuleIndicatorResult result) {
53 53
         if (result instanceof IndicatorResult) {

+ 16 - 9
airport-system/src/main/java/com/sundot/airport/system/service/portrait/PhysicalHealthIndicator.java

@@ -20,41 +20,48 @@ import java.util.Objects;
20 20
  */
21 21
 @Component
22 22
 public class PhysicalHealthIndicator implements Indicator<Object> {
23
-    
24
-    /** 指标值 */
23
+
24
+    /**
25
+     * 指标值
26
+     */
25 27
     private Object value;
26
-    
27
-    /** 身体健康状况数据访问对象 */
28
+
29
+    /**
30
+     * 身体健康状况数据访问对象
31
+     */
28 32
     @Autowired
29 33
     private PhysicalHealthIndicatorMapper mapper;
30
-    
34
+
31 35
     /**
32 36
      * 获取指标名称
37
+     *
33 38
      * @return 指标名称
34 39
      */
35 40
     @Override
36 41
     public String getName() {
37 42
         return IndicatorType.PHYSICAL_HEALTH_STATUS.getCode();
38 43
     }
39
-    
44
+
40 45
     /**
41 46
      * 获取指标值
47
+     *
42 48
      * @return 指标值
43 49
      */
44 50
     @Override
45 51
     public Object getValue() {
46 52
         return value;
47 53
     }
48
-    
54
+
49 55
     /**
50 56
      * 计算指标值
51 57
      * 根据用户类型决定是计算个人身体健康状况还是组织身体健康状况统计
58
+     *
52 59
      * @param params 用户ID、用户类型、部门ID
53 60
      */
54 61
     @Override
55 62
     public void calculate(IndicatorCalculateParams params) {
56 63
         Long userId = params.getUserId();
57
-        UserType userType =params.getUserType();
64
+        UserType userType = params.getUserType();
58 65
         List<Long> userIds = params.getUserIds();
59 66
         if (UserType.PERSONAL.equals(userType)) {
60 67
             // 个人身体健康状况
@@ -64,7 +71,7 @@ public class PhysicalHealthIndicator implements Indicator<Object> {
64 71
             this.value = mapper.queryOrgHealthStats(userIds, userType);
65 72
         }
66 73
     }
67
-    
74
+
68 75
     @Override
69 76
     public void setResult(BaseModuleIndicatorResult result) {
70 77
         if (result instanceof IndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/PoliticalReviewIndicator.java

@@ -18,26 +18,26 @@ import java.util.List;
18 18
  */
19 19
 @Component
20 20
 public class PoliticalReviewIndicator implements Indicator<Object> {
21
-    
21
+
22 22
     @Autowired
23 23
     private PoliticalReviewIndicatorMapper politicalReviewIndicatorMapper;
24
-    
24
+
25 25
     private Object value;
26
-    
26
+
27 27
     @Override
28 28
     public String getName() {
29 29
         return IndicatorType.POLITICAL_REVIEW_STATUS.getCode();
30 30
     }
31
-    
31
+
32 32
     @Override
33 33
     public Object getValue() {
34 34
         return value;
35 35
     }
36
-    
36
+
37 37
     @Override
38 38
     public void calculate(IndicatorCalculateParams params) {
39 39
         Long userId = params.getUserId();
40
-        UserType userType =params.getUserType();
40
+        UserType userType = params.getUserType();
41 41
         List<Long> userIds = params.getUserIds();
42 42
 
43 43
         if (UserType.PERSONAL.equals(userType)) {
@@ -48,7 +48,7 @@ public class PoliticalReviewIndicator implements Indicator<Object> {
48 48
             this.value = politicalReviewIndicatorMapper.queryOrgPoliticalReviewStats(userIds, userType);
49 49
         }
50 50
     }
51
-    
51
+
52 52
     @Override
53 53
     public void setResult(BaseModuleIndicatorResult result) {
54 54
         if (result instanceof IndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/PoliticalStatusIndicator.java

@@ -17,26 +17,26 @@ import java.util.List;
17 17
  */
18 18
 @Component
19 19
 public class PoliticalStatusIndicator implements Indicator<Object> {
20
-    
20
+
21 21
     private Object value;
22
-    
22
+
23 23
     @Autowired
24 24
     private PoliticalStatusIndicatorMapper mapper;
25
-    
25
+
26 26
     @Override
27 27
     public String getName() {
28 28
         return IndicatorType.POLITICAL_STATUS.getCode();
29 29
     }
30
-    
30
+
31 31
     @Override
32 32
     public Object getValue() {
33 33
         return value;
34 34
     }
35
-    
35
+
36 36
     @Override
37 37
     public void calculate(IndicatorCalculateParams params) {
38 38
         Long userId = params.getUserId();
39
-        UserType userType =params.getUserType();
39
+        UserType userType = params.getUserType();
40 40
         List<Long> userIds = params.getUserIds();
41 41
         if (UserType.PERSONAL.equals(userType)) {
42 42
             // 个人政治面貌
@@ -46,7 +46,7 @@ public class PoliticalStatusIndicator implements Indicator<Object> {
46 46
             this.value = mapper.queryOrgPoliticalStatusStats(userIds, userType);
47 47
         }
48 48
     }
49
-    
49
+
50 50
     @Override
51 51
     public void setResult(BaseModuleIndicatorResult result) {
52 52
         if (result instanceof IndicatorResult) {

+ 16 - 9
airport-system/src/main/java/com/sundot/airport/system/service/portrait/QualificationLevelIndicator.java

@@ -23,42 +23,49 @@ import java.util.stream.Collectors;
23 23
  */
24 24
 @Component
25 25
 public class QualificationLevelIndicator implements Indicator<Object> {
26
-    
27
-    /** 指标值 */
26
+
27
+    /**
28
+     * 指标值
29
+     */
28 30
     private Object value;
29
-    
30
-    /** 资质等级数据访问对象 */
31
+
32
+    /**
33
+     * 资质等级数据访问对象
34
+     */
31 35
     @Autowired
32 36
     private QualificationLevelIndicatorMapper mapper;
33 37
 
34
-    
38
+
35 39
     /**
36 40
      * 获取指标名称
41
+     *
37 42
      * @return 指标名称
38 43
      */
39 44
     @Override
40 45
     public String getName() {
41 46
         return IndicatorType.QUALIFICATION_LEVEL.getCode();
42 47
     }
43
-    
48
+
44 49
     /**
45 50
      * 获取指标值
51
+     *
46 52
      * @return 指标值
47 53
      */
48 54
     @Override
49 55
     public Object getValue() {
50 56
         return value;
51 57
     }
52
-    
58
+
53 59
     /**
54 60
      * 计算指标值
55 61
      * 根据用户类型决定是计算个人资质等级还是组织资质等级统计
62
+     *
56 63
      * @param params 用户ID、用户类型、部门ID
57 64
      */
58 65
     @Override
59 66
     public void calculate(IndicatorCalculateParams params) {
60 67
         Long userId = params.getUserId();
61
-        UserType userType =params.getUserType();
68
+        UserType userType = params.getUserType();
62 69
         List<Long> userIds = params.getUserIds();
63 70
         if (UserType.PERSONAL.equals(userType)) {
64 71
             // 个人资质等级
@@ -68,7 +75,7 @@ public class QualificationLevelIndicator implements Indicator<Object> {
68 75
             this.value = mapper.queryOrgQualificationLevelStats(userIds, userType);
69 76
         }
70 77
     }
71
-    
78
+
72 79
     @Override
73 80
     public void setResult(BaseModuleIndicatorResult result) {
74 81
         if (result instanceof IndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/SecurityWorkPositionIndicator.java

@@ -16,26 +16,26 @@ import org.springframework.stereotype.Component;
16 16
  */
17 17
 @Component
18 18
 public class SecurityWorkPositionIndicator implements Indicator<Object> {
19
-    
19
+
20 20
     @Autowired
21 21
     private SecurityWorkPositionIndicatorMapper securityWorkPositionIndicatorMapper;
22
-    
22
+
23 23
     private Object value;
24
-    
24
+
25 25
     @Override
26 26
     public String getName() {
27 27
         return IndicatorType.SECURITY_WORK_POSITION.getCode();
28 28
     }
29
-    
29
+
30 30
     @Override
31 31
     public Object getValue() {
32 32
         return value;
33 33
     }
34
-    
34
+
35 35
     @Override
36 36
     public void calculate(IndicatorCalculateParams params) {
37 37
         Long userId = params.getUserId();
38
-        UserType userType =params.getUserType();
38
+        UserType userType = params.getUserType();
39 39
         if (UserType.PERSONAL.equals(userType)) {
40 40
             // 个人在安检工作中担任过的最高职务
41 41
             this.value = securityWorkPositionIndicatorMapper.queryPersonalSecurityWorkPosition(userId);
@@ -44,7 +44,7 @@ public class SecurityWorkPositionIndicator implements Indicator<Object> {
44 44
             this.value = securityWorkPositionIndicatorMapper.queryOrgSecurityWorkPositionStats(params.getUserIds(), userType);
45 45
         }
46 46
     }
47
-    
47
+
48 48
     @Override
49 49
     public void setResult(BaseModuleIndicatorResult result) {
50 50
         if (result instanceof IndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/SecurityWorkYearsIndicator.java

@@ -16,26 +16,26 @@ import org.springframework.stereotype.Component;
16 16
  */
17 17
 @Component
18 18
 public class SecurityWorkYearsIndicator implements Indicator<Object> {
19
-    
19
+
20 20
     @Autowired
21 21
     private WorkExperienceIndicatorMapper workExperienceIndicatorMapper;
22
-    
22
+
23 23
     private Object value;
24
-    
24
+
25 25
     @Override
26 26
     public String getName() {
27 27
         return IndicatorType.SECURITY_WORK_YEARS.getCode();
28 28
     }
29
-    
29
+
30 30
     @Override
31 31
     public Object getValue() {
32 32
         return value;
33 33
     }
34
-    
34
+
35 35
     @Override
36 36
     public void calculate(IndicatorCalculateParams params) {
37 37
         Long userId = params.getUserId();
38
-        UserType userType =params.getUserType();
38
+        UserType userType = params.getUserType();
39 39
         if (UserType.PERSONAL.equals(userType)) {
40 40
             // 个人安检工作年限
41 41
             this.value = workExperienceIndicatorMapper.queryPersonalSecurityWorkYears(userId);
@@ -44,7 +44,7 @@ public class SecurityWorkYearsIndicator implements Indicator<Object> {
44 44
             this.value = workExperienceIndicatorMapper.queryOrgSecurityWorkYearsStats(params.getUserIds(), userType);
45 45
         }
46 46
     }
47
-    
47
+
48 48
     @Override
49 49
     public void setResult(BaseModuleIndicatorResult result) {
50 50
         if (result instanceof IndicatorResult) {

+ 8 - 8
airport-system/src/main/java/com/sundot/airport/system/service/portrait/SystemModuleIndicatorService.java

@@ -16,17 +16,17 @@ import java.util.*;
16 16
  */
17 17
 @Service
18 18
 public class SystemModuleIndicatorService extends AbstractModuleIndicatorService<IndicatorResult> {
19
-    
19
+
20 20
     @Autowired
21 21
     private Set<Indicator<?>> indicators;
22
-    
22
+
23 23
     private Set<IndicatorType> supportedIndicatorTypes = new HashSet<>();
24
-    
24
+
25 25
     @Override
26 26
     public String getModuleName() {
27 27
         return "system";
28 28
     }
29
-    
29
+
30 30
     @PostConstruct
31 31
     public void initSupportedIndicatorTypes() {
32 32
         // 初始化支持的指标类型
@@ -39,22 +39,22 @@ public class SystemModuleIndicatorService extends AbstractModuleIndicatorService
39 39
             }
40 40
         }
41 41
     }
42
-    
42
+
43 43
     @Override
44 44
     protected IndicatorResult createResult() {
45 45
         return new IndicatorResult();
46 46
     }
47
-    
47
+
48 48
     @Override
49 49
     protected Set<IndicatorType> getSupportedIndicatorTypes() {
50 50
         return supportedIndicatorTypes;
51 51
     }
52
-    
52
+
53 53
     @Override
54 54
     protected Set<Indicator<?>> getIndicators() {
55 55
         return indicators;
56 56
     }
57
-    
57
+
58 58
     @Override
59 59
     protected void setIndicatorResult(Indicator<?> indicator, IndicatorResult result) {
60 60
         // 直接调用指标的setResult方法,将值设置到结果对象中

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/UserPortraitService.java

@@ -15,27 +15,27 @@ import java.util.Set;
15 15
  */
16 16
 @Service
17 17
 public class UserPortraitService {
18
-    
18
+
19 19
     @Autowired
20 20
     private Set<Indicator<?>> indicators;
21
-    
21
+
22 22
     @Autowired
23 23
     private ModuleIndicatorManager moduleIndicatorManager;
24
-    
24
+
25 25
     /**
26 26
      * 获取模块化指标数据
27
-     * 
27
+     *
28 28
      * @param params 用户ID、用户类型、模块列表等参数
29 29
      * @return 模块化指标结果
30 30
      */
31 31
     public ModularIndicatorResult getIndicators(IndicatorCalculateParams params) {
32 32
         return moduleIndicatorManager.calculateAllModuleIndicators(params);
33 33
     }
34
-    
34
+
35 35
     /**
36 36
      * 获取指定模块的指标数据
37
-     * 
38
-     * @param params 用户ID、用户类型、模块列表等参数
37
+     *
38
+     * @param params      用户ID、用户类型、模块列表等参数
39 39
      * @param moduleNames 指定的模块名称列表
40 40
      * @return 模块化指标结果
41 41
      */

+ 6 - 6
airport-system/src/main/java/com/sundot/airport/system/service/portrait/WorkPenaltiesIndicator.java

@@ -18,22 +18,22 @@ import java.util.List;
18 18
  */
19 19
 @Component
20 20
 public class WorkPenaltiesIndicator implements Indicator<Object> {
21
-    
21
+
22 22
     @Autowired
23 23
     private RewardPenaltyIndicatorMapper rewardPenaltyIndicatorMapper;
24
-    
24
+
25 25
     private Object value;
26
-    
26
+
27 27
     @Override
28 28
     public String getName() {
29 29
         return IndicatorType.WORK_PENALTIES.getCode();
30 30
     }
31
-    
31
+
32 32
     @Override
33 33
     public Object getValue() {
34 34
         return value;
35 35
     }
36
-    
36
+
37 37
     @Override
38 38
     public void calculate(IndicatorCalculateParams params) {
39 39
         Long userId = params.getUserId();
@@ -47,7 +47,7 @@ public class WorkPenaltiesIndicator implements Indicator<Object> {
47 47
             this.value = rewardPenaltyIndicatorMapper.queryOrgWorkPenaltiesStats(userIds, userType);
48 48
         }
49 49
     }
50
-    
50
+
51 51
     @Override
52 52
     public void setResult(BaseModuleIndicatorResult result) {
53 53
         if (result instanceof IndicatorResult) {

+ 6 - 6
airport-system/src/main/java/com/sundot/airport/system/service/portrait/WorkRewardsIndicator.java

@@ -18,22 +18,22 @@ import java.util.List;
18 18
  */
19 19
 @Component
20 20
 public class WorkRewardsIndicator implements Indicator<Object> {
21
-    
21
+
22 22
     @Autowired
23 23
     private RewardPenaltyIndicatorMapper rewardPenaltyIndicatorMapper;
24
-    
24
+
25 25
     private Object value;
26
-    
26
+
27 27
     @Override
28 28
     public String getName() {
29 29
         return IndicatorType.WORK_REWARDS.getCode();
30 30
     }
31
-    
31
+
32 32
     @Override
33 33
     public Object getValue() {
34 34
         return value;
35 35
     }
36
-    
36
+
37 37
     @Override
38 38
     public void calculate(IndicatorCalculateParams params) {
39 39
         Long userId = params.getUserId();
@@ -47,7 +47,7 @@ public class WorkRewardsIndicator implements Indicator<Object> {
47 47
             this.value = rewardPenaltyIndicatorMapper.queryOrgWorkRewardsStats(userIds, userType);
48 48
         }
49 49
     }
50
-    
50
+
51 51
     @Override
52 52
     public void setResult(BaseModuleIndicatorResult result) {
53 53
         if (result instanceof IndicatorResult) {

+ 7 - 7
airport-system/src/main/java/com/sundot/airport/system/service/portrait/WorkYearsIndicator.java

@@ -16,26 +16,26 @@ import org.springframework.stereotype.Component;
16 16
  */
17 17
 @Component
18 18
 public class WorkYearsIndicator implements Indicator<Object> {
19
-    
19
+
20 20
     @Autowired
21 21
     private WorkExperienceIndicatorMapper workExperienceIndicatorMapper;
22
-    
22
+
23 23
     private Object value;
24
-    
24
+
25 25
     @Override
26 26
     public String getName() {
27 27
         return IndicatorType.WORK_YEARS.getCode();
28 28
     }
29
-    
29
+
30 30
     @Override
31 31
     public Object getValue() {
32 32
         return value;
33 33
     }
34
-    
34
+
35 35
     @Override
36 36
     public void calculate(IndicatorCalculateParams params) {
37 37
         Long userId = params.getUserId();
38
-        UserType userType =params.getUserType();
38
+        UserType userType = params.getUserType();
39 39
         if (UserType.PERSONAL.equals(userType)) {
40 40
             // 个人工作年限
41 41
             this.value = workExperienceIndicatorMapper.queryPersonalWorkYears(userId);
@@ -44,7 +44,7 @@ public class WorkYearsIndicator implements Indicator<Object> {
44 44
             this.value = workExperienceIndicatorMapper.queryOrgWorkYearsStats(params.getUserIds(), userType);
45 45
         }
46 46
     }
47
-    
47
+
48 48
     @Override
49 49
     public void setResult(BaseModuleIndicatorResult result) {
50 50
         if (result instanceof IndicatorResult) {