|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.qmth.distributed.print.business.bean.dto.*;
|
|
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.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
|
+import com.qmth.distributed.print.business.util.ExcelUtil;
|
|
import com.qmth.distributed.print.common.contant.SystemConstant;
|
|
import com.qmth.distributed.print.common.contant.SystemConstant;
|
|
import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
|
|
import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -134,24 +135,43 @@ public class ClientServiceImpl implements ClientService {
|
|
String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
List<Map> otherList = new ArrayList<>();
|
|
List<Map> otherList = new ArrayList<>();
|
|
- for (Map variable : variableList) {
|
|
|
|
- Map vMap = new HashMap();
|
|
|
|
- vMap.put("type", variable.get("type"));
|
|
|
|
- // todo
|
|
|
|
- /*Map<String, String> urlMap = commonService.filePreview(variable.get("attachmentId").toString(), false);
|
|
|
|
- vMap.put("htmlUrl", urlMap.get("htmlUrl"));
|
|
|
|
- vMap.put("pdfUrl", urlMap.get("pdfUrl"));*/
|
|
|
|
- otherList.add(vMap);
|
|
|
|
- }
|
|
|
|
- List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
|
- for (Map ordinary : ordinaryList) {
|
|
|
|
- Map vMap = new HashMap();
|
|
|
|
- vMap.put("type", ordinary.get("type"));
|
|
|
|
- // todo
|
|
|
|
- /*Map<String, String> urlMap = commonService.filePreview(ordinary.get("attachmentId").toString(), false);
|
|
|
|
- vMap.put("htmlUrl", urlMap.get("htmlUrl"));
|
|
|
|
- vMap.put("pdfUrl", urlMap.get("pdfUrl"));*/
|
|
|
|
- otherList.add(vMap);
|
|
|
|
|
|
+ //印品附件信息
|
|
|
|
+ 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 variable : variableList) {
|
|
|
|
+ Map vMap = new HashMap();
|
|
|
|
+ vMap.put("type", variable.get("type"));
|
|
|
|
+ for (Map path : pathList) {
|
|
|
|
+ String printType = path.get("printType").toString();
|
|
|
|
+ if(printType.equals(variable.get("type").toString())){
|
|
|
|
+ vMap.put("htmlUrl", commonService.filePreviewByPathAndType(path.get("htmlPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("htmlMd5", path.get("htmlMd5"));
|
|
|
|
+ vMap.put("pdfUrl", commonService.filePreviewByPathAndType(path.get("pdfPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("pdfMd5", path.get("pdfMd5"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ otherList.add(vMap);
|
|
|
|
+ }
|
|
|
|
+ List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
|
+ for (Map ordinary : ordinaryList) {
|
|
|
|
+ Map vMap = new HashMap();
|
|
|
|
+ vMap.put("type", ordinary.get("type"));
|
|
|
|
+ for (Map path : pathList) {
|
|
|
|
+ String printType = path.get("printType").toString();
|
|
|
|
+ if(printType.equals(ordinary.get("type").toString())){
|
|
|
|
+ vMap.put("htmlUrl", commonService.filePreviewByPathAndType(path.get("htmlPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("htmlMd5", path.get("htmlMd5"));
|
|
|
|
+ vMap.put("pdfUrl", commonService.filePreviewByPathAndType(path.get("pdfPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("pdfMd5", path.get("pdfMd5"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ otherList.add(vMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
finalMap.put("other", otherList);
|
|
finalMap.put("other", otherList);
|
|
return finalMap;
|
|
return finalMap;
|
|
@@ -294,32 +314,51 @@ public class ClientServiceImpl implements ClientService {
|
|
String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
|
|
List<Map> otherList = new ArrayList<>();
|
|
List<Map> otherList = new ArrayList<>();
|
|
- for (Map variable : variableList) {
|
|
|
|
- int count = Integer.parseInt(variable.get("backupCount").toString());
|
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
|
- Map vMap = new HashMap();
|
|
|
|
- vMap.put("type", variable.get("type"));
|
|
|
|
- // todo
|
|
|
|
- /*Map<String, String> urlMap = commonService.filePreview(variable.get("attachmentId").toString(), false);
|
|
|
|
- vMap.put("htmlUrl", urlMap.get("htmlUrl"));
|
|
|
|
- vMap.put("pdfUrl", urlMap.get("pdfUrl"));*/
|
|
|
|
- otherList.add(vMap);
|
|
|
|
|
|
+ //印品附件信息
|
|
|
|
+ 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 variable : variableList) {
|
|
|
|
+ int count = Integer.parseInt(variable.get("backupCount").toString());
|
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
|
+ Map vMap = new HashMap();
|
|
|
|
+ vMap.put("type", variable.get("type"));
|
|
|
|
+ for (Map path : pathList) {
|
|
|
|
+ String printType = path.get("printType").toString();
|
|
|
|
+ if(printType.equals(variable.get("type").toString())){
|
|
|
|
+ vMap.put("htmlUrl", commonService.filePreviewByPathAndType(path.get("htmlPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("htmlMd5", path.get("htmlMd5"));
|
|
|
|
+ vMap.put("pdfUrl", commonService.filePreviewByPathAndType(path.get("pdfPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("pdfMd5", path.get("pdfMd5"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ otherList.add(vMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
|
+ for (Map ordinary : ordinaryList) {
|
|
|
|
+ int count = Integer.parseInt(ordinary.get("backupCount").toString());
|
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
|
+ Map vMap = new HashMap();
|
|
|
|
+ vMap.put("type", ordinary.get("type"));
|
|
|
|
+ for (Map path : pathList) {
|
|
|
|
+ String printType = path.get("printType").toString();
|
|
|
|
+ if(printType.equals(ordinary.get("type").toString())){
|
|
|
|
+ vMap.put("htmlUrl", commonService.filePreviewByPathAndType(path.get("htmlPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("htmlMd5", path.get("htmlMd5"));
|
|
|
|
+ vMap.put("pdfUrl", commonService.filePreviewByPathAndType(path.get("pdfPath").toString(), path.get("type").toString(), false));
|
|
|
|
+ vMap.put("pdfMd5", path.get("pdfMd5"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ otherList.add(vMap);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
|
|
|
|
- for (Map ordinary : ordinaryList) {
|
|
|
|
- int count = Integer.parseInt(ordinary.get("backupCount").toString());
|
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
|
- Map vMap = new HashMap();
|
|
|
|
- vMap.put("type", ordinary.get("type"));
|
|
|
|
- // todo
|
|
|
|
- /*Map<String, String> urlMap = commonService.filePreview(ordinary.get("attachmentId").toString(), false);
|
|
|
|
- vMap.put("htmlUrl", urlMap.get("htmlUrl"));
|
|
|
|
- vMap.put("pdfUrl", urlMap.get("pdfUrl"));*/
|
|
|
|
- otherList.add(vMap);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
finalMap.put("other", otherList);
|
|
finalMap.put("other", otherList);
|
|
return finalMap;
|
|
return finalMap;
|
|
}
|
|
}
|
|
@@ -455,11 +494,10 @@ public class ClientServiceImpl implements ClientService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<ClientPrintTaskDto> listClientPrintTask(HttpServletResponse response, Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) {
|
|
|
|
|
|
+ public void exportClientPrintTask(HttpServletResponse response, Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception {
|
|
Set<Long> orgIds = commonService.listSubOrgIds(null);
|
|
Set<Long> orgIds = commonService.listSubOrgIds(null);
|
|
- List<ClientPrintTaskDto> clientPrintTaskDtos = examPrintPlanService.listClientPrintTask(schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgIds);
|
|
|
|
- // todo 导出excel操作
|
|
|
|
- return null;
|
|
|
|
|
|
+ List<ClientPrintTaskDto> printTaskDtoIList = examPrintPlanService.listClientPrintTask(schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgIds);
|
|
|
|
+ ExcelUtil.excelExport("印刷管理", ClientPrintTaskDto.class, printTaskDtoIList, response);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|