|
@@ -473,27 +473,29 @@ public class UserController {
|
|
|
@GetMapping("/getDetail")
|
|
|
@Operation(summary = "基本信息展示")
|
|
|
// @PreAuthorize("@ss.hasPermission('system:user:homeDetail')")
|
|
|
- public CommonResult<Map<String,Integer>> getDetail() throws Exception {
|
|
|
- UserPageReqVO reqVO= new UserPageReqVO();
|
|
|
- DeptListReqVO deptVO =new DeptListReqVO();
|
|
|
- List<AdminUserDO> studnetList = userService.getUserList(reqVO.setUserType("1"));
|
|
|
- List<AdminUserDO> teacherList = userService.getUserList(reqVO.setUserType("3"));
|
|
|
+ public CommonResult<Map<String, Integer>> getDetail() throws Exception {
|
|
|
+ // 初始化请求对象
|
|
|
+ UserPageReqVO reqVO = new UserPageReqVO();
|
|
|
+ DeptListReqVO deptVO = new DeptListReqVO();
|
|
|
|
|
|
- Integer studentNum =studnetList.size();
|
|
|
- Integer teacherNum =teacherList.size();
|
|
|
+ List<AdminUserDO> studnetList = userService.getUserList(reqVO.setUserType("1"));
|
|
|
+ List<AdminUserDO> teacherList = userService.getUserList(reqVO.setUserType("3"));
|
|
|
|
|
|
- List<DeptDO>deptList= deptService.getDeptList(deptVO);
|
|
|
- Integer deptNum =deptList.size();
|
|
|
+ Integer studentNum = (studnetList != null) ? studnetList.size() : 0;
|
|
|
+ Integer teacherNum = (teacherList != null) ? teacherList.size() : 0;
|
|
|
+ List<DeptDO> deptList = deptService.getDeptList(deptVO);
|
|
|
+ Integer deptNum = (deptList != null) ? deptList.size() : 0;
|
|
|
|
|
|
Map<String, Integer> result = new HashMap<>();
|
|
|
result.put("studentNum", studentNum);
|
|
|
result.put("teacherNum", teacherNum);
|
|
|
result.put("deptNum", deptNum);
|
|
|
|
|
|
+ // 返回成功结果
|
|
|
return success(result);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@GetMapping("/getGraduateCount")
|
|
|
@Operation(summary = "获取达成毕业体条件生人数统计")
|
|
|
public CommonResult<Map<String,Integer>> getGraduateCount() throws Exception {
|