From 46514450d6d28cf83136ce63d62bd6dc383bae3e Mon Sep 17 00:00:00 2001 From: thinkgem Date: Wed, 22 Oct 2025 10:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3ExcelField=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E5=9C=A8get=E6=96=B9=E6=B3=95=E4=B8=8A=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BAwrong=20number=20of=20arguments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeesite/common/utils/excel/ExcelImport.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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); } } }