|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
+import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
@@ -39,6 +40,7 @@ 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;
|
|
|
@@ -129,6 +131,20 @@ 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){
|
|
|
if(reportPlan.getStudentReportPlanClassRelationList() == null || reportPlan.getStudentReportPlanClassRelationList().isEmpty()){
|