| | |
| | | if (sysUser==null){ |
| | | //查询花城e+是否存在此用户 |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData("","",phonenumber); |
| | | SysUser newUser = new SysUser(); |
| | | if(huaChengSysUser==null) |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(Snowflake.getId()); |
| | | newUser.setLoginName(phonenumber); |
| | | newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户"); |
| | |
| | | } |
| | | else |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(huaChengSysUser.getUserId()); |
| | | newUser.setLoginName(huaChengSysUser.getPhone()); |
| | | newUser.setUserName(huaChengSysUser.getNickName()); |
| | |
| | | newUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | } |
| | | |
| | | sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser!=null) { |
| | | String token = tokenManager.getTokenByUserId(newUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token " + token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(newUser.getUserId(), newUser.getUserId()); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", newUser.getUserId()); |
| | | map.put("userName", newUser.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | |
| | | } |
| | | else |
| | | { |
| | | String token = tokenManager.getTokenByUserId(sysUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token " + token); |
| | |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | |
| | | return ResultData.error("用户不存在"); |
| | | } |
| | | |
| | | public List<String> getDepartmentIds( List<OrganizationChartEntity> organizationChartEntities,List<String> departmentIds){ |