Pārlūkot izejas kodu

开学报到计划发布,不做已经发布验证

大数据与最优化研究所 3 mēneši atpakaļ
vecāks
revīzija
4496e0bfc2

+ 4 - 0
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -57,6 +57,7 @@ import com.xjrsoft.module.system.entity.DictionaryItem;
 import com.xjrsoft.module.system.mapper.DictionarydetailMapper;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -122,6 +123,9 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
     @Override
     public List<BandingTaskClassPageVo> getList(BandingTaskClassPageDto dto) {
         BandingTask bandingTask = bandingTaskMapper.selectById(dto.getBandingTaskId());
+        if(ObjectUtils.isEmpty(bandingTask)){
+            return new ArrayList<>();
+        }
         dto.setGradeId(bandingTask.getGradeId());
         dto.setEnrollType(bandingTask.getEnrollType());
         return this.baseMapper.getList(dto);

+ 18 - 18
src/main/java/com/xjrsoft/module/student/controller/StudentReportPlanController.java

@@ -145,27 +145,27 @@ public class StudentReportPlanController {
         }
         //如果发布,需要先验证计划中的班级是否在其他生效的计划内
         if (dto.getStatus() != null && dto.getStatus() == 1) {
-            List<StudentReportPlan> list = studentReportPlanService.list(
-                    new QueryWrapper<StudentReportPlan>().lambda()
-                            .ne(StudentReportPlan::getId, reportPlan.getId())
-                            .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
-                            .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
-                            .eq(StudentReportPlan::getStatus, 1)
-                            .ne(StudentReportPlan::getSemesterId, reportPlan.getSemesterId())
-            );
-            if (!list.isEmpty()) {
-                throw new MyException("已存在正在进行的计划,无法发布");
-            }
+//            List<StudentReportPlan> list = studentReportPlanService.list(
+//                    new QueryWrapper<StudentReportPlan>().lambda()
+//                            .ne(StudentReportPlan::getId, reportPlan.getId())
+//                            .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+//                            .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+//                            .eq(StudentReportPlan::getStatus, 1)
+//                            .ne(StudentReportPlan::getSemesterId, reportPlan.getSemesterId())
+//            );
+//            if (!list.isEmpty()) {
+//                throw new MyException("已存在正在进行的计划,无法发布");
+//            }
             if (reportPlan.getStudentReportPlanClassRelationList() == null || reportPlan.getStudentReportPlanClassRelationList().isEmpty()) {
                 return RT.error("未选择班级,无法进行发布");
             }
-            List<Long> classIds = reportPlan.getStudentReportPlanClassRelationList()
-                    .stream().map(StudentReportPlanClassRelation::getClassId).collect(Collectors.toList());
-            List<BaseClass> classList = studentReportPlanService.validateClass(dto.getId(), classIds);
-            if (!classList.isEmpty()) {
-                Set<String> classNames = classList.stream().map(BaseClass::getName).collect(Collectors.toSet());
-                return RT.error(classNames.toString().replace("[", "").replace("]", "") + "已在其他计划中,无法发布");
-            }
+//            List<Long> classIds = reportPlan.getStudentReportPlanClassRelationList()
+//                    .stream().map(StudentReportPlanClassRelation::getClassId).collect(Collectors.toList());
+//            List<BaseClass> classList = studentReportPlanService.validateClass(dto.getId(), classIds);
+//            if (!classList.isEmpty()) {
+//                Set<String> classNames = classList.stream().map(BaseClass::getName).collect(Collectors.toSet());
+//                return RT.error(classNames.toString().replace("[", "").replace("]", "") + "已在其他计划中,无法发布");
+//            }
 
             if (reportPlan.getStatus() == 1) {
                 return RT.error("已发布,无法再次发布");