From b8441a1ac74d2c3325dd36d69ced511f19cd760b Mon Sep 17 00:00:00 2001
From: 赵士淞 <zhaoss@yhzhg.cn>
Date: Tue, 09 May 2023 10:02:27 +0000
Subject: [PATCH] 微调
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
index dbf7693..1d97965 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
@@ -48,6 +48,7 @@
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;
@@ -106,6 +107,20 @@
criteria.setLevelNq(role.getLevel());
}
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 <= 1 ? min : min - 1;
+ // 根据角色等级查询
+ List<UserDto> userDtoList = userService.findByRoleLevel(min);
+ return new ResponseEntity<>(userDtoList,HttpStatus.OK);
}
@ApiOperation("查询用户")
@@ -239,4 +254,24 @@
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);
+ }
}
--
Gitblit v1.9.3