|
@@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.qmth.distributed.print.business.bean.query.BasicExamStudentPageQuery;
|
|
|
-import com.qmth.distributed.print.business.bean.query.BasicExamStudentQuery;
|
|
|
import com.qmth.distributed.print.business.bean.dto.DeleteBasicExamStudentStatusDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.ExamStudentDto;
|
|
|
import com.qmth.distributed.print.business.bean.params.BasicExamStudentParam;
|
|
|
+import com.qmth.distributed.print.business.bean.query.BasicExamStudentPageQuery;
|
|
|
+import com.qmth.distributed.print.business.bean.query.BasicExamStudentQuery;
|
|
|
import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
|
|
|
import com.qmth.distributed.print.business.entity.BasicExamRule;
|
|
|
import com.qmth.distributed.print.business.entity.ExamStudent;
|
|
@@ -152,18 +152,21 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
public void deleteBatch(List<Long> idList) {
|
|
|
if (CollectionUtils.isNotEmpty(idList)) {
|
|
|
List<BasicExamStudent> basicExamStudentList = this.listByIds(idList);
|
|
|
- for (BasicExamStudent basicExamStudent : basicExamStudentList) {
|
|
|
- List<MarkStudent> markStudentList = markStudentService.listByBasicStudentId(basicExamStudent.getId());
|
|
|
- if (CollectionUtils.isNotEmpty(markStudentList)) {
|
|
|
- for (MarkStudent markStudent : markStudentList) {
|
|
|
- if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
|
|
|
- BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
|
|
|
- throw ExceptionResultEnum.ERROR.exception("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + basicExamStudent.getStudentCode() + "]考生已有评卷任务,不允许删除");
|
|
|
- }
|
|
|
+ List<Long> basicExamStudentIds = basicExamStudentList.stream().map(BasicExamStudent::getId).collect(Collectors.toList());
|
|
|
+ List<MarkStudent> markStudentList = markStudentService.listByBasicStudentIds(basicExamStudentIds);
|
|
|
+ if (CollectionUtils.isNotEmpty(markStudentList)) {
|
|
|
+ for (MarkStudent markStudent : markStudentList) {
|
|
|
+ if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
|
|
|
+ BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + markStudent.getStudentCode() + "]考生已有评卷任务,不允许删除");
|
|
|
}
|
|
|
}
|
|
|
- examStudentService.deleteByBasicStudentId(basicExamStudent.getId());
|
|
|
- markStudentService.deleteByBasicStudentId(basicExamStudent.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(basicExamStudentIds)) {
|
|
|
+ examStudentService.deleteByBasicStudentId(basicExamStudentIds);
|
|
|
+ markStudentService.deleteByBasicStudentId(basicExamStudentIds);
|
|
|
}
|
|
|
|
|
|
Set<String> paperNumberSet = basicExamStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperNumber())).map(BasicExamStudent::getPaperNumber).collect(Collectors.toSet());
|
|
@@ -294,7 +297,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
|
|
|
// 试卷编号绑定其它课程
|
|
|
if (StringUtils.isNotBlank(basicExamStudent.getPaperNumber())) {
|
|
|
- if(StringUtils.isBlank(basicExamStudent.getExamPlace())){
|
|
|
+ if (StringUtils.isBlank(basicExamStudent.getExamPlace())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("校区(考点)必填");
|
|
|
}
|
|
|
if (this.count(new QueryWrapper<BasicExamStudent>().lambda()
|
|
@@ -464,12 +467,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
List<BasicExamStudent> basicExamStudentList = this.listByIds(idList);
|
|
|
List<DeleteBasicExamStudentStatusDto> list = new ArrayList<>();
|
|
|
for (BasicExamStudent basicExamStudent : basicExamStudentList) {
|
|
|
- BasicCourse basicCourse = basicCourseService.getById(basicExamStudent.getCourseId());
|
|
|
- SysOrg sysOrg = sysOrgService.getById(basicCourse != null ? basicCourse.getTeachingRoomId() : null);
|
|
|
List<MarkStudent> markStudentList = markStudentService.listByStudentId(basicExamStudent.getId());
|
|
|
Map<Long, List<MarkStudent>> map = markStudentList.stream().collect(Collectors.groupingBy(MarkStudent::getBasicStudentId));
|
|
|
for (Map.Entry<Long, List<MarkStudent>> entry : map.entrySet()) {
|
|
|
- DeleteBasicExamStudentStatusDto deleteBasicExamStudentStatusDto = new DeleteBasicExamStudentStatusDto(basicExamStudent.getStudentName(), basicExamStudent.getStudentCode(), basicCourse != null ? basicCourse.getCode() : null, basicCourse != null ? basicCourse.getName() : null, sysOrg != null ? sysOrg.getName() : null);
|
|
|
+ DeleteBasicExamStudentStatusDto deleteBasicExamStudentStatusDto = new DeleteBasicExamStudentStatusDto(basicExamStudent.getStudentName(), basicExamStudent.getStudentCode());
|
|
|
deleteBasicExamStudentStatusDto.setScanStatus(entry.getValue().stream().filter(m -> m.getUpload() != null && m.getUpload()).count() > 0);
|
|
|
int taskCount = 0;
|
|
|
for (MarkStudent markStudent : entry.getValue()) {
|