|
|
@@ -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("未选择班级,无法进行发布");
|
|
|
}
|