Bladeren bron

新增自定义流程属性-流程审批

wangliang 3 jaren geleden
bovenliggende
commit
2da68de962
36 gewijzigde bestanden met toevoegingen van 2183 en 2636 verwijderingen
  1. 107 107
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/DirectorApproveByJxzyyListener.java
  2. 105 105
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/DirectorApproveListener.java
  3. 109 109
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/PresidentApproveListener.java
  4. 106 106
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/PrintApproveSubListener.java
  5. 39 39
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/StartApproveSubListener.java
  6. 1 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/custom/service/AbstractMultiWorkFlowService.java
  7. 0 11
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/FlowTaskApproveParam.java
  8. 170 170
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowApproveResult.java
  9. 6 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowTaskResult.java
  10. 0 133
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlow.java
  11. 1 14
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApprove.java
  12. 0 264
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApproveLog.java
  13. 57 57
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowDynamicBuildEnum.java
  14. 51 51
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowElementEnum.java
  15. 17 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowTypeEnum.java
  16. 0 42
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/FlowModelEnum.java
  17. 24 24
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowApproveLogMapper.java
  18. 10 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowLogMapper.java
  19. 60 60
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowMapper.java
  20. 24 24
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowApproveLogService.java
  21. 11 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowLogService.java
  22. 67 67
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowService.java
  23. 481 515
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java
  24. 3 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  25. 35 35
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowApproveLogServiceImpl.java
  26. 15 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowLogServiceImpl.java
  27. 145 145
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowServiceImpl.java
  28. 0 12
      distributed-print-business/src/main/resources/mapper/TFFlowApproveLogMapper.xml
  29. 11 0
      distributed-print-business/src/main/resources/mapper/TFFlowLogMapper.xml
  30. 0 139
      distributed-print-business/src/main/resources/mapper/TFFlowMapper.xml
  31. 140 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java
  32. 296 296
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFFlowController.java
  33. 0 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  34. 16 7
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveOperationEnum.java
  35. 0 8
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveSetupEnum.java
  36. 76 76
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveVariableEnum.java

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

@@ -1,107 +1,107 @@
-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.entity.TFFlowLog;
-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.distributed.print.business.service.TFFlowLogService;
-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.FlowApproveNameEnum;
-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 org.activiti.bpmn.model.BpmnModel;
-import org.activiti.bpmn.model.FlowNode;
-import org.activiti.bpmn.model.UserTask;
-import org.activiti.engine.RepositoryService;
-import org.activiti.engine.delegate.DelegateTask;
-import org.activiti.engine.delegate.TaskListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-/**
- * @Description: 教研室主任审批
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/11/10
- */
-public class DirectorApproveByJxzyyListener implements TaskListener {
-    private final static Logger log = LoggerFactory.getLogger(DirectorApproveByJxzyyListener.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);
-        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
-        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
-
-        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_DIRECTOR_USER_IDS);
-        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
-        ExamTask examTask = examTaskService.findByFlowId(flowId);
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
-        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
-
-        String currActivityId = delegateTask.getTaskDefinitionKey();
-        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
-        FlowNode currFlow = (UserTask) bpmnModel.getMainProcess().getFlowElement(currActivityId);
-        UserTask userTask = (UserTask) currFlow;
-        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
-        List<ApproveUserResult> sysUserList = new ArrayList<>();
-
-        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
-            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
-            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
-            tfFlowLog.setPendApproveId(approveExchangeUserId);
-        } else {
-            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());
-                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
-                delegateTask.addCandidateUsers(userIdList);
-                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
-            } else {
-                sysUserList = sysUserService.findByJxzyyDirectorApprove(null, FlowApproveNameEnum.DIRECTOR);
-                if (Objects.nonNull(sysUserList) && sysUserList.size() > 0) {
-                    List<String> ids = sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
-                    //添加或签的人员,一人通过即可进入下一环节
-                    delegateTask.addCandidateUsers(ids);
-                    tfFlowLog.setPendApproveId(String.join(", ", ids));
-                }
-            }
-        }
-        tfFlowLogService.updateById(tfFlowLog);
-
-        // 发送审核短信
-        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
-                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
-            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
-        }// 驳回短信(驳回给主任)
-        else if (tfFlowApprove.getStatus().equals(FlowStatusEnum.REJECT)
-                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
-            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
-        }
-    }
-}
+//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.entity.TFFlowLog;
+//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.distributed.print.business.service.TFFlowLogService;
+//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.FlowApproveNameEnum;
+//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 org.activiti.bpmn.model.BpmnModel;
+//import org.activiti.bpmn.model.FlowNode;
+//import org.activiti.bpmn.model.UserTask;
+//import org.activiti.engine.RepositoryService;
+//import org.activiti.engine.delegate.DelegateTask;
+//import org.activiti.engine.delegate.TaskListener;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//import java.util.Objects;
+//import java.util.stream.Collectors;
+//
+///**
+// * @Description: 教研室主任审批
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/11/10
+// */
+//public class DirectorApproveByJxzyyListener implements TaskListener {
+//    private final static Logger log = LoggerFactory.getLogger(DirectorApproveByJxzyyListener.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);
+//        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
+//        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
+//
+//        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_DIRECTOR_USER_IDS);
+//        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
+//        ExamTask examTask = examTaskService.findByFlowId(flowId);
+//        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
+//        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
+//
+//        String currActivityId = delegateTask.getTaskDefinitionKey();
+//        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
+//        FlowNode currFlow = (UserTask) bpmnModel.getMainProcess().getFlowElement(currActivityId);
+//        UserTask userTask = (UserTask) currFlow;
+//        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
+//        List<ApproveUserResult> sysUserList = new ArrayList<>();
+//
+//        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
+//            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
+//            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
+//            tfFlowLog.setPendApproveId(approveExchangeUserId);
+//        } else {
+//            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());
+//                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
+//                delegateTask.addCandidateUsers(userIdList);
+//                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
+//            } else {
+//                sysUserList = sysUserService.findByJxzyyDirectorApprove(null, FlowApproveNameEnum.DIRECTOR);
+//                if (Objects.nonNull(sysUserList) && sysUserList.size() > 0) {
+//                    List<String> ids = sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
+//                    //添加或签的人员,一人通过即可进入下一环节
+//                    delegateTask.addCandidateUsers(ids);
+//                    tfFlowLog.setPendApproveId(String.join(", ", ids));
+//                }
+//            }
+//        }
+//        tfFlowLogService.updateById(tfFlowLog);
+//
+//        // 发送审核短信
+//        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
+//                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
+//            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
+//        }// 驳回短信(驳回给主任)
+//        else if (tfFlowApprove.getStatus().equals(FlowStatusEnum.REJECT)
+//                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
+//            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
+//        }
+//    }
+//}

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

@@ -1,105 +1,105 @@
-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.entity.TFFlowLog;
-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.distributed.print.business.service.TFFlowLogService;
-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.FlowApproveSetupEnum;
-import com.qmth.teachcloud.common.enums.FlowStatusEnum;
-import com.qmth.teachcloud.common.service.SysUserService;
-import com.qmth.teachcloud.common.util.JacksonUtil;
-import org.activiti.bpmn.model.BpmnModel;
-import org.activiti.bpmn.model.FlowNode;
-import org.activiti.bpmn.model.UserTask;
-import org.activiti.engine.RepositoryService;
-import org.activiti.engine.delegate.DelegateTask;
-import org.activiti.engine.delegate.TaskListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-/**
- * @Description: 教研室主任审批
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/7/29
- */
-public class DirectorApproveListener implements TaskListener {
-    private final static Logger log = LoggerFactory.getLogger(DirectorApproveListener.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);
-        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
-        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
-
-        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
-        ExamTask examTask = examTaskService.findByFlowId(flowId);
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
-        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
-
-        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_DIRECTOR_USER_IDS);
-        String currActivityId = delegateTask.getTaskDefinitionKey();
-        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
-        FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(currActivityId);
-        UserTask userTask = (UserTask) currFlow;
-        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
-        List<ApproveUserResult> sysUserList = new ArrayList<>();
-        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
-            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
-            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
-            tfFlowLog.setPendApproveId(approveExchangeUserId);
-        } else {
-            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());
-                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
-                delegateTask.addCandidateUsers(userIdList);
-                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
-            } else {
-                sysUserList = sysUserService.findByDirectorApprove(examTask.getCourseCode(), 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);
-                    tfFlowLog.setPendApproveId(String.join(", ", ids));
-                }
-            }
-        }
-        tfFlowLogService.updateById(tfFlowLog);
-
-        // 发送审核短信
-        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
-                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
-            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
-        }// 驳回短信(驳回给主任)
-        else if (tfFlowApprove.getStatus().equals(FlowStatusEnum.REJECT)
-                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
-            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
-        }
-    }
-}
+//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.entity.TFFlowLog;
+//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.distributed.print.business.service.TFFlowLogService;
+//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.FlowApproveSetupEnum;
+//import com.qmth.teachcloud.common.enums.FlowStatusEnum;
+//import com.qmth.teachcloud.common.service.SysUserService;
+//import com.qmth.teachcloud.common.util.JacksonUtil;
+//import org.activiti.bpmn.model.BpmnModel;
+//import org.activiti.bpmn.model.FlowNode;
+//import org.activiti.bpmn.model.UserTask;
+//import org.activiti.engine.RepositoryService;
+//import org.activiti.engine.delegate.DelegateTask;
+//import org.activiti.engine.delegate.TaskListener;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//import java.util.Objects;
+//import java.util.stream.Collectors;
+//
+///**
+// * @Description: 教研室主任审批
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/7/29
+// */
+//public class DirectorApproveListener implements TaskListener {
+//    private final static Logger log = LoggerFactory.getLogger(DirectorApproveListener.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);
+//        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
+//        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
+//
+//        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
+//        ExamTask examTask = examTaskService.findByFlowId(flowId);
+//        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
+//        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
+//
+//        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_DIRECTOR_USER_IDS);
+//        String currActivityId = delegateTask.getTaskDefinitionKey();
+//        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
+//        FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(currActivityId);
+//        UserTask userTask = (UserTask) currFlow;
+//        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
+//        List<ApproveUserResult> sysUserList = new ArrayList<>();
+//        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
+//            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
+//            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
+//            tfFlowLog.setPendApproveId(approveExchangeUserId);
+//        } else {
+//            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());
+//                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
+//                delegateTask.addCandidateUsers(userIdList);
+//                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
+//            } else {
+//                sysUserList = sysUserService.findByDirectorApprove(examTask.getCourseCode(), 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);
+//                    tfFlowLog.setPendApproveId(String.join(", ", ids));
+//                }
+//            }
+//        }
+//        tfFlowLogService.updateById(tfFlowLog);
+//
+//        // 发送审核短信
+//        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
+//                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
+//            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
+//        }// 驳回短信(驳回给主任)
+//        else if (tfFlowApprove.getStatus().equals(FlowStatusEnum.REJECT)
+//                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
+//            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
+//        }
+//    }
+//}

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

@@ -1,109 +1,109 @@
-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.entity.TFFlowLog;
-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.distributed.print.business.service.TFFlowLogService;
-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.bpmn.model.BpmnModel;
-import org.activiti.bpmn.model.FlowNode;
-import org.activiti.bpmn.model.UserTask;
-import org.activiti.engine.RepositoryService;
-import org.activiti.engine.delegate.DelegateTask;
-import org.activiti.engine.delegate.TaskListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-/**
- * @Description: 教学院长审批
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/7/29
- */
-public class PresidentApproveListener implements TaskListener {
-    private final static Logger log = LoggerFactory.getLogger(PresidentApproveListener.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);
-        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
-        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
-
-        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
-        ExamTask examTask = examTaskService.findByFlowId(flowId);
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
-        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
-
-        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_PRESIDENT_USER_IDS);
-        String currActivityId = delegateTask.getTaskDefinitionKey();
-        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
-        FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(currActivityId);
-        UserTask userTask = (UserTask) currFlow;
-        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
-
-        List<ApproveUserResult> sysUserList = new ArrayList<>();
-        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
-            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
-            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
-            tfFlowLog.setPendApproveId(approveExchangeUserId);
-        } else {
-            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());
-                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
-                delegateTask.addCandidateUsers(userIdList);
-                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
-            } else {
-                SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-                if (Objects.isNull(sysUser.getOrgId())) {
-                    throw ExceptionResultEnum.ERROR.exception("审批人机构为空");
-                }
-                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);
-                    tfFlowLog.setPendApproveId(String.join(", ", ids));
-                }
-            }
-        }
-        tfFlowLogService.updateById(tfFlowLog);
-
-        // 发送审核短信
-        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
-                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.SECOND_APPROVE.getSetup())) {
-            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
-        }
-    }
-}
+//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.entity.TFFlowLog;
+//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.distributed.print.business.service.TFFlowLogService;
+//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.bpmn.model.BpmnModel;
+//import org.activiti.bpmn.model.FlowNode;
+//import org.activiti.bpmn.model.UserTask;
+//import org.activiti.engine.RepositoryService;
+//import org.activiti.engine.delegate.DelegateTask;
+//import org.activiti.engine.delegate.TaskListener;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import java.util.ArrayList;
+//import java.util.Arrays;
+//import java.util.List;
+//import java.util.Objects;
+//import java.util.stream.Collectors;
+//
+///**
+// * @Description: 教学院长审批
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/7/29
+// */
+//public class PresidentApproveListener implements TaskListener {
+//    private final static Logger log = LoggerFactory.getLogger(PresidentApproveListener.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);
+//        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
+//        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
+//
+//        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
+//        ExamTask examTask = examTaskService.findByFlowId(flowId);
+//        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
+//        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
+//
+//        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_PRESIDENT_USER_IDS);
+//        String currActivityId = delegateTask.getTaskDefinitionKey();
+//        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
+//        FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(currActivityId);
+//        UserTask userTask = (UserTask) currFlow;
+//        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
+//
+//        List<ApproveUserResult> sysUserList = new ArrayList<>();
+//        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
+//            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
+//            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
+//            tfFlowLog.setPendApproveId(approveExchangeUserId);
+//        } else {
+//            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());
+//                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
+//                delegateTask.addCandidateUsers(userIdList);
+//                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
+//            } else {
+//                SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+//                if (Objects.isNull(sysUser.getOrgId())) {
+//                    throw ExceptionResultEnum.ERROR.exception("审批人机构为空");
+//                }
+//                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);
+//                    tfFlowLog.setPendApproveId(String.join(", ", ids));
+//                }
+//            }
+//        }
+//        tfFlowLogService.updateById(tfFlowLog);
+//
+//        // 发送审核短信
+//        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
+//                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.SECOND_APPROVE.getSetup())) {
+//            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
+//        }
+//    }
+//}

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

