|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.distributed.print.business.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -27,6 +28,7 @@ import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.connection.StringRedisConnection;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -283,7 +285,40 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
|
|
|
public IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, Long schoolId, Long machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Set<Long> orgIds) {
|
|
|
// 以下状态考场状态不可查询
|
|
|
String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), PrintPlanStatusEnum.READY.name()};
|
|
|
- return this.baseMapper.listClientPrintTask(page, schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgIds, examDetailStatus);
|
|
|
+ IPage<ClientPrintTaskDto> clientPrintTaskDtoIPage = this.baseMapper.listClientPrintTask(page, schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgIds, examDetailStatus);
|
|
|
+ for (ClientPrintTaskDto record : clientPrintTaskDtoIPage.getRecords()) {
|
|
|
+ // 试卷、题卡
|
|
|
+ String printContent = record.getPrintContent();
|
|
|
+ record.setIncluedPaper(StringUtils.isBlank(printContent) ? false : printContent.contains("PAPER"));
|
|
|
+ record.setIncluedCard(StringUtils.isBlank(printContent) ? false : printContent.contains("CARD"));
|
|
|
+ //
|
|
|
+ String variableContent = record.getVariableContent();
|
|
|
+ List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
|
+ record.setIncluedSign(false);
|
|
|
+ record.setIncluedPackage(false);
|
|
|
+ for (Map map : variableList) {
|
|
|
+ String type = map.get("type").toString();
|
|
|
+ String templateId = map.get("templateId").toString();
|
|
|
+ if(ClassifyEnum.SIGN.name().equals(type) && StringUtils.isNotBlank(templateId)){
|
|
|
+ record.setIncluedSign(true);
|
|
|
+ }
|
|
|
+ if(ClassifyEnum.PACKAGE.name().equals(type) && StringUtils.isNotBlank(templateId)){
|
|
|
+ record.setIncluedPackage(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String ordinaryContent = record.getOrdinaryContent();
|
|
|
+ List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
+ record.setIncluedCheckin(false);
|
|
|
+ for (Map map : ordinaryList) {
|
|
|
+ String type = map.get("type").toString();
|
|
|
+ String templateId = map.get("templateId").toString();
|
|
|
+ if(ClassifyEnum.CHECK_IN.name().equals(type) && StringUtils.isNotBlank(templateId)){
|
|
|
+ record.setIncluedCheckin(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return clientPrintTaskDtoIPage;
|
|
|
}
|
|
|
|
|
|
|