| | |
| | | return new ResponseEntity<>(userService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/approval/level") |
| | | @Log("查询审批员工") |
| | | @ApiOperation("查询审批员工") |
| | | @PreAuthorize("@el.check('user:list')") |
| | | public ResponseEntity<Object> queryApprovalUserByLevel(@RequestParam Long userId) { |
| | | // 获取用户最大角色等级 |
| | | List<Integer> levels = roleService.findByUsersId(userId).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList()); |
| | | int min = Collections.min(levels); |
| | | min = min - 1 <= 0 ? min : min - 1; |
| | | // 根据角色等级查询 |
| | | List<UserDto> userDtoList = userService.findByRoleLevel(min); |
| | | return new ResponseEntity<>(userDtoList,HttpStatus.OK); |
| | | } |
| | | |
| | | @ApiOperation("查询用户") |
| | | @GetMapping |
| | | @PreAuthorize("@el.check('user:list')") |
| | |
| | | return new ResponseEntity<>(userService.getUserCalendarInfo(month), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/getUserBaseInfo") |
| | | @GetMapping(value = "/getUserBaseInfo/{yearMonth}") |
| | | @Log("获取用户基础信息") |
| | | @ApiOperation("获取用户日历信息") |
| | | public ResponseEntity<Object> getUserBaseInfo() throws ParseException { |
| | | return new ResponseEntity<>(userService.getUserBaseInfo(), HttpStatus.OK); |
| | | public ResponseEntity<Object> getUserBaseInfo(@PathVariable Date yearMonth) throws ParseException { |
| | | return new ResponseEntity<>(userService.getUserBaseInfo(yearMonth), HttpStatus.OK); |
| | | } |
| | | } |