Bläddra i källkod

修复对象判断

2507040827 3 veckor sedan
förälder
incheckning
b99dccd206

+ 17 - 9
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/AitagTagInfoEntity.java

@@ -116,15 +116,23 @@ public class AitagTagInfoEntity {
 
 
     public boolean valueEqualsValue(AitagTagInfoEntity that) {
-        return  Objects.equals(categoryId, that.categoryId)
-                && Objects.equals(tagNm, that.tagNm)
-                && Objects.equals(tagCode, that.tagCode)
-                && Objects.equals(tagRemark, that.tagRemark)
-                && Objects.equals(parentId, that.parentId)
-                && Objects.equals(reg, that.reg)
-                && Objects.equals(tagLevel, that.tagLevel)
-                && Objects.equals(tagPath, that.tagPath)
-                && Objects.equals(tagPrompt, that.tagPrompt) ;
+        return  isNullOrEmptyEqual(categoryId, that.categoryId)
+                && isNullOrEmptyEqual(tagNm, that.tagNm)
+                && isNullOrEmptyEqual(tagCode, that.tagCode)
+                && isNullOrEmptyEqual(tagRemark, that.tagRemark)
+                && isNullOrEmptyEqual(parentId, that.parentId)
+                && isNullOrEmptyEqual(reg, that.reg)
+                && isNullOrEmptyEqual(tagPrompt, that.tagPrompt) ;
+    }
+
+    private boolean isNullOrEmptyEqual(String str1, String str2) {
+        if (isEmpty(str1) && isEmpty(str2)) {
+            return true;
+        }
+        return Objects.equals(str1, str2);
+    }
+    private boolean isEmpty(String str) {
+        return str == null || str.trim().isEmpty();
     }
 
 }