From edef0eb767e261d5feb391a3699de5591ed14711 Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期五, 10 九月 2021 14:13:21 +0800
Subject: [PATCH] 分页查询用户管理标签显示多个志愿者修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 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 bce01bb..0949a9f 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
@@ -460,14 +460,26 @@
 //            record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone()));
             record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard()));
 
-            String tags = record.getTags() + ",";
-            if (StringUtils.isNotEmpty(tags)) {
+            if (StringUtils.isNotEmpty(record.getTags())) {
+                StringBuffer sb = new StringBuffer();
+                sb.append(record.getTags() + ",");
                 if (record.getIsPartymember().equals(1)) {
-                    tags = tags + "党员,";
+                    sb.append("党员,");
                 }
                 if (record.getIsVolunteer().equals(1)) {
-                    tags = tags + "志愿者,";
+                    sb.append("志愿者,");
                 }
+                String tags = sb.toString();
+                record.setTags(tags.substring(0, tags.length() - 1));
+            }else {
+                StringBuffer sb = new StringBuffer();
+                if (record.getIsPartymember().equals(1)) {
+                    sb.append("党员,");
+                }
+                if (record.getIsVolunteer().equals(1)) {
+                    sb.append("志愿者,");
+                }
+                String tags = sb.toString();
                 if (tags.length() > 0) {
                     record.setTags(tags.substring(0, tags.length() - 1));
                 } else {

--
Gitblit v1.7.1