Crazy преди 6 месеца
родител
ревизия
a0a70f6ee7

+ 14 - 6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/studentSelectSupervisorRecord/studentSelectSupervisorRecordController.java

@@ -244,9 +244,13 @@ public class studentSelectSupervisorRecordController {
     @PreAuthorize("@ss.hasPermission('system:student-select-supervisor-record:getSelection')")
     public CommonResult<selectionBookRespVO> getSelectionBook(@Param("id") Integer recordId) {
        studentSelectSupervisorRecordDO record = studentSelectSupervisorRecordService.getStudentSelectSupervisorRecord(recordId);
+
+        LocalDate date =LocalDate.now();
+        studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(date.getYear()),studentSelectionProjectSaveReqVO.class);
+
        AdminUserDO student =adminUserService.getUser(record.getStudentId());
        AdminUserDO supervisor =adminUserService.getUser(record.getSupervisorId());
-       supervisorSelectionSettingDO superVisorSetting = supervisorSelectionSettingService.getSettingBySupervisorId(record.getSupervisorId());
+       supervisorSelectionSettingDO superVisorSetting = supervisorSelectionSettingService.getSettingBySupervisorIdAndProjectId(record.getSupervisorId(),project.getId());
        selectionBookRespVO result = new selectionBookRespVO();
        result =BeanUtils.toBean(record,selectionBookRespVO.class);
        //学生
@@ -274,6 +278,9 @@ public class studentSelectSupervisorRecordController {
     public CommonResult<String> updateSelectionBook(@RequestBody selectionBookRespVO updateVo) {
         Long loginId =SecurityFrameworkUtils.getLoginUserId();
         Set<Long> roleIds =permissionService.getUserRoleIdListByUserId(loginId);
+
+        LocalDate date =LocalDate.now();
+        studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(date.getYear()),studentSelectionProjectSaveReqVO.class);
         //填写简介
         UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
         userSaveReqVO.setId(loginId);
@@ -303,14 +310,15 @@ public class studentSelectSupervisorRecordController {
                 userSaveReqVO.setTitle(updateVo.getTitle());
             }
             //学生成果要求,和名额填写
-            supervisorSelectionSettingDO setting = supervisorSelectionSettingService.getSettingBySupervisorId(loginId);
+            // TODO 项目id
+            supervisorSelectionSettingDO setting = supervisorSelectionSettingService.getSettingBySupervisorIdAndProjectId(loginId,project.getId());
             if (updateVo.getStudentAchievementRequirement()!=null&&!updateVo.getStudentAchievementRequirement().isEmpty()){
                 setting.setStudentAchievementRequirement(updateVo.getStudentAchievementRequirement());
             }
-            if (updateVo.getProfessionalSlots()!=null||updateVo.getAcademicSlots()!=null){
-                setting.setAcademicSlots(updateVo.getProfessionalSlots());
-                setting.setProfessionalSlots(updateVo.getProfessionalSlots());
-            }
+//            if (updateVo.getProfessionalSlots()!=null||updateVo.getAcademicSlots()!=null){
+//                setting.setAcademicSlots(updateVo.getProfessionalSlots());
+//                setting.setProfessionalSlots(updateVo.getProfessionalSlots());
+//            }
             supervisorSelectionSettingService.updateSupervisorSelectionSetting(BeanUtils.toBean(setting, supervisorSelectionSettingSaveReqVO.class));
         }
         userSaveReqVO.setIsSelectionInformation(1);//已经填写了信息

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

@@ -562,6 +562,7 @@ public class UserController {
         return success(true);
     }
 
+
     //TODO弹窗相关
     //判断用户是否应该弹窗
     @GetMapping("/getIsPop")
@@ -572,7 +573,7 @@ public class UserController {
         LocalDate date =LocalDate.now();
         AdminUserDO loginUser =userService.getUser(loginId);
         Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(loginId);
-        //TODO为了变成list
+
         studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(date.getYear()),studentSelectionProjectSaveReqVO.class);
 
         Integer isStudent = result.getIsStudent();

+ 3 - 2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/supervisorSelectionSetting/supervisorSelectionSettingMapper.java

@@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.supervisorSelectionSetting.
 import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import org.apache.ibatis.annotations.Mapper;
 import cn.iocoder.yudao.module.system.controller.admin.supervisorSelectionSetting.vo.*;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
@@ -43,8 +44,8 @@ public interface supervisorSelectionSettingMapper extends BaseMapperX<supervisor
         return selectPage(reqVO,mpjLambdaWrapperX);
     }
 
-    @Select("SELECT * FROM supervisor_selection_setting WHERE supervisor_id = #{supervisorId} AND deleted =0")
-    supervisorSelectionSettingDO getSettingBySupervisorId(Long supervisorId);
+    @Select("SELECT * FROM supervisor_selection_setting WHERE supervisor_id = #{supervisorId} AND project_id = #{projectId} AND deleted =0")
+    supervisorSelectionSettingDO getSettingBySupervisorIdAndProjectId(@Param("supervisorId") Long supervisorId,@Param("projectId") Integer projectId);
 
 
 

+ 1 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/supervisorSelectionSetting/supervisorSelectionSettingService.java

@@ -52,6 +52,6 @@ public interface supervisorSelectionSettingService {
      */
     PageResult<supervisorSelectionSettingDO> getSupervisorSelectionSettingPage(supervisorSelectionSettingPageReqVO pageReqVO);
 
-    supervisorSelectionSettingDO getSettingBySupervisorId(Long id);
+    supervisorSelectionSettingDO getSettingBySupervisorIdAndProjectId(Long supervisorId,Integer projectId);
 
 }

+ 2 - 2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/supervisorSelectionSetting/supervisorSelectionSettingServiceImpl.java

@@ -102,8 +102,8 @@ public class supervisorSelectionSettingServiceImpl implements supervisorSelectio
         return result;
     }
     @Override
-   public supervisorSelectionSettingDO getSettingBySupervisorId(Long supervisorId){
-        return supervisorSelectionSettingMapper.getSettingBySupervisorId(supervisorId);
+   public supervisorSelectionSettingDO getSettingBySupervisorIdAndProjectId(Long supervisorId,Integer projectId){
+        return supervisorSelectionSettingMapper.getSettingBySupervisorIdAndProjectId(supervisorId,projectId);
     }
 
 }