|
|
@@ -3,6 +3,7 @@ package com.yc.ship.module.trade.utils;
|
|
|
import com.yc.ship.module.trade.framework.annotation.ForUpdate;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
@@ -32,6 +33,11 @@ public class BeanUtils {
|
|
|
try {
|
|
|
Object newValue = field.get(newBean);
|
|
|
Object oldValue = field.get(oldBean);
|
|
|
+ if(newValue instanceof BigDecimal && oldValue instanceof BigDecimal) {
|
|
|
+ if(((BigDecimal) newValue).compareTo((BigDecimal) oldValue) == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!Objects.equals(newValue, oldValue)) {
|
|
|
//获取字段名称
|
|
|
builder.append(field.getAnnotation(ForUpdate.class).fieldName());
|