|
@@ -12,11 +12,9 @@ import com.qmth.distributed.print.business.bean.params.PrintPlanParams;
|
|
import com.qmth.distributed.print.business.bean.params.SyncDataParam;
|
|
import com.qmth.distributed.print.business.bean.params.SyncDataParam;
|
|
import com.qmth.distributed.print.business.bean.result.PrintPlanBrief;
|
|
import com.qmth.distributed.print.business.bean.result.PrintPlanBrief;
|
|
import com.qmth.distributed.print.business.bean.result.PrintPlanResult;
|
|
import com.qmth.distributed.print.business.bean.result.PrintPlanResult;
|
|
|
|
+import com.qmth.distributed.print.business.bean.result.TemplatePrintInfoResult;
|
|
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.ExamPrintPlanSyncStatusEnum;
|
|
|
|
-import com.qmth.distributed.print.business.enums.MessageEnum;
|
|
|
|
-import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
|
|
|
|
|
|
+import com.qmth.distributed.print.business.enums.*;
|
|
import com.qmth.distributed.print.business.mapper.ExamPrintPlanMapper;
|
|
import com.qmth.distributed.print.business.mapper.ExamPrintPlanMapper;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
|
|
import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
|
|
@@ -87,6 +85,7 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
BasicClazzService basicClazzService;
|
|
BasicClazzService basicClazzService;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
ExamDetailCourseService examDetailCourseService;
|
|
ExamDetailCourseService examDetailCourseService;
|
|
|
|
|
|
@@ -99,6 +98,9 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
|
|
@Resource
|
|
@Resource
|
|
CloudMarkingTaskUtils cloudMarkingTaskUtils;
|
|
CloudMarkingTaskUtils cloudMarkingTaskUtils;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ BasicTemplateService basicTemplateService;
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public IPage<PrintPlanResult> printPlanPage(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, PrintPlanStatusEnum status, Long startTime, Long endTime, int pageNumber, int pageSize) {
|
|
public IPage<PrintPlanResult> printPlanPage(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, PrintPlanStatusEnum status, Long startTime, Long endTime, int pageNumber, int pageSize) {
|
|
@@ -192,59 +194,60 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
|
|
}
|
|
}
|
|
|
|
|
|
//3.关联template和template_org表 查询出来orgIds所包含的所有模板并组装
|
|
//3.关联template和template_org表 查询出来orgIds所包含的所有模板并组装
|
|
-// List<TemplatePrintInfoResult> templateInfoList = basicTemplateOrgService.findTemplateInfoByOrgIds(orgIds);
|
|
|
|
-// templateInfoList = templateInfoList.stream().distinct().collect(Collectors.toList());
|
|
|
|
-// System.out.println(JSONObject.toJSONString(templateInfoList));
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(orgIds)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ List<TemplatePrintInfoResult> templateInfoList = basicTemplateService.findTemplateInfoByOrgIds(orgIds);
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
-// // 变量印品
|
|
|
|
-// List<Map<String, Object>> variable = new ArrayList<>();
|
|
|
|
-// List<TemplatePrintInfoResult> variableList = templateInfoList.stream()
|
|
|
|
-// .filter(e -> TemplateTypeEnum.VARIABLE.equals(e.getTemplateType()))
|
|
|
|
-// .collect(Collectors.toList());
|
|
|
|
-// for (ClassifyEnum value : ClassifyEnum.values()) {
|
|
|
|
-// Map<String, Object> variableMap = new HashMap<>();
|
|
|
|
-// List<TemplatePrintInfoResult> sourceList = variableList.stream().filter(e -> value.equals(e.getTemplateClassify())).collect(Collectors.toList());
|
|
|
|
-// List<Map<String, Object>> templateList = new ArrayList<>();
|
|
|
|
-// for (TemplatePrintInfoResult templatePrintInfoResult : sourceList) {
|
|
|
|
-// Map<String, Object> printMap = new HashMap<>();
|
|
|
|
-// printMap.put("id", String.valueOf(templatePrintInfoResult.getTemplateId()));
|
|
|
|
-// printMap.put("name", templatePrintInfoResult.getTemplateName());
|
|
|
|
-// printMap.put("attachmentId", templatePrintInfoResult.getAttachmentId().toString());
|
|
|
|
-// templateList.add(printMap);
|
|
|
|
-// }
|
|
|
|
-// if (templateList.size() > 0) {
|
|
|
|
-// variableMap.put("type", value);
|
|
|
|
-// variableMap.put("template", templateList);
|
|
|
|
-// variable.add(variableMap);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// // 普通印品
|
|
|
|
-// List<Map<String, Object>> ordinary = new ArrayList<>();
|
|
|
|
-// List<TemplatePrintInfoResult> ordinaryList = templateInfoList.stream()
|
|
|
|
-// .filter(e -> TemplateTypeEnum.ORDINARY.equals(e.getTemplateType()))
|
|
|
|
-// .collect(Collectors.toList());
|
|
|
|
-// Map<String, Object> ordinaryMap = new HashMap<>();
|
|
|
|
-// for (ClassifyEnum value : ClassifyEnum.values()) {
|
|
|
|
-// List<TemplatePrintInfoResult> sourceList = ordinaryList.stream().filter(e -> value.equals(e.getTemplateClassify())).collect(Collectors.toList());
|
|
|
|
-// List<Map<String, Object>> templateList = new ArrayList<>();
|
|
|
|
-// for (TemplatePrintInfoResult templatePrintInfoResult : sourceList) {
|
|
|
|
-// Map<String, Object> printMap = new HashMap<>();
|
|
|
|
-// printMap.put("id", String.valueOf(templatePrintInfoResult.getTemplateId()));
|
|
|
|
-// printMap.put("name", templatePrintInfoResult.getTemplateName());
|
|
|
|
-// printMap.put("attachmentId", templatePrintInfoResult.getAttachmentId().toString());
|
|
|
|
-// templateList.add(printMap);
|
|
|
|
-// }
|
|
|
|
-// if (templateList.size() > 0) {
|
|
|
|
-// ordinaryMap.put("type", value);
|
|
|
|
-// ordinaryMap.put("template", templateList);
|
|
|
|
-// ordinary.add(ordinaryMap);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// result.put("variable", variable);
|
|
|
|
-// result.put("ordinary", ordinary);
|
|
|
|
|
|
+ // 变量印品
|
|
|
|
+ List<Map<String, Object>> variable = new ArrayList<>();
|
|
|
|
+ List<TemplatePrintInfoResult> variableList = templateInfoList.stream()
|
|
|
|
+ .filter(e -> TemplateTypeEnum.VARIABLE.equals(e.getTemplateType()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ for (ClassifyEnum value : ClassifyEnum.values()) {
|
|
|
|
+ Map<String, Object> variableMap = new HashMap<>();
|
|
|
|
+ List<TemplatePrintInfoResult> sourceList = variableList.stream().filter(e -> value.equals(e.getTemplateClassify())).collect(Collectors.toList());
|
|
|
|
+ List<Map<String, Object>> templateList = new ArrayList<>();
|
|
|
|
+ for (TemplatePrintInfoResult templatePrintInfoResult : sourceList) {
|
|
|
|
+ Map<String, Object> printMap = new HashMap<>();
|
|
|
|
+ printMap.put("id", String.valueOf(templatePrintInfoResult.getTemplateId()));
|
|
|
|
+ printMap.put("name", templatePrintInfoResult.getTemplateName());
|
|
|
|
+ printMap.put("attachmentId", templatePrintInfoResult.getAttachmentId().toString());
|
|
|
|
+ templateList.add(printMap);
|
|
|
|
+ }
|
|
|
|
+ if (templateList.size() > 0) {
|
|
|
|
+ variableMap.put("type", value);
|
|
|
|
+ variableMap.put("template", templateList);
|
|
|
|
+ variable.add(variableMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 普通印品
|
|
|
|
+ List<Map<String, Object>> ordinary = new ArrayList<>();
|
|
|
|
+ List<TemplatePrintInfoResult> ordinaryList = templateInfoList.stream()
|
|
|
|
+ .filter(e -> TemplateTypeEnum.ORDINARY.equals(e.getTemplateType()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ Map<String, Object> ordinaryMap = new HashMap<>();
|
|
|
|
+ for (ClassifyEnum value : ClassifyEnum.values()) {
|
|
|
|
+ List<TemplatePrintInfoResult> sourceList = ordinaryList.stream().filter(e -> value.equals(e.getTemplateClassify())).collect(Collectors.toList());
|
|
|
|
+ List<Map<String, Object>> templateList = new ArrayList<>();
|
|
|
|
+ for (TemplatePrintInfoResult templatePrintInfoResult : sourceList) {
|
|
|
|
+ Map<String, Object> printMap = new HashMap<>();
|
|
|
|
+ printMap.put("id", String.valueOf(templatePrintInfoResult.getTemplateId()));
|
|
|
|
+ printMap.put("name", templatePrintInfoResult.getTemplateName());
|
|
|
|
+ printMap.put("attachmentId", templatePrintInfoResult.getAttachmentId().toString());
|
|
|
|
+ templateList.add(printMap);
|
|
|
|
+ }
|
|
|
|
+ if (templateList.size() > 0) {
|
|
|
|
+ ordinaryMap.put("type", value);
|
|
|
|
+ ordinaryMap.put("template", templateList);
|
|
|
|
+ ordinary.add(ordinaryMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ result.put("variable", variable);
|
|
|
|
+ result.put("ordinary", ordinary);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|