@@ -1,106 +1,106 @@
-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.entity.TFFlowLog;
-import com.qmth.distributed.print.business.enums.MessageEnum;
-import com.qmth.distributed.print.business.service.*;
-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.bpmn.model.BpmnModel;
-import org.activiti.bpmn.model.FlowNode;
-import org.activiti.bpmn.model.UserTask;
-import org.activiti.engine.RepositoryService;
-import org.activiti.engine.delegate.DelegateTask;
-import org.activiti.engine.delegate.TaskListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-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);
-        ActivitiService activitiService = SpringContextHolder.getBean(ActivitiService.class);
-        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
-        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
-
-        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
-        ExamTask examTask = examTaskService.findByFlowId(flowId);
-        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
-        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
-
-        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_PRINT_USER_IDS);
-        String currActivityId = delegateTask.getTaskDefinitionKey();
-        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
-        FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(currActivityId);
-        UserTask userTask = (UserTask) currFlow;
-        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
-
-        List<ApproveUserResult> sysUserList = new ArrayList<>();
-        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
-            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
-            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
-            tfFlowLog.setPendApproveId(approveExchangeUserId);
-        } else {
-            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());
-                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
-                delegateTask.addCandidateUsers(userIdList);
-                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
-            } else {
-                SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-                if (Objects.isNull(sysUser.getOrgId())) {
-                    throw ExceptionResultEnum.ERROR.exception("审批人机构为空");
-                }
-                sysUserList = activitiService.findByPrintApprove(flowId);
-                if (Objects.nonNull(sysUserList) && sysUserList.size() > 0) {
-                    List<String> ids = sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
-                    //添加或签的人员,一人通过即可进入下一环节
-                    delegateTask.addCandidateUsers(ids);
-                    tfFlowLog.setPendApproveId(String.join(", ", ids));
-                }
-            }
-        }
-        tfFlowLogService.updateById(tfFlowLog);
-
-        // 发送审核短信
-        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
-                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.FOUR_APPROVE.getSetup())) {
-            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
-        }
-    }
-}
+//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.entity.TFFlowLog;
+//import com.qmth.distributed.print.business.enums.MessageEnum;
+//import com.qmth.distributed.print.business.service.*;
+//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.bpmn.model.BpmnModel;
+//import org.activiti.bpmn.model.FlowNode;
+//import org.activiti.bpmn.model.UserTask;
+//import org.activiti.engine.RepositoryService;
+//import org.activiti.engine.delegate.DelegateTask;
+//import org.activiti.engine.delegate.TaskListener;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import java.util.ArrayList;
+//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);
+//        ActivitiService activitiService = SpringContextHolder.getBean(ActivitiService.class);
+//        TFFlowLogService tfFlowLogService = SpringContextHolder.getBean(TFFlowLogService.class);
+//        RepositoryService repositoryService = SpringContextHolder.getBean(RepositoryService.class);
+//
+//        Long flowId = SystemConstant.convertIdToLong(delegateTask.getProcessInstanceId());
+//        ExamTask examTask = examTaskService.findByFlowId(flowId);
+//        TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId, examTask.getSchoolId());
+//        TFFlowLog tfFlowLog = (TFFlowLog) delegateTask.getVariable(SystemConstant.APPROVE_TF_FLOW_LOG);
+//
+//        List<Long> approveUserIds = (List<Long>) delegateTask.getVariable(SystemConstant.APPROVE_PRINT_USER_IDS);
+//        String currActivityId = delegateTask.getTaskDefinitionKey();
+//        BpmnModel bpmnModel = repositoryService.getBpmnModel(delegateTask.getProcessDefinitionId());
+//        FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(currActivityId);
+//        UserTask userTask = (UserTask) currFlow;
+//        String approveExchangeUserId = (String) delegateTask.getVariable(SystemConstant.APPROVE_EXCHANGE_USER_ID + userTask.getId());
+//
+//        List<ApproveUserResult> sysUserList = new ArrayList<>();
+//        if (tfFlowApprove.getStatus() == FlowStatusEnum.REJECT && Objects.nonNull(approveExchangeUserId)) {
+//            sysUserList.addAll(sysUserService.findById(Long.parseLong(approveExchangeUserId)));
+//            delegateTask.addCandidateUsers(sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList()));
+//            tfFlowLog.setPendApproveId(approveExchangeUserId);
+//        } else {
+//            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());
+//                List<String> userIdList = approveUserIds.stream().map(x -> String.valueOf(x)).collect(Collectors.toList());
+//                delegateTask.addCandidateUsers(userIdList);
+//                tfFlowLog.setPendApproveId(String.join(", ", userIdList));
+//            } else {
+//                SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+//                if (Objects.isNull(sysUser.getOrgId())) {
+//                    throw ExceptionResultEnum.ERROR.exception("审批人机构为空");
+//                }
+//                sysUserList = activitiService.findByPrintApprove(flowId);
+//                if (Objects.nonNull(sysUserList) && sysUserList.size() > 0) {
+//                    List<String> ids = sysUserList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
+//                    //添加或签的人员,一人通过即可进入下一环节
+//                    delegateTask.addCandidateUsers(ids);
+//                    tfFlowLog.setPendApproveId(String.join(", ", ids));
+//                }
+//            }
+//        }
+//        tfFlowLogService.updateById(tfFlowLog);
+//
+//        // 发送审核短信
+//        if (tfFlowApprove.getStatus().equals(FlowStatusEnum.AUDITING)
+//                && tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.FOUR_APPROVE.getSetup())) {
+//            basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_CREATED);
+//        }
+//    }
+//}

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

@@ -1,39 +1,39 @@
-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.distributed.print.business.service.TExamTaskFlowService;
-import com.qmth.teachcloud.common.contant.SpringContextHolder;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import org.activiti.engine.delegate.DelegateExecution;
-import org.activiti.engine.delegate.ExecutionListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @Description: 子流程启动监听
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/11/19
- */
-public class StartApproveSubListener implements ExecutionListener {
-    private final static Logger log = LoggerFactory.getLogger(StartApproveSubListener.class);
-
-    @Override
-    @Transactional
-    public void notify(DelegateExecution delegateExecution) {
-        ExamTaskService examTaskService = SpringContextHolder.getBean(ExamTaskService.class);
-        TExamTaskFlowService tExamTaskFlowService = SpringContextHolder.getBean(TExamTaskFlowService.class);
-        ExamTask examTask = examTaskService.findByFlowId(SystemConstant.convertIdToLong(delegateExecution.getRootProcessInstanceId()));
-        Map<String, Object> texamTaskFlowMap = new HashMap<>();
-        texamTaskFlowMap.computeIfAbsent(SystemConstant.SCHOOL_ID, v -> examTask.getSchoolId());
-        texamTaskFlowMap.computeIfAbsent(SystemConstant.EXAM_TASK_ID, v -> examTask.getId());
-        texamTaskFlowMap.computeIfAbsent(SystemConstant.FLOW_ID, v -> SystemConstant.convertIdToLong(delegateExecution.getProcessInstanceId()));
-        tExamTaskFlowService.saveOrUpdate(texamTaskFlowMap);
-    }
-}
+//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.distributed.print.business.service.TExamTaskFlowService;
+//import com.qmth.teachcloud.common.contant.SpringContextHolder;
+//import com.qmth.teachcloud.common.contant.SystemConstant;
+//import org.activiti.engine.delegate.DelegateExecution;
+//import org.activiti.engine.delegate.ExecutionListener;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.HashMap;
+//import java.util.Map;
+//
+///**
+// * @Description: 子流程启动监听
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/11/19
+// */
+//public class StartApproveSubListener implements ExecutionListener {
+//    private final static Logger log = LoggerFactory.getLogger(StartApproveSubListener.class);
+//
+//    @Override
+//    @Transactional
+//    public void notify(DelegateExecution delegateExecution) {
+//        ExamTaskService examTaskService = SpringContextHolder.getBean(ExamTaskService.class);
+//        TExamTaskFlowService tExamTaskFlowService = SpringContextHolder.getBean(TExamTaskFlowService.class);
+//        ExamTask examTask = examTaskService.findByFlowId(SystemConstant.convertIdToLong(delegateExecution.getRootProcessInstanceId()));
+//        Map<String, Object> texamTaskFlowMap = new HashMap<>();
+//        texamTaskFlowMap.computeIfAbsent(SystemConstant.SCHOOL_ID, v -> examTask.getSchoolId());
+//        texamTaskFlowMap.computeIfAbsent(SystemConstant.EXAM_TASK_ID, v -> examTask.getId());
+//        texamTaskFlowMap.computeIfAbsent(SystemConstant.FLOW_ID, v -> SystemConstant.convertIdToLong(delegateExecution.getProcessInstanceId()));
+//        tExamTaskFlowService.saveOrUpdate(texamTaskFlowMap);
+//    }
+//}

+ 1 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/custom/service/AbstractMultiWorkFlowService.java

@@ -3,7 +3,6 @@ package com.qmth.distributed.print.business.activiti.custom.service;
 import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
 import com.qmth.distributed.print.business.bean.flow.link.FlowTaskLink;
 import com.qmth.distributed.print.business.bean.flow.link.FlowTaskNode;
-import com.qmth.distributed.print.business.enums.CustomFlowDynamicBuildEnum;
 import com.qmth.distributed.print.business.enums.CustomFlowTypeEnum;
 import org.activiti.bpmn.model.MultiInstanceLoopCharacteristics;
 import org.activiti.bpmn.model.UserTask;
@@ -122,7 +121,7 @@ public abstract class AbstractMultiWorkFlowService implements DefaultInstanceCon
         customFlowDefaultDto.setContent(DEFAULT_USER_TASK_NAME);
         customFlowDefaultDto.setH(customFlowDefaultDto.getH() + 30D);
         customFlowDefaultDto.setY(customFlowDefaultDto.getY() + 50D);
-        customFlowDefaultDto.setFlowTaskId(CustomFlowDynamicBuildEnum.USER_TASK.getId() + id);
+        customFlowDefaultDto.setFlowTaskId(CustomFlowTypeEnum.USER_TASK.getId() + id);
         FlowTaskNode nodeDefault = new FlowTaskNode(customFlowDefaultDto);
         flowTaskLink.add(nodeDefault);
         return customFlowDefaultDto;

+ 0 - 11
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/FlowTaskApproveParam.java

@@ -35,17 +35,6 @@ public class FlowTaskApproveParam implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     private List<Long> approveUserIds;
 
-    @ApiModelProperty(value = "流程节点id")
-    private String usertaskId;
-
-    public String getUsertaskId() {
-        return usertaskId;
-    }
-
-    public void setUsertaskId(String usertaskId) {
-        this.usertaskId = usertaskId;
-    }
-
     public String getTaskId() {
         return taskId;
     }

+ 170 - 170
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowApproveResult.java

