| | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.entity.constant.StringConstant; |
| | | import cc.mrbird.febs.common.core.entity.system.Dept; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cc.mrbird.febs.server.system.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.server.system.service.IDeptService; |
| | | import cc.mrbird.febs.server.system.service.IUserDataPermissionService; |
| | | |
| | | import com.wuwenze.poi.ExcelKit; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author MrBird |
| | |
| | | public class DeptController { |
| | | |
| | | private final IDeptService deptService; |
| | | private final IUserDataPermissionService userDataPermissionService; |
| | | private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | | .orElse("1"); |
| | | |
| | | @GetMapping("all") |
| | | public FebsResponse getAllEmpBaseInfos(Dept dept) { |
| | |
| | | List<Dept> depts = this.deptService.findDepts(dept, request); |
| | | ExcelKit.$Export(Dept.class, response).downXlsx(depts, false); |
| | | } |
| | | |
| | | @GetMapping("redis") |
| | | public void setDeptToRedis(){ |
| | | deptService.setDeptRedis(); |
| | | } |
| | | |
| | | @GetMapping("userRightDepts") |
| | | public String userRightDepts(){ |
| | | String userRightDepts=userDataPermissionService.findByUserId(FebsUtil.getUserId()); |
| | | log.info("当前用户权限"+userRightDepts); |
| | | return userRightDepts; |
| | | } |
| | | } |