Ver Fonte

代码漏洞修复

gaoxiong há 1 ano atrás
pai
commit
a7a987ed90

+ 1 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/ScheduleConstants.java

@@ -35,7 +35,7 @@ public class ScheduleConstants
          */
         PAUSE("1");
 
-        private String value;
+        private final String value;
 
         private Status(String value)
         {

+ 7 - 6
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/RegisterBookType.java

@@ -2,9 +2,7 @@ package com.xunmei.common.core.enums;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.xunmei.common.core.json.EnumSerializer;
-import lombok.AllArgsConstructor;
 import lombok.Getter;
-import lombok.NoArgsConstructor;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -15,8 +13,6 @@ import java.util.Map;
  */
 
 @Getter
-@NoArgsConstructor
-@AllArgsConstructor
 @JsonSerialize(using = EnumSerializer.class)
 public enum RegisterBookType {
     SECURITY_PERFORMANCE(0, "安保履职登记簿"),
@@ -63,8 +59,13 @@ public enum RegisterBookType {
         }
     }
 
-    private int num;
-    private String text;
+    private final int num;
+    private final String text;
+
+    RegisterBookType(int num, String text) {
+        this.num = num;
+        this.text = text;
+    }
 
     /**
      * 根据code获取name

+ 6 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/drill/DrillPlanStatus.java

@@ -3,6 +3,10 @@ package com.xunmei.common.core.enums.drill;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
+/**
+ * @author gx
+ */
+
 @AllArgsConstructor
 @Getter
 public enum DrillPlanStatus {
@@ -11,7 +15,7 @@ public enum DrillPlanStatus {
     USING(1, "使用中"),
     DELETED(2, "停用"),
     ;
-    private int code;
+    private final int code;
 
-    private String desc;
+    private final String desc;
 }

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/edu/EduTrainingPlanStatus.java

@@ -11,7 +11,7 @@ public enum EduTrainingPlanStatus {
     USING(1, "使用中"),
     DELETED(2, "停用"),
     ;
-    private Integer code;
+    private final Integer code;
 
-    private String desc;
+    private final String desc;
 }

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/enums/PeriodEnum.java

@@ -10,9 +10,9 @@ public enum PeriodEnum {
     Nearly90Days(4, "近90天"),
     ThisYear(5, "今年");
 
-    private Integer code;
+    private final Integer code;
 
-    private String name;
+    private final String name;
 
     PeriodEnum(Integer code, String name) {
         this.code = code;

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/QuestionReformEnum.java

@@ -8,11 +8,12 @@ public enum QuestionReformEnum {
      */
     OverDue(12);
 
-    private Integer value;
+    private final Integer value;
 
     public Integer getValue(){
         return value;
     }
+
     QuestionReformEnum(Integer value){
         this.value=value;
     }

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/QuestionSrcType.java

@@ -3,7 +3,8 @@ package com.xunmei.core.question;
 public enum QuestionSrcType {
     Resumption(1),
     SafetyCheck(2);
-    private Integer value;
+
+    private final Integer value;
 
     public Integer getValue() {
         return value;

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/QuestionStepEnum.java

@@ -6,7 +6,7 @@ public enum QuestionStepEnum {
     confirmDissent(2),
     reform(11);
 
-    private Integer value;
+    private final Integer value;
 
     public Integer getValue() {
         return value;

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/enums/SafetyCheckTaskStatus.java

@@ -11,11 +11,12 @@ public enum SafetyCheckTaskStatus {
     //过期
     OverDue(4);
 
-    private Integer value;
+    private final Integer value;
 
     public Integer getValue(){
         return value;
     }
+
     SafetyCheckTaskStatus(Integer value){
         this.value=value;
     }

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/enums/SafetyTaskSourceType.java

@@ -16,9 +16,9 @@ public enum SafetyTaskSourceType {
      */
     TempTask(1, "临时检查");
 
-    private Integer code;
+    private final Integer code;
 
-    private String label;
+    private final String label;
 
     SafetyTaskSourceType(Integer code, String label) {
         this.code = code;