|
@@ -10,15 +10,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
|
+import com.qmth.distributed.print.business.bean.BasicExamStudentQuery;
|
|
import com.qmth.distributed.print.business.bean.dto.*;
|
|
import com.qmth.distributed.print.business.bean.dto.*;
|
|
import com.qmth.distributed.print.business.bean.dto.approvalForm.*;
|
|
import com.qmth.distributed.print.business.bean.dto.approvalForm.*;
|
|
import com.qmth.distributed.print.business.bean.dto.examObject.ExamObjectDto;
|
|
import com.qmth.distributed.print.business.bean.dto.examObject.ExamObjectDto;
|
|
-import com.qmth.distributed.print.business.bean.dto.excel.ExamStudentImportDto;
|
|
|
|
import com.qmth.distributed.print.business.bean.params.*;
|
|
import com.qmth.distributed.print.business.bean.params.*;
|
|
|
|
+import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
|
|
import com.qmth.distributed.print.business.bean.result.WorkResult;
|
|
import com.qmth.distributed.print.business.bean.result.WorkResult;
|
|
-import com.qmth.distributed.print.business.bean.result.examTaskStudent.ExamTaskExamStudentImportResult;
|
|
|
|
import com.qmth.distributed.print.business.bean.result.examTaskStudent.ExamTaskStudentObjectResult;
|
|
import com.qmth.distributed.print.business.bean.result.examTaskStudent.ExamTaskStudentObjectResult;
|
|
-import com.qmth.distributed.print.business.bean.result.examTaskStudent.StudentInfo;
|
|
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.enums.*;
|
|
import com.qmth.distributed.print.business.enums.*;
|
|
import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
|
|
import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
|
|
@@ -29,9 +28,6 @@ import com.qmth.distributed.print.business.util.pdf.CreatePdfNewUtil;
|
|
import com.qmth.teachcloud.common.bean.dto.AssignTeacherDto;
|
|
import com.qmth.teachcloud.common.bean.dto.AssignTeacherDto;
|
|
import com.qmth.teachcloud.common.bean.dto.BlurryUserDto;
|
|
import com.qmth.teachcloud.common.bean.dto.BlurryUserDto;
|
|
import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
|
|
import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
|
|
-import com.qmth.teachcloud.common.bean.dto.excel.DescribeImportDto;
|
|
|
|
-import com.qmth.teachcloud.common.bean.params.BasicStudentExtrasParam;
|
|
|
|
-import com.qmth.teachcloud.common.bean.result.BasicExamStudentResult;
|
|
|
|
import com.qmth.teachcloud.common.bean.result.SysUserResult;
|
|
import com.qmth.teachcloud.common.bean.result.SysUserResult;
|
|
import com.qmth.teachcloud.common.bean.result.TbTaskDetailResult;
|
|
import com.qmth.teachcloud.common.bean.result.TbTaskDetailResult;
|
|
import com.qmth.teachcloud.common.bean.tiku.TikuPaperInfo;
|
|
import com.qmth.teachcloud.common.bean.tiku.TikuPaperInfo;
|
|
@@ -92,8 +88,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
@Resource
|
|
@Resource
|
|
private ExamTaskTempService examTaskTempService;
|
|
private ExamTaskTempService examTaskTempService;
|
|
@Resource
|
|
@Resource
|
|
- private ExamTaskReviewLogService examTaskReviewLogService;
|
|
|
|
- @Resource
|
|
|
|
private ExamTaskDetailService examTaskDetailService;
|
|
private ExamTaskDetailService examTaskDetailService;
|
|
@Resource
|
|
@Resource
|
|
private BasicAttachmentService basicAttachmentService;
|
|
private BasicAttachmentService basicAttachmentService;
|
|
@@ -117,8 +111,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
@Resource
|
|
@Resource
|
|
private TBTaskPdfService tbTaskPdfService;
|
|
private TBTaskPdfService tbTaskPdfService;
|
|
@Resource
|
|
@Resource
|
|
- private ExamTaskPaperLogService examTaskPaperLogService;
|
|
|
|
- @Resource
|
|
|
|
AsyncPaperReviewPdfExportService asyncPaperReviewPdfExportService;
|
|
AsyncPaperReviewPdfExportService asyncPaperReviewPdfExportService;
|
|
@Resource
|
|
@Resource
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
@@ -895,7 +887,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
if (Objects.nonNull(attachmentId)) {
|
|
if (Objects.nonNull(attachmentId)) {
|
|
BasicAttachment attachment = basicAttachmentService.getById(attachmentId);
|
|
BasicAttachment attachment = basicAttachmentService.getById(attachmentId);
|
|
Optional.ofNullable(attachment).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("附件数据异常"));
|
|
Optional.ofNullable(attachment).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("附件数据异常"));
|
|
- String fileName = dirPath + "试卷" + SystemConstant.HYPHEN + name + attachment.getType();
|
|
|
|
|
|
+ String fileName = dirPath + "试卷" + SystemConstant.HYPHEN + name + attachment.getType();
|
|
fileUploadService.downloadFile(attachment, fileName);
|
|
fileUploadService.downloadFile(attachment, fileName);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1129,37 +1121,23 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public String findCardTitle(Long cardRuleId) {
|
|
|
|
- String title = "通用题卡";
|
|
|
|
- if (-1L != cardRuleId) {
|
|
|
|
- BasicCardRule basicCardRule = basicCardRuleService.getById(cardRuleId);
|
|
|
|
- if (Objects.isNull(basicCardRule)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("未找到题卡规则id");
|
|
|
|
- }
|
|
|
|
- title = basicCardRule.getTitleRule();
|
|
|
|
- // TODO: 2021/8/16 title中的动态变量替换规则
|
|
|
|
- }
|
|
|
|
- return title;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> submitTaskApply(ExamTaskApplyTemp examTaskApplyTemp) {
|
|
|
|
|
|
+ public Map<String, Object> submitTaskApply(ExamTaskSubmitPram examTaskSubmitPram) {
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(examTaskApplyTemp.getExamTaskContent());
|
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(examTaskSubmitPram.getExamTaskContent());
|
|
// 新建命题任务
|
|
// 新建命题任务
|
|
ExamTask examTask = JSONObject.parseObject(String.valueOf(jsonObject.get("examTask")), ExamTask.class);
|
|
ExamTask examTask = JSONObject.parseObject(String.valueOf(jsonObject.get("examTask")), ExamTask.class);
|
|
BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examTask.getExamId());
|
|
BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examTask.getExamId());
|
|
|
|
|
|
if (basicPrintConfig.getReview()) {
|
|
if (basicPrintConfig.getReview()) {
|
|
- Long customFlowId = examTaskApplyTemp.getCustomFlowId();
|
|
|
|
|
|
+ Long customFlowId = examTaskSubmitPram.getCustomFlowId();
|
|
Optional.ofNullable(customFlowId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程ID为空"));
|
|
Optional.ofNullable(customFlowId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程ID为空"));
|
|
|
|
|
|
- if (Objects.nonNull(examTaskApplyTemp.getVersion())) {
|
|
|
|
- Integer version = examTaskApplyTemp.getVersion();
|
|
|
|
|
|
+ if (Objects.nonNull(examTaskSubmitPram.getVersion())) {
|
|
|
|
+ Integer version = examTaskSubmitPram.getVersion();
|
|
Optional.ofNullable(version).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程版本号为空"));
|
|
Optional.ofNullable(version).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程版本号为空"));
|
|
|
|
|
|
TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(customFlowId);
|
|
TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(customFlowId);
|
|
@@ -1472,7 +1450,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
|
|
map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
|
|
map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
|
|
map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
|
|
map.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
|
|
map.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
|
|
- map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> examTaskApplyTemp.getApproveUserIds());
|
|
|
|
|
|
+ map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> examTaskSubmitPram.getApproveUserIds());
|
|
activitiService.taskApprove(map);
|
|
activitiService.taskApprove(map);
|
|
mapVar.putAll(map);
|
|
mapVar.putAll(map);
|
|
mapVar.remove(SystemConstant.SEND_FLOW_START_MQ);
|
|
mapVar.remove(SystemConstant.SEND_FLOW_START_MQ);
|
|
@@ -1651,234 +1629,42 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public List<ExamTaskStudentObjectResult> findExamTaskStudentObject(Long examId, Long courseId, String teacher, String className, SysUser requestUser) {
|
|
|
|
- Long schoolId = requestUser.getSchoolId();
|
|
|
|
|
|
+ public List<ExamTaskStudentObjectResult> findExamTaskStudentObject(Long examId, Long courseId, String teacher, String teachClassName, String className, String paperNumber) {
|
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
List<ExamTaskStudentObjectResult> result = new ArrayList<>();
|
|
List<ExamTaskStudentObjectResult> result = new ArrayList<>();
|
|
// 基础班级对象
|
|
// 基础班级对象
|
|
- List<BasicExamStudentResult> basicStudentResultList = basicStudentService.basicStudentList(schoolId, examId, courseId, teacher, className, null);
|
|
|
|
|
|
+ BasicExamStudentQuery basicExamStudentQuery = new BasicExamStudentQuery();
|
|
|
|
+ basicExamStudentQuery.setSchoolId(schoolId);
|
|
|
|
+ basicExamStudentQuery.setExamId(examId);
|
|
|
|
+ basicExamStudentQuery.setCourseId(courseId);
|
|
|
|
+ basicExamStudentQuery.setTeacherName(teacher);
|
|
|
|
+ basicExamStudentQuery.setTeachClassName(teachClassName);
|
|
|
|
+ basicExamStudentQuery.setTeachClassName(className);
|
|
|
|
+ basicExamStudentQuery.setPaperNumber(paperNumber);
|
|
|
|
+ List<BasicExamStudentResult> basicStudentResultList = basicExamStudentService.listByParams(basicExamStudentQuery);
|
|
if (!CollectionUtils.isEmpty(basicStudentResultList)) {
|
|
if (!CollectionUtils.isEmpty(basicStudentResultList)) {
|
|
- LinkedMultiValueMap<Long, StudentInfo> studentInfoLinkedMultiValueMap = new LinkedMultiValueMap<>();
|
|
|
|
- Map<Long, ExamTaskStudentObjectResult> examTaskStudentObjectResultMap = new LinkedHashMap<>();
|
|
|
|
|
|
+ LinkedMultiValueMap<String, BasicExamStudentResult> studentInfoLinkedMultiValueMap = new LinkedMultiValueMap<>();
|
|
|
|
+ Map<String, ExamTaskStudentObjectResult> examTaskStudentObjectResultMap = new LinkedHashMap<>();
|
|
for (BasicExamStudentResult e : basicStudentResultList) {
|
|
for (BasicExamStudentResult e : basicStudentResultList) {
|
|
|
|
+ String studentTeachClassName = StringUtils.isNotBlank(e.getTeachClassName()) ? e.getTeachClassName() : "空";
|
|
// 没有班级的考生,不返回
|
|
// 没有班级的考生,不返回
|
|
- if (StringUtils.isBlank(e.getClazz())) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- StudentInfo studentInfo = new StudentInfo();
|
|
|
|
- studentInfo.setStudentId(e.getId());
|
|
|
|
- studentInfo.setStudentCode(e.getStudentCode());
|
|
|
|
- studentInfo.setStudentName(e.getStudentName());
|
|
|
|
- studentInfo.setCollegeName(e.getCollegeName());
|
|
|
|
- studentInfo.setMajorName(e.getMajorName());
|
|
|
|
- studentInfo.setBasicClazzId(e.getClazzId());
|
|
|
|
- studentInfo.setBasicClazzName(e.getClazz());
|
|
|
|
- studentInfoLinkedMultiValueMap.add(e.getClazzId(), studentInfo);
|
|
|
|
-
|
|
|
|
- ExamTaskStudentObjectResult examTaskStudentObjectResult = null;
|
|
|
|
- if (!examTaskStudentObjectResultMap.containsKey(e.getClazzId())) {
|
|
|
|
|
|
+ studentInfoLinkedMultiValueMap.add(studentTeachClassName, e);
|
|
|
|
+
|
|
|
|
+ ExamTaskStudentObjectResult examTaskStudentObjectResult;
|
|
|
|
+ if (!examTaskStudentObjectResultMap.containsKey(studentTeachClassName)) {
|
|
examTaskStudentObjectResult = new ExamTaskStudentObjectResult();
|
|
examTaskStudentObjectResult = new ExamTaskStudentObjectResult();
|
|
- examTaskStudentObjectResult.setClazzId(e.getClazzId());
|
|
|
|
- examTaskStudentObjectResult.setClazzName(e.getClazz());
|
|
|
|
|
|
+ examTaskStudentObjectResult.setTeachClassName(studentTeachClassName);
|
|
} else {
|
|
} else {
|
|
- examTaskStudentObjectResult = examTaskStudentObjectResultMap.get(e.getClazzId());
|
|
|
|
|
|
+ examTaskStudentObjectResult = examTaskStudentObjectResultMap.get(studentTeachClassName);
|
|
}
|
|
}
|
|
- examTaskStudentObjectResult.setStudentInfoList(studentInfoLinkedMultiValueMap.get(e.getClazzId()));
|
|
|
|
- examTaskStudentObjectResultMap.put(e.getClazzId(), examTaskStudentObjectResult);
|
|
|
|
|
|
+ examTaskStudentObjectResult.setStudentInfoList(studentInfoLinkedMultiValueMap.get(studentTeachClassName));
|
|
|
|
+ examTaskStudentObjectResultMap.put(studentTeachClassName, examTaskStudentObjectResult);
|
|
}
|
|
}
|
|
result.addAll(examTaskStudentObjectResultMap.values());
|
|
result.addAll(examTaskStudentObjectResultMap.values());
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
|
- @Override
|
|
|
|
- public List<ExamTaskExamStudentImportResult> examTaskExamStudentImport(MultipartFile file, SysUser requestUser) throws IOException, NoSuchFieldException, IllegalAccessException {
|
|
|
|
- if (Objects.isNull(file)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("缺少导入文件");
|
|
|
|
- }
|
|
|
|
- // excel 读取和检验
|
|
|
|
- List<ExamStudentImportDto> examStudentImportDtoList = new ArrayList<>();
|
|
|
|
- List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(file.getInputStream(), Lists.newArrayList(ExamStudentImportDto.class, DescribeImportDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
|
|
|
|
- List<ExcelError> excelErrorTemp = new ArrayList<>();
|
|
|
|
- Map<String, String> checkCodeMap = new HashMap<>();
|
|
|
|
- Map<String, String> checkPhoneMap = new HashMap<>();
|
|
|
|
- for (int i = 0; i < finalExcelList.size(); i++) {
|
|
|
|
- LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
|
|
|
|
- List<Object> examStudentImportDtoDatasource = excelMap.get(i);
|
|
|
|
- assert examStudentImportDtoDatasource != null;
|
|
|
|
- if (examStudentImportDtoDatasource.get(0) instanceof DescribeImportDto) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- for (int y = 0; y < Objects.requireNonNull(examStudentImportDtoDatasource).size(); y++) {
|
|
|
|
- ExamStudentImportDto examStudentImportDto = (ExamStudentImportDto) examStudentImportDtoDatasource.get(y);
|
|
|
|
- String studentName = examStudentImportDto.getStudentName();
|
|
|
|
- String studentCode = examStudentImportDto.getStudentCode();
|
|
|
|
- String phoneNumber = examStudentImportDto.getPhoneNumber();
|
|
|
|
- String clazzName = examStudentImportDto.getClazzName();
|
|
|
|
- String examPlace = examStudentImportDto.getExamPlace();
|
|
|
|
- String examRoom = examStudentImportDto.getExamRoom();
|
|
|
|
- examStudentImportDtoList.add(examStudentImportDto);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 检验excel中
|
|
|
|
- // 检验学号
|
|
|
|
- if (SystemConstant.strNotNull(studentCode)) {
|
|
|
|
- if (checkCodeMap.containsKey(studentCode)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的excel中包含在重复的学生编号[" + studentCode + "]");
|
|
|
|
- } else {
|
|
|
|
- checkCodeMap.put(studentCode, studentName);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 如果电话有值则检验电话excel中唯一性
|
|
|
|
- if (SystemConstant.strNotNull(phoneNumber)) {
|
|
|
|
- if (checkPhoneMap.containsKey(phoneNumber)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的excel中包含在重复的电话号码[" + phoneNumber + "]");
|
|
|
|
- } else {
|
|
|
|
- checkPhoneMap.put(phoneNumber, studentCode);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- excelErrorTemp.addAll(ExcelUtil.checkExcelField(examStudentImportDto, y, i));
|
|
|
|
- if (Objects.nonNull(studentCode) && !studentCode.matches(SystemConstant.REGULAR_EXPRESSION_OF_CODE)) {
|
|
|
|
- excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[学号]不符合输入规范"));
|
|
|
|
- }
|
|
|
|
- if (Objects.nonNull(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
|
|
|
|
- excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[电话号码]不符合输入规范"));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (excelErrorTemp.size() > 0) {
|
|
|
|
- List<String> errors = excelErrorTemp.stream().map(ExcelError::getExcelErrorType).collect(Collectors.toList());
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(errors));
|
|
|
|
- }
|
|
|
|
- return finalExcelList;
|
|
|
|
- }, 2);
|
|
|
|
- // 校验已经有的考生所在部门的信息是否正确
|
|
|
|
- // 导入的excel创建或查询的学生集合
|
|
|
|
- List<BasicExamStudentResult> studentDatasource = basicStudentService.basicStudentList(requestUser.getSchoolId(), null, null, null, null, null);
|
|
|
|
-
|
|
|
|
- List<ExamStudentImportDto> existStudentList = examStudentImportDtoList
|
|
|
|
- .stream()
|
|
|
|
- .filter(e -> studentDatasource.stream().map(BasicExamStudentResult::getStudentCode).collect(Collectors.toList()).contains(e.getStudentCode()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- for (ExamStudentImportDto examStudentImportDto : existStudentList) {
|
|
|
|
- String studentName = examStudentImportDto.getStudentName();
|
|
|
|
- String studentCode = examStudentImportDto.getStudentCode();
|
|
|
|
- String impCollegeName = examStudentImportDto.getCollegeName();
|
|
|
|
- String impMajorName = examStudentImportDto.getMajorName();
|
|
|
|
- String impClazzName = examStudentImportDto.getClazzName();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- List<BasicExamStudentResult> basicStudentList = studentDatasource.stream().filter(e -> e.getStudentCode().equals(studentCode)).collect(Collectors.toList());
|
|
|
|
- if (basicStudentList.size() != 1) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("学号为:" + studentCode + "的考生数据异常");
|
|
|
|
- }
|
|
|
|
- BasicExamStudentResult basicStudent = basicStudentList.get(0);
|
|
|
|
-
|
|
|
|
- String realityCollegeName = basicStudent.getCollegeName();
|
|
|
|
- String realityMajorName = basicStudent.getMajorName();
|
|
|
|
- String realityClazzName = basicStudent.getClazz();
|
|
|
|
-
|
|
|
|
- // 学院核对
|
|
|
|
- if (!impCollegeName.equals(realityCollegeName)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的考生[" + studentName + "(" + studentCode + ")]所在学院[" + impCollegeName +
|
|
|
|
- "]与该考生实际所在学院[" + realityCollegeName + "]不符,请检验excel数据是否异常或联系管理员核对");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 专业核对
|
|
|
|
- if (!impMajorName.equals(realityMajorName)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的考生[" + studentName + "(" + studentCode + ")]所在专业[" + impMajorName +
|
|
|
|
- "]与该考生实际所在专业[" + realityMajorName + "]不符,请检验excel数据是否异常或联系管理员核对");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 班级核对
|
|
|
|
- if (!impClazzName.equals(realityClazzName)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的考生[" + studentName + "(" + studentCode + ")]所在班级[" + impClazzName +
|
|
|
|
- "]与该考生实际所在班级[" + realityClazzName + "]不符,请检验excel数据是否异常或联系管理员核对");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 去掉已存在的学生集合
|
|
|
|
- List<ExamStudentImportDto> willAddStudentList = new ArrayList<>(examStudentImportDtoList);
|
|
|
|
- willAddStudentList.removeAll(existStudentList);
|
|
|
|
-
|
|
|
|
- // 创建基础学生信息
|
|
|
|
- List<BasicStudentExtrasParam> basicStudentExtrasParamList = willAddStudentList.stream().flatMap(e -> {
|
|
|
|
- BasicStudentExtrasParam basicStudentExtrasParam = new BasicStudentExtrasParam();
|
|
|
|
- basicStudentExtrasParam.setStudentName(e.getStudentName());
|
|
|
|
- basicStudentExtrasParam.setStudentCode(e.getStudentCode());
|
|
|
|
- basicStudentExtrasParam.setPhoneNumber(e.getPhoneNumber());
|
|
|
|
- basicStudentExtrasParam.setCollegeName(e.getCollegeName());
|
|
|
|
- basicStudentExtrasParam.setMajorName(e.getMajorName());
|
|
|
|
- basicStudentExtrasParam.setClazzName(e.getClazzName());
|
|
|
|
- return Stream.of(basicStudentExtrasParam);
|
|
|
|
- }).collect(Collectors.toList());
|
|
|
|
- basicStudentService.saveBasicStudentWithExtrasList(basicStudentExtrasParamList, requestUser, false, null);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 考生信息回溯
|
|
|
|
- List<ExamTaskExamStudentImportResult> result = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- List<String> studentCodeDatasource = examStudentImportDtoList.stream().map(ExamStudentImportDto::getStudentCode).distinct().collect(Collectors.toList());
|
|
|
|
- // 导入的excel创建或查询的学生集合
|
|
|
|
- List<BasicExamStudentResult> basicStudentResultDatasource = basicStudentService.basicStudentList(requestUser.getSchoolId(), null, null, null, null, studentCodeDatasource);
|
|
|
|
-
|
|
|
|
- // 考试对象键(考点、考场)
|
|
|
|
- List<Map<String, String>> examObjectKeyList = examStudentImportDtoList.stream().flatMap(e -> {
|
|
|
|
- Map<String, String> key = new HashMap<>();
|
|
|
|
- key.put("examPlace", e.getExamPlace());
|
|
|
|
- key.put("examRoom", e.getExamRoom());
|
|
|
|
- return Stream.of(key);
|
|
|
|
- }).distinct().collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- for (Map<String, String> key : examObjectKeyList) {
|
|
|
|
- // 考点
|
|
|
|
- String examPlace = key.get("examPlace");
|
|
|
|
- // 考场
|
|
|
|
- String examRoom = key.get("examRoom");
|
|
|
|
-
|
|
|
|
- // 该考试对象考生考号集合
|
|
|
|
- List<String> studentCodeList = examStudentImportDtoList.stream()
|
|
|
|
- .filter(e -> examPlace.equals(e.getExamPlace()) && examRoom.equals(e.getExamRoom()))
|
|
|
|
- .map(ExamStudentImportDto::getStudentCode)
|
|
|
|
- .distinct()
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- List<ExamTaskStudentObjectResult> examTaskStudentObjectResultList = new ArrayList<>();
|
|
|
|
- List<BasicExamStudentResult> basicStudentResultList = basicStudentResultDatasource.stream().filter(e -> studentCodeList.contains(e.getStudentCode())).collect(Collectors.toList());
|
|
|
|
- List<Long> basicClazzIdList = basicStudentResultList.stream().map(BasicExamStudentResult::getClazzId).distinct().collect(Collectors.toList());
|
|
|
|
- for (Long basicClazzId : basicClazzIdList) {
|
|
|
|
- List<BasicExamStudentResult> basicStudentClazzList = basicStudentResultList.stream()
|
|
|
|
- .filter(e -> basicClazzId.equals(e.getClazzId())).collect(Collectors.toList());
|
|
|
|
- List<StudentInfo> studentInfoList = basicStudentClazzList.stream().flatMap(e -> {
|
|
|
|
- StudentInfo studentInfo = new StudentInfo();
|
|
|
|
- studentInfo.setStudentId(e.getId());
|
|
|
|
- studentInfo.setStudentCode(e.getStudentCode());
|
|
|
|
- studentInfo.setStudentName(e.getStudentName());
|
|
|
|
- studentInfo.setCollegeName(e.getCollegeName());
|
|
|
|
- studentInfo.setMajorName(e.getMajorName());
|
|
|
|
- studentInfo.setBasicClazzId(e.getClazzId());
|
|
|
|
- studentInfo.setBasicClazzName(e.getClazz());
|
|
|
|
- return Stream.of(studentInfo);
|
|
|
|
- }).collect(Collectors.toList());
|
|
|
|
- ExamTaskStudentObjectResult examTaskStudentObjectResult = new ExamTaskStudentObjectResult();
|
|
|
|
- examTaskStudentObjectResult.setClazzId(basicClazzId);
|
|
|
|
- examTaskStudentObjectResult.setClazzName(basicClazzService.getById(basicClazzId).getClazzName());
|
|
|
|
- examTaskStudentObjectResult.setStudentInfoList(studentInfoList);
|
|
|
|
- examTaskStudentObjectResultList.add(examTaskStudentObjectResult);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- ExamTaskExamStudentImportResult examTaskExamStudentImportResult = new ExamTaskExamStudentImportResult();
|
|
|
|
- examTaskExamStudentImportResult.setExamRoom(examRoom);
|
|
|
|
- if (SystemConstant.strNotNull(examPlace)) {
|
|
|
|
- examTaskExamStudentImportResult.setExamPlace(examPlace);
|
|
|
|
- }
|
|
|
|
- examTaskExamStudentImportResult.setExamTaskStudentObjectResultList(examTaskStudentObjectResultList);
|
|
|
|
- result.add(examTaskExamStudentImportResult);
|
|
|
|
- }
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void delete(Long id) {
|
|
public void delete(Long id) {
|
|
// 命题任务生成,命题老师未提交前允许删除
|
|
// 命题任务生成,命题老师未提交前允许删除
|
|
@@ -2244,6 +2030,21 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
return examDetailList;
|
|
return examDetailList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<TaskPrintHouseDto> listPrintHouse() {
|
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
+ QueryWrapper<SysOrg> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.lambda().eq(SysOrg::getSchoolId, schoolId)
|
|
|
|
+ .eq(SysOrg::getType, OrgTypeEnum.PRINTING_HOUSE);
|
|
|
|
+ List<SysOrg> sysOrgList = sysOrgService.list(queryWrapper);
|
|
|
|
+ return sysOrgList.stream().map(m -> {
|
|
|
|
+ TaskPrintHouseDto taskPrintHouseDto = new TaskPrintHouseDto();
|
|
|
|
+ taskPrintHouseDto.setPrintHouseId(m.getId());
|
|
|
|
+ taskPrintHouseDto.setPrintHouseName(m.getName());
|
|
|
|
+ return taskPrintHouseDto;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
private ExamTaskPaperData saveTikuPaperData(Long examId, Long paperId, String uuid, File zipFile) {
|
|
private ExamTaskPaperData saveTikuPaperData(Long examId, Long paperId, String uuid, File zipFile) {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
String zipDestPath = null;
|
|
String zipDestPath = null;
|