Explorar o código

easyexcel注解翻译增加默认值

lengfaqiang %!s(int64=2) %!d(string=hai) anos
pai
achega
74c39026c0

+ 5 - 3
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/ExcelConverter.java

@@ -80,11 +80,13 @@ public class ExcelConverter implements Converter<String> {
             } else if (NumberConstant.TWO == status) {
                 Method codeOf = type.getMethod("getName", Integer.class);
                 invoke = codeOf.invoke(type, Integer.valueOf(value));
-            } else {
+            } else if (NumberConstant.THREE == status) {
                 Method codeOf = type.getMethod("getEntityByCode", Integer.class);
                 invoke = codeOf.invoke(type, value);
-                Method getName = invoke.getClass().getMethod("getDestination");
-                invoke = String.valueOf(getName.invoke(invoke));
+//                Method getName = invoke.getClass().getMethod("getDestination");
+//                invoke = String.valueOf(getName.invoke(invoke));
+            } else {
+                invoke = value;
             }
         } catch (NoSuchMethodException e) {
             log.info("NoSuchMethodException ERROR:{}", e.getMessage(), e);