소스 검색

开学报到导出调整

dzx 9 달 전
부모
커밋
b9758364b2

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

@@ -40,7 +40,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
-import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -131,22 +130,19 @@ public class StudentReportPlanController {
         if(reportPlan == null){
             throw new MyException("未能找到计划信息");
         }
-        LocalDateTime now = LocalDateTime.now();
-        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)
-                        .eq(StudentReportPlan::getSemesterId, 1)
-                        .le(StudentReportPlan::getStartTime, now)
-                        .ge(StudentReportPlan::getEndTime, now)
-        );
-        if(!list.isEmpty()){
-            throw new MyException("已存在正在进行的计划,无法发布");
-        }
         //如果发布,需要先验证计划中的班级是否在其他生效的计划内
         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("已存在正在进行的计划,无法发布");
+            }
             if(reportPlan.getStudentReportPlanClassRelationList() == null || reportPlan.getStudentReportPlanClassRelationList().isEmpty()){
                 return RT.error("未选择班级,无法进行发布");
             }

+ 1 - 0
src/main/resources/mapper/student/BaseStudentMapper.xml

@@ -64,6 +64,7 @@
         LEFT JOIN xjr_dictionary_detail t10 ON t3.learn_status = t10.code AND t10.item_id = 1762024751192084482
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
         and t3.archives_status = 'FB2901'
+        and t2.is_normal = 1
         <if test="dto.name != null and dto.name != ''">
             and t1.name like concat('%', #{dto.name},'%')
         </if>