|
@@ -9,13 +9,13 @@ import com.qmth.distributed.print.business.bean.dto.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
|
|
import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
|
+import com.qmth.teachcloud.common.bean.dto.SchoolDto;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
import com.qmth.teachcloud.common.entity.SysPrivilege;
|
|
import com.qmth.teachcloud.common.entity.SysPrivilege;
|
|
|
|
+import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
-import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
|
|
-import com.qmth.teachcloud.common.service.SysPrivilegeService;
|
|
|
|
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
|
|
|
|
+import com.qmth.teachcloud.common.service.*;
|
|
import com.qmth.teachcloud.common.util.ExcelUtil;
|
|
import com.qmth.teachcloud.common.util.ExcelUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -66,7 +66,10 @@ public class ClientServiceImpl implements ClientService {
|
|
SysPrivilegeService sysPrivilegeService;
|
|
SysPrivilegeService sysPrivilegeService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
- BasicExamService basicExamService;
|
|
|
|
|
|
+ SysUserService sysUserService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ BasicSchoolService basicSchoolService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
|
|
public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
|
|
@@ -75,9 +78,23 @@ public class ClientServiceImpl implements ClientService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<Map<String, String>> getPaperUrl(Long printPlanId, Long examTaskId) {
|
|
|
|
|
|
+ public List<Map<String, Object>> getPaperUrl(List<JSONObject> objects) {
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
- return examTaskDetailService.getPaperUrl(schoolId, printPlanId, examTaskId);
|
|
|
|
|
|
+ List<Map<String, Object>> finalList = new ArrayList<>();
|
|
|
|
+ for (JSONObject object : objects) {
|
|
|
|
+ Long printPlanId = object.getLong("printPlanId");
|
|
|
|
+ Long examTaskId = object.getLong("examTaskId");
|
|
|
|
+ ExamTask examTask = examTaskService.getById(examTaskId);
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("printPlanId", printPlanId);
|
|
|
|
+ map.put("courseCode", examTask.getCourseCode());
|
|
|
|
+ map.put("courseName", examTask.getCourseName());
|
|
|
|
+ map.put("paperNumber", examTask.getPaperNumber());
|
|
|
|
+ List<Map<String, String>> mapList = examTaskDetailService.getPaperUrl(schoolId, printPlanId, examTaskId);
|
|
|
|
+ map.put("list", mapList);
|
|
|
|
+ finalList.add(map);
|
|
|
|
+ }
|
|
|
|
+ return finalList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -157,183 +174,193 @@ public class ClientServiceImpl implements ClientService {
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> getPrintData(Long examDetailId, String machineCode, Boolean isPrint, String printUser) {
|
|
|
|
- ExamDetail examDetail = examDetailService.getById(examDetailId);
|
|
|
|
- // 撤回提示
|
|
|
|
- if (ExamDetailStatusEnum.NEW.equals(examDetail.getStatus()) || ExamDetailStatusEnum.READY.equals(examDetail.getStatus())) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
|
|
|
|
- }
|
|
|
|
- if (isPrint && StringUtils.isBlank(printUser)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("打印员不能为空");
|
|
|
|
- }
|
|
|
|
- if (isPrint && StringUtils.isNotBlank(examDetail.getPrintUser()) && !examDetail.getPrintUser().equals(printUser)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("该任务已被[" + examDetail.getPrintUser() + "]占用");
|
|
|
|
|
|
+ public List<Map<String, Object>> getPrintData(String examDetailIds, String machineCode, Boolean isPrint, String printUser) {
|
|
|
|
+ String[] strings = examDetailIds.split(",");
|
|
|
|
+ if (strings.length == 0) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("请选择数据");
|
|
}
|
|
}
|
|
|
|
|
|
- // 课程、试卷信息
|
|
|
|
- List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
|
|
|
|
|
|
+ List<Map<String, Object>> finalList = new ArrayList<>();
|
|
|
|
+ for (String string : strings) {
|
|
|
|
+ Long examDetailId = Long.valueOf(string);
|
|
|
|
+ ExamDetail examDetail = examDetailService.getById(examDetailId);
|
|
|
|
+ // 撤回提示
|
|
|
|
+ if (ExamDetailStatusEnum.NEW.equals(examDetail.getStatus()) || ExamDetailStatusEnum.READY.equals(examDetail.getStatus())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
|
|
|
|
+ }
|
|
|
|
+ if (isPrint && StringUtils.isBlank(printUser)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("打印员不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (isPrint && StringUtils.isNotBlank(examDetail.getPrintUser()) && !examDetail.getPrintUser().equals(printUser)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("该任务已被[" + examDetail.getPrintUser() + "]占用");
|
|
|
|
+ }
|
|
|
|
|
|
- Map<String, Object> finalMap = new HashMap<>();
|
|
|
|
- ExamPrintPlan examPrintPlan = examPrintPlanService.getById(examDetail.getPrintPlanId());
|
|
|
|
- // 2.取生成的完整的pdf
|
|
|
|
- String printContent = examPrintPlan.getPrintContent();
|
|
|
|
- // 是否包含试卷、题卡
|
|
|
|
- if (StringUtils.isNotBlank(printContent)) {
|
|
|
|
- // 试卷、题卡map
|
|
|
|
- Map<String, Object> detailMap = new HashMap<>();
|
|
|
|
- // 备用试卷、备用题卡map
|
|
|
|
- Map<String, Object> backupMap = new HashMap<>();
|
|
|
|
- // 备份数量
|
|
|
|
- int backupCount = examPrintPlan.getBackupCount();
|
|
|
|
- if (printContent.contains("PAPER")) {
|
|
|
|
- if (examDetail.getAttachmentId() == null) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("考场pdf文件未生成");
|
|
|
|
- }
|
|
|
|
|
|
+ // 课程、试卷信息
|
|
|
|
+ List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
|
|
|
|
+
|
|
|
|
+ Map<String, Object> finalMap = new HashMap<>();
|
|
|
|
+ ExamPrintPlan examPrintPlan = examPrintPlanService.getById(examDetail.getPrintPlanId());
|
|
|
|
+ // 2.取生成的完整的pdf
|
|
|
|
+ String printContent = examPrintPlan.getPrintContent();
|
|
|
|
+ // 是否包含试卷、题卡
|
|
|
|
+ if (StringUtils.isNotBlank(printContent)) {
|
|
|
|
+ // 试卷、题卡map
|
|
|
|
+ Map<String, Object> detailMap = new HashMap<>();
|
|
|
|
+ // 备用试卷、备用题卡map
|
|
|
|
+ Map<String, Object> backupMap = new HashMap<>();
|
|
|
|
+ // 备份数量
|
|
|
|
+ int backupCount = examPrintPlan.getBackupCount();
|
|
|
|
+ if (printContent.contains("PAPER")) {
|
|
|
|
+ if (examDetail.getAttachmentId() == null) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考场pdf文件未生成");
|
|
|
|
+ }
|
|
|
|
|
|
- BasicAttachment attachment = basicAttachmentService.getById(examDetail.getAttachmentId());
|
|
|
|
- if (attachment == null) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("考场pdf文件记录异常");
|
|
|
|
- }
|
|
|
|
|
|
+ BasicAttachment attachment = basicAttachmentService.getById(examDetail.getAttachmentId());
|
|
|
|
+ if (attachment == null) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考场pdf文件记录异常");
|
|
|
|
+ }
|
|
|
|
|
|
- Map<String, String> totalPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getAttachmentId(), false);
|
|
|
|
- if (StringUtils.isBlank(totalPathUrl.get("url"))) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("考场pdf文件丢失");
|
|
|
|
- }
|
|
|
|
|
|
+ Map<String, String> totalPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getAttachmentId(), false);
|
|
|
|
+ if (StringUtils.isBlank(totalPathUrl.get("url"))) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考场pdf文件丢失");
|
|
|
|
+ }
|
|
|
|
|
|
- finalMap.put("paperTotal", totalPathUrl);
|
|
|
|
- // 取试卷
|
|
|
|
- Map<String, Map<String, String>> map = mapCourseUrl(examDetailCourses);
|
|
|
|
- // 生成试卷List
|
|
|
|
- detailMap.put("paper", splicePaperContent(examDetailCourses, map, null, null));
|
|
|
|
- //试卷
|
|
|
|
- List<Map<String, String>> keyMaps = examDetailCourses.stream().map(m -> {
|
|
|
|
- Map<String, String> stringMap = new HashMap<>();
|
|
|
|
- stringMap.put("courseCode", m.get("courseCode").toString());
|
|
|
|
- stringMap.put("courseName", m.get("courseName").toString());
|
|
|
|
- stringMap.put("paperNumber", m.get("paperNumber").toString());
|
|
|
|
- stringMap.put("paperType", m.get("paperType").toString());
|
|
|
|
- return stringMap;
|
|
|
|
- }).distinct().collect(Collectors.toList());
|
|
|
|
- List<ClientPrintBackupDataDto> paperBackupList = new ArrayList<>();
|
|
|
|
- for (Map<String, String> keyMap : keyMaps) {
|
|
|
|
- List<String> paperTypes = Arrays.stream(keyMap.get("paperType").split(",")).sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
|
|
|
|
- for (String paperType : paperTypes) {
|
|
|
|
- for (int i = 0; i < backupCount; i++) {
|
|
|
|
- ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
|
|
|
|
- clientPrintBackupDataDto.setCourseCode(keyMap.get("courseCode"));
|
|
|
|
- clientPrintBackupDataDto.setCourseName(keyMap.get("courseName"));
|
|
|
|
- clientPrintBackupDataDto.setPaperNumber(keyMap.get("paperNumber"));
|
|
|
|
- clientPrintBackupDataDto.setPaperType(paperType);
|
|
|
|
- StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
|
|
|
|
- String key = sj.add(keyMap.get("courseCode")).add(keyMap.get("paperNumber")).add(paperType).toString();
|
|
|
|
- clientPrintBackupDataDto.setMd5(map.get(key).get("md5"));
|
|
|
|
- clientPrintBackupDataDto.setUrl(map.get(key).get("url"));
|
|
|
|
- paperBackupList.add(clientPrintBackupDataDto);
|
|
|
|
|
|
+ finalMap.put("paperTotal", totalPathUrl);
|
|
|
|
+ // 取试卷
|
|
|
|
+ Map<String, Map<String, String>> map = mapCourseUrl(examDetailCourses);
|
|
|
|
+ // 生成试卷List
|
|
|
|
+ detailMap.put("paper", splicePaperContent(examDetailCourses, map, null, null));
|
|
|
|
+ //试卷
|
|
|
|
+ List<Map<String, String>> keyMaps = examDetailCourses.stream().map(m -> {
|
|
|
|
+ Map<String, String> stringMap = new HashMap<>();
|
|
|
|
+ stringMap.put("courseCode", m.get("courseCode").toString());
|
|
|
|
+ stringMap.put("courseName", m.get("courseName").toString());
|
|
|
|
+ stringMap.put("paperNumber", m.get("paperNumber").toString());
|
|
|
|
+ stringMap.put("paperType", m.get("paperType").toString());
|
|
|
|
+ return stringMap;
|
|
|
|
+ }).distinct().collect(Collectors.toList());
|
|
|
|
+ List<ClientPrintBackupDataDto> paperBackupList = new ArrayList<>();
|
|
|
|
+ for (Map<String, String> keyMap : keyMaps) {
|
|
|
|
+ List<String> paperTypes = Arrays.stream(keyMap.get("paperType").split(",")).sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
|
|
|
|
+ for (String paperType : paperTypes) {
|
|
|
|
+ for (int i = 0; i < backupCount; i++) {
|
|
|
|
+ ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
|
|
|
|
+ clientPrintBackupDataDto.setCourseCode(keyMap.get("courseCode"));
|
|
|
|
+ clientPrintBackupDataDto.setCourseName(keyMap.get("courseName"));
|
|
|
|
+ clientPrintBackupDataDto.setPaperNumber(keyMap.get("paperNumber"));
|
|
|
|
+ clientPrintBackupDataDto.setPaperType(paperType);
|
|
|
|
+ StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
|
|
|
|
+ String key = sj.add(keyMap.get("courseCode")).add(keyMap.get("paperNumber")).add(paperType).toString();
|
|
|
|
+ clientPrintBackupDataDto.setMd5(map.get(key).get("md5"));
|
|
|
|
+ clientPrintBackupDataDto.setUrl(map.get(key).get("url"));
|
|
|
|
+ paperBackupList.add(clientPrintBackupDataDto);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ backupMap.put("paper", paperBackupList);
|
|
}
|
|
}
|
|
- backupMap.put("paper", paperBackupList);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
|
|
- if (printContent.contains("CARD")) {
|
|
|
|
- Map<String, String> totalCardPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getCardAttachmentId(), false);
|
|
|
|
- finalMap.put("cardTotal", totalCardPathUrl);
|
|
|
|
|
|
+ if (printContent.contains("CARD")) {
|
|
|
|
+ Map<String, String> totalCardPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getCardAttachmentId(), false);
|
|
|
|
+ finalMap.put("cardTotal", totalCardPathUrl);
|
|
|
|
|
|
- // 生成题卡List
|
|
|
|
- detailMap.put("card", spliceCardContent(examDetailCourses, null, null));
|
|
|
|
|
|
+ // 生成题卡List
|
|
|
|
+ detailMap.put("card", spliceCardContent(examDetailCourses, null, null));
|
|
|
|
|
|
- // 备用题卡
|
|
|
|
- List<ClientPrintBackupDataDto> cardBackupList = new ArrayList<>();
|
|
|
|
- for (Map<String, Object> examDetailCours : examDetailCourses) {
|
|
|
|
- String attachmentIds = examDetailCours.get("cardAttachmentIds").toString();
|
|
|
|
- if (StringUtils.isBlank(attachmentIds)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("备用题卡未生成");
|
|
|
|
- }
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(attachmentIds);
|
|
|
|
- List<Map> backupCards = JSONObject.parseArray(JSONObject.toJSONString(jsonObject.get("card")), Map.class);
|
|
|
|
- for (Map backupCard : backupCards) {
|
|
|
|
- ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
|
|
|
|
- clientPrintBackupDataDto.setCourseCode(examDetailCours.get("courseCode").toString());
|
|
|
|
- clientPrintBackupDataDto.setCourseName(examDetailCours.get("courseName").toString());
|
|
|
|
- clientPrintBackupDataDto.setPaperNumber(examDetailCours.get("paperNumber").toString());
|
|
|
|
- clientPrintBackupDataDto.setPaperType(backupCard.get("name").toString());
|
|
|
|
- Map<String, String> urlMap = teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(backupCard.get("attachmentId").toString()), false);
|
|
|
|
- clientPrintBackupDataDto.setMd5(urlMap.get("md5"));
|
|
|
|
- clientPrintBackupDataDto.setUrl(urlMap.get("url"));
|
|
|
|
- cardBackupList.add(clientPrintBackupDataDto);
|
|
|
|
|
|
+ // 备用题卡
|
|
|
|
+ List<ClientPrintBackupDataDto> cardBackupList = new ArrayList<>();
|
|
|
|
+ for (Map<String, Object> examDetailCours : examDetailCourses) {
|
|
|
|
+ String attachmentIds = examDetailCours.get("cardAttachmentIds").toString();
|
|
|
|
+ if (StringUtils.isBlank(attachmentIds)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("备用题卡未生成");
|
|
|
|
+ }
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(attachmentIds);
|
|
|
|
+ List<Map> backupCards = JSONObject.parseArray(JSONObject.toJSONString(jsonObject.get("card")), Map.class);
|
|
|
|
+ for (Map backupCard : backupCards) {
|
|
|
|
+ ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
|
|
|
|
+ clientPrintBackupDataDto.setCourseCode(examDetailCours.get("courseCode").toString());
|
|
|
|
+ clientPrintBackupDataDto.setCourseName(examDetailCours.get("courseName").toString());
|
|
|
|
+ clientPrintBackupDataDto.setPaperNumber(examDetailCours.get("paperNumber").toString());
|
|
|
|
+ clientPrintBackupDataDto.setPaperType(backupCard.get("name").toString());
|
|
|
|
+ Map<String, String> urlMap = teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(backupCard.get("attachmentId").toString()), false);
|
|
|
|
+ clientPrintBackupDataDto.setMd5(urlMap.get("md5"));
|
|
|
|
+ clientPrintBackupDataDto.setUrl(urlMap.get("url"));
|
|
|
|
+ cardBackupList.add(clientPrintBackupDataDto);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ backupMap.put("card", cardBackupList);
|
|
}
|
|
}
|
|
- backupMap.put("card", cardBackupList);
|
|
|
|
|
|
+ detailMap.put("backup", backupMap);
|
|
|
|
+ finalMap.put("detail", detailMap);
|
|
}
|
|
}
|
|
- detailMap.put("backup", backupMap);
|
|
|
|
- finalMap.put("detail", detailMap);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- //3.5
|
|
|
|
- String variableContent = examPrintPlan.getVariableContent();
|
|
|
|
- String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
|
|
- List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
|
|
- List<Map> otherList = new ArrayList<>();
|
|
|
|
- //印品附件信息
|
|
|
|
- String attachmentPath = examDetail.getAttachmentPath();
|
|
|
|
- if (StringUtils.isNotBlank(attachmentPath)) {
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(attachmentPath);
|
|
|
|
- String pathString = jsonObject.getString("path");
|
|
|
|
- List<Map> pathList = JSONObject.parseArray(pathString, Map.class);
|
|
|
|
- if (!pathList.isEmpty()) {
|
|
|
|
- for (Map contentMap : variableList) {
|
|
|
|
- int count = Integer.parseInt(contentMap.get("backupCount").toString());
|
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
|
- spliceOtherContent(otherList, pathList, contentMap);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
|
- for (Map contentMap : ordinaryList) {
|
|
|
|
- int count = Integer.parseInt(contentMap.get("backupCount").toString());
|
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
|
- spliceOtherContent(otherList, pathList, contentMap);
|
|
|
|
|
|
+ //3.5
|
|
|
|
+ String variableContent = examPrintPlan.getVariableContent();
|
|
|
|
+ String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
|
|
+ List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
|
|
+ List<Map> otherList = new ArrayList<>();
|
|
|
|
+ //印品附件信息
|
|
|
|
+ String attachmentPath = examDetail.getAttachmentPath();
|
|
|
|
+ if (StringUtils.isNotBlank(attachmentPath)) {
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(attachmentPath);
|
|
|
|
+ String pathString = jsonObject.getString("path");
|
|
|
|
+ List<Map> pathList = JSONObject.parseArray(pathString, Map.class);
|
|
|
|
+ if (!pathList.isEmpty()) {
|
|
|
|
+ for (Map contentMap : variableList) {
|
|
|
|
+ int count = Integer.parseInt(contentMap.get("backupCount").toString());
|
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
|
+ spliceOtherContent(otherList, pathList, contentMap);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
|
+ for (Map contentMap : ordinaryList) {
|
|
|
|
+ int count = Integer.parseInt(contentMap.get("backupCount").toString());
|
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
|
+ spliceOtherContent(otherList, pathList, contentMap);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- finalMap.put("other", otherList);
|
|
|
|
|
|
+ finalMap.put("other", otherList);
|
|
|
|
|
|
- // 更新印刷中状态,更新曝光卷型、未曝光卷型,打印开始时间
|
|
|
|
- if (isPrint) {
|
|
|
|
- // 更新exam_detail状态为印刷中
|
|
|
|
- UpdateWrapper<ExamDetail> examDetailUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
- examDetailUpdateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.PRINTING).set(ExamDetail::getPrintStartTime, System.currentTimeMillis()).set(ExamDetail::getPrintUser, printUser).eq(ExamDetail::getId, examDetailId);
|
|
|
|
- examDetailService.update(examDetailUpdateWrapper);
|
|
|
|
-
|
|
|
|
- // 更新曝光卷型、未曝光卷型
|
|
|
|
- for (Map<String, Object> examDetailCours : examDetailCourses) {
|
|
|
|
- String examDetailCourseId = examDetailCours.get("examDetailCourseId").toString();
|
|
|
|
- // 考生使用卷型
|
|
|
|
- List<String> studentPaperTypes = examStudentService.listByExamDetailCourseId(examDetailCourseId);
|
|
|
|
- Object exposedPaperType = examDetailCours.get("exposedPaperType");
|
|
|
|
- Set<String> exposedPaperSet = Objects.isNull(exposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(exposedPaperType.toString().split(",")));
|
|
|
|
- Object unexposedPaperType = examDetailCours.get("unexposedPaperType");
|
|
|
|
- Set<String> unexposedPaperSet = Objects.isNull(unexposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(unexposedPaperType.toString().split(",")));
|
|
|
|
- if (!studentPaperTypes.isEmpty()) {
|
|
|
|
- for (String studentPaperType : studentPaperTypes) {
|
|
|
|
- exposedPaperSet.add(studentPaperType);
|
|
|
|
- unexposedPaperSet.remove(studentPaperType);
|
|
|
|
|
|
+ // 更新印刷中状态,更新曝光卷型、未曝光卷型,打印开始时间
|
|
|
|
+ if (isPrint) {
|
|
|
|
+ // 更新exam_detail状态为印刷中
|
|
|
|
+ UpdateWrapper<ExamDetail> examDetailUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
+ examDetailUpdateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.PRINTING).set(ExamDetail::getPrintStartTime, System.currentTimeMillis()).set(ExamDetail::getPrintUser, printUser).eq(ExamDetail::getId, examDetailId);
|
|
|
|
+ examDetailService.update(examDetailUpdateWrapper);
|
|
|
|
+
|
|
|
|
+ // 更新曝光卷型、未曝光卷型
|
|
|
|
+ for (Map<String, Object> examDetailCours : examDetailCourses) {
|
|
|
|
+ String examDetailCourseId = examDetailCours.get("examDetailCourseId").toString();
|
|
|
|
+ // 考生使用卷型
|
|
|
|
+ List<String> studentPaperTypes = examStudentService.listByExamDetailCourseId(examDetailCourseId);
|
|
|
|
+ Object exposedPaperType = examDetailCours.get("exposedPaperType");
|
|
|
|
+ Set<String> exposedPaperSet = Objects.isNull(exposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(exposedPaperType.toString().split(",")));
|
|
|
|
+ Object unexposedPaperType = examDetailCours.get("unexposedPaperType");
|
|
|
|
+ Set<String> unexposedPaperSet = Objects.isNull(unexposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(unexposedPaperType.toString().split(",")));
|
|
|
|
+ if (!studentPaperTypes.isEmpty()) {
|
|
|
|
+ for (String studentPaperType : studentPaperTypes) {
|
|
|
|
+ exposedPaperSet.add(studentPaperType);
|
|
|
|
+ unexposedPaperSet.remove(studentPaperType);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ String examTaskId = examDetailCours.get("examTaskId").toString();
|
|
|
|
+ UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
+ String exposedPaper = String.join(",", exposedPaperSet);
|
|
|
|
+ String unexposedPaper = String.join(",", unexposedPaperSet);
|
|
|
|
+ examTaskDetailUpdateWrapper.lambda()
|
|
|
|
+ .set(ExamTaskDetail::getExposedPaperType, StringUtils.isBlank(exposedPaper) ? null : exposedPaper)
|
|
|
|
+ .set(ExamTaskDetail::getUnexposedPaperType, StringUtils.isBlank(unexposedPaper) ? null : unexposedPaper)
|
|
|
|
+ .eq(ExamTaskDetail::getExamTaskId, examTaskId);
|
|
|
|
+ examTaskDetailService.update(examTaskDetailUpdateWrapper);
|
|
}
|
|
}
|
|
- String examTaskId = examDetailCours.get("examTaskId").toString();
|
|
|
|
- UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
- String exposedPaper = String.join(",", exposedPaperSet);
|
|
|
|
- String unexposedPaper = String.join(",", unexposedPaperSet);
|
|
|
|
- examTaskDetailUpdateWrapper.lambda()
|
|
|
|
- .set(ExamTaskDetail::getExposedPaperType, StringUtils.isBlank(exposedPaper) ? null : exposedPaper)
|
|
|
|
- .set(ExamTaskDetail::getUnexposedPaperType, StringUtils.isBlank(unexposedPaper) ? null : unexposedPaper)
|
|
|
|
- .eq(ExamTaskDetail::getExamTaskId, examTaskId);
|
|
|
|
- examTaskDetailService.update(examTaskDetailUpdateWrapper);
|
|
|
|
}
|
|
}
|
|
|
|
+ finalMap.put("examDetailId", examDetailId);
|
|
|
|
+ finalList.add(finalMap);
|
|
}
|
|
}
|
|
- return finalMap;
|
|
|
|
|
|
+ return finalList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -355,9 +382,8 @@ public class ClientServiceImpl implements ClientService {
|
|
}
|
|
}
|
|
List<Map<String, Object>> finalList = new ArrayList<>();
|
|
List<Map<String, Object>> finalList = new ArrayList<>();
|
|
for (ClientPrintTaskDto clientPrintTaskDto : pirntTaskDtoList) {
|
|
for (ClientPrintTaskDto clientPrintTaskDto : pirntTaskDtoList) {
|
|
- Map<String, Object> map = getPrintData(Long.valueOf(clientPrintTaskDto.getExamDetailId()), null, false, null);
|
|
|
|
- map.put("examDetailId", clientPrintTaskDto.getExamDetailId());
|
|
|
|
- finalList.add(map);
|
|
|
|
|
|
+ List<Map<String, Object>> list = getPrintData(clientPrintTaskDto.getExamDetailId(), null, false, null);
|
|
|
|
+ finalList.addAll(list);
|
|
}
|
|
}
|
|
return finalList;
|
|
return finalList;
|
|
}
|
|
}
|
|
@@ -597,6 +623,26 @@ public class ClientServiceImpl implements ClientService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public boolean updatePassword(Long userId, String password) {
|
|
|
|
+ SysUser sysUser = sysUserService.getById(userId);
|
|
|
|
+ if (sysUser == null) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("用户不存在");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(password)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("请输入新密码");
|
|
|
|
+ }
|
|
|
|
+ UpdateWrapper<SysUser> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.lambda().set(SysUser::getPassword, password)
|
|
|
|
+ .eq(SysUser::getId, userId);
|
|
|
|
+ return sysUserService.update(updateWrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<SchoolDto> listSchool() {
|
|
|
|
+ return basicSchoolService.listSchool();
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据考场生成试卷map
|
|
* 根据考场生成试卷map
|
|
*/
|
|
*/
|