Forráskód Böngészése

Merge branch 'master' of http://gogs.gisvg.com/YDM/graduate

47 3 hónapja
szülő
commit
230a42df26

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

@@ -344,7 +344,8 @@ public class MailTemplateController {
                     }
                     }
 
 
                     PDFont font = PDType0Font.load(document, getClass().getResourceAsStream("/font/STXIHEI.TTF"));
                     PDFont font = PDType0Font.load(document, getClass().getResourceAsStream("/font/STXIHEI.TTF"));
-                // 使用第一个流写标题
+
+                    // 使用第一个流写标题
                     PDPageContentStream contentStream = contentStreams.get(0);
                     PDPageContentStream contentStream = contentStreams.get(0);
                     // 页面宽度与高度
                     // 页面宽度与高度
                     float pageWidth = page.getMediaBox().getWidth();
                     float pageWidth = page.getMediaBox().getWidth();

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

@@ -515,7 +515,7 @@ public class StudentSelectSupervisorRecordController {
                 userSaveReqVO.setMobile(updateVo.getMobile());
                 userSaveReqVO.setMobile(updateVo.getMobile());
             }
             }
 
 
-        }else if (roleIds.contains(113L)){//导师
+        }else if (roleIds.contains(113L)||roleIds.contains(114L)){//导师或学院编辑信息
             //导师填写信息
             //导师填写信息
             //1.研究方向
             //1.研究方向
             if (updateVo.getMajor()!=null&&!updateVo.getMajor().isEmpty()){
             if (updateVo.getMajor()!=null&&!updateVo.getMajor().isEmpty()){

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

@@ -137,6 +137,8 @@ public class studentSelectionProjectController {
 
 
         List<Long> newSupervisorIds = new ArrayList<>(updateReqVO.getSupervisorIds()); // 新的导师ID列表
         List<Long> newSupervisorIds = new ArrayList<>(updateReqVO.getSupervisorIds()); // 新的导师ID列表
 
 
+        List<String> updateErrorSupervisor =new ArrayList<>();//更新失败的导师
+
         // 处理新增的导师(在新列表中存在但在原列表中不存在)
         // 处理新增的导师(在新列表中存在但在原列表中不存在)
         newSupervisorIds.removeAll(originSupervisorIds); // 移除已存在的导师
         newSupervisorIds.removeAll(originSupervisorIds); // 移除已存在的导师
         if (!newSupervisorIds.isEmpty()) {
         if (!newSupervisorIds.isEmpty()) {
@@ -148,12 +150,13 @@ public class studentSelectionProjectController {
 
 
                 // 根据 request 中的名额信息设置名额
                 // 根据 request 中的名额信息设置名额
                 Map<String, String> supervisorQuota = findSupervisorQuotaById(updateReqVO.getSupervisorsWithQuota(), supervisorId);
                 Map<String, String> supervisorQuota = findSupervisorQuotaById(updateReqVO.getSupervisorsWithQuota(), supervisorId);
-
+                AdminUserDO supervisor =adminUserService.getUser(supervisorId);
                 if (supervisorQuota != null) {
                 if (supervisorQuota != null) {
                     Integer  occupiedAcademicSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorId,1);//占用学硕
                     Integer  occupiedAcademicSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorId,1);//占用学硕
                     Integer  occupiedProfessionalSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorId,2);//占用专硕
                     Integer  occupiedProfessionalSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorId,2);//占用专硕
 
 
                     if (Long.parseLong(supervisorQuota.get("academicSlots"))<occupiedAcademicSlots ||Long.parseLong(supervisorQuota.get("professionalSlots"))<occupiedProfessionalSlots){
                     if (Long.parseLong(supervisorQuota.get("academicSlots"))<occupiedAcademicSlots ||Long.parseLong(supervisorQuota.get("professionalSlots"))<occupiedProfessionalSlots){
+                        updateErrorSupervisor.add(supervisor.getNickname());
                         continue;
                         continue;
                     }
                     }
                     settingSaveReqVO.setAcademicSlots(Integer.valueOf(supervisorQuota.get("academicSlots")));
                     settingSaveReqVO.setAcademicSlots(Integer.valueOf(supervisorQuota.get("academicSlots")));
@@ -169,7 +172,15 @@ public class studentSelectionProjectController {
         removedSupervisorIds.removeAll(updateReqVO.getSupervisorIds()); // 找出被移除的导师ID
         removedSupervisorIds.removeAll(updateReqVO.getSupervisorIds()); // 找出被移除的导师ID
         if (!removedSupervisorIds.isEmpty()) {
         if (!removedSupervisorIds.isEmpty()) {
             for (Long supervisorId : removedSupervisorIds) {
             for (Long supervisorId : removedSupervisorIds) {
+                AdminUserDO supervisor =adminUserService.getUser(supervisorId);
                 supervisorSelectionSettingDO settingDO = supervisorSelectionSettingService.getSettingBySupervisorIdAndProjectId(supervisorId, updateReqVO.getId());
                 supervisorSelectionSettingDO settingDO = supervisorSelectionSettingService.getSettingBySupervisorIdAndProjectId(supervisorId, updateReqVO.getId());
+                Integer  occupiedAcademicSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorId,1);//占用学硕
+                Integer  occupiedProfessionalSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorId,2);//占用专硕
+                if (occupiedAcademicSlots!=0||occupiedProfessionalSlots!=0){//删除失败
+                    updateReqVO.getSupervisorIds().add(supervisorId);
+                    updateErrorSupervisor.add(supervisor.getNickname());
+                    continue;
+                }
                 if (settingDO != null) {
                 if (settingDO != null) {
                     supervisorSelectionSettingService.deleteSupervisorSelectionSetting(settingDO.getId());
                     supervisorSelectionSettingService.deleteSupervisorSelectionSetting(settingDO.getId());
                 }
                 }
@@ -180,7 +191,6 @@ public class studentSelectionProjectController {
                 .collect(Collectors.toList());
                 .collect(Collectors.toList());
 
 
         // 更新已有的导师(名额发生变化的导师)
         // 更新已有的导师(名额发生变化的导师)
-        List<String> errorSupervisor =new ArrayList<>();
         for (supervisorSelectionSettingDO supervisorSetting : originSupervisors) {
         for (supervisorSelectionSettingDO supervisorSetting : originSupervisors) {
 
 
             supervisorSelectionSettingSaveReqVO settingSaveReqVO = new supervisorSelectionSettingSaveReqVO();
             supervisorSelectionSettingSaveReqVO settingSaveReqVO = new supervisorSelectionSettingSaveReqVO();
@@ -196,7 +206,7 @@ public class studentSelectionProjectController {
                 Integer  occupiedProfessionalSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorSetting.getSupervisorId(),2);//占用专硕
                 Integer  occupiedProfessionalSlots =adminUserService.countStudentListBySupervisorId(project.getStudentGrade(),supervisorSetting.getSupervisorId(),2);//占用专硕
 
 
                 if (Long.parseLong(supervisorQuota.get("academicSlots"))<occupiedAcademicSlots ||Long.parseLong(supervisorQuota.get("professionalSlots"))<occupiedProfessionalSlots){
                 if (Long.parseLong(supervisorQuota.get("academicSlots"))<occupiedAcademicSlots ||Long.parseLong(supervisorQuota.get("professionalSlots"))<occupiedProfessionalSlots){
-                    errorSupervisor.add(supervisor.getNickname());
+                    updateErrorSupervisor.add(supervisor.getNickname());
                     continue;
                     continue;
                 }
                 }
                 settingSaveReqVO.setAcademicSlots(Integer.valueOf(supervisorQuota.get("academicSlots")));
                 settingSaveReqVO.setAcademicSlots(Integer.valueOf(supervisorQuota.get("academicSlots")));
@@ -207,8 +217,9 @@ public class studentSelectionProjectController {
 
 
         // 更新项目
         // 更新项目
         studentSelectionProjectService.updateStudentSelectionProject(updateReqVO);
         studentSelectionProjectService.updateStudentSelectionProject(updateReqVO);
-        if (!errorSupervisor.isEmpty()){
-            return error(1,errorSupervisor+"名额设置错误");
+        if (!updateErrorSupervisor.isEmpty()){
+            return error(1, updateErrorSupervisor + "导师设置错误" );
+
         }
         }
         return success(true);
         return success(true);
     }
     }