This commit is contained in:
张秉卓
2026-03-19 17:58:59 +08:00
parent 8201c3578b
commit 3234f623ba
36 changed files with 5300 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package com.pictc.utils;
import com.xjrsoft.module.datalog.vo.CompareResultVo;
import org.apache.commons.collections4.CollectionUtils;
import java.lang.reflect.Field;
@ -31,6 +32,18 @@ public class ObjectDiffUtils {
return diffs;
}
public static <T> CompareResultVo<T> result(List<T> list) {
CompareResultVo<T> result = new CompareResultVo<>();
T newBean = list.get(0);
result.setNewBean(newBean);
if (list.size() > 1) {
T oldBean = list.get(1);
result.setOldBean(oldBean);
result.setDiffResultList(ObjectDiffUtils.compare(newBean, oldBean));
}
return result;
}
/**
* 递归比较对象字段
*/