From 1e3b97098151f2d0471de6e8103b6cdaa6b5099d Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期六, 18 九月 2021 09:15:59 +0800
Subject: [PATCH] Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into auth

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 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 47ca873..89446cf 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
@@ -461,13 +461,19 @@
             record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard()));
 
             if (StringUtils.isNotEmpty(record.getTags())) {
-                String tags = record.getTags() + ",";
+                StringBuffer sb = new StringBuffer();
+                sb.append(record.getTags() + ",");
                 if (record.getIsPartymember().equals(1)) {
-                    tags = tags + "党员,";
+                    if (!sb.toString().contains("党员")){
+                        sb.append("党员,");
+                    }
                 }
                 if (record.getIsVolunteer().equals(1)) {
-                    tags = tags + "志愿者,";
+                    if (!sb.toString().contains("志愿者")) {
+                        sb.append("志愿者,");
+                    }
                 }
+                String tags = sb.toString();
                 record.setTags(tags.substring(0, tags.length() - 1));
             }else {
                 StringBuffer sb = new StringBuffer();
@@ -588,7 +594,9 @@
     public R putUserTag(LoginUserInfoVO loginUserInfoVO) {
         SysUserDO sysUserDO = new SysUserDO();
         sysUserDO.setUserId(loginUserInfoVO.getUserId());
-        sysUserDO.setTags(loginUserInfoVO.getTags());
+        if (StringUtils.isNotEmpty(loginUserInfoVO.getTags()) && !"无".equals(loginUserInfoVO.getTags())) {
+            sysUserDO.setTags(loginUserInfoVO.getTags());
+        }
         int update = userDao.putUserTag(sysUserDO);
         if (update > 0) {
             return R.ok();
@@ -2414,4 +2422,19 @@
     public R getUserListByCommunityId(Long communityId) {
         return R.ok(this.userDao.getUserListByCommunityId(communityId));
     }
+
+    /**
+     * 检查当前用户是否是社区工作人员
+     * @param phone
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R checkCurrentUserIsTeam(String phone, Long communityId) {
+        int result = this.userDao.selectCountTeam(phone, communityId);
+        if (result > 0) {
+            return R.ok(true);
+        }
+        return R.ok(false);
+    }
 }

--
Gitblit v1.7.1