Commit 32582570 by s_guodong

优化自定义vo赋值 和 校验

parent 18b36fb0
...@@ -69,12 +69,17 @@ public class ReflectUtil { ...@@ -69,12 +69,17 @@ public class ReflectUtil {
declaredField.set(baseVo, o); declaredField.set(baseVo, o);
} else { } else {
// 对象类型 // 对象类型
Object typeO = type.newInstance(); if (type == f.getType()) {
String s = setValue2RequestVo(o, f.getType(), typeO, type); // 相同的class 直接赋值
if (!StringUtils.isBlank(s)) { declaredField.set(baseVo, o);
return s; } else {
Object typeO = type.newInstance();
String s = setValue2RequestVo(o, f.getType(), typeO, type);
if (!StringUtils.isBlank(s)) {
return s;
}
declaredField.set(baseVo, typeO);
} }
declaredField.set(baseVo, typeO);
} }
} catch (Exception e) { } catch (Exception e) {
// Class<?> superclass = baseVoClass.getSuperclass(); // Class<?> superclass = baseVoClass.getSuperclass();
......
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