From 9b15ddbe6b0106261c7c59889ad75d5627a2b545 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 12 五月 2021 14:46:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 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 379ab94..d64fd64 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
@@ -253,6 +253,7 @@
                 loginUserInfoVO.setIsmemberrole(1);
             }
         }
+        loginUserInfoVO.setIsRealNamed(sysUserDO.getIdCard()!=null);
         return R.ok(loginUserInfoVO);
     }
 
@@ -513,10 +514,28 @@
      */
     @Override
     public R putUserIsVolunteer(String phone, int type) {
+
         SysUserDO sysUserDO = new SysUserDO();
         sysUserDO.setIsVolunteer(type);
         int update = userDao.update(sysUserDO, new UpdateWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, phone));
         if (update > 0) {
+            ComMngVolunteerMngVO comMngVolunteerMngVO = userDao.selectVolunteerMngByPhone(phone);
+            if(comMngVolunteerMngVO!=null&&comMngVolunteerMngVO.getSubmitUserId()!=null) {
+                Long userId = comMngVolunteerMngVO.getSubmitUserId();
+                //删除用户信息缓存
+                String userKey = UserConstants.LOGIN_USER_INFO + userId;
+                stringRedisTemplate.delete(userKey);
+            }else{
+                List<SysUserDO> userDOList =  userDao.selectList(new LambdaQueryWrapper<SysUserDO>().eq(SysUserDO::getPhone, phone));
+                if(userDOList!=null && userDOList.size()>0){
+                    userDOList.forEach(usrDo ->{
+                        Long userId = usrDo.getUserId();
+                        //删除用户信息缓存
+                        String userKey = UserConstants.LOGIN_USER_INFO + userId;
+                        stringRedisTemplate.delete(userKey);
+                    });
+                }
+            }
             return R.ok();
         }
         return R.fail();
@@ -546,6 +565,9 @@
             }
             int update = userDao.updateById(sysUserDO);
             if (update > 0) {
+                //删除用户信息缓存
+                String userKey = UserConstants.LOGIN_USER_INFO + userId;
+                stringRedisTemplate.delete(userKey);
                 return R.ok();
             }
         }
@@ -593,8 +615,9 @@
         SysUserDO sysUserDO = new SysUserDO();
         sysUserDO.setName(name);
         sysUserDO.setIdCard(idCard);
-        sysUserDO.setSex(loginUserInfoVO.getSex());
-        sysUserDO.setBirthday(loginUserInfoVO.getBirthday());
+        //通过身份证号判断性别以及出生日期
+        sysUserDO.setSex(IdCard.sex(idCard));
+        sysUserDO.setBirthday(IdCard.birthDay(idCard));
         sysUserDO.setJob(loginUserInfoVO.getJob());
         sysUserDO.setUserId(loginUserInfoVO.getUserId());
         sysUserDO.setFaceUrl(loginUserInfoVO.getFaceUrl());

--
Gitblit v1.7.1