From 305aebeffe0c5ff5fae977c7bffdcec09889b2e1 Mon Sep 17 00:00:00 2001
From: 张天森 <1292933220@qq.com>
Date: 星期五, 23 九月 2022 17:24:45 +0800
Subject: [PATCH] update

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 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 c7413ea..990a284 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
@@ -745,10 +745,19 @@
         else {
             if(loginUserInfoVO.getStreetId()!=null){
                 loginUserInfoVO.setUserType(1);
+                loginUserInfoVO.setLevel(3);
             }
             else {
                 loginUserInfoVO.setUserType(2);
+                loginUserInfoVO.setLevel(4);
             }
+        }
+        if (sysUserDO.getType().equals(11)){
+            loginUserInfoVO.setLevel(5);
+        }else if (sysUserDO.getType().equals(12)){
+            loginUserInfoVO.setLevel(2);
+        }else if (isNull(loginUserInfoVO.getLevel())){
+            loginUserInfoVO.setLevel(1);
         }
         return R.ok(loginUserInfoVO);
     }
@@ -3679,8 +3688,20 @@
             if (nonNull(administratorsUserVO.getImageUrl())){
                 sysUserDO.setImageUrl(administratorsUserVO.getImageUrl());
             }
-            sysUserDO.setType(administratorsUserVO.getType());
+            if (nonNull(administratorsUserVO.getType())){
+                sysUserDO.setType(administratorsUserVO.getType());
+            }
             userDao.insert(sysUserDO);
+            //分配权限
+            SysUserRoleDO sysUserRole=new SysUserRoleDO();
+            sysUserRole.setUserId(sysUserDO.getUserId());
+            if (sysUserDO.getType().equals(11)){
+                sysUserRole.setRoleId(Long.parseLong(UserConstants.SANSHUO_EXPERT_ROLE));
+            }else{
+                sysUserRole.setRoleId(Long.parseLong(UserConstants.SANSHUO_INDUSTRY_CENTER_ROLE));
+            }
+            //配置权限
+            sysUserRoleDAO.insert(sysUserRole);
             return R.ok();
         }
         return R.fail("账户名已存在");

--
Gitblit v1.7.1