Browse Source

广药子流程

wangliang 3 năm trước cách đây
mục cha
commit
277ce46350
38 tập tin đã thay đổi với 907 bổ sung94 xóa
  1. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/DirectorApproveByJxzyyListener.java
  2. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/DirectorApproveListener.java
  3. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/PresidentApproveListener.java
  4. 81 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/PrintApproveSubListener.java
  5. 28 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/StartApproveSubListener.java
  6. 31 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/TeacherApproveSubListener.java
  7. 4 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowTaskApprovePeopleAllResult.java
  8. 3 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTask.java
  9. 4 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApprove.java
  10. 61 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApproveLog.java
  11. 5 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowLog.java
  12. 11 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java
  13. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskReviewLogMapper.java
  14. 8 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowApproveMapper.java
  15. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowMapper.java
  16. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskReviewLogService.java
  17. 9 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  18. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowApproveService.java
  19. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowService.java
  20. 68 19
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java
  21. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskReviewLogServiceImpl.java
  22. 26 12
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  23. 10 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowApproveServiceImpl.java
  24. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowServiceImpl.java
  25. 43 7
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  26. 2 2
      distributed-print-business/src/main/resources/mapper/ExamTaskReviewLogMapper.xml
  27. 3 0
      distributed-print-business/src/main/resources/mapper/TFFlowApproveMapper.xml
  28. 1 1
      distributed-print-business/src/main/resources/mapper/TFFlowMapper.xml
  29. 6 0
      distributed-print/.bpmn/src/main/resources/processes/GdykdxPaperApprove2.2.2.bpmn2d
  30. 253 0
      distributed-print/.bpmn/src/main/resources/processes/GdykdxPaperApproveSubByPrint.bpmn2d
  31. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java
  32. 3 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFFlowController.java
  33. 132 0
      distributed-print/src/main/resources/processes/GdykdxPaperApprove2.2.2.bpmn
  34. 81 0
      distributed-print/src/main/resources/processes/GdykdxPaperApproveSubByPrint.bpmn
  35. 2 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  36. 3 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveNameEnum.java
  37. 4 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveSetupEnum.java
  38. 7 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveVariableEnum.java

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/DirectorApproveByJxzyyListener.java

@@ -49,7 +49,7 @@ public class DirectorApproveByJxzyyListener implements TaskListener {
         TFFlowApproveService tfFlowApproveService = SpringContextHolder.getBean(TFFlowApproveService.class);
         List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_DIRECTOR_USER_IDS);
         String flowId = delegateTask.getProcessInstanceId();
-        ExamTask examTask = examTaskService.findByFlowId(Long.parseLong(flowId));
+        ExamTask examTask = examTaskService.findByFlowId(flowId);
         List<ApproveUserResult> sysUserList = null;
         if (Objects.nonNull(approveUserIds) && approveUserIds.size() > 0) {
             List<SysUser> sysUsers = sysUserService.listByIds(approveUserIds);
@@ -65,7 +65,7 @@ public class DirectorApproveByJxzyyListener implements TaskListener {
             }
         }
         // 发送审核短信
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(Long.valueOf(flowId));
+        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
         if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
                 && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
             basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/DirectorApproveListener.java

@@ -48,7 +48,7 @@ public class DirectorApproveListener implements TaskListener {
         TFFlowApproveService tfFlowApproveService = SpringContextHolder.getBean(TFFlowApproveService.class);
         List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_DIRECTOR_USER_IDS);
         String flowId = delegateTask.getProcessInstanceId();
-        ExamTask examTask = examTaskService.findByFlowId(Long.parseLong(flowId));
+        ExamTask examTask = examTaskService.findByFlowId(flowId);
         List<ApproveUserResult> sysUserList = null;
         if (Objects.nonNull(approveUserIds) && approveUserIds.size() > 0) {
             List<SysUser> sysUsers = sysUserService.listByIds(approveUserIds);
@@ -64,7 +64,7 @@ public class DirectorApproveListener implements TaskListener {
             }
         }
         // 发送审核短信
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(Long.valueOf(flowId));
+        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
         if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
                 && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
             basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/PresidentApproveListener.java

@@ -51,7 +51,7 @@ public class PresidentApproveListener implements TaskListener {
         TFFlowApproveService tfFlowApproveService = SpringContextHolder.getBean(TFFlowApproveService.class);
         List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_PRESIDENT_USER_IDS);
         String flowId = delegateTask.getProcessInstanceId();
-        ExamTask examTask = examTaskService.findByFlowId(Long.parseLong(flowId));
+        ExamTask examTask = examTaskService.findByFlowId(flowId);
         List<ApproveUserResult> sysUserList = null;
         if (Objects.nonNull(approveUserIds) && approveUserIds.size() > 0) {
             List<SysUser> sysUsers = sysUserService.listByIds(approveUserIds);
@@ -71,7 +71,7 @@ public class PresidentApproveListener implements TaskListener {
             }
         }
         // 发送审核短信
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(Long.valueOf(flowId));
+        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
         if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
                 && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.SECOND_APPROVE.getSetup())) {
             basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);

+ 81 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/PrintApproveSubListener.java

@@ -0,0 +1,81 @@
+package com.qmth.distributed.print.business.activiti;
+
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+import com.qmth.distributed.print.business.entity.ExamTask;
+import com.qmth.distributed.print.business.entity.TFFlowApprove;
+import com.qmth.distributed.print.business.enums.MessageEnum;
+import com.qmth.distributed.print.business.service.BasicMessageService;
+import com.qmth.distributed.print.business.service.ExamTaskService;
+import com.qmth.distributed.print.business.service.TFFlowApproveService;
+import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
+import com.qmth.teachcloud.common.contant.SpringContextHolder;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
+import com.qmth.teachcloud.common.enums.FlowStatusEnum;
+import com.qmth.teachcloud.common.service.SysUserService;
+import com.qmth.teachcloud.common.util.JacksonUtil;
+import com.qmth.teachcloud.common.util.ServletUtil;
+import org.activiti.engine.delegate.DelegateTask;
+import org.activiti.engine.delegate.TaskListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 印刷人员审批(子流程)
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/11/19
+ */
+public class PrintApproveSubListener implements TaskListener {
+    private final static Logger log = LoggerFactory.getLogger(PrintApproveSubListener.class);
+
+    /**
+     * 查找印刷人员
+     *
+     * @param delegateTask
+     */
+    @Override
+    public void notify(DelegateTask delegateTask) {
+        SysUserService sysUserService = SpringContextHolder.getBean(SysUserService.class);
+        ExamTaskService examTaskService = SpringContextHolder.getBean(ExamTaskService.class);
+        BasicMessageService basicMessageService = SpringContextHolder.getBean(BasicMessageService.class);
+        TFFlowApproveService tfFlowApproveService = SpringContextHolder.getBean(TFFlowApproveService.class);
+        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_PRINT_USER_IDS);
+        String flowId = delegateTask.getProcessInstanceId();
+        ExamTask examTask = examTaskService.findByFlowId(flowId);
+        List<ApproveUserResult> sysUserList = null;
+        if (Objects.nonNull(approveUserIds) && approveUserIds.size() > 0) {
+            List<SysUser> sysUsers = sysUserService.listByIds(approveUserIds);
+            sysUserList = new Gson().fromJson(JacksonUtil.parseJson(sysUsers), new TypeToken<List<ApproveUserResult>>() {
+            }.getType());
+            delegateTask.addCandidateUsers(approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList()));
+        } else {
+            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+            if (Objects.isNull(sysUser.getOrgId())) {
+                throw ExceptionResultEnum.ERROR.exception("审批人机构为空");
+            }
+            delegateTask.addCandidateUsers(Arrays.asList("190416459858444288", "190416551696924672"));
+//            sysUserList = sysUserService.findByPresidentApprove(Arrays.asList(sysUser.getOrgId()), null);
+//            if (Objects.nonNull(sysUserList) && sysUserList.size() > 0) {
+//                List<String> ids = sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
+//                //添加或签的人员,一人通过即可进入下一环节
+//                delegateTask.addCandidateUsers(ids);
+//            }
+        }
+        // 发送审核短信
+        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
+        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
+                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.FOUR_APPROVE.getSetup())) {
+            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
+        }
+    }
+}

+ 28 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/StartApproveSubListener.java

