|
@@ -14,11 +14,7 @@ import com.qmth.distributed.print.business.bean.dto.TaskTotalLeftDto;
|
|
|
import com.qmth.distributed.print.business.bean.result.ExaminationDetailResult;
|
|
|
import com.qmth.distributed.print.business.bean.result.ExaminationResult;
|
|
|
import com.qmth.distributed.print.business.bean.result.SummarizedDataResult;
|
|
|
-import com.qmth.distributed.print.business.entity.BasicAttachment;
|
|
|
-import com.qmth.distributed.print.business.entity.BasicExamRule;
|
|
|
-import com.qmth.distributed.print.business.entity.ExamDetail;
|
|
|
-import com.qmth.distributed.print.business.entity.ExamDetailCourse;
|
|
|
-import com.qmth.distributed.print.business.entity.ExamStudent;
|
|
|
+import com.qmth.distributed.print.business.entity.*;
|
|
|
import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
|
|
|
import com.qmth.distributed.print.business.mapper.ExamDetailMapper;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
@@ -38,10 +34,7 @@ import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.net.URLEncoder;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
@@ -299,7 +292,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
public boolean submitTask(ExamDetail examDetail) {
|
|
|
// 检查前置操作是否完成 todo
|
|
|
UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.PRINTING).eq(ExamDetail::getId, examDetail.getId());
|
|
|
+ updateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.WAITING).eq(ExamDetail::getId, examDetail.getId());
|
|
|
return this.update(updateWrapper);
|
|
|
}
|
|
|
|
|
@@ -327,16 +320,16 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public void disposeExamDetailByExaminationExcel(List<Map<String, Object>> dataList, Long userId){
|
|
|
+ public void disposeExamDetailByExaminationExcel(List<Map<String, Object>> dataList, Long userId) {
|
|
|
List<Map<String, Object>> examDetailKeyList = dataList.stream().flatMap(e -> {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("schoolId",e.get("schoolId"));
|
|
|
- map.put("printPlanId",e.get("printPlanId"));
|
|
|
- map.put("printPlanName",e.get("printPlanName"));
|
|
|
- map.put("examPlace",e.get("examPlace"));
|
|
|
- map.put("examRoom",e.get("examRoom"));
|
|
|
- map.put("examDate",e.get("examDate"));
|
|
|
- map.put("examTime",e.get("examTime"));
|
|
|
+ map.put("schoolId", e.get("schoolId"));
|
|
|
+ map.put("printPlanId", e.get("printPlanId"));
|
|
|
+ map.put("printPlanName", e.get("printPlanName"));
|
|
|
+ map.put("examPlace", e.get("examPlace"));
|
|
|
+ map.put("examRoom", e.get("examRoom"));
|
|
|
+ map.put("examDate", e.get("examDate"));
|
|
|
+ map.put("examTime", e.get("examTime"));
|
|
|
return Stream.of(map);
|
|
|
}).distinct().collect(Collectors.toList());
|
|
|
|
|
@@ -378,19 +371,19 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public void disposeExamDetailCourseByExaminationExcel(List<Map<String, Object>> dataList,Long userId){
|
|
|
+ public void disposeExamDetailCourseByExaminationExcel(List<Map<String, Object>> dataList, Long userId) {
|
|
|
|
|
|
List<Map<String, Object>> examDetailKeyList = dataList.stream().flatMap(e -> {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("schoolId",e.get("schoolId"));
|
|
|
- map.put("printPlanId",e.get("printPlanId"));
|
|
|
- map.put("examPlace",e.get("examPlace"));
|
|
|
- map.put("examRoom",e.get("examRoom"));
|
|
|
- map.put("examDate",e.get("examDate"));
|
|
|
- map.put("examTime",e.get("examTime"));
|
|
|
- map.put("courseCode",e.get("courseCode"));
|
|
|
- map.put("courseName",e.get("courseName"));
|
|
|
- map.put("paperNumber",e.get("paperNumber"));
|
|
|
+ map.put("schoolId", e.get("schoolId"));
|
|
|
+ map.put("printPlanId", e.get("printPlanId"));
|
|
|
+ map.put("examPlace", e.get("examPlace"));
|
|
|
+ map.put("examRoom", e.get("examRoom"));
|
|
|
+ map.put("examDate", e.get("examDate"));
|
|
|
+ map.put("examTime", e.get("examTime"));
|
|
|
+ map.put("courseCode", e.get("courseCode"));
|
|
|
+ map.put("courseName", e.get("courseName"));
|
|
|
+ map.put("paperNumber", e.get("paperNumber"));
|
|
|
return Stream.of(map);
|
|
|
}).distinct().collect(Collectors.toList());
|
|
|
|
|
@@ -406,12 +399,12 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
String courseName = String.valueOf(map.get("courseName"));
|
|
|
String paperNumber = String.valueOf(map.get("paperNumber"));
|
|
|
List<ExamDetail> examDetailList = this.list(new QueryWrapper<ExamDetail>().lambda()
|
|
|
- .eq(ExamDetail::getPrintPlanId,printPlanId)
|
|
|
- .eq(ExamDetail::getExamPlace,examPlace)
|
|
|
- .eq(ExamDetail::getExamRoom,examRoom)
|
|
|
- .eq(ExamDetail::getExamStartTime,examStartTime)
|
|
|
- .eq(ExamDetail::getExamEndTime,examEndTime));
|
|
|
- if (examDetailList.size() != 1){
|
|
|
+ .eq(ExamDetail::getPrintPlanId, printPlanId)
|
|
|
+ .eq(ExamDetail::getExamPlace, examPlace)
|
|
|
+ .eq(ExamDetail::getExamRoom, examRoom)
|
|
|
+ .eq(ExamDetail::getExamStartTime, examStartTime)
|
|
|
+ .eq(ExamDetail::getExamEndTime, examEndTime));
|
|
|
+ if (examDetailList.size() != 1) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("无法找到新增的考务场次数据");
|
|
|
}
|
|
|
Long examDetailId = examDetailList.get(0).getId();
|
|
@@ -428,9 +421,10 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
}
|
|
|
examDetailCourseService.saveBatch(examDetailCourseList);
|
|
|
}
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public void disposeExamStudentByExaminationExcel(List<Map<String, Object>> dataList,Long userId){
|
|
|
+ public void disposeExamStudentByExaminationExcel(List<Map<String, Object>> dataList, Long userId) {
|
|
|
List<ExamStudent> examStudentList = new ArrayList<>();
|
|
|
for (Map<String, Object> map : dataList) {
|
|
|
Long schoolId = Long.valueOf(String.valueOf(map.get("schoolId")));
|
|
@@ -445,21 +439,21 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
String studentName = String.valueOf(map.get("studentName"));
|
|
|
String studentCode = String.valueOf(map.get("studentCode"));
|
|
|
List<ExamDetail> examDetailList = this.list(new QueryWrapper<ExamDetail>().lambda()
|
|
|
- .eq(ExamDetail::getPrintPlanId,printPlanId)
|
|
|
- .eq(ExamDetail::getExamPlace,examPlace)
|
|
|
- .eq(ExamDetail::getExamRoom,examRoom)
|
|
|
- .eq(ExamDetail::getExamStartTime,examStartTime)
|
|
|
- .eq(ExamDetail::getExamEndTime,examEndTime));
|
|
|
- if (examDetailList.size() != 1){
|
|
|
+ .eq(ExamDetail::getPrintPlanId, printPlanId)
|
|
|
+ .eq(ExamDetail::getExamPlace, examPlace)
|
|
|
+ .eq(ExamDetail::getExamRoom, examRoom)
|
|
|
+ .eq(ExamDetail::getExamStartTime, examStartTime)
|
|
|
+ .eq(ExamDetail::getExamEndTime, examEndTime));
|
|
|
+ if (examDetailList.size() != 1) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("无法找到新增的考务场次数据");
|
|
|
}
|
|
|
Long examDetailId = examDetailList.get(0).getId();
|
|
|
List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(new QueryWrapper<ExamDetailCourse>().lambda()
|
|
|
- .eq(ExamDetailCourse::getExamDetailId,examDetailId)
|
|
|
- .eq(ExamDetailCourse::getCourseCode,courseCode)
|
|
|
- .eq(ExamDetailCourse::getCourseName,courseName)
|
|
|
- .eq(ExamDetailCourse::getPaperNumber,paperNumber));
|
|
|
- if (examDetailCourseList.size() != 1){
|
|
|
+ .eq(ExamDetailCourse::getExamDetailId, examDetailId)
|
|
|
+ .eq(ExamDetailCourse::getCourseCode, courseCode)
|
|
|
+ .eq(ExamDetailCourse::getCourseName, courseName)
|
|
|
+ .eq(ExamDetailCourse::getPaperNumber, paperNumber));
|
|
|
+ if (examDetailCourseList.size() != 1) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("无法找到新增的考务科目数据");
|
|
|
}
|
|
|
Long examDetailCourseId = examDetailCourseList.get(0).getId();
|
|
@@ -478,4 +472,27 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
}
|
|
|
examStudentService.saveBatch(examStudentList);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ExamDetail> listByCourseCodeAndPaperNumber(Long schoolId, String courseCode, String paperNumber) {
|
|
|
+ QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
|
|
|
+ examDetailCourseQueryWrapper.lambda().eq(ExamDetailCourse::getSchoolId, schoolId)
|
|
|
+ .eq(ExamDetailCourse::getCourseCode, courseCode)
|
|
|
+ .eq(ExamDetailCourse::getPaperNumber, paperNumber);
|
|
|
+ List<ExamDetailCourse> examDetailCourses = examDetailCourseService.list(examDetailCourseQueryWrapper);
|
|
|
+ if (examDetailCourses != null && examDetailCourses.size() > 0) {
|
|
|
+ Set<Long> examDetailIds = examDetailCourses.stream().map(m -> m.getExamDetailId()).collect(Collectors.toSet());
|
|
|
+ List<ExamDetail> examDetails = this.listByIds(examDetailIds);
|
|
|
+ return examDetails;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ExamDetail> listByExamPrintId(Long printPlanId) {
|
|
|
+ QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, printPlanId)
|
|
|
+ .ne(ExamDetail::getStatus, ExamDetailStatusEnum.READY);
|
|
|
+ return this.list(queryWrapper);
|
|
|
+ }
|
|
|
}
|