Browse Source

Merge branch 'dev_v3.2.0' of http://git.qmth.com.cn/wangliang/distributed-print-service into dev_v3.2.0

xiaof 2 years ago
parent
commit
b98970a10c

+ 16 - 17
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskDetailCardDto.java

@@ -12,7 +12,7 @@ public class ExamTaskDetailCardDto {
     private String examTaskId;
     private String paperType;
     private String paperAttachmentIds;
-    private String cardId;
+//    private String cardId;
     private String paperConfirmAttachmentIds;
     private String remark;
     private String exposedPaperType;
@@ -21,7 +21,7 @@ public class ExamTaskDetailCardDto {
     private Boolean enable;
     private String makeMethod;
     private Integer drawCount;
-    private String status;
+//    private String status;
     private String flowId;
     private Integer setup;
     // 审核流程taskId
@@ -77,13 +77,13 @@ public class ExamTaskDetailCardDto {
         this.paperAttachmentIds = paperAttachmentIds;
     }
 
-    public String getCardId() {
-        return cardId;
-    }
-
-    public void setCardId(String cardId) {
-        this.cardId = cardId;
-    }
+//    public String getCardId() {
+//        return cardId;
+//    }
+//
+//    public void setCardId(String cardId) {
+//        this.cardId = cardId;
+//    }
 
     public String getPaperConfirmAttachmentIds() {
         return paperConfirmAttachmentIds;
@@ -149,14 +149,13 @@ public class ExamTaskDetailCardDto {
         this.drawCount = drawCount;
     }
 
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
+//    public String getStatus() {
+//        return status;
+//    }
+//
+//    public void setStatus(String status) {
+//        this.status = status;
+//    }
     public String getFlowId() {
         return flowId;
     }

+ 0 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/TemplateDto.java

@@ -16,7 +16,6 @@ public class TemplateDto {
     private String id;
     private String schoolId;
     private String name;
-    private TemplateTypeEnum type;
     private ClassifyEnum classify;
 
     @JsonSerialize(using = ToStringSerializer.class)
@@ -52,14 +51,6 @@ public class TemplateDto {
         this.name = name;
     }
 
-    public TemplateTypeEnum getType() {
-        return type;
-    }
-
-    public void setType(TemplateTypeEnum type) {
-        this.type = type;
-    }
-
     public ClassifyEnum getClassify() {
         return classify;
     }

+ 0 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/TemplatePrintInfoResult.java

@@ -2,7 +2,6 @@ package com.qmth.distributed.print.business.bean.result;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.TemplateTypeEnum;
 import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -24,9 +23,6 @@ public class TemplatePrintInfoResult {
     @ApiModelProperty(value = "模板名称")
     private String templateName;
 
-    @ApiModelProperty(value = "模板类型")
-    private TemplateTypeEnum templateType;
-
     @ApiModelProperty(value = "模板样式")
     private ClassifyEnum templateClassify;
 
@@ -64,14 +60,6 @@ public class TemplatePrintInfoResult {
         this.templateName = templateName;
     }
 
-    public TemplateTypeEnum getTemplateType() {
-        return templateType;
-    }
-
-    public void setTemplateType(TemplateTypeEnum templateType) {
-        this.templateType = templateType;
-    }
-
     public ClassifyEnum getTemplateClassify() {
         return templateClassify;
     }
@@ -110,7 +98,6 @@ public class TemplatePrintInfoResult {
                 "templateId=" + templateId +
                 ", schoolId=" + schoolId +
                 ", templateName='" + templateName + '\'' +
-                ", templateType=" + templateType +
                 ", templateClassify=" + templateClassify +
                 ", attachmentId=" + attachmentId +
                 ", enable=" + enable +

+ 1 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/BasicTemplate.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.TemplateTypeEnum;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import io.swagger.annotations.ApiModelProperty;
@@ -39,10 +38,7 @@ public class BasicTemplate extends BaseEntity implements Serializable {
      * 模板名称
      */
     private String name;
-    /**
-     * 模板类型:GENERIC-通卡模板,VARIABLE-变量印品模板,ORDINARY-普通印品模板
-     */
-    private TemplateTypeEnum type;
+
     /**
      * template_type值为VARIABLE、ORDINARY时,不为空。
      * SIGN-签到表,PACKAGE-卷袋贴,CHECK_IN-登记表
@@ -106,14 +102,6 @@ public class BasicTemplate extends BaseEntity implements Serializable {
         this.name = name;
     }
 
-    public TemplateTypeEnum getType() {
-        return type;
-    }
-
-    public void setType(TemplateTypeEnum type) {
-        this.type = type;
-    }
-
     public ClassifyEnum getClassify() {
         return classify;
     }

+ 0 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/TemplateTypeEnum.java

@@ -12,9 +12,6 @@ import java.util.List;
  */
 public enum TemplateTypeEnum {
 
-    GENERIC("通卡模板"),
-    VARIABLE("变量印品模板"),
-    ORDINARY("普通印品模板"),
     PRINT_CONFIG("印品配置"),
     CARD_RULE("题卡规则");
 

+ 26 - 33
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicTemplateServiceImpl.java

@@ -8,15 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.bean.dto.TemplateDto;
-import com.qmth.distributed.print.business.bean.params.ExamCardParams;
 import com.qmth.distributed.print.business.bean.result.TemplatePrintInfoResult;
 import com.qmth.distributed.print.business.entity.BasicTemplate;
-import com.qmth.distributed.print.business.entity.ExamCard;
-import com.qmth.distributed.print.business.entity.ExamCardDetail;
-import com.qmth.distributed.print.business.enums.CardStatusEnum;
-import com.qmth.distributed.print.business.enums.CardTypeEnum;
-import com.qmth.distributed.print.business.enums.MakeMethodEnum;
-import com.qmth.distributed.print.business.enums.TemplateTypeEnum;
 import com.qmth.distributed.print.business.mapper.BasicTemplateMapper;
 import com.qmth.distributed.print.business.service.BasicTemplateService;
 import com.qmth.distributed.print.business.service.ExamCardDetailService;
@@ -129,32 +122,32 @@ public class BasicTemplateServiceImpl extends ServiceImpl<BasicTemplateMapper, B
         // 新增权限
 //        basicTemplateOrgService.saveBatch(schoolId, template.getType(), template.getId(), template.getOrgIds(), template.getCreateId());
 
-        if (TemplateTypeEnum.GENERIC.name().equals(template.getType().name())) {
-            // 通用题卡,同步更新exam_card
-            BasicAttachment attachment = basicAttachmentService.getById(template.getAttachmentId());
-
-            ExamCard examCard1 = examCardService.getOneByTemplateId(template.getId());
-            if (examCard1 == null) {
-                ExamCard examCard = examCardService.getOneByTemplateId(template.getId());
-                ExamCardParams examCardParams = new ExamCardParams();
-                examCardParams.setId(examCard == null ? null : examCard.getId());
-                examCardParams.setOrgId(sysUser.getOrgId());
-                examCardParams.setTitle(template.getName());
-                examCardParams.setMakeMethod(MakeMethodEnum.SELECT);// 默认SELECT
-                examCardParams.setType(CardTypeEnum.GENERIC); // 默认GENERIC
-                examCardParams.setTemplateId(template.getId());
-                examCardParams.setStatus(CardStatusEnum.SUBMIT); // 默认SUBMIT
-                examCardParams.setHtmlContent(teachcloudCommonService.readFileContent(attachment.getPath()));
-                examCardService.saveExamCard(examCardParams);
-            } else {
-                examCard1.setTitle(template.getName());
-                examCardService.updateById(examCard1);
-
-                ExamCardDetail examCardDetail = examCardDetailService.getByCardId(examCard1.getId());
-                examCardDetail.setHtmlContent(teachcloudCommonService.readFileContent(attachment.getPath()));
-                examCardDetailService.updateById(examCardDetail);
-            }
-        }
+//        if (TemplateTypeEnum.GENERIC.name().equals(template.getType().name())) {
+//            // 通用题卡,同步更新exam_card
+//            BasicAttachment attachment = basicAttachmentService.getById(template.getAttachmentId());
+//
+//            ExamCard examCard1 = examCardService.getOneByTemplateId(template.getId());
+//            if (examCard1 == null) {
+//                ExamCard examCard = examCardService.getOneByTemplateId(template.getId());
+//                ExamCardParams examCardParams = new ExamCardParams();
+//                examCardParams.setId(examCard == null ? null : examCard.getId());
+//                examCardParams.setOrgId(sysUser.getOrgId());
+//                examCardParams.setTitle(template.getName());
+//                examCardParams.setMakeMethod(MakeMethodEnum.SELECT);// 默认SELECT
+//                examCardParams.setType(CardTypeEnum.GENERIC); // 默认GENERIC
+//                examCardParams.setTemplateId(template.getId());
+//                examCardParams.setStatus(CardStatusEnum.SUBMIT); // 默认SUBMIT
+//                examCardParams.setHtmlContent(teachcloudCommonService.readFileContent(attachment.getPath()));
+//                examCardService.saveExamCard(examCardParams);
+//            } else {
+//                examCard1.setTitle(template.getName());
+//                examCardService.updateById(examCard1);
+//
+//                ExamCardDetail examCardDetail = examCardDetailService.getByCardId(examCard1.getId());
+//                examCardDetail.setHtmlContent(teachcloudCommonService.readFileContent(attachment.getPath()));
+//                examCardDetailService.updateById(examCardDetail);
+//            }
+//        }
         return isSuccess;
     }
 

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -658,9 +658,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             examStudent.setStudentClazzType(StudentClazzEnum.TEACH_CLAZZ);
             examStudent.setCreateId(userId);
             examStudent.setUpdateId(userId);
+            examStudent.setPaperNumber(paperNumber);
             examStudentList.add(examStudent);
 
-
             BasicStudentExtrasParam basicStudentExtrasParam = new BasicStudentExtrasParam();
 
             basicStudentExtrasParam.setStudentName(studentName);

+ 6 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java

@@ -14,7 +14,10 @@ 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.TemplatePrintInfoResult;
 import com.qmth.distributed.print.business.entity.*;
-import com.qmth.distributed.print.business.enums.*;
+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.mapper.ExamPrintPlanMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
@@ -203,7 +206,7 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         // 变量印品
         List<Map<String, Object>> variable = new ArrayList<>();
         List<TemplatePrintInfoResult> variableList = templateInfoList.stream()
-                .filter(e -> TemplateTypeEnum.VARIABLE.equals(e.getTemplateType()))
+                .filter(e -> ClassifyEnum.SIGN == e.getTemplateClassify() || ClassifyEnum.PACKAGE == e.getTemplateClassify())
                 .collect(Collectors.toList());
         for (ClassifyEnum value : ClassifyEnum.values()) {
             Map<String, Object> variableMap = new HashMap<>();
@@ -226,7 +229,7 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         // 普通印品
         List<Map<String, Object>> ordinary = new ArrayList<>();
         List<TemplatePrintInfoResult> ordinaryList = templateInfoList.stream()
-                .filter(e -> TemplateTypeEnum.ORDINARY.equals(e.getTemplateType()))
+                .filter(e -> ClassifyEnum.CHECK_IN == e.getTemplateClassify())
                 .collect(Collectors.toList());
         Map<String, Object> ordinaryMap = new HashMap<>();
         for (ClassifyEnum value : ClassifyEnum.values()) {

+ 0 - 6
distributed-print-business/src/main/resources/mapper/BasicTemplateMapper.xml

@@ -30,7 +30,6 @@
         id,
         school_id schoolId,
         name,
-        type,
         classify,
         attachment_id attachmentId,
         enable,
@@ -43,9 +42,6 @@
             <if test="schoolId != null and schoolId != ''">
                 and school_id = #{schoolId}
             </if>
-            <if test="type != null and type != ''">
-                and type = #{type}
-            </if>
             <if test="name != null and name != ''">
                 and name like concat('%',#{name}, '%')
             </if>
@@ -68,7 +64,6 @@
         DISTINCT (tmp.id) as templateId,
         tmp.school_id as schoolId,
         tmp.name as templateName,
-        tmp.type as templateType,
         tmp.classify as templateClassify,
         tmp.attachment_id as attachmentId,
         tmp.enable as enable,
@@ -76,7 +71,6 @@
         FROM basic_template tmp
         <where>
             and tmp.enable = true
-            AND (tmp.type = 'VARIABLE' OR tmp.type = 'ORDINARY')
             <if test="orgIds != null and orgIds != '' and orgIds.size() > 0">
                 AND tmp.org_id IN
                 <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">

+ 0 - 2
distributed-print-business/src/main/resources/mapper/BasicTemplateOrgMapper.xml

@@ -33,7 +33,6 @@
         DISTINCT (tmp.id) as templateId,
         tmp.school_id as schoolId,
         tmp.name as templateName,
-        tmp.type as templateType,
         tmp.classify as templateClassify,
         tmp.attachment_id as attachmentId,
         tmp.enable as enable,
@@ -44,7 +43,6 @@
         basic_template tmp ON org.rule_id = tmp.id
         <where>
             and tmp.enable = true
-            AND (tmp.type = 'VARIABLE' OR tmp.type = 'ORDINARY')
             <if test="orgIds.size() == 0">
                 AND org.org_id IN (null)
             </if>

+ 0 - 5
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -605,13 +605,11 @@
             h.name semesterName,
             case #{source} when 'REVIEW' then ifnull(c.paper_type, a.paper_type) else a.paper_type end paperType,
             case #{source} when 'REVIEW' then ifnull(c.paper_attachment_ids, a.paper_attachment_ids) else a.paper_attachment_ids end paperAttachmentIds,
-            case #{source} when 'REVIEW' then ifnull(c.card_id, b.id) else b.id end cardId,
             a.paper_confirm_attachment_ids paperConfirmAttachmentIds,
             a.remark,
             a.exposed_paper_type exposedPaperType,
             ifnull(d.make_method, a.make_method) makeMethod,
             a.draw_count drawCount,
-            ifnull(d.status, b.status) status,
             e.flow_id flowId,
             f.setup,
             f.status as flowStatus
@@ -621,9 +619,6 @@
             exam_task_detail a on a.exam_task_id = e.id
                 left JOIN
             exam_task_paper_log c ON a.exam_task_id = c.exam_task_id and c.review = false
-                JOIN
-            exam_card b ON FIND_IN_SET(b.id, REPLACE(substring_index(substring_index(CONVERT((a.paper_attachment_ids ->>'$[*].cardId')
-                                                                                             USING utf8), ']', 1), '[',-1),'"',''))
                 left join
             exam_card d on c.card_id = d.id
                 left join