Quellcode durchsuchen

1.9所有校内导师

Crazy vor 17 Stunden
Ursprung
Commit
c088ab0bcf

+ 1 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/studentSelectSupervisorRecord/StudentSelectSupervisorRecordController.java

@@ -388,7 +388,7 @@ public class StudentSelectSupervisorRecordController {
         return success(true);
     }
 
-    //在导师设置那传导师id,志愿填报那撤回
+    //在导师设置那传导师id,志愿填报那撤回(没用了暂时)
     @PutMapping("/withdraw")
     @Operation(summary = "撤回")
     @PreAuthorize("@ss.hasPermission('system:student-select-supervisor-record:withdraw')")

+ 1 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/studentSelectionProject/studentSelectionProjectController.java

@@ -216,7 +216,7 @@ public class studentSelectionProjectController {
         supervisorSelectionSettingService.deleteSettingsBySupervisorIds(id,supervisorIds);
         //删除项目下的互选记录
         studentSelectSupervisorRecordService.deleteRecordsByProjectId(id);
-        //初始化选中的学生的导师id
+        //初始化选中的学生的导师id(校内校外)
         adminUserService.updateStudentSupervisorId(project.getStudentGrade());
         //删除项目;
         studentSelectionProjectService.deleteStudentSelectionProject(id);

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

@@ -11,13 +11,11 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
 import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
-import cn.iocoder.yudao.module.system.controller.admin.studentSelectionProject.vo.studentPageReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.studentSelectionProject.vo.studentSelectionProjectSaveReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
 
 import cn.iocoder.yudao.module.system.convert.user.UserConvert;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
-import cn.iocoder.yudao.module.system.dal.dataobject.studentSelectionProject.studentSelectionProjectDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.PopDo;
 import cn.iocoder.yudao.module.system.enums.common.SexEnum;
@@ -44,7 +42,6 @@ import java.io.*;
 
 import java.time.LocalDate;
 import java.util.*;
-import java.util.stream.Collectors;
 
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 
@@ -715,7 +712,7 @@ public class UserController {
     @GetMapping("/getPassedStudentsPage")
     @Operation(summary = "获取今年项目学生通过分页")
     @PreAuthorize("@ss.hasPermission('system:user:getPassedStudentsPage')")
-    public CommonResult<PageResult<AdminUserDO>> getPassedStudentsPage(@Valid UserPageReqVO pageReqVO) {
+    public CommonResult<PageResult<StudentProjectRespVO>> getPassedStudentsPage(@Valid UserPageReqVO pageReqVO) {
         LocalDate date =LocalDate.now();
         Integer lastYear =date.getYear()-1 ;
         studentSelectionProjectSaveReqVO project =new studentSelectionProjectSaveReqVO();
@@ -728,14 +725,14 @@ public class UserController {
         pageReqVO.setGrade(project.getStudentGrade());
         pageReqVO.setUserType("1");
 
-        PageResult<AdminUserDO>  result = userService.getPassedStudentsPage(pageReqVO);
+        PageResult<StudentProjectRespVO>  result = userService.getPassedStudentsPage(pageReqVO,project.getId());
         return success(result);
     }
 
     @GetMapping("/getUnPassedStudentsPage")
     @Operation(summary = "获取今年互选项目学生未通过分页")//未提交和待处理
     @PreAuthorize("@ss.hasPermission('system:user:getUnPassedStudentsPage')")
-    public CommonResult<PageResult<AdminUserDO>> getUnPassedStudentsPage(@Valid UserPageReqVO reqVO) {
+    public CommonResult<PageResult<StudentProjectRespVO>> getUnPassedStudentsPage(@Valid UserPageReqVO reqVO) {
         LocalDate date =LocalDate.now();
         Integer lastYear =date.getYear()-1 ;
         studentSelectionProjectSaveReqVO project =new studentSelectionProjectSaveReqVO();
@@ -748,7 +745,7 @@ public class UserController {
 
         reqVO.setGrade(project.getStudentGrade());
         reqVO.setUserType("1");
-        PageResult<AdminUserDO>  result = userService.getUnPassedStudentsPage(reqVO);
+        PageResult<StudentProjectRespVO>  result = userService.getUnPassedStudentsPage(reqVO,project.getId());
         return success(result);
     }
 

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

@@ -0,0 +1,88 @@
+package cn.iocoder.yudao.module.system.controller.admin.user.vo.user;
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 用户互选项目信息 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class StudentProjectRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    private Long id;
+
+    @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao")
+    private String username;
+
+    @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+    private String nickname;
+
+    @Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1")
+    @DictFormat(DictTypeConstants.USER_SEX)
+    private Integer sex;
+
+    @Schema(description = "年级")
+    private String grade;
+
+    @Schema(description = "用户学号")
+    private String userNumber;
+
+    @Schema(description = "用户邮箱", example = "yudao@iocoder.cn")
+    private String email;
+
+    @Schema(description = "手机号码", example = "15601691300")
+    private String mobile;
+
+    @Schema(description = "用户类型")
+    private String userType;
+
+    @Schema(description = "导师名称")
+    private String supervisor;
+
+    @Schema(description = "校外导师名称")
+    private String externalSupervisor;
+
+    @Schema(description = "导师电话")
+    private String supervisorMobile;
+
+    @Schema(description = "照片", example = "url")
+
+    private String photoUrl;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "备注", example = "我是一个用户")
+    private String remark;
+
+    @Schema(description ="家长手机号码")
+    private String parentMobile;
+
+    @Schema(description = "专业名称")
+    private String major;
+
+    @Schema(description = "硕士类型")
+    private Integer masterType;
+
+    @Schema(description = "简介PDF")
+    private String introduction;
+
+    //选择状态
+    @Schema(description = "选择状态")
+    private Integer selectStatus;
+
+    @Schema(description = "记录id")
+    private Long recordId;
+
+    @Schema(description = "项目id")
+    private Long projectId;
+
+}

+ 0 - 2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java

@@ -193,7 +193,5 @@ public class AdminUserDO extends TenantBaseDO {
     @TableField(exist = false)
     private Integer selectStatus;
 
-    @TableField(exist = false)
-    private Long recordId;
 
 }

+ 3 - 15
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java

@@ -1,28 +1,16 @@
 package cn.iocoder.yudao.module.system.dal.mysql.user;
 
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
-import cn.iocoder.yudao.framework.security.core.LoginUser;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
-import cn.iocoder.yudao.module.system.controller.admin.studentSelectionProject.vo.studentPageReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
-import cn.iocoder.yudao.module.system.dal.dataobject.studentSelectSupervisorRecord.studentSelectSupervisorRecordDO;
+import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.StudentProjectRespVO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.PopDo;
-import cn.iocoder.yudao.module.system.dal.dataobject.userAchievement.UserAchievementDO;
-import cn.iocoder.yudao.module.system.service.permission.PermissionService;
-import cn.iocoder.yudao.module.system.service.user.AdminUserService;
-import com.baomidou.mybatisplus.annotation.DbType;
-import com.baomidou.mybatisplus.extension.toolkit.Db;
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import org.apache.catalina.User;
 import org.apache.ibatis.annotations.*;
 
-import javax.annotation.Resource;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -432,8 +420,8 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
     //待处理和已提交
 
     //未通过学生
-     List<AdminUserDO> getIsPassedStudentsPage( @Param("reqVO") UserPageReqVO reqVO,@Param("offset") Integer offset ,@Param("isPassed") Integer isPassed);
-     Long  getIsPassedStudentsPageCount( @Param("reqVO") UserPageReqVO reqVO,@Param("isPassed") Integer isPassed);
+     List<StudentProjectRespVO> getIsPassedStudentsPage(@Param("reqVO") UserPageReqVO reqVO, @Param("projectId") Long projectId, @Param("offset") Integer offset , @Param("isPassed") Integer isPassed);
+     Long  getIsPassedStudentsPageCount( @Param("reqVO") UserPageReqVO reqVO,@Param("projectId") Long projectId,@Param("isPassed") Integer isPassed);
 
 
      //获取用户选择状态

+ 2 - 4
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java

@@ -8,8 +8,6 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.PopDo;
-import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
-import org.apache.ibatis.annotations.Param;
 
 import javax.validation.Valid;
 import java.io.InputStream;
@@ -263,10 +261,10 @@ public interface AdminUserService {
     void updateStudentSupervisorId(String grade);
 
     //通过的用户分页
-    PageResult<AdminUserDO> getPassedStudentsPage(UserPageReqVO pageReqVO);
+    PageResult<StudentProjectRespVO> getPassedStudentsPage(UserPageReqVO pageReqVO, Long projectId);
 
     //未通过的用户分页
-    PageResult<AdminUserDO> getUnPassedStudentsPage(UserPageReqVO reqVO);
+    PageResult<StudentProjectRespVO> getUnPassedStudentsPage(UserPageReqVO reqVO, Long projectId);
 
     //获取user的选择状态
     Integer getUserSelectStatus(Long id ,Long projectId);

+ 6 - 16
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java

@@ -6,17 +6,13 @@ import cn.hutool.core.io.IoUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
 import cn.iocoder.yudao.framework.common.exception.ServiceException;
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
 import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
-import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
 import cn.iocoder.yudao.module.infra.api.file.FileApi;
-import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
@@ -24,7 +20,6 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
 import cn.iocoder.yudao.module.system.controller.admin.userAchievement.vo.UserAchievementPageReqVO;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
-import cn.iocoder.yudao.module.system.dal.dataobject.studentSelectionProject.studentSelectionProjectDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.PopDo;
 import cn.iocoder.yudao.module.system.dal.dataobject.userAchievement.UserAchievementDO;
@@ -41,20 +36,15 @@ import com.mzt.logapi.context.LogRecordContext;
 import com.mzt.logapi.service.impl.DiffParseFunction;
 import com.mzt.logapi.starter.annotation.LogRecord;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import javax.validation.ConstraintViolationException;
 import java.io.InputStream;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.*;
-import java.util.stream.Collectors;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
@@ -1221,29 +1211,29 @@ public class AdminUserServiceImpl implements AdminUserService {
     }
 
     @Override
-    public PageResult<AdminUserDO> getPassedStudentsPage(UserPageReqVO reqVO){
+    public PageResult<StudentProjectRespVO> getPassedStudentsPage(UserPageReqVO reqVO, Long projectId){
         int offset;
         if (reqVO.getPageSize() == -1) {
             offset =-1;  //
         } else {
             offset = (reqVO.getPageNo() - 1) * reqVO.getPageSize();
         }
-        List<AdminUserDO> result =userMapper.getIsPassedStudentsPage(reqVO,offset,1);
-        Long size = userMapper.getIsPassedStudentsPageCount(reqVO,1);
+        List<StudentProjectRespVO> result =userMapper.getIsPassedStudentsPage(reqVO,projectId,offset,1);
+        Long size = userMapper.getIsPassedStudentsPageCount(reqVO,projectId,1);
 
         return new PageResult<>(result,size);
     }
 
     @Override
-    public PageResult<AdminUserDO> getUnPassedStudentsPage(UserPageReqVO reqVO){
+    public PageResult<StudentProjectRespVO> getUnPassedStudentsPage(UserPageReqVO reqVO, Long projectId){
         int offset;
         if (reqVO.getPageSize() == -1) {
             offset =-1;  //
         } else {
             offset = (reqVO.getPageNo() - 1) * reqVO.getPageSize();
         }
-        List<AdminUserDO> result =userMapper.getIsPassedStudentsPage(reqVO,offset,0);
-        Long size = userMapper.getIsPassedStudentsPageCount(reqVO,0);
+        List<StudentProjectRespVO> result =userMapper.getIsPassedStudentsPage(reqVO,projectId,offset,0);
+        Long size = userMapper.getIsPassedStudentsPageCount(reqVO,projectId,0);
 
         return new PageResult<>(result,size);
     }

+ 9 - 5
yudao-module-system/yudao-module-system-biz/src/main/resources/Mapper/user/AdminUserMapper.xml

@@ -424,9 +424,9 @@
 
 
 
-    <select id="getIsPassedStudentsPage" resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
+    <select id="getIsPassedStudentsPage" resultType="cn.iocoder.yudao.module.system.controller.admin.user.vo.user.StudentProjectRespVO">
         SELECT
-        a.*,r.id,
+        a.*,r.id,r.project_id,
         CASE
         WHEN COALESCE(MAX(r.select_type), 0) = 2 THEN 2
         WHEN COALESCE(MAX(r.select_type), 0) = 1 THEN 1
@@ -441,14 +441,17 @@
 
         COALESCE(system_dept.name, "测绘学院") AS deptName,
         supervisor_user.nickname AS supervisor,
-        supervisor_user.mobile AS supervisorMobile
+        supervisor_user.mobile AS supervisorMobile,
+        externalSupervisor_user.nickname AS externalSupervisor
         FROM
         system_users a
         LEFT JOIN
-        student_select_supervisor_record r ON r.student_id = a.id AND r.deleted = 0
+        student_select_supervisor_record r ON r.student_id = a.id AND r.deleted = 0 AND r.project_id = #{projectId}
         LEFT JOIN
         system_users supervisor_user ON supervisor_user.id = a.supervisor_id AND supervisor_user.deleted = 0
         LEFT JOIN
+        system_users externalSupervisor_user ON externalSupervisor_user.id = a.external_supervisor_id AND externalSupervisor_user.deleted = 0
+        LEFT JOIN
         system_dept system_dept ON system_dept.id = a.dept_id
         WHERE
         1=1
@@ -514,8 +517,9 @@
         FROM (
         SELECT a.id
         FROM system_users a
-        LEFT JOIN student_select_supervisor_record r ON r.student_id = a.id AND r.deleted = 0
+        LEFT JOIN student_select_supervisor_record r ON r.student_id = a.id AND r.deleted = 0 AND r.project_id = #{projectId}
         LEFT JOIN system_users supervisor_user ON supervisor_user.id = a.supervisor_id AND supervisor_user.deleted = 0
+        LEFT JOIN system_users externalSupervisor_user ON externalSupervisor_user.id = a.external_supervisor_id AND externalSupervisor_user.deleted = 0
         LEFT JOIN system_dept system_dept ON system_dept.id = a.dept_id
         WHERE 1 = 1
         <if test="reqVO.username != null and reqVO.username != ''">