| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.annotation.AnonymousAccess; |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.config.RsaProperties; |
| | | import me.zhengjie.modules.system.domain.Dept; |
| | |
| | | import me.zhengjie.modules.system.service.DeptService; |
| | | import me.zhengjie.modules.system.service.RoleService; |
| | | import me.zhengjie.modules.system.service.dto.DeptDto; |
| | | import me.zhengjie.modules.system.service.dto.DeptUserNodeDto; |
| | | import me.zhengjie.modules.system.service.dto.RoleSmallDto; |
| | | import me.zhengjie.modules.system.service.dto.UserDto; |
| | | import me.zhengjie.modules.system.service.dto.UserQueryCriteria; |
| | |
| | | import me.zhengjie.utils.*; |
| | | import me.zhengjie.modules.system.service.UserService; |
| | | import me.zhengjie.utils.enums.CodeEnum; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @PreAuthorize("@el.check('user:download')") |
| | | public void exportUser(HttpServletResponse response, UserQueryCriteria criteria) throws IOException { |
| | | userService.download(userService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping(value = "/dept/{deptId}") |
| | | @AnonymousAccess |
| | | public ResponseEntity<Object> queryDeptUserByDeptId(@PathVariable Long deptId) { |
| | | return new ResponseEntity<>(userService.queryDeptUserByDeptId(deptId), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/all") |
| | |
| | | return new ResponseEntity<>(PageUtil.toPage(null,0),HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("新增用户") |
| | | // @Log("新增用户") |
| | | @ApiOperation("新增用户") |
| | | @PostMapping |
| | | @PreAuthorize("@el.check('user:add')") |
| | |
| | | throw new BadRequestException("角色权限不足"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取用户日历信息 |
| | | * @param month |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @GetMapping(value = "/getUserCalendarInfo/{month}") |
| | | @Log("获取用户日历信息") |
| | | @ApiOperation("获取用户日历信息") |
| | | public ResponseEntity<Object> getUserCalendarInfo(@PathVariable String month) throws Exception { |
| | | return new ResponseEntity<>(userService.getUserCalendarInfo(month), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/getUserBaseInfo/{yearMonth}") |
| | | @Log("获取用户基础信息") |
| | | @ApiOperation("获取用户日历信息") |
| | | public ResponseEntity<Object> getUserBaseInfo(@PathVariable Date yearMonth) throws ParseException { |
| | | return new ResponseEntity<>(userService.getUserBaseInfo(yearMonth), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/getProjectUser") |
| | | public ResponseEntity<Object> getUserByTaskId(String taskId){ |
| | | return new ResponseEntity<>(userService.getUserByTaskId(taskId),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/getAllUser") |
| | | public ResponseEntity<Object> getAllUserByTaskId(String taskId){ |
| | | return new ResponseEntity<>(userService.getAllUserByTaskId(taskId),HttpStatus.OK); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getUserDept") |
| | | public ResponseEntity<Object> getAllUserDetail(){ |
| | | return new ResponseEntity<>(userService.getUserDept(),HttpStatus.OK); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getUserPidDept") |
| | | public ResponseEntity<Object> getUserPidDept(Long[] ids) { |
| | | List<Long[]> result = new ArrayList<>(); |
| | | for (Long id : ids) { |
| | | result.add(userService.getUserPidDept(id)); |
| | | } |
| | | return new ResponseEntity<>(result,HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/getPerformanceDetail") |
| | | public ResponseEntity<Object> getPerformanceDetail(Long nextMonth) throws ParseException { |
| | | return new ResponseEntity<>(HttpStatus.OK); // userService.getPerformanceDetail(nextMonth), |
| | | |
| | | } |
| | | |
| | | @GetMapping(value = "/getUserInfose") |
| | | @Log("查询用户信息") |
| | | @ApiOperation("查询用户信息") |
| | | public ResponseEntity<Object> getUserInfos() { |
| | | return new ResponseEntity<>(userService.getUserInfose(), HttpStatus.OK); |
| | | } |
| | | } |