Commit 23e438b0 by s_guodong

优化自定义返回vo赋值问题

parent 48a9eb4c
......@@ -120,11 +120,9 @@ public class ReflectUtil {
} else if ("com.brilliance.mda.runtime.mda.impl.ModuleList".equals(type.getName())) {
// 取总条数total
ModuleList moduleList = (ModuleList) o;
log.info("moduleList====" + moduleList.getFullSize());
if (moduleList.getFullSize() >= 0) {
total = String.valueOf(moduleList.getFullSize());
}
// list数据类型
Class tType = ReflectUtil.getTType(f);
if (ReflectUtil.isPrimate(tType)) {
......@@ -133,13 +131,17 @@ public class ReflectUtil {
} else {
// 泛型是对象
List list = (List) o;
List dataList = new ArrayList(list.size());
for (Object data : list) {
Object o1 = tType.newInstance();
setValue2RespondVo(o1, tType, data, ReflectUtil.getTType(declaredField));
dataList.add(o1);
if (tType.equals(ReflectUtil.getTType(declaredField))) {
f.set(respondVo, list);
} else {
List dataList = new ArrayList(list.size());
for (Object data : list) {
Object o1 = tType.newInstance();
setValue2RespondVo(o1, tType, data, ReflectUtil.getTType(declaredField));
dataList.add(o1);
}
f.set(respondVo, dataList);
}
f.set(respondVo, dataList);
}
} else if ("java.util.List".equals(type.getName())) {
f.set(respondVo, 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