@@ -1,170 +1,170 @@
-package com.qmth.distributed.print.business.bean.result;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
-import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
-import com.qmth.teachcloud.common.enums.FlowStatusEnum;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * @Description: 流程审批列表result
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/8/5
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class FlowApproveResult extends TFFlowApproveLog implements Serializable {
-
-    @ApiModelProperty(value = "发起人名称")
-    private String startName;
-
-    @ApiModelProperty(value = "一级审核人名称")
-    private String primaryApproveName;
-
-    @ApiModelProperty(value = "二级审核人名称")
-    private String secondApproveName;
-
-    @ApiModelProperty(value = "三级审核人名称")
-    private String threeApproveName;
-
-    @ApiModelProperty(value = "四级审核人名称")
-    private String fourApproveName;
-
-    @ApiModelProperty(value = "流程状态")
-    private FlowStatusEnum status;
-
-    @ApiModelProperty(value = "流程状态")
-    private String statusStr;
-
-    @ApiModelProperty(value = "当前节点")
-    private int setup;
-
-    @ApiModelProperty(value = "当前节点")
-    private String setupStr;
-
-    @ApiModelProperty(value = "当前处理人")
-    private String currentApproveUserName;
-
-    @ApiModelProperty(value = "科目代码")
-    private String courseCode;
-
-    @ApiModelProperty(value = "科目名称")
-    private String courseName;
-
-    @ApiModelProperty(value = "试卷编号")
-    private String paperNumber;
-
-    public String getThreeApproveName() {
-        return threeApproveName;
-    }
-
-    public void setThreeApproveName(String threeApproveName) {
-        this.threeApproveName = threeApproveName;
-    }
-
-    public String getFourApproveName() {
-        return fourApproveName;
-    }
-
-    public void setFourApproveName(String fourApproveName) {
-        this.fourApproveName = fourApproveName;
-    }
-
-    public FlowStatusEnum getStatus() {
-        return status;
-    }
-
-    public void setStatus(FlowStatusEnum status) {
-        this.status = status;
-    }
-
-    public String getStartName() {
-        return startName;
-    }
-
-    public void setStartName(String startName) {
-        this.startName = startName;
-    }
-
-    public String getPrimaryApproveName() {
-        return primaryApproveName;
-    }
-
-    public void setPrimaryApproveName(String primaryApproveName) {
-        this.primaryApproveName = primaryApproveName;
-    }
-
-    public String getSecondApproveName() {
-        return secondApproveName;
-    }
-
-    public void setSecondApproveName(String secondApproveName) {
-        this.secondApproveName = secondApproveName;
-    }
-
-    public String getStatusStr() {
-        if (Objects.nonNull(status)) {
-            return status.getTitle();
-        } else {
-            return statusStr;
-        }
-    }
-
-    public void setStatusStr(String statusStr) {
-        this.statusStr = statusStr;
-    }
-
-    public int getSetup() {
-        return setup;
-    }
-
-    public void setSetup(int setup) {
-        this.setup = setup;
-    }
-
-    public String getSetupStr() {
-        return setupStr;
-    }
-
-    public void setSetupStr(String setupStr) {
-        this.setupStr = setupStr;
-    }
-
-    public String getCurrentApproveUserName() {
-        return currentApproveUserName;
-    }
-
-    public void setCurrentApproveUserName(String currentApproveUserName) {
-        this.currentApproveUserName = currentApproveUserName;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getPaperNumber() {
-        return paperNumber;
-    }
-
-    public void setPaperNumber(String paperNumber) {
-        this.paperNumber = paperNumber;
-    }
-}
+//package com.qmth.distributed.print.business.bean.result;
+//
+//import com.fasterxml.jackson.annotation.JsonInclude;
+//import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+//import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
+//import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
+//import com.qmth.teachcloud.common.enums.FlowStatusEnum;
+//import io.swagger.annotations.ApiModelProperty;
+//
+//import java.io.Serializable;
+//import java.util.Objects;
+//
+///**
+// * @Description: 流程审批列表result
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/8/5
+// */
+//@JsonInclude(JsonInclude.Include.NON_NULL)
+//public class FlowApproveResult extends TFFlowApproveLog implements Serializable {
+//
+//    @ApiModelProperty(value = "发起人名称")
+//    private String startName;
+//
+//    @ApiModelProperty(value = "一级审核人名称")
+//    private String primaryApproveName;
+//
+//    @ApiModelProperty(value = "二级审核人名称")
+//    private String secondApproveName;
+//
+//    @ApiModelProperty(value = "三级审核人名称")
+//    private String threeApproveName;
+//
+//    @ApiModelProperty(value = "四级审核人名称")
+//    private String fourApproveName;
+//
+//    @ApiModelProperty(value = "流程状态")
+//    private FlowStatusEnum status;
+//
+//    @ApiModelProperty(value = "流程状态")
+//    private String statusStr;
+//
+//    @ApiModelProperty(value = "当前节点")
+//    private int setup;
+//
+//    @ApiModelProperty(value = "当前节点")
+//    private String setupStr;
+//
+//    @ApiModelProperty(value = "当前处理人")
+//    private String currentApproveUserName;
+//
+//    @ApiModelProperty(value = "科目代码")
+//    private String courseCode;
+//
+//    @ApiModelProperty(value = "科目名称")
+//    private String courseName;
+//
+//    @ApiModelProperty(value = "试卷编号")
+//    private String paperNumber;
+//
+//    public String getThreeApproveName() {
+//        return threeApproveName;
+//    }
+//
+//    public void setThreeApproveName(String threeApproveName) {
+//        this.threeApproveName = threeApproveName;
+//    }
+//
+//    public String getFourApproveName() {
+//        return fourApproveName;
+//    }
+//
+//    public void setFourApproveName(String fourApproveName) {
+//        this.fourApproveName = fourApproveName;
+//    }
+//
+//    public FlowStatusEnum getStatus() {
+//        return status;
+//    }
+//
+//    public void setStatus(FlowStatusEnum status) {
+//        this.status = status;
+//    }
+//
+//    public String getStartName() {
+//        return startName;
+//    }
+//
+//    public void setStartName(String startName) {
+//        this.startName = startName;
+//    }
+//
+//    public String getPrimaryApproveName() {
+//        return primaryApproveName;
+//    }
+//
+//    public void setPrimaryApproveName(String primaryApproveName) {
+//        this.primaryApproveName = primaryApproveName;
+//    }
+//
+//    public String getSecondApproveName() {
+//        return secondApproveName;
+//    }
+//
+//    public void setSecondApproveName(String secondApproveName) {
+//        this.secondApproveName = secondApproveName;
+//    }
+//
+//    public String getStatusStr() {
+//        if (Objects.nonNull(status)) {
+//            return status.getTitle();
+//        } else {
+//            return statusStr;
+//        }
+//    }
+//
+//    public void setStatusStr(String statusStr) {
+//        this.statusStr = statusStr;
+//    }
+//
+//    public int getSetup() {
+//        return setup;
+//    }
+//
+//    public void setSetup(int setup) {
+//        this.setup = setup;
+//    }
+//
+//    public String getSetupStr() {
+//        return setupStr;
+//    }
+//
+//    public void setSetupStr(String setupStr) {
+//        this.setupStr = setupStr;
+//    }
+//
+//    public String getCurrentApproveUserName() {
+//        return currentApproveUserName;
+//    }
+//
+//    public void setCurrentApproveUserName(String currentApproveUserName) {
+//        this.currentApproveUserName = currentApproveUserName;
+//    }
+//
+//    public String getCourseCode() {
+//        return courseCode;
+//    }
+//
+//    public void setCourseCode(String courseCode) {
+//        this.courseCode = courseCode;
+//    }
+//
+//    public String getCourseName() {
+//        return courseName;
+//    }
+//
+//    public void setCourseName(String courseName) {
+//        this.courseName = courseName;
+//    }
+//
+//    public String getPaperNumber() {
+//        return paperNumber;
+//    }
+//
+//    public void setPaperNumber(String paperNumber) {
+//        this.paperNumber = paperNumber;
+//    }
+//}

+ 6 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowTaskResult.java

@@ -32,6 +32,12 @@ public class FlowTaskResult implements Serializable {
 
     }
 
+    public FlowTaskResult(String taskName, String taskKey, Integer setup) {
+        this.taskName = taskName;
+        this.taskKey = taskKey;
+        this.setup = setup;
+    }
+
     public FlowTaskResult(Long flowId, String taskName, String taskKey, Integer setup) {
         this.flowId = flowId;
         this.taskName = taskName;

+ 0 - 133
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlow.java

@@ -1,133 +0,0 @@
-package com.qmth.distributed.print.business.entity;
-
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.base.BaseEntity;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 流程表
- * </p>
- *
- * @author wangliang
- * @since 2021-08-02
- */
-@ApiModel(value = "TFFlow对象", description = "流程表")
-public class TFFlow extends BaseEntity implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "学校id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long schoolId;
-
-    @ApiModelProperty(value = "机构id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField(value = "org_id", updateStrategy = FieldStrategy.IGNORED)
-    private Long orgId;
-
-    @ApiModelProperty(value = "流程名称")
-    private String name;
-
-    @ApiModelProperty(value = "流程key")
-    private String flowKey;
-
-    @ApiModelProperty(value = "是否启用,0:停用,1:启用")
-    private Boolean enable;
-
-    @ApiModelProperty(value = "是否发布,0:否,1:是")
-    private Boolean publish;
-
-    @ApiModelProperty(value = "流程id")
-    private String actFlowId;
-
-    public TFFlow() {
-
-    }
-
-    public TFFlow(Long schoolId, Long orgId, String name, Long userId, String flowKey, String actFlowId) {
-        this.schoolId = schoolId;
-        this.orgId = orgId;
-        this.name = name;
-        this.flowKey = flowKey;
-        this.actFlowId = actFlowId;
-        insertInfo(userId);
-    }
-
-    public TFFlow(Long schoolId, Long orgId, String name, Boolean publish, Long userId, String flowKey, String actFlowId) {
-        this.schoolId = schoolId;
-        this.orgId = orgId;
-        this.name = name;
-        this.publish = publish;
-        this.flowKey = flowKey;
-        this.actFlowId = actFlowId;
-        insertInfo(userId);
-    }
-
-    public String getActFlowId() {
-        return actFlowId;
-    }
-
-    public void setActFlowId(String actFlowId) {
-        this.actFlowId = actFlowId;
-    }
-
-    public String getFlowKey() {
-        return flowKey;
-    }
-
-    public void setFlowKey(String flowKey) {
-        this.flowKey = flowKey;
-    }
-
-    public Long getSchoolId() {
-        return schoolId;
-    }
-
-    public void setSchoolId(Long schoolId) {
-        this.schoolId = schoolId;
-    }
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public Boolean getPublish() {
-        return publish;
-    }
-
-    public void setPublish(Boolean publish) {
-        this.publish = publish;
-    }
-}

+ 1 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApprove.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.FlowModelEnum;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
@@ -50,14 +49,11 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "计划步骤")
     private Integer setup;
 
-    @ApiModelProperty(value = "流程模式,CHOOSE:选人,SYSTEM:系统选择")
-    private FlowModelEnum model;
-
     public TFFlowApprove() {
 
     }
 
-    public TFFlowApprove(Long schoolId, Long orgId, Long flowId, Long approveId, FlowStatusEnum status, Long userId, FlowModelEnum model) {
+    public TFFlowApprove(Long schoolId, Long orgId, Long flowId, Long approveId, FlowStatusEnum status, Long userId) {
         setId(SystemConstant.getDbUuid());
         this.schoolId = schoolId;
         this.orgId = orgId;
@@ -66,15 +62,6 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
         this.status = status;
         insertInfo(userId);
         this.setup = FlowApproveSetupEnum.SUBMIT.getSetup();
-        this.model = model;
-    }
-
-    public FlowModelEnum getModel() {
-        return model;
-    }
-
-    public void setModel(FlowModelEnum model) {
-        this.model = model;
     }
 
     public Long getSchoolId() {

+ 0 - 264
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFFlowApproveLog.java

@@ -1,264 +0,0 @@
-package com.qmth.distributed.print.business.entity;
-
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.teachcloud.common.base.BaseEntity;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 流程审批记录
- * </p>
- *
- * @author wangliang
- * @since 2021-08-05
- */
-@ApiModel(value = "TFFlowApproveLog对象", description = "流程审批记录")
-public class TFFlowApproveLog extends BaseEntity implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "学校id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long schoolId;
-
-    @ApiModelProperty(value = "机构id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    @TableField(value = "org_id", updateStrategy = FieldStrategy.IGNORED)
-    private Long orgId;
-
-    @ApiModelProperty(value = "流程id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long flowId;
-
-    @ApiModelProperty(value = "命题任务id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long taskId;
-
-    @ApiModelProperty(value = "发起人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long startId;
-
-    @ApiModelProperty(value = "一级审核人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long primaryApproveId;
-
-    @ApiModelProperty(value = "一级审核人意见")
-    private String primaryApproveRemark;
-
-    @ApiModelProperty(value = "一级审核人操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止")
-    private FlowApproveOperationEnum primaryApproveOperation;
-
-    @ApiModelProperty(value = "二级审核人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long secondApproveId;
-
-    @ApiModelProperty(value = "二级审核人意见")
-    private String secondApproveRemark;
-
-    @ApiModelProperty(value = "二级审核人操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止")
-    private FlowApproveOperationEnum secondApproveOperation;
-
-    @ApiModelProperty(value = "三级审核人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long threeApproveId;
-
-    @ApiModelProperty(value = "三级审核人意见")
-    private String threeApproveRemark;
-
-    @ApiModelProperty(value = "三级审核人操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止")
-    private FlowApproveOperationEnum threeApproveOperation;
-
-    @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;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    public TFFlowApproveLog() {
-
-    }
-
-    public TFFlowApproveLog(Long schoolId, Long orgId, Long flowId, Long taskId, Long startId, Long userId) {
-        setId(SystemConstant.getDbUuid());
-        this.schoolId = schoolId;
-        this.orgId = orgId;
-        this.flowId = flowId;
-        this.taskId = taskId;
-        this.startId = startId;
-        insertInfo(userId);
-    }
-
-    public Long getThreeApproveId() {
-        return threeApproveId;
-    }
-
-    public void setThreeApproveId(Long threeApproveId) {
-        this.threeApproveId = threeApproveId;
-    }
-
-    public FlowApproveOperationEnum getThreeApproveOperation() {
-        return threeApproveOperation;
-    }
-
-    public void setThreeApproveOperation(FlowApproveOperationEnum threeApproveOperation) {
-        this.threeApproveOperation = threeApproveOperation;
-    }
-
-    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;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public Long getSchoolId() {
-        return schoolId;
-    }
-
-    public void setSchoolId(Long schoolId) {
-        this.schoolId = schoolId;
-    }
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public Long getFlowId() {
-        return flowId;
-    }
-
-    public void setFlowId(Long flowId) {
-        this.flowId = flowId;
-    }
-
-    public Long getTaskId() {
-        return taskId;
-    }
-
-    public void setTaskId(Long taskId) {
-        this.taskId = taskId;
-    }
-
-    public Long getStartId() {
-        return startId;
-    }
-
-    public void setStartId(Long startId) {
-        this.startId = startId;
-    }
-
-    public Long getPrimaryApproveId() {
-        return primaryApproveId;
-    }
-
-    public void setPrimaryApproveId(Long primaryApproveId) {
-        this.primaryApproveId = primaryApproveId;
-    }
-
-    public String getPrimaryApproveRemark() {
-        return primaryApproveRemark;
-    }
-
-    public void setPrimaryApproveRemark(String primaryApproveRemark) {
-        this.primaryApproveRemark = primaryApproveRemark;
-    }
-
-    public FlowApproveOperationEnum getPrimaryApproveOperation() {
-        return primaryApproveOperation;
-    }
-
-    public void setPrimaryApproveOperation(FlowApproveOperationEnum primaryApproveOperation) {
-        this.primaryApproveOperation = primaryApproveOperation;
-    }
-
-    public Long getSecondApproveId() {
-        return secondApproveId;
-    }
-
-    public void setSecondApproveId(Long secondApproveId) {
-        this.secondApproveId = secondApproveId;
-    }
-
-    public String getSecondApproveRemark() {
-        return secondApproveRemark;
-    }
-
-    public void setSecondApproveRemark(String secondApproveRemark) {
-        this.secondApproveRemark = secondApproveRemark;
-    }
-
-    public FlowApproveOperationEnum getSecondApproveOperation() {
-        return secondApproveOperation;
-    }
-
-    public void setSecondApproveOperation(FlowApproveOperationEnum secondApproveOperation) {
-        this.secondApproveOperation = secondApproveOperation;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-}

+ 57 - 57
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowDynamicBuildEnum.java

@@ -1,57 +1,57 @@
-package com.qmth.distributed.print.business.enums;
-
-import java.util.Objects;
-
-/**
- * @Description: 流程动态创建 enum
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/10/22
- */
-public enum CustomFlowDynamicBuildEnum {
-
-    START("start", "开始节点"),
-
-    USER_TASK("usertask", "任务节点"),
-
-    PARALLEL_GATE_WAY("parallelgateway", "并行网关"),
-
-    EXCLUSIVE_GATE_WAY("exclusivegateway", "排他网关"),
-
-    SEQUENCE("flow", "箭头"),
-
-    END("end", "结束节点");
-
-    private String id;
-
-    private String title;
-
-    private CustomFlowDynamicBuildEnum(String id, String title) {
-        this.id = id;
-        this.title = title;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    /**
-     * 状态转换 toName
-     *
-     * @param title
-     * @return
-     */
-    public static String convertToName(String title) {
-        for (CustomFlowDynamicBuildEnum e : CustomFlowDynamicBuildEnum.values()) {
-            if (Objects.equals(title, e.getTitle())) {
-                return e.name();
-            }
-        }
-        return null;
-    }
-}
+//package com.qmth.distributed.print.business.enums;
+//
+//import java.util.Objects;
+//
+///**
+// * @Description: 流程动态创建 enum
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/10/22
+// */
+//public enum CustomFlowDynamicBuildEnum {
+//
+//    START("start", "开始节点"),
+//
+//    USER_TASK("usertask", "任务节点"),
+//
+//    PARALLEL_GATE_WAY("parallelgateway", "并行网关"),
+//
+//    EXCLUSIVE_GATE_WAY("exclusivegateway", "排他网关"),
+//
+//    SEQUENCE("flow", "箭头"),
+//
+//    END("end", "结束节点");
+//
+//    private String id;
+//
+//    private String title;
+//
+//    private CustomFlowDynamicBuildEnum(String id, String title) {
+//        this.id = id;
+//        this.title = title;
+//    }
+//
+//    public String getId() {
+//        return id;
+//    }
+//
+//    public String getTitle() {
+//        return title;
+//    }
+//
+//    /**
+//     * 状态转换 toName
+//     *
+//     * @param title
+//     * @return
+//     */
+//    public static String convertToName(String title) {
+//        for (CustomFlowDynamicBuildEnum e : CustomFlowDynamicBuildEnum.values()) {
+//            if (Objects.equals(title, e.getTitle())) {
+//                return e.name();
+//            }
+//        }
+//        return null;
+//    }
+//}

+ 51 - 51
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowElementEnum.java

@@ -1,51 +1,51 @@
-package com.qmth.distributed.print.business.enums;
-
-import java.util.Objects;
-
-/**
- * @Description: 流程元素 enum
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/10/22
- */
-public enum CustomFlowElementEnum {
-
-    APPROVE("approve", "审批"),
-
-    REJECT("reject", "驳回"),
-
-    END("end", "终止");
-
-    private String id;
-
-    private String title;
-
-    private CustomFlowElementEnum(String id, String title) {
-        this.id = id;
-        this.title = title;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    /**
-     * 状态转换 toName
-     *
-     * @param title
-     * @return
-     */
-    public static String convertToName(String title) {
-        for (CustomFlowElementEnum e : CustomFlowElementEnum.values()) {
-            if (Objects.equals(title, e.getTitle())) {
-                return e.name();
-            }
-        }
-        return null;
-    }
-}
+//package com.qmth.distributed.print.business.enums;
+//
+//import java.util.Objects;
+//
+///**
+// * @Description: 流程元素 enum
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/10/22
+// */
+//public enum CustomFlowElementEnum {
+//
+//    APPROVE("approve", "审批"),
+//
+//    REJECT("reject", "驳回"),
+//
+//    END("end", "终止");
+//
+//    private String id;
+//
+//    private String title;
+//
+//    private CustomFlowElementEnum(String id, String title) {
+//        this.id = id;
+//        this.title = title;
+//    }
+//
+//    public String getId() {
+//        return id;
+//    }
+//
+//    public String getTitle() {
+//        return title;
+//    }
+//
+//    /**
+//     * 状态转换 toName
+//     *
+//     * @param title
+//     * @return
+//     */
+//    public static String convertToName(String title) {
+//        for (CustomFlowElementEnum e : CustomFlowElementEnum.values()) {
+//            if (Objects.equals(title, e.getTitle())) {
+//                return e.name();
+//            }
+//        }
+//        return null;
+//    }
+//}

+ 17 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowTypeEnum.java

@@ -11,20 +11,31 @@ import java.util.Objects;
  */
 public enum CustomFlowTypeEnum {
 
-    START("开始节点"),
+    START("开始节点", "start"),
 
-    PROCESS("过程节点"),
+    PROCESS("过程节点", "process"),
 
-    END("结束节点"),
+    END("结束节点", "end"),
 
-    EXCLUSIVE_GATE_WAY("排他网关"),
+    EXCLUSIVE_GATE_WAY("排他网关", "exclusivegateway"),
 
-    PARALLEL_GATE_WAY("并行网关");
+    PARALLEL_GATE_WAY("并行网关", "parallelgateway"),
+
+    SEQUENCE("箭头", "flow"),
+
+    USER_TASK("任务节点", "usertask");
 
     private String title;
 
-    private CustomFlowTypeEnum(String title) {
+    private String id;
+
+    private CustomFlowTypeEnum(String title, String id) {
         this.title = title;
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
     }
 
     public String getTitle() {

+ 0 - 42
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/FlowModelEnum.java

@@ -1,42 +0,0 @@
-package com.qmth.distributed.print.business.enums;
-
-import java.util.Objects;
-
-/**
- * @Description: 流程模式 enum
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/9/9
- */
-public enum FlowModelEnum {
-
-    CHOOSE("选人"),
-
-    SYSTEM("系统选择");
-
-    private String title;
-
-    private FlowModelEnum(String title) {
-        this.title = title;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    /**
-     * 状态转换 toName
-     *
-     * @param title
-     * @return
-     */
-    public static String convertToName(String title) {
-        for (FlowModelEnum e : FlowModelEnum.values()) {
-            if (Objects.equals(title, e.getTitle())) {
-                return e.name();
-            }
-        }
-        return null;
-    }
-}

+ 24 - 24
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowApproveLogMapper.java

@@ -1,24 +1,24 @@
-package com.qmth.distributed.print.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * <p>
- * 流程审批记录 Mapper 接口
- * </p>
- *
- * @author wangliang
- * @since 2021-08-05
- */
-public interface TFFlowApproveLogMapper extends BaseMapper<TFFlowApproveLog> {
-
-    /**
-     * 根据流程id查询流程状态
-     *
-     * @param flowId
-     * @return
-     */
-    TFFlowApproveLog findByFlowId(@Param("flowId") Long flowId);
-}
+//package com.qmth.distributed.print.business.mapper;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
+//import org.apache.ibatis.annotations.Param;
+//
+///**
+// * <p>
+// * 流程审批记录 Mapper 接口
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-05
+// */
+//public interface TFFlowApproveLogMapper extends BaseMapper<TFFlowApproveLog> {
+//
+//    /**
+//     * 根据流程id查询流程状态
+//     *
+//     * @param flowId
+//     * @return
+//     */
+//    TFFlowApproveLog findByFlowId(@Param("flowId") Long flowId);
+//}

+ 10 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowLogMapper.java

@@ -33,4 +33,14 @@ public interface TFFlowLogMapper extends BaseMapper<TFFlowLog> {
      * @return
      */
     List<TFFlowLogResult> findByExamTaskId(@Param("taskId") Long taskId);
+
+    /**
+     * 查找最后一条审批记录
+     *
+     * @param flowId
+     * @param schoolId
+     * @param approveOperation
+     * @return
+     */
+    TFFlowLog findByLast(@Param("flowId") Long flowId, @Param("schoolId") Long schoolId, @Param("approveOperation") String approveOperation);
 }

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

@@ -1,60 +1,60 @@
-package com.qmth.distributed.print.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
-import com.qmth.distributed.print.business.entity.TFFlow;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.Map;
-
-/**
- * <p>
- * 流程表 Mapper 接口
- * </p>
- *
- * @author wangliang
- * @since 2021-08-02
- */
-public interface TFFlowMapper extends BaseMapper<TFFlow> {
-
-    /**
-     * 流程列表
-     *
-     * @param iPage
-     * @param name
-     * @param schoolId
-     * @param orgId
-     * @return
-     */
-    IPage<TFFlow> list(IPage<Map> iPage, @Param("name") String name, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId);
-
-    /**
-     * 流程审批记录列表
-     *
-     * @param iPage
-     * @param startName
-     * @param schoolId
-     * @param orgId
-     * @param flowId
-     * @return
-     */
-    IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, @Param("status") String status, @Param("startName") String startName, @Param("teachingRoomId") Long teachingRoomId, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId, @Param("flowId") Long flowId);
-
-    /**
-     * 流程审批记录找人
-     *
-     * @param schoolId
-     * @param flowId
-     * @return
-     */
-    FlowApproveResult flowApproveUserList(@Param("schoolId") Long schoolId, @Param("flowId") Long flowId);
-
-    /**
-     * 根据key查找id
-     *
-     * @param flowKey
-     * @return
-     */
-    public String findActIdByFlowKey(@Param("flowKey") String flowKey);
-}
+//package com.qmth.distributed.print.business.mapper;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.baomidou.mybatisplus.core.metadata.IPage;
+//import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
+//import com.qmth.distributed.print.business.entity.TFFlow;
+//import org.apache.ibatis.annotations.Param;
+//
+//import java.util.Map;
+//
+///**
+// * <p>
+// * 流程表 Mapper 接口
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-02
+// */
+//public interface TFFlowMapper extends BaseMapper<TFFlow> {
+//
+//    /**
+//     * 流程列表
+//     *
+//     * @param iPage
+//     * @param name
+//     * @param schoolId
+//     * @param orgId
+//     * @return
+//     */
+//    IPage<TFFlow> list(IPage<Map> iPage, @Param("name") String name, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId);
+//
+//    /**
+//     * 流程审批记录列表
+//     *
+//     * @param iPage
+//     * @param startName
+//     * @param schoolId
+//     * @param orgId
+//     * @param flowId
+//     * @return
+//     */
+//    IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, @Param("status") String status, @Param("startName") String startName, @Param("teachingRoomId") Long teachingRoomId, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId, @Param("flowId") Long flowId);
+//
+//    /**
+//     * 流程审批记录找人
+//     *
+//     * @param schoolId
+//     * @param flowId
+//     * @return
+//     */
+//    FlowApproveResult flowApproveUserList(@Param("schoolId") Long schoolId, @Param("flowId") Long flowId);
+//
+//    /**
+//     * 根据key查找id
+//     *
+//     * @param flowKey
+//     * @return
+//     */
+//    public String findActIdByFlowKey(@Param("flowKey") String flowKey);
+//}

+ 24 - 24
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowApproveLogService.java

@@ -1,24 +1,24 @@
-package com.qmth.distributed.print.business.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.entity.TFFlowApprove;
-import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
-
-/**
- * <p>
- * 流程审批记录 服务类
- * </p>
- *
- * @author wangliang
- * @since 2021-08-05
- */
-public interface TFFlowApproveLogService extends IService<TFFlowApproveLog> {
-
-    /**
-     * 根据流程id查询流程状态
-     *
-     * @param flowId
-     * @return
-     */
-    TFFlowApproveLog findByFlowId(Long flowId);
-}
+//package com.qmth.distributed.print.business.service;
+//
+//import com.baomidou.mybatisplus.extension.service.IService;
+//import com.qmth.distributed.print.business.entity.TFFlowApprove;
+//import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
+//
+///**
+// * <p>
+// * 流程审批记录 服务类
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-05
+// */
+//public interface TFFlowApproveLogService extends IService<TFFlowApproveLog> {
+//
+//    /**
+//     * 根据流程id查询流程状态
+//     *
+//     * @param flowId
+//     * @return
+//     */
+//    TFFlowApproveLog findByFlowId(Long flowId);
+//}

+ 11 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowLogService.java

@@ -3,6 +3,7 @@ package com.qmth.distributed.print.business.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.bean.result.TFFlowLogResult;
 import com.qmth.distributed.print.business.entity.TFFlowLog;
+import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;
 
 import java.util.List;
 
@@ -32,4 +33,14 @@ public interface TFFlowLogService extends IService<TFFlowLog> {
      * @return
      */
     List<TFFlowLogResult> findByExamTaskId(Long taskId);
+
+    /**
+     * 查找最后一条审批记录
+     *
+     * @param flowId
+     * @param schoolId
+     * @param flowApproveOperationEnum
+     * @return
+     */
+    TFFlowLog findByLast(Long flowId, Long schoolId, FlowApproveOperationEnum flowApproveOperationEnum);
 }

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

@@ -1,67 +1,67 @@
-package com.qmth.distributed.print.business.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
-import com.qmth.distributed.print.business.entity.TFFlow;
-
-import java.util.Map;
-
-/**
- * <p>
- * 流程表 服务类
- * </p>
- *
- * @author wangliang
- * @since 2021-08-02
- */
-public interface TFFlowService extends IService<TFFlow> {
-
-    /**
-     * 流程列表
-     *
-     * @param iPage
-     * @param name
-     * @param schoolId
-     * @param orgId
-     * @return
-     */
-    public IPage<TFFlow> list(IPage<Map> iPage, String name, Long schoolId, Long orgId);
-
-    /**
-     * 流程审批记录列表
-     *
-     * @param iPage
-     * @param startName
-     * @param schoolId
-     * @param orgId
-     * @param flowId
-     * @return
-     */
-    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String status, String startName, Long teachingRoomId, Long createStartTime, Long createEndTime, Long schoolId, Long orgId, Long flowId);
-
-    /**
-     * 流程审批记录找人
-     *
-     * @param schoolId
-     * @param flowId
-     * @return
-     */
-    public FlowApproveResult flowApproveUserList(Long schoolId, Long flowId);
-
-    /**
-     * 根据key查找流程
-     *
-     * @param flowKey
-     * @return
-     */
-    public Integer findByFlowKey(String flowKey);
-
-    /**
-     * 根据key查找id
-     *
-     * @param flowKey
-     * @return
-     */
-    public String findActIdByFlowKey(String flowKey);
-}
+//package com.qmth.distributed.print.business.service;
+//
+//import com.baomidou.mybatisplus.core.metadata.IPage;
+//import com.baomidou.mybatisplus.extension.service.IService;
+//import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
+//import com.qmth.distributed.print.business.entity.TFFlow;
+//
+//import java.util.Map;
+//
+///**
+// * <p>
+// * 流程表 服务类
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-02
+// */
+//public interface TFFlowService extends IService<TFFlow> {
+//
+//    /**
+//     * 流程列表
+//     *
+//     * @param iPage
+//     * @param name
+//     * @param schoolId
+//     * @param orgId
+//     * @return
+//     */
+//    public IPage<TFFlow> list(IPage<Map> iPage, String name, Long schoolId, Long orgId);
+//
+//    /**
+//     * 流程审批记录列表
+//     *
+//     * @param iPage
+//     * @param startName
+//     * @param schoolId
+//     * @param orgId
+//     * @param flowId
+//     * @return
+//     */
+//    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String status, String startName, Long teachingRoomId, Long createStartTime, Long createEndTime, Long schoolId, Long orgId, Long flowId);
+//
+//    /**
+//     * 流程审批记录找人
+//     *
+//     * @param schoolId
+//     * @param flowId
+//     * @return
+//     */
+//    public FlowApproveResult flowApproveUserList(Long schoolId, Long flowId);
+//
+//    /**
+//     * 根据key查找流程
+//     *
+//     * @param flowKey
+//     * @return
+//     */
+//    public Integer findByFlowKey(String flowKey);
+//
+//    /**
+//     * 根据key查找id
+//     *
+//     * @param flowKey
+//     * @return
+//     */
+//    public String findActIdByFlowKey(String flowKey);
+//}

File diff suppressed because it is too large
+ 481 - 515
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java


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

@@ -17,7 +17,6 @@ import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.*;
 import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
 import com.qmth.distributed.print.business.service.*;
-import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
 import com.qmth.distributed.print.business.templete.execute.AsyncPaperReviewPdfExportService;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
 import com.qmth.distributed.print.business.util.HtmlToPdfUtil;
@@ -149,9 +148,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Resource
     RedisUtil redisUtil;
 
-    @Resource
-    TFFlowApproveLogService tfFlowApproveLogService;
-
     @Resource
     TFFlowLogService tfFlowLogService;
 
@@ -1043,9 +1039,9 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(task.getFlowId(), task.getSchoolId());
         Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("审核流程进度丢失,不能撤回"));
 
-        if (!tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
-            throw ExceptionResultEnum.ERROR.exception("当前审核节点不能撤回");
-        }
+//        if (!tfFlowApprove.getSetup().equals(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup())) {
+//            throw ExceptionResultEnum.ERROR.exception("当前审核节点不能撤回");
+//        }
 
         Task flowTask = taskService.createTaskQuery().processInstanceId(String.valueOf(task.getFlowId())).singleResult();
         Map<String, Object> map = new HashMap<>();

+ 35 - 35
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowApproveLogServiceImpl.java

@@ -1,35 +1,35 @@
-package com.qmth.distributed.print.business.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
-import com.qmth.distributed.print.business.mapper.TFFlowApproveLogMapper;
-import com.qmth.distributed.print.business.service.TFFlowApproveLogService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * <p>
- * 流程审批记录 服务实现类
- * </p>
- *
- * @author wangliang
- * @since 2021-08-05
- */
-@Service
-public class TFFlowApproveLogServiceImpl extends ServiceImpl<TFFlowApproveLogMapper, TFFlowApproveLog> implements TFFlowApproveLogService {
-
-    @Resource
-    TFFlowApproveLogMapper tfFlowApproveLogMapper;
-
-    /**
-     * 根据流程id查询流程状态
-     *
-     * @param flowId
-     * @return
-     */
-    @Override
-    public TFFlowApproveLog findByFlowId(Long flowId) {
-        return tfFlowApproveLogMapper.findByFlowId(flowId);
-    }
-}
+//package com.qmth.distributed.print.business.service.impl;
+//
+//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+//import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
+//import com.qmth.distributed.print.business.mapper.TFFlowApproveLogMapper;
+//import com.qmth.distributed.print.business.service.TFFlowApproveLogService;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//
+///**
+// * <p>
+// * 流程审批记录 服务实现类
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-05
+// */
+//@Service
+//public class TFFlowApproveLogServiceImpl extends ServiceImpl<TFFlowApproveLogMapper, TFFlowApproveLog> implements TFFlowApproveLogService {
+//
+//    @Resource
+//    TFFlowApproveLogMapper tfFlowApproveLogMapper;
+//
+//    /**
+//     * 根据流程id查询流程状态
+//     *
+//     * @param flowId
+//     * @return
+//     */
+//    @Override
+//    public TFFlowApproveLog findByFlowId(Long flowId) {
+//        return tfFlowApproveLogMapper.findByFlowId(flowId);
+//    }
+//}

+ 15 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowLogServiceImpl.java

@@ -5,10 +5,12 @@ import com.qmth.distributed.print.business.bean.result.TFFlowLogResult;
 import com.qmth.distributed.print.business.entity.TFFlowLog;
 import com.qmth.distributed.print.business.mapper.TFFlowLogMapper;
 import com.qmth.distributed.print.business.service.TFFlowLogService;
+import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * <p>
@@ -46,4 +48,17 @@ public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog
     public List<TFFlowLogResult> findByExamTaskId(Long taskId) {
         return tfFlowLogMapper.findByExamTaskId(taskId);
     }
+
+    /**
+     * 查找最后一条审批记录
+     *
+     * @param flowId
+     * @param schoolId
+     * @param flowApproveOperationEnum
+     * @return
+     */
+    @Override
+    public TFFlowLog findByLast(Long flowId, Long schoolId, FlowApproveOperationEnum flowApproveOperationEnum) {
+        return tfFlowLogMapper.findByLast(flowId, schoolId, Objects.nonNull(flowApproveOperationEnum) ? flowApproveOperationEnum.name() : null);
+    }
 }

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

@@ -1,145 +1,145 @@
-package com.qmth.distributed.print.business.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
-import com.qmth.distributed.print.business.entity.TFFlow;
-import com.qmth.distributed.print.business.entity.TFFlowLog;
-import com.qmth.distributed.print.business.mapper.TExamTaskFlowMapper;
-import com.qmth.distributed.print.business.mapper.TFFlowLogMapper;
-import com.qmth.distributed.print.business.mapper.TFFlowMapper;
-import com.qmth.distributed.print.business.service.TFFlowService;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
-import com.qmth.teachcloud.common.service.SysUserService;
-import com.qmth.teachcloud.common.util.ServletUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-/**
- * <p>
- * 流程表 服务实现类
- * </p>
- *
- * @author wangliang
- * @since 2021-08-02
- */
-@Service
-public class TFFlowServiceImpl extends ServiceImpl<TFFlowMapper, TFFlow> implements TFFlowService {
-
-    @Resource
-    TFFlowMapper tfFlowMapper;
-
-    @Resource
-    TExamTaskFlowMapper tExamTaskFlowMapper;
-
-    @Resource
-    TFFlowLogMapper tfFlowLogMapper;
-
-    @Autowired
-    SysUserService sysUserService;
-
-    /**
-     * 流程列表
-     *
-     * @param iPage
-     * @param name
-     * @param schoolId
-     * @param orgId
-     * @return
-     */
-    @Override
-    public IPage<TFFlow> list(IPage<Map> iPage, String name, Long schoolId, Long orgId) {
-        return tfFlowMapper.list(iPage, name, schoolId, orgId);
-    }
-
-    /**
-     * 流程审批记录列表
-     *
-     * @param iPage
-     * @param startName
-     * @param schoolId
-     * @param orgId
-     * @param flowId
-     * @return
-     */
-    @Override
-    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String status, String startName, Long teachingRoomId, Long createStartTime, Long createEndTime, Long schoolId, Long orgId, Long flowId) {
-        IPage<FlowApproveResult> flowApproveResultIPage = tfFlowMapper.flowApproveList(iPage, status, startName, teachingRoomId, createStartTime, createEndTime, schoolId, orgId, flowId);
-        for (FlowApproveResult record : flowApproveResultIPage.getRecords()) {
-            record.setStatusStr(record.getStatus().getTitle());
-            // FlowApproveSetupEnum
-            if (FlowApproveSetupEnum.FINISH.getSetup() == record.getSetup()) {
-                record.setSetupStr("结束节点");
-            } else if (FlowApproveSetupEnum.SUBMIT.getSetup() == record.getSetup()) {
-                record.setSetupStr("开始节点");
-            } else {
-                record.setSetupStr("审批节点");
-            }
-
-            Long maxFlowId = tExamTaskFlowMapper.selectMaxFlowIdByExamTaskId(record.getTaskId());
-            if (Objects.nonNull(maxFlowId)) {
-                List<TFFlowLog> flowLogs = tfFlowLogMapper.findByFlowId(maxFlowId, Long.parseLong((String) ServletUtil.getRequestHeaderSchoolId()));
-                TFFlowLog tfFlowLog = flowLogs.stream().sorted(Comparator.comparingLong(TFFlowLog::getCreateTime).reversed()).findFirst().orElse(null);
-                if (Objects.nonNull(tfFlowLog)) {
-                    String pendApproveId = tfFlowLog.getPendApproveId();
-                    if (StringUtils.isNotBlank(pendApproveId)) {
-                        StringJoiner sj = new StringJoiner(",");
-                        for (String id : pendApproveId.split(",")) {
-                            SysUser sysUser = sysUserService.getById(id);
-                            sj.add(sysUser.getRealName());
-                        }
-                        record.setCurrentApproveUserName(sj.toString());
-                    }
-                }
-            }
-
-        }
-        return flowApproveResultIPage;
-    }
-
-    /**
-     * 流程审批记录找人
-     *
-     * @param schoolId
-     * @param flowId
-     * @return
-     */
-    @Override
-    public FlowApproveResult flowApproveUserList(Long schoolId, Long flowId) {
-        return tfFlowMapper.flowApproveUserList(schoolId, flowId);
-    }
-
-    /**
-     * 根据key查找流程
-     *
-     * @param flowKey
-     * @return
-     */
-    @Override
-    public Integer findByFlowKey(String flowKey) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        QueryWrapper<TFFlow> tfFlowQueryWrapper = new QueryWrapper<>();
-        tfFlowQueryWrapper.lambda().eq(TFFlow::getSchoolId, sysUser.getSchoolId())
-                .eq(TFFlow::getFlowKey, flowKey)
-                .eq(TFFlow::getEnable, true)
-                .eq(TFFlow::getPublish, true);
-        return this.count(tfFlowQueryWrapper);
-    }
-
-    /**
-     * 根据key查找id
-     *
-     * @param flowKey
-     * @return
-     */
-    @Override
-    public String findActIdByFlowKey(String flowKey) {
-        return tfFlowMapper.findActIdByFlowKey(flowKey);
-    }
-}
+//package com.qmth.distributed.print.business.service.impl;
+//
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+//import com.baomidou.mybatisplus.core.metadata.IPage;
+//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+//import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
+//import com.qmth.distributed.print.business.entity.TFFlow;
+//import com.qmth.distributed.print.business.entity.TFFlowLog;
+//import com.qmth.distributed.print.business.mapper.TExamTaskFlowMapper;
+//import com.qmth.distributed.print.business.mapper.TFFlowLogMapper;
+//import com.qmth.distributed.print.business.mapper.TFFlowMapper;
+//import com.qmth.distributed.print.business.service.TFFlowService;
+//import com.qmth.teachcloud.common.entity.SysUser;
+//import com.qmth.teachcloud.common.enums.FlowApproveSetupEnum;
+//import com.qmth.teachcloud.common.service.SysUserService;
+//import com.qmth.teachcloud.common.util.ServletUtil;
+//import org.apache.commons.lang3.StringUtils;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//import java.util.*;
+//
+///**
+// * <p>
+// * 流程表 服务实现类
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-02
+// */
+//@Service
+//public class TFFlowServiceImpl extends ServiceImpl<TFFlowMapper, TFFlow> implements TFFlowService {
+//
+//    @Resource
+//    TFFlowMapper tfFlowMapper;
+//
+//    @Resource
+//    TExamTaskFlowMapper tExamTaskFlowMapper;
+//
+//    @Resource
+//    TFFlowLogMapper tfFlowLogMapper;
+//
+//    @Autowired
+//    SysUserService sysUserService;
+//
+//    /**
+//     * 流程列表
+//     *
+//     * @param iPage
+//     * @param name
+//     * @param schoolId
+//     * @param orgId
+//     * @return
+//     */
+//    @Override
+//    public IPage<TFFlow> list(IPage<Map> iPage, String name, Long schoolId, Long orgId) {
+//        return tfFlowMapper.list(iPage, name, schoolId, orgId);
+//    }
+//
+//    /**
+//     * 流程审批记录列表
+//     *
+//     * @param iPage
+//     * @param startName
+//     * @param schoolId
+//     * @param orgId
+//     * @param flowId
+//     * @return
+//     */
+//    @Override
+//    public IPage<FlowApproveResult> flowApproveList(IPage<Map> iPage, String status, String startName, Long teachingRoomId, Long createStartTime, Long createEndTime, Long schoolId, Long orgId, Long flowId) {
+//        IPage<FlowApproveResult> flowApproveResultIPage = tfFlowMapper.flowApproveList(iPage, status, startName, teachingRoomId, createStartTime, createEndTime, schoolId, orgId, flowId);
+//        for (FlowApproveResult record : flowApproveResultIPage.getRecords()) {
+//            record.setStatusStr(record.getStatus().getTitle());
+//            // FlowApproveSetupEnum
+//            if (FlowApproveSetupEnum.FINISH.getSetup() == record.getSetup()) {
+//                record.setSetupStr("结束节点");
+//            } else if (FlowApproveSetupEnum.SUBMIT.getSetup() == record.getSetup()) {
+//                record.setSetupStr("开始节点");
+//            } else {
+//                record.setSetupStr("审批节点");
+//            }
+//
+//            Long maxFlowId = tExamTaskFlowMapper.selectMaxFlowIdByExamTaskId(record.getTaskId());
+//            if (Objects.nonNull(maxFlowId)) {
+//                List<TFFlowLog> flowLogs = tfFlowLogMapper.findByFlowId(maxFlowId, Long.parseLong((String) ServletUtil.getRequestHeaderSchoolId()));
+//                TFFlowLog tfFlowLog = flowLogs.stream().sorted(Comparator.comparingLong(TFFlowLog::getCreateTime).reversed()).findFirst().orElse(null);
+//                if (Objects.nonNull(tfFlowLog)) {
+//                    String pendApproveId = tfFlowLog.getPendApproveId();
+//                    if (StringUtils.isNotBlank(pendApproveId)) {
+//                        StringJoiner sj = new StringJoiner(",");
+//                        for (String id : pendApproveId.split(",")) {
+//                            SysUser sysUser = sysUserService.getById(id);
+//                            sj.add(sysUser.getRealName());
+//                        }
+//                        record.setCurrentApproveUserName(sj.toString());
+//                    }
+//                }
+//            }
+//
+//        }
+//        return flowApproveResultIPage;
+//    }
+//
+//    /**
+//     * 流程审批记录找人
+//     *
+//     * @param schoolId
+//     * @param flowId
+//     * @return
+//     */
+//    @Override
+//    public FlowApproveResult flowApproveUserList(Long schoolId, Long flowId) {
+//        return tfFlowMapper.flowApproveUserList(schoolId, flowId);
+//    }
+//
+//    /**
+//     * 根据key查找流程
+//     *
+//     * @param flowKey
+//     * @return
+//     */
+//    @Override
+//    public Integer findByFlowKey(String flowKey) {
+//        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+//        QueryWrapper<TFFlow> tfFlowQueryWrapper = new QueryWrapper<>();
+//        tfFlowQueryWrapper.lambda().eq(TFFlow::getSchoolId, sysUser.getSchoolId())
+//                .eq(TFFlow::getFlowKey, flowKey)
+//                .eq(TFFlow::getEnable, true)
+//                .eq(TFFlow::getPublish, true);
+//        return this.count(tfFlowQueryWrapper);
+//    }
+//
+//    /**
+//     * 根据key查找id
+//     *
+//     * @param flowKey
+//     * @return
+//     */
+//    @Override
+//    public String findActIdByFlowKey(String flowKey) {
+//        return tfFlowMapper.findActIdByFlowKey(flowKey);
+//    }
+//}

+ 0 - 12
distributed-print-business/src/main/resources/mapper/TFFlowApproveLogMapper.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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.TFFlowApproveLogMapper">
-
-    <select id="findByFlowId" resultType="com.qmth.distributed.print.business.entity.TFFlowApproveLog">
-        select * from t_f_flow_approve_log tffal
-         where EXISTS(
-            select tetf.task_id from t_exam_task_flow tetf
-            where tetf.flow_id = #{flowId} and tetf.task_id = tffal.task_id
-            )
-    </select>
-</mapper>

+ 11 - 0
distributed-print-business/src/main/resources/mapper/TFFlowLogMapper.xml

@@ -41,4 +41,15 @@
         order by
             tffl.create_time desc
     </select>
+
+    <select id="findByLast" resultType="com.qmth.distributed.print.business.entity.TFFlowLog">
+        select * from t_f_flow_log tffl
+                          join t_exam_task_flow tetf on
+            tetf.flow_id = tffl.flow_id
+        where tffl.school_id = #{schoolId} and tffl.flow_id = #{flowId}
+        and tffl.approve_operation = #{approveOperation}
+        order by tffl.create_time desc
+        limit 1
+    </select>
+
 </mapper>

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

@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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.TFFlowMapper">
-
-    <select id="list" resultType="com.qmth.distributed.print.business.entity.TFFlow">
-        select tff.id,tff.school_id as schoolId,tff.org_id as orgId,tff.name,tff.enable,tff.publish from t_f_flow tff
-        <where>
-            <if test="schoolId != null and schoolId != ''">
-                and tff.school_id = #{schoolId}
-            </if>
-            <if test="name != null and name != ''">
-                and tff.name like concat('%',#{name},'%')
-            </if>
-            and tff.enable = 1
-<!--            <if test="orgId != null and orgId != ''">-->
-<!--                and tff.org_id = #{orgId}-->
-<!--            </if>-->
-        </where>
-    </select>
-
-    <select id="flowApproveList" resultType="com.qmth.distributed.print.business.bean.result.FlowApproveResult">
-        select
-            tffal.flow_id as flowId,
-            tffal.task_id as taskId,
-            tffal.start_id as startId,
-            su.real_name as startName,
-            tffal.create_time as createTime,
-            tffa.setup,
-            tffa.status,
-            et.course_code courseCode,
-            et.course_name courseName,
-            et.paper_number paperNumber
-        from
-            t_f_flow_approve_log tffal
-        left join t_f_flow_approve tffa on tffa.flow_id = tffal.flow_id
-        left join sys_user su on su.id = tffal.start_id
-        left join exam_task et on tffal.flow_id = et.flow_id
-        <where>
-            <if test="schoolId != null and schoolId != ''">
-                and tffal.school_id = #{schoolId}
-            </if>
-            <if test="status != null and status != ''">
-                and tffa.status = #{status}
-            </if>
-            <if test="teachingRoomId != null and teachingRoomId != ''">
-                and et.teaching_room_id = #{teachingRoomId}
-            </if>
-            <if test="startName != null and startName != ''">
-                and su.real_name like concat('%',#{startName},'%')
-            </if>
-            <if test="createStartTime != null and createStartTime != ''">
-                and tffal.create_time &gt;= #{createStartTime}
-            </if>
-            <if test="createEndTime != null and createEndTime != ''">
-                and tffal.create_time &lt;= #{createEndTime}
-            </if>
-<!--            <if test="orgId != null and orgId != ''">-->
-<!--                and tffal.org_id = #{orgId}-->
-<!--            </if>-->
-            <if test="flowId != null and flowId != ''">
-                and EXISTS(
-                select tetf.task_id from t_exam_task_flow tetf
-                where tetf.flow_id = #{flowId} and tetf.task_id = tffal.task_id
-                )
-            </if>
-            and tffal.enable = 1
-        </where>
-        order by
-            tffal.create_time desc
-    </select>
-
-    <select id="flowApproveUserList" resultType="com.qmth.distributed.print.business.bean.result.FlowApproveResult">
-        select
-        tffal.flow_id as flowId,
-        tffal.task_id as taskId,
-        tffal.start_id as startId,
-        su.real_name as startName,
-        tffal.create_time as createTime,
-        tffal.primary_approve_id as primaryApproveId,
-        (
-        select
-        t.real_name
-        from
-        sys_user t
-        where
-        t.id = tffal.primary_approve_id) as primaryApproveName,
-        tffal.primary_approve_remark as primaryApproveRemark,
-        tffal.second_approve_id as secondApproveId,
-        (
-        select
-        t.real_name
-        from
-        sys_user t
-        where
-        t.id = tffal.second_approve_id) as secondApproveName,
-        tffal.second_approve_remark as secondApproveRemark,
-        tffal.three_approve_id as threeApproveId,
-        tffal.three_approve_remark as threeApproveRemark,
-        (
-        select
-        t.real_name
-        from
-        sys_user t
-        where
-        t.id = tffal.three_approve_id) as threeApproveName,
-        tffal.four_approve_id as fourApproveId,
-        tffal.four_approve_remark as fourApproveRemark,
-        (
-        select
-        t.real_name
-        from
-        sys_user t
-        where
-        t.id = tffal.four_approve_id) as fourApproveName,
-        tffa.status
-        from
-        t_f_flow_approve_log tffal
-        left join t_f_flow_approve tffa on tffa.school_id = tffal.school_id and tffa.flow_id = tffal.flow_id
-        left join sys_user su on su.id = tffal.start_id
-        <where>
-            <if test="schoolId != null and schoolId != ''">
-                and tffal.school_id = #{schoolId}
-            </if>
-            <if test="flowId != null and flowId != ''">
-                and EXISTS(
-                select tetf.task_id from t_exam_task_flow tetf
-                where tetf.flow_id = #{flowId} and tetf.task_id = tffal.task_id
-                )
-            </if>
-            and tffal.enable = 1
-        </where>
-        order by
-        tffal.create_time desc
-    </select>
-
-    <select id="findActIdByFlowKey" resultType="java.lang.String">
-        select max(arp.ID_) as actFlowId from act_re_procdef arp where arp.KEY_ = #{flowKey} order by arp.VERSION_ desc LIMIT 1
-    </select>
-</mapper>

+ 140 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

@@ -6,6 +6,11 @@ import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.bean.flow.CustomFlowSaveDto;
+import com.qmth.distributed.print.business.bean.params.FlowApproveParam;
+import com.qmth.distributed.print.business.bean.params.FlowParam;
+import com.qmth.distributed.print.business.bean.params.FlowTaskApproveParam;
+import com.qmth.distributed.print.business.bean.result.FlowTaskApprovePeopleAllResult;
+import com.qmth.distributed.print.business.bean.result.FlowTaskResult;
 import com.qmth.distributed.print.business.entity.TFCustomFlow;
 import com.qmth.distributed.print.business.service.ActivitiService;
 import com.qmth.distributed.print.business.service.TFCustomFlowService;
@@ -16,7 +21,6 @@ import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.util.*;
 import io.swagger.annotations.*;
-import org.activiti.engine.TaskService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.transaction.annotation.Transactional;
@@ -26,7 +30,10 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.validation.Valid;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
 import java.security.NoSuchAlgorithmException;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -106,9 +113,6 @@ public class TFCustomFlowController {
         return ResultUtil.ok(true);
     }
 
-    @Resource
-    TaskService taskService;
-
     @ApiOperation(value = "测试启动流程")
     @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
     @RequestMapping(value = "/testStart", method = RequestMethod.POST)
@@ -118,4 +122,136 @@ public class TFCustomFlowController {
         activitiService.customFlowStartUpdateApproveId(SystemConstant.convertIdToLong(id), sysUser.getId());
         return ResultUtil.ok(true);
     }
+
+    @ApiOperation(value = "审批流程")
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/task/approve", method = RequestMethod.POST)
+    public Result taskApprove(@Valid @RequestBody FlowTaskApproveParam flowTaskApproveParam, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        Map<String, Object> map = new HashMap<>();
+        map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> flowTaskApproveParam.getTaskId());
+        map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> flowTaskApproveParam.getApprovePass());
+        map.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> flowTaskApproveParam.getRemark());
+        map.computeIfAbsent(SystemConstant.APPROVE_SETUP, v -> flowTaskApproveParam.getSetup());
+        map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> flowTaskApproveParam.getApproveUserIds());
+        Map<String, Object> objectMap = activitiService.taskApprove(map);
+//        if (Objects.nonNull(objectMap)) {
+//            TFFlowApprove tfFlowApprove = (TFFlowApprove) objectMap.get("tfFlowApprove");
+//            ExamTask examTask = (ExamTask) objectMap.get("examTask");
+//            boolean presidentApprove = Objects.nonNull(objectMap.get(SystemConstant.APPROVE_PRESIDENT_SYSTEM)) ? (boolean) objectMap.get(SystemConstant.APPROVE_PRESIDENT_SYSTEM) : false;
+//            //审核通过,生成pdf
+//            if (Objects.nonNull(tfFlowApprove) && FlowApproveSetupEnum.FINISH.getSetup() == tfFlowApprove.getSetup()) {
+//                // 取命题老师ID
+//                SysUser sysUser = sysUserService.getById(examTask.getUserId());
+//                try {
+//                    printCommonService.checkData(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber(), sysUser);
+//                } catch (IOException e) {
+//                    throw ExceptionResultEnum.ERROR.exception("生成pdf失败");
+//                }
+//            } else if (Objects.nonNull(tfFlowApprove) && FlowApproveSetupEnum.THREE_APPROVE.getSetup() == tfFlowApprove.getSetup() && presidentApprove) {//命题老师后台提交
+//                TExamTaskFlow tExamTaskFlow = tExamTaskFlowService.findByFlowLevel(examTask.getId());
+//                Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(tExamTaskFlow.getFlowId())).singleResult();
+//                if (Objects.nonNull(task)) {
+//                    Map<String, Object> mapObject = new HashMap<>();
+//                    mapObject.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
+//                    mapObject.computeIfAbsent(SystemConstant.APPROVE_PRESIDENT_SYSTEM, v -> presidentApprove);
+//                    activitiService.taskApprove(mapObject);
+//                }
+//            }
+//
+//            // 驳回短信(驳回给提交老师)
+//            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());
+//                basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
+//            }
+//        }
+        return ResultUtil.ok();
+    }
+
+    @ApiOperation(value = "流程审批记录列表")
+    @ApiResponses({@ApiResponse(code = 200, message = "流程审批记录信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/approve/list", method = RequestMethod.POST)
+    public Result taskApproveList(@ApiParam(value = "状态", required = false) @RequestParam(required = false) String status,
+                                  @ApiParam(value = "发起人名称", required = false) @RequestParam(required = false) String startName,
+                                  @ApiParam(value = "教研室", required = false) @RequestParam(required = false) Long teachingRoomId,
+                                  @ApiParam(value = "提交开始时间", required = false) @RequestParam(required = false) Long createStartTime,
+                                  @ApiParam(value = "提交结束时间", required = false) @RequestParam(required = false) Long createEndTime,
+                                  @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                                  @ApiParam(value = "数量", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        return ResultUtil.ok(true);
+    }
+
+    @ApiOperation(value = "流程列表")
+    @ApiResponses({@ApiResponse(code = 200, message = "流程信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public Result list(@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name,
+                       @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                       @ApiParam(value = "数量", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        return ResultUtil.ok(true);
+    }
+
+    @ApiOperation(value = "流程逻辑删除")
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/enable", method = RequestMethod.POST)
+    public Result enable(@Valid @RequestBody FlowParam flowParam, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        return ResultUtil.ok(activitiService.flowDelete(flowParam.getId()));
+    }
+
+    @ApiOperation(value = "流程审批记录逻辑删除")
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/approve/enable", method = RequestMethod.POST)
+    public Result enable(@Valid @RequestBody FlowApproveParam flowApproveParam, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        return ResultUtil.ok(true);
+    }
+
+    @ApiOperation(value = "流程终止")
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/end", method = RequestMethod.POST)
+    public Result end(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
+        activitiService.flowEnd(flowId);
+        return ResultUtil.ok();
+    }
+
+    @ApiOperation(value = "获取所有流程节点")
+    @ApiResponses({@ApiResponse(code = 200, message = "流程节点", response = FlowTaskResult.class)})
+    @RequestMapping(value = "/task/all", method = RequestMethod.POST)
+    public Result taskAll(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
+        return ResultUtil.ok(activitiService.getTaskAll(flowId));
+    }
+
+    @ApiOperation(value = "获取所有流程节点待审批人")
+    @ApiResponses({@ApiResponse(code = 200, message = "流程节点待审批人", response = FlowTaskApprovePeopleAllResult.class)})
+    @RequestMapping(value = "/task/approver/people_all", method = RequestMethod.POST)
+    public Result taskApproverPeopleAll(@ApiParam(value = "课程编码", required = false) @RequestParam(required = false) String courseCode,
+                                        @ApiParam(value = "流程节点id", required = false) @RequestParam(required = false) String taskId) {
+        return ResultUtil.ok(activitiService.taskApproverPeopleAll(courseCode, taskId));
+    }
+
+    @ApiOperation(value = "流程节点转他人审批")
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/task/approver/exchange", method = RequestMethod.POST)
+    public Result taskApproverExchange(@ApiParam(value = "审批人id", required = true) @RequestParam String userId,
+                                       @ApiParam(value = "流程节点id", required = true) @RequestParam String taskId) {
+        return ResultUtil.ok(activitiService.taskApproverExchange(userId, taskId));
+    }
+
+    @ApiOperation(value = "获取转他人审批人")
+    @ApiResponses({@ApiResponse(code = 200, message = "流程节点审批人", response = FlowTaskApprovePeopleAllResult.class)})
+    @RequestMapping(value = "/task/approver/exchange/people", method = RequestMethod.POST)
+    public Result taskApproverExchangePeople(@ApiParam(value = "流程节点id", required = true) @RequestParam String taskId,
+                                             @ApiParam(value = "用户姓名", required = false) @RequestParam(required = false) String realName) {
+        return ResultUtil.ok(activitiService.taskApproverExchangePeople(taskId, realName));
+    }
 }

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

@@ -1,299 +1,299 @@
-package com.qmth.distributed.print.api;
-
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.google.common.reflect.TypeToken;
-import com.google.gson.Gson;
-import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.boot.api.exception.ApiException;
-import com.qmth.distributed.print.business.bean.params.FlowApproveParam;
-import com.qmth.distributed.print.business.bean.params.FlowParam;
-import com.qmth.distributed.print.business.bean.params.FlowTaskApproveParam;
-import com.qmth.distributed.print.business.bean.result.EditResult;
-import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
-import com.qmth.distributed.print.business.bean.result.FlowTaskApprovePeopleAllResult;
-import com.qmth.distributed.print.business.bean.result.FlowTaskResult;
-import com.qmth.distributed.print.business.entity.*;
-import com.qmth.distributed.print.business.enums.MessageEnum;
-import com.qmth.distributed.print.business.service.*;
-import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicAttachment;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.*;
-import com.qmth.teachcloud.common.service.BasicAttachmentService;
-import com.qmth.teachcloud.common.service.SysUserService;
-import com.qmth.teachcloud.common.util.JacksonUtil;
-import com.qmth.teachcloud.common.util.Result;
-import com.qmth.teachcloud.common.util.ResultUtil;
-import com.qmth.teachcloud.common.util.ServletUtil;
-import io.swagger.annotations.*;
-import org.activiti.engine.TaskService;
-import org.activiti.engine.task.Task;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.DuplicateKeyException;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.validation.Valid;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * <p>
- * 流程表 前端控制器
- * </p>
- *
- * @author wangliang
- * @since 2021-08-02
- */
-@Api(tags = "流程Controller")
-@RestController
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.flow}")
-//@Aac(auth = BOOL.FALSE, strict = BOOL.FALSE)
-@Validated
-public class TFFlowController {
-    private final static Logger log = LoggerFactory.getLogger(TFFlowController.class);
-
-    @Resource
-    PrintCommonService printCommonService;
-
-    @Resource
-    BasicAttachmentService basicAttachmentService;
-
-    @Resource
-    ActivitiService activitiService;
-
-    @Resource
-    TFFlowService tfFlowService;
-
-    @Resource
-    TFFlowApproveLogService tfFlowApproveLogService;
-
-    @Autowired
-    SysUserService sysUserService;
-
-    @Autowired
-    BasicMessageService basicMessageService;
-
-    @Resource
-    TaskService taskService;
-
-    @Resource
-    TExamTaskFlowService tExamTaskFlowService;
-
-    @ApiOperation(value = "注册流程")
-    @Transactional
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-    @RequestMapping(value = "/register", method = RequestMethod.POST)
-    public Result register(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
-                           @ApiParam(value = "流程文件名称", required = true) @RequestParam String name) {
-        BasicAttachment basicAttachment = null;
-        try {
-            int temp = file.getOriginalFilename().lastIndexOf(".");
-            String fileName = file.getOriginalFilename().substring(0, temp);
-            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
-            if (!format.equalsIgnoreCase(".bpmn")) {
-                throw ExceptionResultEnum.ERROR.exception("上传的流程文件格式只能为.bmpn");
-            }
-            basicAttachment = printCommonService.saveAttachment(file, ServletUtil.getRequestMd5(), UploadFileEnum.FILE);
-            if (Objects.isNull(basicAttachment)) {
-                throw ExceptionResultEnum.ATTACHMENT_ERROR.exception();
-            }
-            activitiService.uploadDeployment(file);
-            String actFlowId = tfFlowService.findActIdByFlowKey(SystemConstant.GDYKDX_FLOW_KEY);
-            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-            TFFlow tfFlow = new TFFlow(SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId(), name, sysUser.getId(), fileName, actFlowId);
-            tfFlowService.save(tfFlow);
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            if (Objects.nonNull(basicAttachment)) {
-                basicAttachmentService.deleteAttachment(basicAttachment);
-            }
-            if (e instanceof DuplicateKeyException) {
-                String errorColumn = e.getCause().toString();
-                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
-                throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
-            } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-        return ResultUtil.ok(new EditResult(basicAttachment.getId()));
-    }
-
-//    @ApiOperation(value = "发布流程")
+//package com.qmth.distributed.print.api;
+//
+//import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+//import com.google.common.reflect.TypeToken;
+//import com.google.gson.Gson;
+//import com.qmth.boot.api.constant.ApiConstant;
+//import com.qmth.boot.api.exception.ApiException;
+//import com.qmth.distributed.print.business.bean.params.FlowApproveParam;
+//import com.qmth.distributed.print.business.bean.params.FlowParam;
+//import com.qmth.distributed.print.business.bean.params.FlowTaskApproveParam;
+//import com.qmth.distributed.print.business.bean.result.EditResult;
+////import com.qmth.distributed.print.business.bean.result.FlowApproveResult;
+//import com.qmth.distributed.print.business.bean.result.FlowTaskApprovePeopleAllResult;
+//import com.qmth.distributed.print.business.bean.result.FlowTaskResult;
+//import com.qmth.distributed.print.business.entity.*;
+//import com.qmth.distributed.print.business.enums.MessageEnum;
+//import com.qmth.distributed.print.business.service.*;
+//import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
+//import com.qmth.teachcloud.common.contant.SystemConstant;
+//import com.qmth.teachcloud.common.entity.BasicAttachment;
+//import com.qmth.teachcloud.common.entity.SysUser;
+//import com.qmth.teachcloud.common.enums.*;
+//import com.qmth.teachcloud.common.service.BasicAttachmentService;
+//import com.qmth.teachcloud.common.service.SysUserService;
+//import com.qmth.teachcloud.common.util.JacksonUtil;
+//import com.qmth.teachcloud.common.util.Result;
+//import com.qmth.teachcloud.common.util.ResultUtil;
+//import com.qmth.teachcloud.common.util.ServletUtil;
+//import io.swagger.annotations.*;
+//import org.activiti.engine.TaskService;
+//import org.activiti.engine.task.Task;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.dao.DuplicateKeyException;
+//import org.springframework.transaction.annotation.Transactional;
+//import org.springframework.validation.BindingResult;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import javax.annotation.Resource;
+//import javax.validation.Valid;
+//import javax.validation.constraints.Max;
+//import javax.validation.constraints.Min;
+//import java.io.IOException;
+//import java.util.*;
+//
+///**
+// * <p>
+// * 流程表 前端控制器
+// * </p>
+// *
+// * @author wangliang
+// * @since 2021-08-02
+// */
+//@Api(tags = "流程Controller")
+//@RestController
+//@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.flow}")
+////@Aac(auth = BOOL.FALSE, strict = BOOL.FALSE)
+//@Validated
+//public class TFFlowController {
+//    private final static Logger log = LoggerFactory.getLogger(TFFlowController.class);
+//
+//    @Resource
+//    PrintCommonService printCommonService;
+//
+//    @Resource
+//    BasicAttachmentService basicAttachmentService;
+//
+//    @Resource
+//    ActivitiService activitiService;
+//
+//    @Resource
+//    TFFlowService tfFlowService;
+//
+//    @Resource
+//    TFFlowApproveLogService tfFlowApproveLogService;
+//
+//    @Autowired
+//    SysUserService sysUserService;
+//
+//    @Autowired
+//    BasicMessageService basicMessageService;
+//
+//    @Resource
+//    TaskService taskService;
+//
+//    @Resource
+//    TExamTaskFlowService tExamTaskFlowService;
+//
+//    @ApiOperation(value = "注册流程")
+//    @Transactional
 //    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-//    @RequestMapping(value = "/publish", method = RequestMethod.POST)
-//    public Result publish(@ApiParam(value = "流程文件id", required = true) @RequestParam String id) {
+//    @RequestMapping(value = "/register", method = RequestMethod.POST)
+//    public Result register(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+//                           @ApiParam(value = "流程文件名称", required = true) @RequestParam String name) {
+//        BasicAttachment basicAttachment = null;
+//        try {
+//            int temp = file.getOriginalFilename().lastIndexOf(".");
+//            String fileName = file.getOriginalFilename().substring(0, temp);
+//            String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
+//            if (!format.equalsIgnoreCase(".bpmn")) {
+//                throw ExceptionResultEnum.ERROR.exception("上传的流程文件格式只能为.bmpn");
+//            }
+//            basicAttachment = printCommonService.saveAttachment(file, ServletUtil.getRequestMd5(), UploadFileEnum.FILE);
+//            if (Objects.isNull(basicAttachment)) {
+//                throw ExceptionResultEnum.ATTACHMENT_ERROR.exception();
+//            }
+//            activitiService.uploadDeployment(file);
+//            String actFlowId = tfFlowService.findActIdByFlowKey(SystemConstant.GDYKDX_FLOW_KEY);
+//            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+//            TFFlow tfFlow = new TFFlow(SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId(), name, sysUser.getId(), fileName, actFlowId);
+//            tfFlowService.save(tfFlow);
+//        } catch (Exception e) {
+//            log.error(SystemConstant.LOG_ERROR, e);
+//            if (Objects.nonNull(basicAttachment)) {
+//                basicAttachmentService.deleteAttachment(basicAttachment);
+//            }
+//            if (e instanceof DuplicateKeyException) {
+//                String errorColumn = e.getCause().toString();
+//                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
+//                throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
+//            } else if (e instanceof ApiException) {
+//                ResultUtil.error((ApiException) e, e.getMessage());
+//            } else {
+//                ResultUtil.error(e.getMessage());
+//            }
+//        }
+//        return ResultUtil.ok(new EditResult(basicAttachment.getId()));
+//    }
+//
+////    @ApiOperation(value = "发布流程")
+////    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+////    @RequestMapping(value = "/publish", method = RequestMethod.POST)
+////    public Result publish(@ApiParam(value = "流程文件id", required = true) @RequestParam String id) {
+////        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+////        UpdateWrapper tfFlowUpdateWrapper = new UpdateWrapper<>();
+////        tfFlowUpdateWrapper.lambda().eq(TFFlow::getId, Long.parseLong(id))
+////                .set(TFFlow::getPublish, true)
+////                .set(TFFlow::getUpdateId, sysUser.getId())
+////                .set(TFFlow::getUpdateTime, System.currentTimeMillis());
+////        return ResultUtil.ok(tfFlowService.update(tfFlowUpdateWrapper));
+////    }
+//
+//    @ApiOperation(value = "流程逻辑删除")
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+//    @RequestMapping(value = "/enable", method = RequestMethod.POST)
+//    public Result enable(@Valid @RequestBody FlowParam flowParam, BindingResult bindingResult) {
+//        if (bindingResult.hasErrors()) {
+//            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+//        }
+//        return ResultUtil.ok(activitiService.flowDelete(flowParam.getId()));
+//    }
+//
+//    @ApiOperation(value = "流程列表")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程信息", response = TFFlow.class)})
+//    @RequestMapping(value = "/list", method = RequestMethod.POST)
+//    public Result list(@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name,
+//                       @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+//                       @ApiParam(value = "数量", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
 //        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-//        UpdateWrapper tfFlowUpdateWrapper = new UpdateWrapper<>();
-//        tfFlowUpdateWrapper.lambda().eq(TFFlow::getId, Long.parseLong(id))
-//                .set(TFFlow::getPublish, true)
-//                .set(TFFlow::getUpdateId, sysUser.getId())
-//                .set(TFFlow::getUpdateTime, System.currentTimeMillis());
-//        return ResultUtil.ok(tfFlowService.update(tfFlowUpdateWrapper));
+//        return ResultUtil.ok(tfFlowService.list(new Page<>(pageNumber, pageSize), name, SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId()));
+//    }
+//
+//    @ApiOperation(value = "审批流程")
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+//    @RequestMapping(value = "/task/approve", method = RequestMethod.POST)
+//    public Result taskApprove(@Valid @RequestBody FlowTaskApproveParam flowTaskApproveParam, BindingResult bindingResult) {
+//        if (bindingResult.hasErrors()) {
+//            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+//        }
+//        Map<String, Object> map = new HashMap<>();
+//        map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> flowTaskApproveParam.getTaskId());
+//        map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> flowTaskApproveParam.getApprovePass());
+//        map.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> flowTaskApproveParam.getRemark());
+//        map.computeIfAbsent(SystemConstant.APPROVE_SETUP, v -> flowTaskApproveParam.getSetup());
+//        map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> flowTaskApproveParam.getApproveUserIds());
+//        map.computeIfAbsent(SystemConstant.USER_TASK_ID, v -> flowTaskApproveParam.getUsertaskId());
+//        Map<String, Object> objectMap = activitiService.taskApprove(map);
+//        if (Objects.nonNull(objectMap)) {
+//            TFFlowApprove tfFlowApprove = (TFFlowApprove) objectMap.get("tfFlowApprove");
+//            ExamTask examTask = (ExamTask) objectMap.get("examTask");
+//            boolean presidentApprove = Objects.nonNull(objectMap.get(SystemConstant.APPROVE_PRESIDENT_SYSTEM)) ? (boolean) objectMap.get(SystemConstant.APPROVE_PRESIDENT_SYSTEM) : false;
+//            //审核通过,生成pdf
+//            if (Objects.nonNull(tfFlowApprove) && FlowApproveSetupEnum.FINISH.getSetup() == tfFlowApprove.getSetup()) {
+//                // 取命题老师ID
+//                SysUser sysUser = sysUserService.getById(examTask.getUserId());
+//                try {
+//                    printCommonService.checkData(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber(), sysUser);
+//                } catch (IOException e) {
+//                    throw ExceptionResultEnum.ERROR.exception("生成pdf失败");
+//                }
+//            } else if (Objects.nonNull(tfFlowApprove) && FlowApproveSetupEnum.THREE_APPROVE.getSetup() == tfFlowApprove.getSetup() && presidentApprove) {//命题老师后台提交
+//                TExamTaskFlow tExamTaskFlow = tExamTaskFlowService.findByFlowLevel(examTask.getId());
+//                Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(tExamTaskFlow.getFlowId())).singleResult();
+//                if (Objects.nonNull(task)) {
+//                    Map<String, Object> mapObject = new HashMap<>();
+//                    mapObject.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
+//                    mapObject.computeIfAbsent(SystemConstant.APPROVE_PRESIDENT_SYSTEM, v -> presidentApprove);
+//                    activitiService.taskApprove(mapObject);
+//                }
+//            }
+//
+//            // 驳回短信(驳回给提交老师)
+//            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());
+//                basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
+//            }
+//        }
+//        return ResultUtil.ok();
+//    }
+//
+//    @ApiOperation(value = "流程审批记录列表")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程审批记录信息", response = FlowApproveResult.class)})
+//    @RequestMapping(value = "/approve/list", method = RequestMethod.POST)
+//    public Result taskApproveList(@ApiParam(value = "状态", required = false) @RequestParam(required = false) String status,
+//                                  @ApiParam(value = "发起人名称", required = false) @RequestParam(required = false) String startName,
+//                                  @ApiParam(value = "教研室", required = false) @RequestParam(required = false) Long teachingRoomId,
+//                                  @ApiParam(value = "提交开始时间", required = false) @RequestParam(required = false) Long createStartTime,
+//                                  @ApiParam(value = "提交结束时间", required = false) @RequestParam(required = false) Long createEndTime,
+//                                  @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+//                                  @ApiParam(value = "数量", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+//        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+//        return ResultUtil.ok(tfFlowService.flowApproveList(new Page<>(pageNumber, pageSize), status, startName, teachingRoomId, createStartTime, createEndTime, SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId(), null));
+//    }
+//
+//    @ApiOperation(value = "流程审批记录逻辑删除")
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+//    @RequestMapping(value = "/approve/enable", method = RequestMethod.POST)
+//    public Result enable(@Valid @RequestBody FlowApproveParam flowApproveParam, BindingResult bindingResult) {
+//        if (bindingResult.hasErrors()) {
+//            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+//        }
+//        UpdateWrapper<TFFlowApproveLog> tfFlowApproveLogUpdateWrapper = new UpdateWrapper<>();
+//        tfFlowApproveLogUpdateWrapper.lambda().eq(TFFlowApproveLog::getFlowId, flowApproveParam.getFlowId())
+//                .set(TFFlowApproveLog::getEnable, flowApproveParam.getEnable());
+//        return ResultUtil.ok(tfFlowApproveLogService.update(tfFlowApproveLogUpdateWrapper));
+//    }
+//
+//    @ApiOperation(value = "流程终止")
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+//    @RequestMapping(value = "/end", method = RequestMethod.POST)
+//    public Result end(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
+//        activitiService.flowEnd(flowId);
+//        return ResultUtil.ok();
+//    }
+//
+//    @ApiOperation(value = "获取所有流程节点")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程节点", response = FlowTaskResult.class)})
+//    @RequestMapping(value = "/task/all", method = RequestMethod.POST)
+//    public Result taskAll(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
+//        return ResultUtil.ok(activitiService.getTaskAll(flowId));
+//    }
+//
+//    @ApiOperation(value = "获取所有流程节点待审批人")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程节点待审批人", response = FlowTaskApprovePeopleAllResult.class)})
+//    @RequestMapping(value = "/task/approver/people_all", method = RequestMethod.POST)
+//    public Result taskApproverPeopleAll(@ApiParam(value = "课程编码", required = false) @RequestParam(required = false) String courseCode,
+//                                        @ApiParam(value = "流程节点id", required = false) @RequestParam(required = false) String taskId) {
+//        return ResultUtil.ok(activitiService.taskApproverPeopleAll(courseCode, taskId));
+//    }
+//
+//    @ApiOperation(value = "流程节点转他人审批")
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+//    @RequestMapping(value = "/task/approver/exchange", method = RequestMethod.POST)
+//    public Result taskApproverExchange(@ApiParam(value = "审批人id", required = true) @RequestParam String userId,
+//                                       @ApiParam(value = "流程节点id", required = true) @RequestParam String taskId) {
+//        return ResultUtil.ok(activitiService.taskApproverExchange(userId, taskId));
+//    }
+//
+//    @ApiOperation(value = "获取转他人审批人")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程节点审批人", response = FlowTaskApprovePeopleAllResult.class)})
+//    @RequestMapping(value = "/task/approver/exchange/people", method = RequestMethod.POST)
+//    public Result taskApproverExchangePeople(@ApiParam(value = "流程节点id", required = true) @RequestParam String taskId,
+//                                             @ApiParam(value = "用户姓名", required = false) @RequestParam(required = false) String realName) {
+//        return ResultUtil.ok(activitiService.taskApproverExchangePeople(taskId, realName));
+//    }
+//
+//    @ApiOperation(value = "获取下级节点审批人")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程节点审批人", response = FlowTaskApprovePeopleAllResult.class)})
+//    @RequestMapping(value = "/task/approver/next/people", method = RequestMethod.POST)
+//    public Result taskApproverNextPeople(@ApiParam(value = "课程编码", required = false) @RequestParam(required = false) String courseCode,
+//                                         @ApiParam(value = "流程节点id", required = false) @RequestParam(required = false) String taskId) {
+//        return ResultUtil.ok(activitiService.taskApproverNextPeople(courseCode, taskId));
+//    }
+//
+//    @ApiOperation(value = "获取提交记录")
+//    @ApiResponses({@ApiResponse(code = 200, message = "流程提交记录", response = FlowTaskApprovePeopleAllResult.class)})
+//    @RequestMapping(value = "/task/approver/submit/list", method = RequestMethod.POST)
+//    public Result taskApproverSubmitList(@ApiParam(value = "考试任务id", required = true) @RequestParam String examTaskId) {
+//        return ResultUtil.ok(activitiService.taskApproverSubmitList(examTaskId));
 //    }
-
-    @ApiOperation(value = "流程逻辑删除")
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-    @RequestMapping(value = "/enable", method = RequestMethod.POST)
-    public Result enable(@Valid @RequestBody FlowParam flowParam, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
-        }
-        return ResultUtil.ok(activitiService.flowDelete(flowParam.getId()));
-    }
-
-    @ApiOperation(value = "流程列表")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程信息", response = TFFlow.class)})
-    @RequestMapping(value = "/list", method = RequestMethod.POST)
-    public Result list(@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name,
-                       @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                       @ApiParam(value = "数量", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        return ResultUtil.ok(tfFlowService.list(new Page<>(pageNumber, pageSize), name, SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId()));
-    }
-
-    @ApiOperation(value = "审批流程")
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-    @RequestMapping(value = "/task/approve", method = RequestMethod.POST)
-    public Result taskApprove(@Valid @RequestBody FlowTaskApproveParam flowTaskApproveParam, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
-        }
-        Map<String, Object> map = new HashMap<>();
-        map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> flowTaskApproveParam.getTaskId());
-        map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> flowTaskApproveParam.getApprovePass());
-        map.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> flowTaskApproveParam.getRemark());
-        map.computeIfAbsent(SystemConstant.APPROVE_SETUP, v -> flowTaskApproveParam.getSetup());
-        map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> flowTaskApproveParam.getApproveUserIds());
-        map.computeIfAbsent(SystemConstant.USER_TASK_ID, v -> flowTaskApproveParam.getUsertaskId());
-        Map<String, Object> objectMap = activitiService.taskApprove(map);
-        if (Objects.nonNull(objectMap)) {
-            TFFlowApprove tfFlowApprove = (TFFlowApprove) objectMap.get("tfFlowApprove");
-            ExamTask examTask = (ExamTask) objectMap.get("examTask");
-            boolean presidentApprove = Objects.nonNull(objectMap.get(SystemConstant.APPROVE_PRESIDENT_SYSTEM)) ? (boolean) objectMap.get(SystemConstant.APPROVE_PRESIDENT_SYSTEM) : false;
-            //审核通过,生成pdf
-            if (Objects.nonNull(tfFlowApprove) && FlowApproveSetupEnum.FINISH.getSetup() == tfFlowApprove.getSetup()) {
-                // 取命题老师ID
-                SysUser sysUser = sysUserService.getById(examTask.getUserId());
-                try {
-                    printCommonService.checkData(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber(), sysUser);
-                } catch (IOException e) {
-                    throw ExceptionResultEnum.ERROR.exception("生成pdf失败");
-                }
-            } else if (Objects.nonNull(tfFlowApprove) && FlowApproveSetupEnum.THREE_APPROVE.getSetup() == tfFlowApprove.getSetup() && presidentApprove) {//命题老师后台提交
-                TExamTaskFlow tExamTaskFlow = tExamTaskFlowService.findByFlowLevel(examTask.getId());
-                Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(tExamTaskFlow.getFlowId())).singleResult();
-                if (Objects.nonNull(task)) {
-                    Map<String, Object> mapObject = new HashMap<>();
-                    mapObject.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
-                    mapObject.computeIfAbsent(SystemConstant.APPROVE_PRESIDENT_SYSTEM, v -> presidentApprove);
-                    activitiService.taskApprove(mapObject);
-                }
-            }
-
-            // 驳回短信(驳回给提交老师)
-            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());
-                basicMessageService.sendNoticeTaskAuditFlow(examTask, sysUserList, MessageEnum.NOTICE_OF_AUDIT_REJECT);
-            }
-        }
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "流程审批记录列表")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程审批记录信息", response = FlowApproveResult.class)})
-    @RequestMapping(value = "/approve/list", method = RequestMethod.POST)
-    public Result taskApproveList(@ApiParam(value = "状态", required = false) @RequestParam(required = false) String status,
-                                  @ApiParam(value = "发起人名称", required = false) @RequestParam(required = false) String startName,
-                                  @ApiParam(value = "教研室", required = false) @RequestParam(required = false) Long teachingRoomId,
-                                  @ApiParam(value = "提交开始时间", required = false) @RequestParam(required = false) Long createStartTime,
-                                  @ApiParam(value = "提交结束时间", required = false) @RequestParam(required = false) Long createEndTime,
-                                  @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                                  @ApiParam(value = "数量", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        return ResultUtil.ok(tfFlowService.flowApproveList(new Page<>(pageNumber, pageSize), status, startName, teachingRoomId, createStartTime, createEndTime, SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId(), null));
-    }
-
-    @ApiOperation(value = "流程审批记录逻辑删除")
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-    @RequestMapping(value = "/approve/enable", method = RequestMethod.POST)
-    public Result enable(@Valid @RequestBody FlowApproveParam flowApproveParam, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
-        }
-        UpdateWrapper<TFFlowApproveLog> tfFlowApproveLogUpdateWrapper = new UpdateWrapper<>();
-        tfFlowApproveLogUpdateWrapper.lambda().eq(TFFlowApproveLog::getFlowId, flowApproveParam.getFlowId())
-                .set(TFFlowApproveLog::getEnable, flowApproveParam.getEnable());
-        return ResultUtil.ok(tfFlowApproveLogService.update(tfFlowApproveLogUpdateWrapper));
-    }
-
-    @ApiOperation(value = "流程终止")
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-    @RequestMapping(value = "/end", method = RequestMethod.POST)
-    public Result end(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
-        activitiService.flowEnd(flowId);
-        return ResultUtil.ok();
-    }
-
-    @ApiOperation(value = "获取所有流程节点")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程节点", response = FlowTaskResult.class)})
-    @RequestMapping(value = "/task/all", method = RequestMethod.POST)
-    public Result taskAll(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
-        return ResultUtil.ok(activitiService.getTaskAll(flowId));
-    }
-
-    @ApiOperation(value = "获取所有流程节点待审批人")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程节点待审批人", response = FlowTaskApprovePeopleAllResult.class)})
-    @RequestMapping(value = "/task/approver/people_all", method = RequestMethod.POST)
-    public Result taskApproverPeopleAll(@ApiParam(value = "课程编码", required = false) @RequestParam(required = false) String courseCode,
-                                        @ApiParam(value = "流程节点id", required = false) @RequestParam(required = false) String taskId) {
-        return ResultUtil.ok(activitiService.taskApproverPeopleAll(courseCode, taskId));
-    }
-
-    @ApiOperation(value = "流程节点转他人审批")
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
-    @RequestMapping(value = "/task/approver/exchange", method = RequestMethod.POST)
-    public Result taskApproverExchange(@ApiParam(value = "审批人id", required = true) @RequestParam String userId,
-                                       @ApiParam(value = "流程节点id", required = true) @RequestParam String taskId) {
-        return ResultUtil.ok(activitiService.taskApproverExchange(userId, taskId));
-    }
-
-    @ApiOperation(value = "获取转他人审批人")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程节点审批人", response = FlowTaskApprovePeopleAllResult.class)})
-    @RequestMapping(value = "/task/approver/exchange/people", method = RequestMethod.POST)
-    public Result taskApproverExchangePeople(@ApiParam(value = "流程节点id", required = true) @RequestParam String taskId,
-                                             @ApiParam(value = "用户姓名", required = false) @RequestParam(required = false) String realName) {
-        return ResultUtil.ok(activitiService.taskApproverExchangePeople(taskId, realName));
-    }
-
-    @ApiOperation(value = "获取下级节点审批人")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程节点审批人", response = FlowTaskApprovePeopleAllResult.class)})
-    @RequestMapping(value = "/task/approver/next/people", method = RequestMethod.POST)
-    public Result taskApproverNextPeople(@ApiParam(value = "课程编码", required = false) @RequestParam(required = false) String courseCode,
-                                         @ApiParam(value = "流程节点id", required = false) @RequestParam(required = false) String taskId) {
-        return ResultUtil.ok(activitiService.taskApproverNextPeople(courseCode, taskId));
-    }
-
-    @ApiOperation(value = "获取提交记录")
-    @ApiResponses({@ApiResponse(code = 200, message = "流程提交记录", response = FlowTaskApprovePeopleAllResult.class)})
-    @RequestMapping(value = "/task/approver/submit/list", method = RequestMethod.POST)
-    public Result taskApproverSubmitList(@ApiParam(value = "考试任务id", required = true) @RequestParam String examTaskId) {
-        return ResultUtil.ok(activitiService.taskApproverSubmitList(examTaskId));
-    }
-}
+//}

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

@@ -219,7 +219,6 @@ public class SystemConstant {
     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 USER_TASK_ID = "usertaskId";//流程节点id
     public static final String APPROVE_CANCEL = "cancel";//流程撤销操作
     public static final String APPROVE_CANCEL_USER = "approveCancelUserId";//流程撤销用户id操作
     public static final Long APPROVE_CANCEL_USER_ID = -1L;//流程撤销用户id操作

+ 16 - 7
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/FlowApproveOperationEnum.java

@@ -11,22 +11,31 @@ import java.util.Objects;
  */
 public enum FlowApproveOperationEnum {
 
-    SUBMIT("提交"),
+    SUBMIT("提交", "submit"),
 
-    APPROVE("审批"),
+    APPROVE("审批", "approve"),
 
-    REJECT("驳回"),
+    REJECT("驳回", "reject"),
 
-    END("终止"),
+    END("终止", "end"),
 
-    CANCEL("撤销"),
+    CANCEL("撤销", "cancel"),
 
-    EXCHANGE("转他人审批");
+    EXCHANGE("转他人审批", "exchange"),
+
+    FINISH("结束", "finish");
 
     private String title;
 
-    private FlowApproveOperationEnum(String title) {
+    private String id;
+
+    private FlowApproveOperationEnum(String title, String id) {
         this.title = title;
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
     }
 
     public String getTitle() {

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

@@ -13,14 +13,6 @@ public enum FlowApproveSetupEnum {
 
     SUBMIT("提交试卷", "usertask1", 1, "命题老师"),
 
-    PRIMARY_APPROVE("一级审核", "usertask2", 2, "主任"),
-
-    SECOND_APPROVE("二级审核", "usertask3", 3, "院长"),
-
-    THREE_APPROVE("三级审核", "usertask4", 4, "命题老师"),
-
-    FOUR_APPROVE("四级审核", "usertask5", 5, "印刷员"),
-
     END("已终止", null, -1, "终止"),
 
     FINISH("已结束", null, 0, "结束");

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

@@ -1,76 +1,76 @@
-package com.qmth.teachcloud.common.enums;
-
-import java.util.Objects;
-
-/**
- * @Description: 流程审批变量 enum
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/8/2
- */
-public enum FlowApproveVariableEnum {
-
-    PRIMARY_APPROVE("一级审核通过", "1"),
-
-    PRIMARY_REJECT("一级审核驳回", "0"),
-
-    SECOND_APPROVE("二级审核通过", "2"),
-
-    SECOND_REJECT_ONE("二级审核驳回至第一节点", "0"),
-
-    SECOND_REJECT_TWO("二级审核驳回至第二节点", "1"),
-
-    THREE_APPROVE("三级审核通过", "3"),
-
-    FOUR_APPROVE("四级审核通过", "1"),
-
-    FOUR_REJECT("四级审核驳回", "0");
-
-    private String title;
-
-    private String id;
-
-    private FlowApproveVariableEnum(String title, String id) {
-        this.title = title;
-        this.id = id;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    /**
-     * 状态转换 toName
-     *
-     * @param title
-     * @return
-     */
-    public static String convertToName(String title) {
-        for (FlowApproveVariableEnum e : FlowApproveVariableEnum.values()) {
-            if (Objects.equals(title, e.getTitle())) {
-                return e.name();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 状态转换 toInstance
-     *
-     * @param id
-     * @return
-     */
-    public static FlowApproveVariableEnum convertToInstance(String id) {
-        for (FlowApproveVariableEnum e : FlowApproveVariableEnum.values()) {
-            if (Objects.equals(id, e.getTitle())) {
-                return e;
-            }
-        }
-        return null;
-    }
-}
+//package com.qmth.teachcloud.common.enums;
+//
+//import java.util.Objects;
+//
+///**
+// * @Description: 流程审批变量 enum
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2021/8/2
+// */
+//public enum FlowApproveVariableEnum {
+//
+//    PRIMARY_APPROVE("一级审核通过", "1"),
+//
+//    PRIMARY_REJECT("一级审核驳回", "0"),
+//
+//    SECOND_APPROVE("二级审核通过", "2"),
+//
+//    SECOND_REJECT_ONE("二级审核驳回至第一节点", "0"),
+//
+//    SECOND_REJECT_TWO("二级审核驳回至第二节点", "1"),
+//
+//    THREE_APPROVE("三级审核通过", "3"),
+//
+//    FOUR_APPROVE("四级审核通过", "1"),
+//
+//    FOUR_REJECT("四级审核驳回", "0");
+//
+//    private String title;
+//
+//    private String id;
+//
+//    private FlowApproveVariableEnum(String title, String id) {
+//        this.title = title;
+//        this.id = id;
+//    }
+//
+//    public String getTitle() {
+//        return title;
+//    }
+//
+//    public String getId() {
+//        return id;
+//    }
+//
+//    /**
+//     * 状态转换 toName
+//     *
+//     * @param title
+//     * @return
+//     */
+//    public static String convertToName(String title) {
+//        for (FlowApproveVariableEnum e : FlowApproveVariableEnum.values()) {
+//            if (Objects.equals(title, e.getTitle())) {
+//                return e.name();
+//            }
+//        }
+//        return null;
+//    }
+//
+//    /**
+//     * 状态转换 toInstance
+//     *
+//     * @param id
+//     * @return
+//     */
+//    public static FlowApproveVariableEnum convertToInstance(String id) {
+//        for (FlowApproveVariableEnum e : FlowApproveVariableEnum.values()) {
+//            if (Objects.equals(id, e.getTitle())) {
+//                return e;
+//            }
+//        }
+//        return null;
+//    }
+//}

Some files were not shown because too many files changed in this diff