Crazy 8 months ago
parent
commit
5b1e139bcc

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

@@ -280,8 +280,8 @@ public class UserController {
     @PreAuthorize("@ss.hasPermission('system:user:query')")
     public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) {
         AdminUserDO user = userService.getUser(id);
-        //毕业生专属
-        if (user.getSupervisorId() != null && Objects.equals(user.getUserType(), "2")) {
+        //添加导师名称
+        if (user.getSupervisorId() != null && (Objects.equals(user.getUserType(), "1") || Objects.equals(user.getUserType(), "2"))) {
             AdminUserDO supervisorUser = userService.getUser(user.getSupervisorId());
             String supervisor = supervisorUser.getNickname();
             user.setSupervisor(supervisor);
@@ -336,7 +336,7 @@ public class UserController {
     }
 
 
-    //在校生导入
+    //在校生导入//没用
     @GetMapping("/get-import-StudentTemplate")
     @Operation(summary = "获得在校生考勤人员下发模板")
     public void importStudentTemplate(HttpServletResponse response) throws IOException {
@@ -371,7 +371,7 @@ public class UserController {
     }
 
 
-    //毕业生
+    //毕业生在用,不过没必要
     @GetMapping("/get-import-GraduateStudentTemplate")
     @Operation(summary = "获得毕业生模板")
     public void importGraduateStudentTemplate(HttpServletResponse response) throws IOException {

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

@@ -61,6 +61,13 @@ public class UserProfileController {
     public CommonResult<UserProfileRespVO> getUserProfile() {
         // 获得用户基本信息
         AdminUserDO user = userService.getUser(getLoginUserId());
+        Long supervisorId =user.getSupervisorId();
+        if (supervisorId!=null){
+            AdminUserDO supervisorUser = userService.getUser(supervisorId);
+            String supervisor = supervisorUser.getNickname();
+            user.setSupervisor(supervisor);
+            System.out.println("学生基本信息"+user);
+        }
         // 获得用户角色
         List<RoleDO> userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId()));
         // 获得部门信息

+ 24 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java

@@ -72,4 +72,28 @@ public class UserProfileRespVO {
 
     }
 
+    /**
+     * 新加的个人信息列
+     */
+    @Schema(description = "1本科生,2毕业生,3导师", example = "1")
+    private String userType;
+
+    @Schema(description = "专业名称")
+    private String major;
+
+    @Schema(description = "专硕(学硕)名称", example = "2")
+    private String masterType;
+
+    @Schema(description = "导师id", example = "21284")
+    private Long supervisorId;
+
+    @Schema(description = "学号")
+    private String userNumber;
+
+    @Schema(description = "年级")
+    private String grade;
+
+    @Schema(description = "导师名称")
+    private String supervisor;
+
 }

+ 1 - 6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java

@@ -37,9 +37,6 @@ public class UserPageReqVO extends PageParam {
 
     //新加的查询条件
 
-    /**
-     * 新加的个人信息列
-     */
     @Schema(description = "1本科生,2毕业生,3导师", example = "1")
     private String userType;
 
@@ -49,9 +46,6 @@ public class UserPageReqVO extends PageParam {
     @Schema(description = "专硕(学硕)名称", example = "2")
     private String masterType;
 
-    @Schema(description = "导师id", example = "21284")
-    private Long supervisorId;
-
     @Schema(description = "学号")
     private String userNumber;
 
@@ -61,6 +55,7 @@ public class UserPageReqVO extends PageParam {
     @Schema(description = "用户昵称")
     private String nickname;
 
+    @Schema(description = "导师名称")
     private String supervisor;
 
 

+ 18 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java

@@ -72,11 +72,28 @@ public class UserRespVO{
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
     private LocalDateTime createTime;
 
+    //
     @Schema(description = "照片", example = "url")
     private String photoUrl;
 
-    @Schema(description = "用户学号", example = "3232")
+    @Schema(description = "用户学号")
     private String userNumber;
 
+    @Schema(description = "导师名称")
+    private String supervisor;
+
+    @Schema(description = "导师电话")
+    private String supervisorMobile;
+
+    @Schema(description = "工作地点")
+    private String workPlace;
+
+    @Schema(description = "年级")
+    private String grade;
+
+    @Schema(description = "用户类型")
+    private String userType;
+
+
 
 }

+ 10 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java

@@ -86,4 +86,14 @@ public class UserSaveReqVO {
     @DiffLogField(name = "照片url")
     private String  photoUrl;
 
+    //新加修改传来的值
+    @Schema(description = "1在科生,2毕业生,3导师", example = "1")
+    private String userType;
+
+    @Schema(description = "导师id")
+    private Long supervisorId;
+
+    @Schema(description = "工作地点")
+    private String workPlace;
+
 }