diff --git a/common/src/main/java/com/jeesite/common/utils/excel/ExcelImport.java b/common/src/main/java/com/jeesite/common/utils/excel/ExcelImport.java index ae90da96..677198ed 100644 --- a/common/src/main/java/com/jeesite/common/utils/excel/ExcelImport.java +++ b/common/src/main/java/com/jeesite/common/utils/excel/ExcelImport.java @@ -538,15 +538,13 @@ public class ExcelImport implements Closeable { ReflectUtils.invokeSetter(e, ef.attrName(), val); }else{ if (os[1] instanceof Field){ - //ReflectUtils.invokeSetter(e, ((Field)os[1]).getName(), val); - ((Field)os[1]).set(e, val); + ReflectUtils.invokeSetter(e, ((Field)os[1]).getName(), val); }else if (os[1] instanceof Method){ - //String mthodName = ((Method)os[1]).getName(); - //if ("get".equals(mthodName.substring(0, 3))){ - // mthodName = "set"+StringUtils.substringAfter(mthodName, "get"); - //} - //ReflectUtils.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val}); - ((Method)os[1]).invoke(e, val); + String mthodName = ((Method)os[1]).getName(); + if ("get".equals(mthodName.substring(0, 3))){ + mthodName = "set"+mthodName.substring(3); + } + ReflectUtils.invokeMethodByAsm(e, mthodName, val); } } }