Commit 7ef7a334 by s_guodong

定制参数list 判空

parent 4e848cfb
...@@ -2,6 +2,7 @@ package com.ceb.gjjs.mda.util; ...@@ -2,6 +2,7 @@ package com.ceb.gjjs.mda.util;
import com.brilliance.mda.runtime.annotation.RelPath; import com.brilliance.mda.runtime.annotation.RelPath;
import com.brilliance.mda.runtime.mda.impl.ModuleList; import com.brilliance.mda.runtime.mda.impl.ModuleList;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -48,15 +49,17 @@ public class ReflectUtil { ...@@ -48,15 +49,17 @@ public class ReflectUtil {
List list = (List) o; List list = (List) o;
ModuleList moduleList = new ModuleList(); ModuleList moduleList = new ModuleList();
for (Object data : list) { if (!MdaUtils.isEmpty(list)) {
Object dataObj = moduleT.newInstance(); for (Object data : list) {
String s = setValue2RequestVo(data, listT, dataObj, moduleT); Object dataObj = moduleT.newInstance();
if (!StringUtils.isBlank(s)) { String s = setValue2RequestVo(data, listT, dataObj, moduleT);
return s; if (!StringUtils.isBlank(s)) {
return s;
}
moduleList.add(dataObj);
} }
moduleList.add(dataObj); declaredField.set(baseVo, moduleList);
} }
declaredField.set(baseVo, moduleList);
} else if ("java.util.List".equals(type.getName())) { } else if ("java.util.List".equals(type.getName())) {
// list数据类型 // list数据类型
declaredField.set(baseVo, o); declaredField.set(baseVo, o);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment