| | |
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo;
|
| | | import com.ruoyi.project.system.mapper.SysDeptMapper;
|
| | | import com.ruoyi.project.system.service.ISysUserDeptService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.util.ObjectUtils;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | |
| | | @Autowired
|
| | | private ISysUserDeptService userDeptService;
|
| | |
|
| | | @Autowired
|
| | | private SysDeptMapper sysDeptMapper;
|
| | |
|
| | | /**
|
| | | * 登录方法
|
| | | *
|
| | |
| | | {
|
| | | LoginUser loginUser = SecurityUtils.getLoginUser();
|
| | | SysUser user = loginUser.getUser();
|
| | | // 获取当前登录公司
|
| | | Integer tenantId = loginUser.getTenantId();
|
| | | if(null != tenantId){
|
| | | user.setTenantId(tenantId);
|
| | | SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue());
|
| | | if(!ObjectUtils.isEmpty(sysDept)){
|
| | | user.setCurrentFactoryName(sysDept.getDeptName());
|
| | | }
|
| | | }
|
| | | // 角色集合
|
| | | Set<String> roles = permissionService.getRolePermission(user);
|
| | | // 权限集合
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @GetMapping("/userDeptList")
|
| | | public AjaxResult userDeptList(SysUserDeptVo sysUserDeptVo){
|
| | | return AjaxResult.success(userDeptService.selectUserDeptList(sysUserDeptVo));
|
| | | @GetMapping("/userLoginFacotryList")
|
| | | public AjaxResult userLoginFacotryList(SysUserDeptVo sysUserDeptVo){
|
| | | return AjaxResult.success(userDeptService.userLoginFacotryList(sysUserDeptVo));
|
| | | }
|
| | |
|
| | | /**
|