Crazy 4 月之前
父節點
當前提交
3a27c67201

+ 2 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/studentAttendance/vo/StudentAttendanceEmailVO.java

@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.studentAttendance.vo;
 
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -38,7 +39,7 @@ public class StudentAttendanceEmailVO {
     private String date;
 
     @Schema(description = "打卡时间")
-    @ExcelProperty("打卡时间")
+    @DateTimeFormat
     private String clockInTime;
 
     @Schema(description = "打卡状态 0正常,1未打卡,2请假", example = "1")

+ 12 - 10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java

@@ -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 {

+ 5 - 3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java

@@ -65,9 +65,11 @@ public class UserProfileController {
         //获取用户导师的信息
         if (supervisorId!=null){
             AdminUserDO supervisorUser = userService.getUser(supervisorId);
-            String supervisor = supervisorUser.getNickname();
-            user.setSupervisor(supervisor);
-            System.out.println("学生基本信息"+user);
+            if (supervisorUser!=null) {
+                String supervisor = supervisorUser.getNickname();
+                user.setSupervisor(supervisor);
+                System.out.println("学生基本信息" + user);
+            }
         }
         // 获得用户角色
         List<RoleDO> userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId()));