| | |
| | | package com.project.admin.controller.system; |
| | | |
| | | import com.project.common.config.ProjectConfig; |
| | | import com.project.common.core.domain.entity.SysDept; |
| | | import com.project.framework.web.service.SysPermissionService; |
| | | import com.project.system.service.ISysDeptService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.project.common.annotation.Log; |
| | | import com.project.common.config.ProjectConfig; |
| | | import com.project.common.constant.UserConstants; |
| | | import com.project.common.core.controller.BaseController; |
| | | import com.project.common.core.domain.AjaxResult; |
| | | import com.project.common.core.domain.entity.SysDept; |
| | | import com.project.common.core.domain.entity.SysUser; |
| | | import com.project.common.core.domain.model.LoginUser; |
| | | import com.project.common.enums.BusinessType; |
| | |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.utils.file.FileUploadUtils; |
| | | import com.project.common.utils.file.MimeTypeUtils; |
| | | import com.project.framework.web.service.SysPermissionService; |
| | | import com.project.framework.web.service.TokenService; |
| | | import com.project.system.domain.SysCompany; |
| | | import com.project.system.service.ISysCompanyService; |
| | | import com.project.system.service.ISysDeptService; |
| | | import com.project.system.service.ISysUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Set; |
| | | |
| | |
| | | private final ISysDeptService deptService; |
| | | private final TokenService tokenService; |
| | | private final SysPermissionService permissionService; |
| | | private final ISysCompanyService companyService; |
| | | |
| | | |
| | | /** |
| | |
| | | public AjaxResult profile() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | SysDept sysDept = deptService.selectDeptById(userService.getById(user.getUserId()).getDeptId()); |
| | | sysDept.setDeptName(deptService.getDeptAllName(sysDept.getDeptId())); |
| | | user.setDept(sysDept); |
| | | if ("02".equals(user.getUserType())){ |
| | | SysCompany company = companyService.getById(userService.getById(user.getUserId()).getDeptId()); |
| | | SysDept sysDept = new SysDept(); |
| | | sysDept.setDeptName(company.getCompanyName()); |
| | | user.setDept(sysDept); |
| | | } else { |
| | | SysDept sysDept = deptService.selectDeptById(userService.getById(user.getUserId()).getDeptId()); |
| | | sysDept.setDeptName(deptService.getDeptAllName(sysDept.getDeptId())); |
| | | user.setDept(sysDept); |
| | | } |
| | | |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |