|
@@ -44,7 +44,6 @@ public class BeanUtils {
|
|
for (Map.Entry<String, Object> entry : oldResult.entrySet()) {
|
|
for (Map.Entry<String, Object> entry : oldResult.entrySet()) {
|
|
Object oldValue = oldResult.get(entry.getKey());
|
|
Object oldValue = oldResult.get(entry.getKey());
|
|
Object newValue = newResult.get(entry.getKey());
|
|
Object newValue = newResult.get(entry.getKey());
|
|
- if (Objects.isNull(oldValue) && Objects.isNull(newValue)) continue;
|
|
|
|
if (Objects.isNull(newValue)) continue;
|
|
if (Objects.isNull(newValue)) continue;
|
|
Class<?> cls = newEntry.getClass();
|
|
Class<?> cls = newEntry.getClass();
|
|
Field field = cls.getDeclaredField(entry.getKey());
|
|
Field field = cls.getDeclaredField(entry.getKey());
|
|
@@ -52,7 +51,11 @@ public class BeanUtils {
|
|
FieldName fieldName = field.getDeclaredAnnotation(FieldName.class);
|
|
FieldName fieldName = field.getDeclaredAnnotation(FieldName.class);
|
|
boolean result = ObjectUtil.notEqual(oldValue, newValue);
|
|
boolean result = ObjectUtil.notEqual(oldValue, newValue);
|
|
if (result) {
|
|
if (result) {
|
|
- beforeBuilder.append(fieldName.name()).append(oldValue.toString());
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(oldValue)) {
|
|
|
|
+ beforeBuilder.append(fieldName.name()).append(":").append("--");
|
|
|
|
+ } else {
|
|
|
|
+ beforeBuilder.append(fieldName.name()).append(":").append(oldValue.toString());
|
|
|
|
+ }
|
|
afterBuilder.append(fieldName.name()).append(newValue.toString());
|
|
afterBuilder.append(fieldName.name()).append(newValue.toString());
|
|
resultMap.put("before", beforeBuilder.toString());
|
|
resultMap.put("before", beforeBuilder.toString());
|
|
resultMap.put("after", afterBuilder.toString());
|
|
resultMap.put("after", afterBuilder.toString());
|