@@ -0,0 +1,28 @@
+package com.qmth.distributed.print.business.activiti;
+
+import com.qmth.distributed.print.business.entity.ExamTask;
+import com.qmth.distributed.print.business.service.ExamTaskService;
+import com.qmth.teachcloud.common.contant.SpringContextHolder;
+import org.activiti.engine.delegate.DelegateExecution;
+import org.activiti.engine.delegate.ExecutionListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @Description: 子流程启动监听
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/11/19
+ */
+public class StartApproveSubListener implements ExecutionListener {
+    private final static Logger log = LoggerFactory.getLogger(StartApproveSubListener.class);
+
+    @Override
+    public void notify(DelegateExecution delegateExecution) {
+        ExamTaskService examTaskService = SpringContextHolder.getBean(ExamTaskService.class);
+        ExamTask examTask = examTaskService.findByFlowId(delegateExecution.getRootProcessInstanceId());
+        examTask.setFlowId(examTask.getFlowId() + "," + delegateExecution.getProcessInstanceId());
+        examTaskService.updateById(examTask);
+    }
+}

+ 31 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/TeacherApproveSubListener.java

@@ -0,0 +1,31 @@
+package com.qmth.distributed.print.business.activiti;
+
+import com.qmth.distributed.print.business.service.ActivitiService;
+import com.qmth.teachcloud.common.contant.SpringContextHolder;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import org.activiti.engine.delegate.DelegateTask;
+import org.activiti.engine.delegate.TaskListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Description: 子流程启动监听
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/11/19
+ */
+public class TeacherApproveSubListener implements TaskListener {
+    private final static Logger log = LoggerFactory.getLogger(TeacherApproveSubListener.class);
+
+    @Override
+    public void notify(DelegateTask delegateTask) {
+//        ActivitiService activitiService = SpringContextHolder.getBean(ActivitiService.class);
+//        Map<String, Object> map = new HashMap<>();
+//        map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> delegateTask.getId());
+//        activitiService.taskApprove(map);
+    }
+}

+ 4 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowTaskApprovePeopleAllResult.java

