From bc0953386230888b953fb1be0f726f80b04cb9f1 Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期五, 10 九月 2021 11:57:36 +0800
Subject: [PATCH] 修改标签设置bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
index b9b8ca6..07b374e 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -14,7 +14,6 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -461,18 +460,19 @@
 //            record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone()));
             record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard()));
 
-            StringBuilder sb = new StringBuilder();
-            if (record.getIsPartymember().equals(1)) {
-                sb.append("党员,");
-            }
-            if (record.getIsVolunteer().equals(1)) {
-                sb.append("志愿者,");
-            }
-            String tag = sb.toString();
-            if (tag.length() > 0) {
-                record.setTags(tag.substring(0, tag.length() - 1));
-            } else {
-                record.setTags("无");
+            String tags = record.getTags();
+            if (StringUtils.isNotEmpty(tags)) {
+                if (record.getIsPartymember().equals(1)) {
+                    tags = tags + "党员,";
+                }
+                if (record.getIsVolunteer().equals(1)) {
+                    tags = tags + "志愿者,";
+                }
+                if (tags.length() > 0) {
+                    record.setTags(tags.substring(0, tags.length() - 1));
+                } else {
+                    record.setTags("无");
+                }
             }
         });
         return R.ok(iPage);

--
Gitblit v1.7.1