yumeng hace 5 años
padre
commit
efbfc604c9

+ 14 - 3
module-common/src/main/java/cn/com/ctop/common/module/enums/MaterialEnum.java

@@ -19,10 +19,12 @@ public enum MaterialEnum {
         this.height = height;
     }
 
-    public static Integer getTypeBySize(Integer width, Integer height) {
+    public static Integer getTypeBySize(Integer widthStr, Integer heightStr) {
         for (MaterialEnum material : MaterialEnum.values()) {
-            if (width == material.getWidth() && height == material.getHeight()) {
-                return material.type;
+            Integer width = material.getWidth();
+            Integer height = material.getHeight();
+            if (widthStr.equals(width) && heightStr.equals(height)) {
+                return material.getType();
             }
         }
 
@@ -53,4 +55,13 @@ public enum MaterialEnum {
     public void setHeight(Integer height) {
         this.height = height;
     }
+
+    @Override
+    public String toString() {
+        return "MaterialEnum{" +
+                "type=" + type +
+                ", width=" + width +
+                ", height=" + height +
+                '}';
+    }
 }