@@ -17,8 +17,7 @@ import java.util.List;
 public class FlowTaskApprovePeopleAllResult implements Serializable {
 
     @ApiModelProperty(value = "流程id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long flowId;
+    private String flowId;
 
     @ApiModelProperty(value = "流程审批人列表")
     private List<FlowTaskApprovePeopleResult> approveUserList;
@@ -27,7 +26,7 @@ public class FlowTaskApprovePeopleAllResult implements Serializable {
 
     }
 
-    public FlowTaskApprovePeopleAllResult(Long flowId) {
+    public FlowTaskApprovePeopleAllResult(String flowId) {
         this.flowId = flowId;
     }
 
@@ -35,11 +34,11 @@ public class FlowTaskApprovePeopleAllResult implements Serializable {
         this.approveUserList = approveUserList;
     }
 
-    public Long getFlowId() {
+    public String getFlowId() {
         return flowId;
     }
 
-    public void setFlowId(Long flowId) {
+    public void setFlowId(String flowId) {
         this.flowId = flowId;
     }
 

+ 3 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTask.java

@@ -116,20 +116,19 @@ public class ExamTask extends BaseEntity implements Serializable {
     private List<Map<String, String>> users;
 
     @ApiModelProperty(value = "流程id")
-    @JsonSerialize(using = ToStringSerializer.class)
     @TableField(value = "flow_id", updateStrategy = FieldStrategy.IGNORED)
-    private Long flowId;
+    private String flowId;
 
     @ApiModelProperty(value = "命题任务审批表记录")
     @JsonSerialize(using = ToStringSerializer.class)
     @TableField(value = "approve_form_attachment_id")
     private Long approveFormAttachmentId;
 
-    public Long getFlowId() {
+    public String getFlowId() {
         return flowId;
     }
 
-    public void setFlowId(Long flowId) {
+    public void setFlowId(String flowId) {
         this.flowId = flowId;
     }
 

+ 4 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApprove.java

@@ -37,8 +37,7 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
     private Long orgId;
 
     @ApiModelProperty(value = "流程id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long flowId;
+    private String flowId;
 
     @ApiModelProperty(value = "审核人id")
     @JsonSerialize(using = ToStringSerializer.class)
@@ -57,7 +56,7 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
 
     }
 
-    public TFFlowApprove(Long schoolId, Long orgId, Long flowId, Long approveId, FlowStatusEnum status, Long userId, FlowModelEnum model) {
+    public TFFlowApprove(Long schoolId, Long orgId, String flowId, Long approveId, FlowStatusEnum status, Long userId, FlowModelEnum model) {
         setId(SystemConstant.getDbUuid());
         this.schoolId = schoolId;
         this.orgId = orgId;
@@ -113,11 +112,11 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
         return serialVersionUID;
     }
 
-    public Long getFlowId() {
+    public String getFlowId() {
         return flowId;
     }
 
-    public void setFlowId(Long flowId) {
+    public void setFlowId(String flowId) {
         this.flowId = flowId;
     }
 

+ 61 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApproveLog.java

@@ -35,8 +35,7 @@ public class TFFlowApproveLog extends BaseEntity implements Serializable {
     private Long orgId;
 
     @ApiModelProperty(value = "流程id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long flowId;
+    private String flowId;
 
     @ApiModelProperty(value = "命题任务id")
     @JsonSerialize(using = ToStringSerializer.class)
@@ -66,6 +65,23 @@ public class TFFlowApproveLog extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "二级审核人操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止")
     private FlowApproveOperationEnum secondApproveOperation;
 
+    @ApiModelProperty(value = "三级审核人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long startApproveId;
+
+    @ApiModelProperty(value = "三级审核人意见")
+    private String threeApproveRemark;
+
+    @ApiModelProperty(value = "四级审核人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long fourApproveId;
+
+    @ApiModelProperty(value = "四级审核人意见")
+    private String fourApproveRemark;
+
+    @ApiModelProperty(value = "四级审核人操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止")
+    private FlowApproveOperationEnum fourApproveOperation;
+
     @ApiModelProperty(value = "是否启用,0:停用,1:启用")
     private Boolean enable;
 
@@ -76,7 +92,7 @@ public class TFFlowApproveLog extends BaseEntity implements Serializable {
 
     }
 
-    public TFFlowApproveLog(Long schoolId, Long orgId, Long flowId, Long taskId, Long startId, Long userId) {
+    public TFFlowApproveLog(Long schoolId, Long orgId, String flowId, Long taskId, Long startId, Long userId) {
         setId(SystemConstant.getDbUuid());
         this.schoolId = schoolId;
         this.orgId = orgId;
@@ -86,6 +102,46 @@ public class TFFlowApproveLog extends BaseEntity implements Serializable {
         insertInfo(userId);
     }
 
+    public Long getStartApproveId() {
+        return startApproveId;
+    }
+
+    public void setStartApproveId(Long startApproveId) {
+        this.startApproveId = startApproveId;
+    }
+
+    public String getThreeApproveRemark() {
+        return threeApproveRemark;
+    }
+
+    public void setThreeApproveRemark(String threeApproveRemark) {
+        this.threeApproveRemark = threeApproveRemark;
+    }
+
+    public Long getFourApproveId() {
+        return fourApproveId;
+    }
+
+    public void setFourApproveId(Long fourApproveId) {
+        this.fourApproveId = fourApproveId;
+    }
+
+    public String getFourApproveRemark() {
+        return fourApproveRemark;
+    }
+
+    public void setFourApproveRemark(String fourApproveRemark) {
+        this.fourApproveRemark = fourApproveRemark;
+    }
+
+    public FlowApproveOperationEnum getFourApproveOperation() {
+        return fourApproveOperation;
+    }
+
+    public void setFourApproveOperation(FlowApproveOperationEnum fourApproveOperation) {
+        this.fourApproveOperation = fourApproveOperation;
+    }
+
     public String getRemark() {
         return remark;
     }
@@ -114,11 +170,11 @@ public class TFFlowApproveLog extends BaseEntity implements Serializable {
         return serialVersionUID;
     }
 
-    public Long getFlowId() {
+    public String getFlowId() {
         return flowId;
     }
 
-    public void setFlowId(Long flowId) {
+    public void setFlowId(String flowId) {
         this.flowId = flowId;
     }
 

+ 5 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowLog.java

@@ -35,8 +35,7 @@ public class TFFlowLog extends BaseEntity implements Serializable {
     private Long orgId;
 
     @ApiModelProperty(value = "流程id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long flowId;
+    private String flowId;
 
     @ApiModelProperty(value = "任务id")
     @JsonSerialize(using = ToStringSerializer.class)
@@ -62,7 +61,7 @@ public class TFFlowLog extends BaseEntity implements Serializable {
 
     }
 
-    public TFFlowLog(Long schoolId, Long orgId, Long flowId, Long taskId, Long approveId, Long userId, String approveRemark) {
+    public TFFlowLog(Long schoolId, Long orgId, String flowId, Long taskId, Long approveId, Long userId, String approveRemark) {
         setId(SystemConstant.getDbUuid());
         this.schoolId = schoolId;
         this.orgId = orgId;
@@ -73,7 +72,7 @@ public class TFFlowLog extends BaseEntity implements Serializable {
         insertInfo(userId);
     }
 
-    public TFFlowLog(Long schoolId, Long orgId, Long flowId, Long taskId, Long userId, String approveRemark, FlowApproveOperationEnum approveOperation) {
+    public TFFlowLog(Long schoolId, Long orgId, String flowId, Long taskId, Long userId, String approveRemark, FlowApproveOperationEnum approveOperation) {
         setId(SystemConstant.getDbUuid());
         this.schoolId = schoolId;
         this.orgId = orgId;
@@ -112,11 +111,11 @@ public class TFFlowLog extends BaseEntity implements Serializable {
         return serialVersionUID;
     }
 
-    public Long getFlowId() {
+    public String getFlowId() {
         return flowId;
     }
 
-    public void setFlowId(Long flowId) {
+    public void setFlowId(String flowId) {
         this.flowId = flowId;
     }
 

+ 11 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java

@@ -137,5 +137,15 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
      * @param printPlanStatusEnumList 印刷计划状态集合
      * @return 数据集
      */
-    List<ExamPackageDetail> findExamPackageDetailByPaperNumber(@Param("schoolId") Long schoolId,@Param("courseCode") String courseCode,@Param("paperNumber") String paperNumber, @Param("printPlanStatusEnumList") List<PrintPlanStatusEnum> printPlanStatusEnumList);
+    List<ExamPackageDetail> findExamPackageDetailByPaperNumber(@Param("schoolId") Long schoolId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("printPlanStatusEnumList") List<PrintPlanStatusEnum> printPlanStatusEnumList);
+
+    ExamTask findByFlowId(@Param("flowId") String flowId);
+
+    /**
+     * 获取ProcessDefinitionId
+     *
+     * @param key
+     * @return
+     */
+    String getProcessDefinitionIdByMaxVersion(@Param("key") String key);
 }

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskReviewLogMapper.java

@@ -18,7 +18,7 @@ import java.util.List;
  */
 public interface ExamTaskReviewLogMapper extends BaseMapper<ExamTaskReviewLog> {
 
-    List<ReviewLogDto> list(Long examTaskId);
+    List<ReviewLogDto> list(@Param("flowId") String flowId);
 
-    ApprovalInfo findOnePassBySetUp(@Param("flowId") Long flowId,@Param("setup") int setup);
+    ApprovalInfo findOnePassBySetUp(@Param("flowId") String flowId, @Param("setup") int setup);
 }

+ 8 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowApproveMapper.java

@@ -2,6 +2,7 @@ package com.qmth.distributed.print.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.distributed.print.business.entity.TFFlowApprove;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -13,4 +14,11 @@ import com.qmth.distributed.print.business.entity.TFFlowApprove;
  */
 public interface TFFlowApproveMapper extends BaseMapper<TFFlowApprove> {
 
+    /**
+     * 根据流程id查询流程状态
+     *
+     * @param flowId
+     * @return
+     */
+    TFFlowApprove findByFlowId(@Param("flowId") String flowId);
 }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowMapper.java

@@ -39,7 +39,7 @@ public interface TFFlowMapper extends BaseMapper<TFFlow> {
      * @param flowId
      * @return
      */
-    IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, @Param("startName") String startName, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId, @Param("flowId") Long flowId);
+    IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, @Param("startName") String startName, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId, @Param("flowId") String flowId);
 
     /**
      * 根据key查找id

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskReviewLogService.java

@@ -17,7 +17,7 @@ import java.util.List;
  */
 public interface ExamTaskReviewLogService extends IService<ExamTaskReviewLog> {
 
-    List<ReviewLogDto> list(Long flowId);
+    List<ReviewLogDto> list(String flowId);
 
-    ApprovalInfo findOnePassBySetUp(Long flowId,int setup);
+    ApprovalInfo findOnePassBySetUp(String flowId, int setup);
 }

+ 9 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java

@@ -240,5 +240,13 @@ public interface ExamTaskService extends IService<ExamTask> {
      * @param flowId
      * @return
      */
-    public ExamTask findByFlowId(Long flowId);
+    public ExamTask findByFlowId(String flowId);
+
+    /**
+     * 获取ProcessDefinitionId
+     *
+     * @param key
+     * @return
+     */
+    public String getProcessDefinitionIdByMaxVersion(String key);
 }

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

@@ -19,5 +19,5 @@ public interface TFFlowApproveService extends IService<TFFlowApprove> {
      * @param flowId
      * @return
      */
-    TFFlowApprove findByFlowId(Long flowId);
+    TFFlowApprove findByFlowId(String flowId);
 }

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

@@ -38,7 +38,7 @@ public interface TFFlowService extends IService<TFFlow> {
      * @param flowId
      * @return
      */
-    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String startName, Long schoolId, Long orgId, Long flowId);
+    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String startName, Long schoolId, Long orgId, String flowId);
 
     /**
      * 根据key查找流程

+ 68 - 19
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java

@@ -14,7 +14,6 @@ import com.qmth.distributed.print.business.enums.ExamStatusEnum;
 import com.qmth.distributed.print.business.enums.FlowModelEnum;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.entity.SysOrg;
@@ -32,6 +31,7 @@ import org.activiti.engine.RepositoryService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.TaskService;
 import org.activiti.engine.impl.RepositoryServiceImpl;
+import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
 import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
 import org.activiti.engine.repository.DeploymentBuilder;
 import org.activiti.engine.runtime.ProcessInstance;
@@ -185,9 +185,9 @@ public class ActivitiServiceImpl implements ActivitiService {
             tfFlowApproveQueryWrapper.lambda().eq(TFFlowApprove::getFlowId, Long.parseLong(flowId));
             TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(tfFlowApproveQueryWrapper);
             if (Objects.isNull(tfFlowApprove)) {
-                ExamTask examTask = examTaskService.findByFlowId(Long.parseLong(flowId));
+                ExamTask examTask = examTaskService.findByFlowId(flowId);
                 int count = sysUserService.countByTeachingRoomId(examTask.getTeachingRoomId());
-                tfFlowApprove = new TFFlowApprove(sysUser.getSchoolId(), sysUser.getOrgId(), Long.parseLong(flowId), sysUser.getId(), FlowStatusEnum.END, sysUser.getId(), count == 0 ? FlowModelEnum.CHOOSE : FlowModelEnum.SYSTEM);
+                tfFlowApprove = new TFFlowApprove(sysUser.getSchoolId(), sysUser.getOrgId(), flowId, sysUser.getId(), FlowStatusEnum.END, sysUser.getId(), count == 0 ? FlowModelEnum.CHOOSE : FlowModelEnum.SYSTEM);
             } else {
                 tfFlowApprove.setStatus(FlowStatusEnum.END);
                 tfFlowApprove.setSetup(FlowApproveSetupEnum.END.getSetup());
@@ -196,8 +196,8 @@ public class ActivitiServiceImpl implements ActivitiService {
             tfFlowApproveService.saveOrUpdate(tfFlowApprove);
 
             //流程流水日志
-            ExamTask examTask = examTaskService.findByFlowId(Long.parseLong(flowId));
-            TFFlowLog tfFlowLog = new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), Long.parseLong(flowId), examTask.getId(), sysUser.getId(), sysUser.getId(), FlowApproveSetupEnum.END.getTitle());
+            ExamTask examTask = examTaskService.findByFlowId(flowId);
+            TFFlowLog tfFlowLog = new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), flowId, examTask.getId(), sysUser.getId(), sysUser.getId(), FlowApproveSetupEnum.END.getTitle());
             tfFlowLog.setApproveOperation(FlowApproveOperationEnum.END);
             tfFlowLog.setApproveSetup(FlowApproveSetupEnum.END.getSetup());
             tfFlowLogService.save(tfFlowLog);
@@ -217,7 +217,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                             .eq(TFFlowApproveLog::getTaskId, examTask.getId());
                     TFFlowApproveLog tfFlowApproveLog = tfFlowApproveLogService.getOne(tfFlowApproveLogQueryWrapper);
                     if (Objects.isNull(tfFlowApproveLog)) {
-                        tfFlowApproveLog = new TFFlowApproveLog(sysUser.getSchoolId(), sysUser.getOrgId(), Long.parseLong(flowId), examTask.getId(), sysUser.getId(), sysUser.getId());
+                        tfFlowApproveLog = new TFFlowApproveLog(sysUser.getSchoolId(), sysUser.getOrgId(), flowId, examTask.getId(), sysUser.getId(), sysUser.getId());
                     }
                     FlowApproveSetupEnum setupEnum = FlowApproveSetupEnum.convertToInstance(userTask.getId());
                     //广东医科大学流程
@@ -272,7 +272,7 @@ public class ActivitiServiceImpl implements ActivitiService {
     public void flowApproveStart(Map<String, Object> map) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Optional.ofNullable(map.get(SystemConstant.FLOW_ID)).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程id不能为空"));
-        Long flowId = Long.parseLong(map.get(SystemConstant.FLOW_ID).toString());
+        String flowId = (String) map.get(SystemConstant.FLOW_ID);
 
         Optional.ofNullable(map.get(SystemConstant.FLOW_STATUS)).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程状态不能为空"));
         FlowStatusEnum flowStatusEnum = (FlowStatusEnum) map.get(SystemConstant.FLOW_STATUS);
@@ -303,7 +303,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             Task task = taskService.createTaskQuery().taskId(flowTaskId).singleResult();
             Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务为空或该流程已被他人审核,请刷新再试!"));
             String processInstanceId = task.getProcessInstanceId();
-            ExamTask examTask = examTaskService.findByFlowId(Long.parseLong(processInstanceId));
+            ExamTask examTask = examTaskService.findByFlowId(processInstanceId);
 
             String processDefinitionId = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult().getProcessDefinitionId();
             ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefinitionId);
@@ -328,13 +328,14 @@ public class ActivitiServiceImpl implements ActivitiService {
                 UserTask userTask = (UserTask) currFlow;
                 String remark = Objects.nonNull(map.get(SystemConstant.APPROVE_REMARK)) ? map.get(SystemConstant.APPROVE_REMARK).toString() : null;
                 //流程流水日志
-                tfFlowLog = new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), Long.parseLong(processInstanceId), examTask.getId(), sysUser.getId(), sysUser.getId(), remark);
+                tfFlowLog = new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), processInstanceId, examTask.getId(), sysUser.getId(), sysUser.getId(), remark);
                 FlowApproveSetupEnum setupEnum = FlowApproveSetupEnum.convertToInstance(userTask.getId());
                 if (Objects.isNull(tfFlowApproveLog)) {
-                    tfFlowApproveLog = new TFFlowApproveLog(sysUser.getSchoolId(), sysUser.getOrgId(), Long.parseLong(processInstanceId), examTask.getId(), sysUser.getId(), sysUser.getId());
+                    tfFlowApproveLog = new TFFlowApproveLog(sysUser.getSchoolId(), sysUser.getOrgId(), processInstanceId, examTask.getId(), sysUser.getId(), sysUser.getId());
                 }
                 //广东医科大学流程
-                if (Objects.nonNull(processDefinitionEntity) && processDefinitionEntity.getKey().contains(SystemConstant.GDYKDX_FLOW_KEY)) {
+                if (Objects.nonNull(processDefinitionEntity) && (processDefinitionEntity.getKey().contains(SystemConstant.GDYKDX_FLOW_KEY)
+                        || processDefinitionEntity.getKey().contains(SystemConstant.GDYKDX_SUB_FLOW_KEY))) {
                     if (setupEnum == FlowApproveSetupEnum.SUBMIT) {//命题提交
                         this.assignSubmit(task, sysUser, tfFlowApprove, tfFlowLog, map);
                     } else if (setupEnum == FlowApproveSetupEnum.PRIMARY_APPROVE) {//主任提交
@@ -369,13 +370,45 @@ public class ActivitiServiceImpl implements ActivitiService {
                         } else if (approve == FlowApproveVariableEnum.SECOND_APPROVE) {//提交
                             tfFlowLog.setApproveOperation(FlowApproveOperationEnum.APPROVE);
                             tfFlowApproveLog.setSecondApproveOperation(FlowApproveOperationEnum.APPROVE);
-                            tfFlowApprove.setStatus(FlowStatusEnum.FINISH);
-                            tfFlowApprove.setSetup(FlowApproveSetupEnum.FINISH.getSetup());
+                            tfFlowApprove.setStatus(FlowStatusEnum.AUDITING);
+                            tfFlowApprove.setSetup(FlowApproveSetupEnum.THREE_APPROVE.getSetup());
                         } else {
                             throw ExceptionResultEnum.ERROR.exception("流程变量值错误");
                         }
                         FlowApproveVariableEnum finalApprove = approve;
                         map.computeIfAbsent(SystemConstant.APPROVE, v -> finalApprove.getId());
+                        TFFlowApproveLog finalTfFlowApproveLog = tfFlowApproveLog;
+                        map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> finalTfFlowApproveLog.getStartId());
+                    } else if (setupEnum == FlowApproveSetupEnum.THREE_APPROVE) {//命题提交
+                        flowSubmitVaild(task, sysUser.getId());
+                        tfFlowLog.setApproveSetup(FlowApproveSetupEnum.THREE_APPROVE.getSetup());
+                        tfFlowLog.setApproveOperation(FlowApproveOperationEnum.APPROVE);
+                        tfFlowApprove.setStatus(FlowStatusEnum.AUDITING);
+                        tfFlowApprove.setSetup(FlowApproveSetupEnum.THREE_APPROVE.getSetup());
+                        tfFlowApproveLog.setStartApproveId(sysUser.getId());
+                        tfFlowApproveLog.setSecondApproveRemark(remark);
+                        map.computeIfAbsent(SystemConstant.APPROVE_PRINT_USER_IDS, v -> map.get(SystemConstant.APPROVE_USER_IDS));
+                    } else if (setupEnum == FlowApproveSetupEnum.FOUR_APPROVE) {//印刷员提交
+                        flowApproveVaild(task, sysUser.getId(), map);
+                        FlowApprovePassEnum approvePass = (FlowApprovePassEnum) map.get(SystemConstant.APPROVE_OPERATION);
+                        FlowApproveVariableEnum approve = approvePass == FlowApprovePassEnum.PASS ? FlowApproveVariableEnum.PRIMARY_APPROVE : FlowApproveVariableEnum.PRIMARY_REJECT;
+                        tfFlowLog.setApproveSetup(FlowApproveSetupEnum.FOUR_APPROVE.getSetup());
+                        tfFlowApproveLog.setFourApproveId(sysUser.getId());
+                        tfFlowApproveLog.setFourApproveRemark(remark);
+                        if (approve == FlowApproveVariableEnum.FOUR_REJECT) {//驳回命题
+                            tfFlowLog.setApproveOperation(FlowApproveOperationEnum.REJECT);
+                            tfFlowApproveLog.setFourApproveOperation(FlowApproveOperationEnum.REJECT);
+                            tfFlowApprove.setStatus(FlowStatusEnum.REJECT);
+                            tfFlowApprove.setSetup(FlowApproveSetupEnum.THREE_APPROVE.getSetup());
+                        } else if (approve == FlowApproveVariableEnum.FOUR_APPROVE) {//提交
+                            tfFlowLog.setApproveOperation(FlowApproveOperationEnum.APPROVE);
+                            tfFlowApproveLog.setFourApproveOperation(FlowApproveOperationEnum.APPROVE);
+                            tfFlowApprove.setStatus(FlowStatusEnum.FINISH);
+                            tfFlowApprove.setSetup(FlowApproveSetupEnum.FINISH.getSetup());
+                        } else {
+                            throw ExceptionResultEnum.ERROR.exception("流程变量值错误");
+                        }
+                        map.computeIfAbsent(SystemConstant.APPROVE, v -> approve.getId());
                     }
                 }
                 //江西中医药大学
@@ -444,6 +477,23 @@ public class ActivitiServiceImpl implements ActivitiService {
                     FlowApproveSetupEnum flowApproveSetupEnum = FlowApproveSetupEnum.convertToInstance(userTask.getId());
                     flowTaskResultList.add(new FlowTaskResult(Long.parseLong(flowId), userTask.getName(), flowApproveSetupEnum.getId(), flowApproveSetupEnum.getSetup()));
                 }
+            } else if (flowElement instanceof CallActivity) {
+                CallActivity callActivity = (CallActivity) flowElement;
+                String processDefinitionIdSub = examTaskService.getProcessDefinitionIdByMaxVersion(callActivity.getCalledElement());
+                ProcessDefinitionEntity processDefinitionEntitySub = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefinitionIdSub);
+                BpmnModel bpmnModelSub = repositoryService.getBpmnModel(processDefinitionIdSub);
+                Process processSub = bpmnModelSub.getProcessById(processDefinitionEntitySub.getKey());
+                Collection<FlowElement> flowElementsSubs = processSub.getFlowElements();
+                for (FlowElement flowElementSub : flowElementsSubs) {
+                    //假设是任务节点
+                    if (flowElementSub instanceof UserTask) {
+                        UserTask userTask = (UserTask) flowElementSub;
+                        if (Objects.nonNull(userTask)) {
+                            FlowApproveSetupEnum flowApproveSetupEnum = FlowApproveSetupEnum.convertToInstance(userTask.getId());
+                            flowTaskResultList.add(new FlowTaskResult(Long.parseLong(flowId), userTask.getName(), flowApproveSetupEnum.getId(), flowApproveSetupEnum.getSetup()));
+                        }
+                    }
+                }
             }
         }
         return flowTaskResultList;
@@ -463,8 +513,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             throw ExceptionResultEnum.ERROR.exception("有在途的流程,无法删除!");
         } else {
             UpdateWrapper<TFFlow> tfFlowUpdateWrapper = new UpdateWrapper<>();
-            tfFlowUpdateWrapper.lambda().eq(TFFlow::getFlowKey, SystemConstant.GDYKDX_FLOW_KEY)
-                    .eq(TFFlow::getActFlowId, tfFlow.getActFlowId())
+            tfFlowUpdateWrapper.lambda().eq(TFFlow::getId, id)
                     .set(TFFlow::getEnable, false);
             tfFlowService.update(tfFlowUpdateWrapper);
         }
@@ -485,7 +534,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (Objects.nonNull(taskId) && !Objects.equals(taskId, "")) {//说明从已审核的节点开始捞人
             Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
             Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务为空或该流程已被他人审核,请刷新再试!"));
-            flowTaskApprovePeopleAllResult = new FlowTaskApprovePeopleAllResult(Long.parseLong(task.getProcessInstanceId()));
+            flowTaskApprovePeopleAllResult = new FlowTaskApprovePeopleAllResult(task.getProcessInstanceId());
             flowTaskApprovePeopleResultList = new LinkedList();
             //获取当前流程节点
             TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowTaskApprovePeopleAllResult.getFlowId());
@@ -633,7 +682,7 @@ public class ActivitiServiceImpl implements ActivitiService {
     public boolean taskApproverExchange(String userId, String taskId) {
         Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
         Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务为空或该流程已被他人审核,请刷新再试!"));
-        Long flowId = Long.parseLong(task.getProcessInstanceId());
+        String flowId = task.getProcessInstanceId();
         TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
         Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到流程状态记录"));
         if (tfFlowApprove.getSetup() <= 0) {
@@ -707,7 +756,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
         Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务为空或该流程已被他人审核,请刷新再试!"));
-        FlowTaskApprovePeopleAllResult flowTaskApprovePeopleAllResult = new FlowTaskApprovePeopleAllResult(Long.parseLong(task.getProcessInstanceId()));
+        FlowTaskApprovePeopleAllResult flowTaskApprovePeopleAllResult = new FlowTaskApprovePeopleAllResult(task.getProcessInstanceId());
         //获取当前流程节点
         TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowTaskApprovePeopleAllResult.getFlowId());
         Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到流程状态记录"));
@@ -796,7 +845,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
             Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务为空或该流程已被他人审核,请刷新再试!"));
 
-            flowTaskApprovePeopleAllResult = new FlowTaskApprovePeopleAllResult(Long.parseLong(task.getProcessInstanceId()));
+            flowTaskApprovePeopleAllResult = new FlowTaskApprovePeopleAllResult(task.getProcessInstanceId());
             //获取当前流程节点
             TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowTaskApprovePeopleAllResult.getFlowId());
             Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到流程状态记录"));

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

@@ -22,12 +22,12 @@ import java.util.List;
 public class ExamTaskReviewLogServiceImpl extends ServiceImpl<ExamTaskReviewLogMapper, ExamTaskReviewLog> implements ExamTaskReviewLogService {
 
     @Override
-    public List<ReviewLogDto> list(Long examTaskId) {
-        return this.baseMapper.list(examTaskId);
+    public List<ReviewLogDto> list(String flowId) {
+        return this.baseMapper.list(flowId);
     }
 
     @Override
-    public ApprovalInfo findOnePassBySetUp(Long flowId, int setup) {
+    public ApprovalInfo findOnePassBySetUp(String flowId, int setup) {
         return this.baseMapper.findOnePassBySetUp(flowId,setup);
     }
 }

+ 26 - 12
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -253,7 +253,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         }
 
         ExamStatusEnum examStatusEnum = ExamStatusEnum.DRAFT;
-        Long flowId = null;
+        String flowId = null;
         UpdateWrapper<ExamTask> updateWrapper = new UpdateWrapper<>();
         ExamTask task = this.getById(examTask.getId());
         // 指派命题老师
@@ -268,7 +268,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                 map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
                 ProcessInstance processInstance = activitiService.flowStart(map);
-                flowId = Long.parseLong(processInstance.getId());
+                flowId = processInstance.getId();
             }
         }
         // 更改命题老师
@@ -287,7 +287,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                     map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
                     ProcessInstance processInstance = activitiService.startActivity(SystemConstant.GDYKDX_FLOW_KEY, map);
-                    flowId = Long.parseLong(processInstance.getId());
+                    flowId = processInstance.getId();
                 } else {
                     flowId = task.getFlowId();
                 }
@@ -413,7 +413,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                 map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
                 ProcessInstance processInstance = activitiService.flowStart(map);
-                examTask.setFlowId(Long.parseLong(processInstance.getId()));
+                examTask.setFlowId(processInstance.getId());
             } else if (!examTask.getReview()) {
                 examTask.setStatus(ExamStatusEnum.STAGE);
             }
@@ -701,7 +701,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                 map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
                 ProcessInstance processInstance = activitiService.flowStart(map);
-                examTask.setFlowId(Long.parseLong(processInstance.getId()));
+                examTask.setFlowId(processInstance.getId());
                 this.updateById(examTask);
             }
         }
@@ -1482,7 +1482,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                     map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
                     ProcessInstance processInstance = activitiService.flowStart(map);
-                    examTask.setFlowId(Long.parseLong(processInstance.getId()));
+                    examTask.setFlowId(processInstance.getId());
                 }
             }
             this.saveOrUpdate(examTask);
@@ -1617,7 +1617,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                     map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
                     ProcessInstance processInstance = activitiService.flowStart(map);
-                    examTask.setFlowId(Long.parseLong(processInstance.getId()));
+                    examTask.setFlowId(processInstance.getId());
                 }
             }
             this.save(examTask);
@@ -1767,7 +1767,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
 
         // 流程id
-        Long flowId = examTask.getFlowId();
+        String flowId = examTask.getFlowId();
 
         // 3.ApprovalInfo部分
         Boolean review = examTask.getReview();
@@ -1896,10 +1896,24 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
      * @return
      */
     @Override
-    public ExamTask findByFlowId(Long flowId) {
-        QueryWrapper<ExamTask> examTaskQueryWrapper = new QueryWrapper<>();
-        examTaskQueryWrapper.lambda().eq(ExamTask::getFlowId, flowId);
-        return examTaskService.getOne(examTaskQueryWrapper);
+    public ExamTask findByFlowId(String flowId) {
+//        QueryWrapper<ExamTask> examTaskQueryWrapper = new QueryWrapper<>();
+//        examTaskQueryWrapper.lambda().eq(ExamTask::getFlowId, flowId);
+//        return examTaskService.getOne(examTaskQueryWrapper);
+        ExamTask examTask = examTaskMapper.findByFlowId(flowId);
+        Optional.ofNullable(examTask).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("命题计划为空"));
+        return examTask;
+    }
+
+    /**
+     * 获取ProcessDefinitionId
+     *
+     * @param key
+     * @return
+     */
+    @Override
+    public String getProcessDefinitionIdByMaxVersion(String key) {
+        return examTaskMapper.getProcessDefinitionIdByMaxVersion(key);
     }
 
     /**

+ 10 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowApproveServiceImpl.java

@@ -7,6 +7,8 @@ import com.qmth.distributed.print.business.mapper.TFFlowApproveMapper;
 import com.qmth.distributed.print.business.service.TFFlowApproveService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+
 /**
  * <p>
  * 流程审核表 服务实现类
@@ -18,6 +20,9 @@ import org.springframework.stereotype.Service;
 @Service
 public class TFFlowApproveServiceImpl extends ServiceImpl<TFFlowApproveMapper, TFFlowApprove> implements TFFlowApproveService {
 
+    @Resource
+    TFFlowApproveMapper tfFlowApproveMapper;
+
     /**
      * 根据流程id查询流程状态
      *
@@ -25,9 +30,10 @@ public class TFFlowApproveServiceImpl extends ServiceImpl<TFFlowApproveMapper, T
      * @return
      */
     @Override
-    public TFFlowApprove findByFlowId(Long flowId) {
-        QueryWrapper<TFFlowApprove> tfFlowApproveQueryWrapper = new QueryWrapper<>();
-        tfFlowApproveQueryWrapper.lambda().eq(TFFlowApprove::getFlowId, flowId);
-        return this.getOne(tfFlowApproveQueryWrapper);
+    public TFFlowApprove findByFlowId(String flowId) {
+//        QueryWrapper<TFFlowApprove> tfFlowApproveQueryWrapper = new QueryWrapper<>();
+//        tfFlowApproveQueryWrapper.lambda().eq(TFFlowApprove::getFlowId, flowId);
+//        return this.getOne(tfFlowApproveQueryWrapper);
+        return tfFlowApproveMapper.findByFlowId(flowId);
     }
 }

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

@@ -53,7 +53,7 @@ public class TFFlowServiceImpl extends ServiceImpl<TFFlowMapper, TFFlow> impleme
      * @return
      */
     @Override
-    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String startName, Long schoolId, Long orgId, Long flowId) {
+    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String startName, Long schoolId, Long orgId, String flowId) {
         return tfFlowMapper.flowApproveList(iPage, startName, schoolId, orgId, flowId);
     }
 

+ 43 - 7
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -793,6 +793,30 @@
         and et.enable = 1
     </sql>
 
+    <sql id="findAllFlowId">
+        (select
+			DISTINCT t.PARENT_ID_
+		from
+			ACT_RU_EXECUTION t
+		where
+			t.ROOT_PROC_INST_ID_ = et.flow_id
+			and
+			t.PARENT_ID_ is not null
+		)
+    </sql>
+
+    <sql id="findAllFlowIdByParam">
+        (select
+			DISTINCT t.PARENT_ID_
+		from
+			ACT_RU_EXECUTION t
+		where
+			t.ROOT_PROC_INST_ID_ = #{flowId}
+			and
+			t.PARENT_ID_ is not null
+		)
+    </sql>
+
     <select id="getFlowTaskReadyList" resultType="com.qmth.distributed.print.business.bean.result.WorkResult">
           select * from(select
                 et.id,
@@ -817,7 +841,7 @@
                 et.create_time as createTime,
                 et.update_time as updateTime,
                 art.EXECUTION_ID_ as executionId,
-                et.flow_id as flowId,
+                art.PROC_INST_ID_ as flowId,
                 art.NAME_ as taskName,
                 art.TASK_DEF_KEY_ as taskDefKey,
                 art.ID_ as taskId,
@@ -829,7 +853,7 @@
             from
                 ACT_RU_TASK art
             left join exam_task et on
-                et.flow_id = art.PROC_INST_ID_
+                find_in_set(art.PROC_INST_ID_ ,et.flow_id)
             left join basic_card_rule b ON
                 et.card_rule_id = b.id
             left join t_f_flow_approve tffa on
@@ -869,7 +893,7 @@
                 et.create_time as createTime,
                 et.update_time as updateTime,
                 art.EXECUTION_ID_ as executionId,
-                et.flow_id as flowId,
+                art.PROC_INST_ID_ as flowId,
                 art.NAME_ as taskName,
                 art.TASK_DEF_KEY_ as taskDefKey,
                 art.ID_ as taskId,
@@ -881,7 +905,7 @@
             from
                 ACT_RU_TASK art
             left join exam_task et on
-                et.flow_id = art.PROC_INST_ID_
+                find_in_set(art.PROC_INST_ID_ ,et.flow_id)
             left join act_ru_identitylink ari on
                 ari.TASK_ID_ = art.ID_
             left join basic_card_rule b ON
@@ -925,7 +949,7 @@
                 et.create_time as createTime,
                 et.update_time as updateTime,
                 et.EXECUTION_ID_ as executionId,
-                et.flow_id as flowId,
+                et.PROC_INST_ID_ as flowId,
                 et.NAME_ as taskName,
                 et.TASK_DEF_KEY_ as taskDefKey,
                 et.ID_ as taskId,
@@ -948,13 +972,14 @@
                         art.NAME_,
                         art.TASK_DEF_KEY_,
                         art.ID_,
+                        art.PROC_INST_ID_,
                         tffa.setup
                     from
                         exam_task et
                     left join ACT_RU_TASK art on
-                        et.flow_id = art.PROC_INST_ID_
+                        find_in_set(art.PROC_INST_ID_ ,et.flow_id)
                     left join t_f_flow_approve tffa on
-                        tffa.flow_id = et.flow_id
+                        find_in_set(tffa.flow_id ,et.flow_id)
                     where
                         et.school_id = #{schoolId}
                         and et.user_id = #{userId}
@@ -1116,4 +1141,15 @@
             </if>
         </where>
     </select>
+
+    <select id="findByFlowId" resultType="com.qmth.distributed.print.business.entity.ExamTask">
+        select * from exam_task et where find_in_set(et.flow_id ,#{flowId})
+    </select>
+
+    <select id="getProcessDefinitionIdByMaxVersion" resultType="java.lang.String">
+        select t.ID_ from ACT_RE_PROCDEF t
+            where t.KEY_ = #{key}
+            and t.VERSION_ = (select max(t.VERSION_) from ACT_RE_PROCDEF t
+            where t.KEY_ = #{key})
+    </select>
 </mapper>

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

@@ -30,7 +30,7 @@
         from
             t_f_flow_log tffl
         left join sys_user su on tffl.approve_id = su.id
-        where tffl.flow_id = #{flowId}
+        where find_in_set(tffl.flow_id ,#{flowId})
         order by tffl.create_time desc
     </select>
 
@@ -49,7 +49,7 @@
         <where>
             AND tffl.approve_operation = 'APPROVE'
             <if test="flowId > 0 and flowId != ''">
-                AND tffl.flow_id = #{flowId}
+                AND find_in_set(tffl.flow_id ,#{flowId})
             </if>
             <if test="setup != null and setup != ''">
                 AND tffl.approve_setup = #{setup}

+ 3 - 0
distributed-print-business/src/main/resources/mapper/TFFlowApproveMapper.xml

@@ -2,4 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.distributed.print.business.mapper.TFFlowApproveMapper">
 
+    <select id="findByFlowId" resultType="com.qmth.distributed.print.business.entity.TFFlowApprove">
+        select * from t_f_flow_approve tffa where find_in_set(tffa.flow_id ,#{flowId})
+    </select>
 </mapper>

+ 1 - 1
distributed-print-business/src/main/resources/mapper/TFFlowMapper.xml

@@ -59,7 +59,7 @@
 <!--                and tffal.org_id = #{orgId}-->
 <!--            </if>-->
             <if test="flowId != null and flowId != ''">
-                and tffal.flow_id = #{flowId}
+                and find_in_set(tffal.flow_id ,#{flowId})
             </if>
             and tffal.enable = 1
         </where>

+ 6 - 0
distributed-print/.bpmn/src/main/resources/processes/GdykdxPaperApprove2.2.2.bpmn2d

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="GdykdxPaperApprove2.2.2" snapToGrid="true" version="0.11.0">
+  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+  <colors red="227" green="238" blue="249"/>
+  <colors red="255" green="255" blue="255"/>
+</pi:Diagram>

+ 253 - 0
distributed-print/.bpmn/src/main/resources/processes/GdykdxPaperApproveSubByPrint.bpmn2d

@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" active="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="GdykdxPaperApproveSubByPrint" snapToGrid="true" version="0.11.0">
+  <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="821635583"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="43" y="46">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="1" transparency="0.0" width="35" height="35" style="//@styles.0"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="237005797"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="151" y="36">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0 //@connections.3"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="237005797"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="&#x63d0;&#x4ea4;&#x8bd5;&#x5377;"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiusertask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="815834176"/>
+    <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="105" height="55" x="350" y="36">
+      <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" lineWidth="1" transparency="0.0" width="105" height="55" style="//@styles.1" cornerHeight="20" cornerWidth="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" incomingConnections="//@connections.1"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <properties key="independentObject" value="815834176"/>
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="105" height="23" y="20" style="//@styles.1" font="//@fonts.1" horizontalAlignment="ALIGNMENT_CENTER" value="&#x5ba1;&#x6838;&#x8bd5;&#x5377;"/>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Image" lineWidth="1" transparency="0.0" width="16" height="16" x="5" y="5" id="org.activiti.designer.guiusertask" stretchH="false" stretchV="false" proportional="false"/>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="106291236"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="385" y="760">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="3" transparency="0.0" width="35" height="35" style="//@styles.0"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor"/>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="1896206961"/>
+    <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="382" y="110">
+      <graphicsAlgorithmChildren xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" width="40" height="40" style="//@styles.0">
+        <points y="20"/>
+        <points x="20"/>
+        <points x="40" y="20"/>
+        <points x="20" y="40"/>
+        <points y="20"/>
+      </graphicsAlgorithmChildren>
+      <points y="20"/>
+      <points x="20"/>
+      <points x="40" y="20"/>
+      <points x="20" y="40"/>
+      <points y="20"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.3 //@connections.4" incomingConnections="//@connections.2"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.1">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <anchors xsi:type="pi:ChopboxAnchor"/>
+    <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="//@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="0.51" relativeHeight="0.93">
+      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
+    </anchors>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="30" y="10"/>
+        <points x="10" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+    <children visible="true">
+      <graphicsAlgorithm xsi:type="al:Polyline" lineWidth="5" filled="false" transparency="0.0" style="//@styles.0">
+        <points x="10" y="10"/>
+        <points x="30" y="30"/>
+      </graphicsAlgorithm>
+    </children>
+  </children>
+  <children xsi:type="pi:ContainerShape" visible="true" active="true">
+    <properties key="independentObject" value="756485548"/>
+    <graphicsAlgorithm xsi:type="al:Ellipse" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="35" height="35" x="385" y="200">
+      <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="3" transparency="0.0" width="35" height="35" style="//@styles.0"/>
+    </graphicsAlgorithm>
+    <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.4"/>
+  </children>
+  <styles foreground="//@colors.2" lineWidth="20" id="EVENT">
+    <renderingStyle>
+      <adaptedGradientColoredAreas definedStyleId="bpmnEventStyle" gradientType="0">
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="250" green="251" blue="252"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="250" green="251" blue="252"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+      </adaptedGradientColoredAreas>
+    </renderingStyle>
+  </styles>
+  <styles foreground="//@colors.2" lineWidth="20" id="TASK">
+    <renderingStyle>
+      <adaptedGradientColoredAreas definedStyleId="bpmnTaskStyle" gradientType="0">
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="250" green="251" blue="252"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="255" green="255" blue="204"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+        <adaptedGradientColoredAreas styleAdaption="0">
+          <gradientColor>
+            <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </start>
+            <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
+              <color red="229" green="229" blue="194"/>
+            </end>
+          </gradientColor>
+        </adaptedGradientColoredAreas>
+      </adaptedGradientColoredAreas>
+    </renderingStyle>
+  </styles>
+  <styles background="//@colors.2" foreground="//@colors.2" lineWidth="1" id="BPMN-POLYGON-ARROW"/>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@anchors.0" end="//@children.1/@anchors.0">
+    <properties key="independentObject" value="524038801"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.1/@anchors.0" end="//@children.2/@anchors.0">
+    <properties key="independentObject" value="1397705317"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.2/@anchors.0" end="//@children.4/@anchors.0">
+    <properties key="independentObject" value="1660873155"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.4/@anchors.0" end="//@children.1/@anchors.0">
+    <properties key="independentObject" value="1467301185"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x9a73;&#x56de;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+    <bendpoints x="203" y="130"/>
+  </connections>
+  <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.4/@anchors.0" end="//@children.5/@anchors.0">
+    <properties key="independentObject" value="2135900971"/>
+    <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+    <connectionDecorators visible="true" active="true" location="0.5">
+      <graphicsAlgorithm xsi:type="al:MultiText" lineWidth="1" filled="false" transparency="0.0" width="22" height="16" style="//@styles.1" font="//@fonts.1" verticalAlignment="ALIGNMENT_TOP" value="&#x901a;&#x8fc7;"/>
+    </connectionDecorators>
+    <connectionDecorators visible="true" locationRelative="true" location="1.0">
+      <graphicsAlgorithm xsi:type="al:Polygon" lineWidth="1" filled="true" transparency="0.0" style="//@styles.2">
+        <points x="-10" y="-5" before="3" after="3"/>
+        <points/>
+        <points x="-10" y="5" before="3" after="3"/>
+        <points x="-8" before="3" after="3"/>
+      </graphicsAlgorithm>
+    </connectionDecorators>
+  </connections>
+  <colors red="227" green="238" blue="249"/>
+  <colors red="255" green="255" blue="255"/>
+  <colors/>
+  <fonts name="Arial" size="8"/>
+  <fonts name="Arial" size="11"/>
+</pi:Diagram>

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -257,7 +257,7 @@ public class ExamTaskController {
     @ApiOperation(value = "审核历史")
     @RequestMapping(value = "/review_list", method = RequestMethod.POST)
     public Result reviewList(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
-        return ResultUtil.ok(examTaskReviewLogService.list(SystemConstant.convertIdToLong(flowId)));
+        return ResultUtil.ok(examTaskReviewLogService.list(flowId));
     }
 
     /**

+ 3 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/TFFlowController.java

@@ -188,8 +188,9 @@ public class TFFlowController {
             }
 
             // 驳回短信(驳回给提交老师)
-            if (tfFlowApprove.getStatus().equals(FlowStatusEnum.REJECT)
-                    && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.SUBMIT.getSetup())) {
+            if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT
+                    && (tfFlowApprove.getSetup().intValue() == FlowApproveSetupEnum.SUBMIT.getSetup())
+                    || tfFlowApprove.getSetup().intValue() == FlowApproveSetupEnum.THREE_APPROVE.getSetup()) {
                 List<SysUser> sysUsers = sysUserService.listByIds(Arrays.asList(examTask.getUserId()));
                 List<ApproveUserResult> sysUserList = new Gson().fromJson(JacksonUtil.parseJson(sysUsers), new TypeToken<List<ApproveUserResult>>() {
                 }.getType());

+ 132 - 0
distributed-print/src/main/resources/processes/GdykdxPaperApprove2.2.2.bpmn

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="GdykdxPaperApprove" name="GdykdxPaperApprove" isExecutable="true">
+    <startEvent id="startevent1" name="Start"></startEvent>
+    <userTask id="usertask1" name="提交试卷" activiti:assignee="${approveId}"></userTask>
+    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
+    <userTask id="usertask2" name="审核试卷">
+      <extensionElements>
+        <activiti:taskListener event="create" class="com.qmth.distributed.print.business.activiti.DirectorApproveListener"></activiti:taskListener>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <exclusiveGateway id="exclusivegateway1" name="审批"></exclusiveGateway>
+    <sequenceFlow id="flow3" sourceRef="usertask2" targetRef="exclusivegateway1"></sequenceFlow>
+    <userTask id="usertask3" name="审核试卷">
+      <extensionElements>
+        <activiti:taskListener event="create" class="com.qmth.distributed.print.business.activiti.PresidentApproveListener"></activiti:taskListener>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow4" name="通过" sourceRef="exclusivegateway1" targetRef="usertask3">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow5" name="驳回" sourceRef="exclusivegateway1" targetRef="usertask1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <exclusiveGateway id="exclusivegateway2" name="审批"></exclusiveGateway>
+    <sequenceFlow id="flow6" sourceRef="usertask3" targetRef="exclusivegateway2"></sequenceFlow>
+    <sequenceFlow id="flow8" name="驳回" sourceRef="exclusivegateway2" targetRef="usertask2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow9" name="驳回" sourceRef="exclusivegateway2" targetRef="usertask1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <callActivity id="GdykdxPrintSubActivity" name="印刷员审核子流程" calledElement="GdykdxPaperSubPrintApprove">
+      <extensionElements>
+        <activiti:in source="approveId" target="approveId"></activiti:in>
+      </extensionElements>
+    </callActivity>
+    <sequenceFlow id="flow10" name="通过" sourceRef="exclusivegateway2" targetRef="GdykdxPrintSubActivity">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 2}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow11" sourceRef="GdykdxPrintSubActivity" targetRef="endevent1"></sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_GdykdxPaperApprove">
+    <bpmndi:BPMNPlane bpmnElement="GdykdxPaperApprove" id="BPMNPlane_GdykdxPaperApprove">
+      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="43.0" y="46.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
+        <omgdc:Bounds height="55.0" width="105.0" x="151.0" y="36.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
+        <omgdc:Bounds height="55.0" width="105.0" x="350.0" y="36.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="385.0" y="490.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
+        <omgdc:Bounds height="40.0" width="40.0" x="382.0" y="110.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
+        <omgdc:Bounds height="55.0" width="105.0" x="350.0" y="190.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
+        <omgdc:Bounds height="40.0" width="40.0" x="382.0" y="300.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="GdykdxPrintSubActivity" id="BPMNShape_GdykdxPrintSubActivity">
+        <omgdc:Bounds height="55.0" width="105.0" x="350.0" y="390.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="78.0" y="63.0"></omgdi:waypoint>
+        <omgdi:waypoint x="151.0" y="63.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="256.0" y="63.0"></omgdi:waypoint>
+        <omgdi:waypoint x="350.0" y="63.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="402.0" y="91.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="110.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+        <omgdi:waypoint x="402.0" y="150.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="190.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="402.0" y="150.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="382.0" y="130.0"></omgdi:waypoint>
+        <omgdi:waypoint x="203.0" y="130.0"></omgdi:waypoint>
+        <omgdi:waypoint x="203.0" y="91.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="382.0" y="130.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+        <omgdi:waypoint x="402.0" y="245.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="300.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+        <omgdi:waypoint x="422.0" y="320.0"></omgdi:waypoint>
+        <omgdi:waypoint x="546.0" y="319.0"></omgdi:waypoint>
+        <omgdi:waypoint x="546.0" y="63.0"></omgdi:waypoint>
+        <omgdi:waypoint x="455.0" y="63.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="422.0" y="320.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+        <omgdi:waypoint x="382.0" y="320.0"></omgdi:waypoint>
+        <omgdi:waypoint x="203.0" y="321.0"></omgdi:waypoint>
+        <omgdi:waypoint x="203.0" y="91.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="382.0" y="320.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+        <omgdi:waypoint x="402.0" y="340.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="390.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="402.0" y="340.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+        <omgdi:waypoint x="402.0" y="445.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="490.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>

+ 81 - 0
distributed-print/src/main/resources/processes/GdykdxPaperApproveSubByPrint.bpmn

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="GdykdxPaperSubPrintApprove" name="GdykdxPaperSubPrintApprove" isExecutable="true">
+    <startEvent id="startevent1" name="Start">
+      <extensionElements>
+        <activiti:executionListener event="start" class="com.qmth.distributed.print.business.activiti.StartApproveSubListener"></activiti:executionListener>
+      </extensionElements>
+    </startEvent>
+    <userTask id="usertask4" name="提交试卷" activiti:assignee="${approveId}">
+      <extensionElements>
+        <activiti:taskListener event="create" class="com.qmth.distributed.print.business.activiti.TeacherApproveSubListener"></activiti:taskListener>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask4"></sequenceFlow>
+    <userTask id="usertask5" name="审核试卷">
+      <extensionElements>
+        <activiti:taskListener event="create" class="com.qmth.distributed.print.business.activiti.PrintApproveSubListener"></activiti:taskListener>
+      </extensionElements>
+    </userTask>
+    <sequenceFlow id="flow2" sourceRef="usertask4" targetRef="usertask5"></sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <exclusiveGateway id="exclusivegateway1" name="审批"></exclusiveGateway>
+    <sequenceFlow id="flow3" sourceRef="usertask5" targetRef="exclusivegateway1"></sequenceFlow>
+    <sequenceFlow id="flow5" name="驳回" sourceRef="exclusivegateway1" targetRef="usertask4">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent2" name="End"></endEvent>
+    <sequenceFlow id="flow9" name="通过" sourceRef="exclusivegateway1" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 1}]]></conditionExpression>
+    </sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_GdykdxPaperSubPrintApprove">
+    <bpmndi:BPMNPlane bpmnElement="GdykdxPaperSubPrintApprove" id="BPMNPlane_GdykdxPaperSubPrintApprove">
+      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="43.0" y="46.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
+        <omgdc:Bounds height="55.0" width="105.0" x="151.0" y="36.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5">
+        <omgdc:Bounds height="55.0" width="105.0" x="350.0" y="36.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="385.0" y="760.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
+        <omgdc:Bounds height="40.0" width="40.0" x="382.0" y="110.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
+        <omgdc:Bounds height="35.0" width="35.0" x="385.0" y="200.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="78.0" y="63.0"></omgdi:waypoint>
+        <omgdi:waypoint x="151.0" y="63.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="256.0" y="63.0"></omgdi:waypoint>
+        <omgdi:waypoint x="350.0" y="63.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="402.0" y="91.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="110.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="382.0" y="130.0"></omgdi:waypoint>
+        <omgdi:waypoint x="203.0" y="130.0"></omgdi:waypoint>
+        <omgdi:waypoint x="203.0" y="91.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="382.0" y="130.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+        <omgdi:waypoint x="402.0" y="150.0"></omgdi:waypoint>
+        <omgdi:waypoint x="402.0" y="200.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="22.0" x="402.0" y="150.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>

+ 2 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -197,6 +197,7 @@ public class SystemConstant {
      */
     public static final String PROCESSES = "processes";
     public static final String GDYKDX_FLOW_KEY = "GdykdxPaperApprove";//广药流程key
+    public static final String GDYKDX_SUB_FLOW_KEY = "GdykdxPaperSubPrintApprove";//广药子流程key
     public static final String JXZYY_FLOW_KEY = "JxzyyPaperApprove";//江西流程key
     public static final String APPROVE_ID = "approveId";//审批id
     public static final String TEACHING_ROOM_ID = "teachingRoomId";//教研室机构id
@@ -207,6 +208,7 @@ public class SystemConstant {
     public static final String APPROVE_USER_IDS = "approveUserIds";//流程审批人列表
     public static final String APPROVE_DIRECTOR_USER_IDS = "approveDirectorUserIds";//流程主任审批人列表
     public static final String APPROVE_PRESIDENT_USER_IDS = "approvePresidentUserIds";//流程院长审批人列表
+    public static final String APPROVE_PRINT_USER_IDS = "approvePrintUserIds";//印刷人员审批人列表
     public static final String APPROVE_OPERATION = "approveOperation";//流程操作
     public static final String FLOW_STATUS = "flowStatus";//流程状态
     public static final String APPROVE_REMARK = "approveRemark";//流程审批意见

+ 3 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveNameEnum.java

@@ -15,7 +15,9 @@ public enum FlowApproveNameEnum {
 
     DIRECTOR("主任审批", "Director"),
 
-    PRESIDENT("院长审核", "President");
+    PRESIDENT("院长审核", "President"),
+
+    PRINT("印刷员审核", "Print");
 
     private String title;
 

+ 4 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveSetupEnum.java

@@ -17,6 +17,10 @@ public enum FlowApproveSetupEnum {
 
     SECOND_APPROVE("二级审核", "usertask3", 3),
 
+    THREE_APPROVE("三级审核", "usertask4", 4),
+
+    FOUR_APPROVE("四级审核", "usertask5", 5),
+
     END("已终止", null, -1),
 
     FINISH("已结束", null, 0);

+ 7 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveVariableEnum.java

@@ -19,7 +19,13 @@ public enum FlowApproveVariableEnum {
 
     SECOND_REJECT_ONE("二级审核驳回至第一节点", "0"),
 
-    SECOND_REJECT_TWO("二级审核驳回至第二节点", "1");
+    SECOND_REJECT_TWO("二级审核驳回至第二节点", "1"),
+
+    THREE_APPROVE("三级审核通过", "3"),
+
+    FOUR_APPROVE("四级审核通过", "1"),
+
+    FOUR_REJECT("四级审核驳回", "0");
 
     private String title;