瀏覽代碼

流程消息改造

wangliang 2 年之前
父節點
當前提交
17e2febd75

+ 20 - 16
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/dto/HandleMessageDto.java

@@ -15,33 +15,37 @@ import java.util.List;
 public class HandleMessageDto implements Serializable {
 
     @ApiModelProperty(value = "待办消息")
-    List<StandardFlowWorkMsg> standardFlowWorkMsgList;
+    List<StandardFlowWorkMsg> todoTaskList;
 
-    @ApiModelProperty(value = "消息详情")
-    StandardFlowViewMsg standardFlowViewMsg;
+//    @ApiModelProperty(value = "消息详情")
+//    StandardFlowViewMsg standardFlowViewMsg;
 
     public HandleMessageDto() {
 
     }
 
-    public HandleMessageDto(List<StandardFlowWorkMsg> standardFlowWorkMsgList, StandardFlowViewMsg standardFlowViewMsg) {
-        this.standardFlowWorkMsgList = standardFlowWorkMsgList;
-        this.standardFlowViewMsg = standardFlowViewMsg;
+    public HandleMessageDto(List<StandardFlowWorkMsg> todoTaskList) {
+        this.todoTaskList = todoTaskList;
     }
 
-    public List<StandardFlowWorkMsg> getStandardFlowWorkMsgList() {
-        return standardFlowWorkMsgList;
-    }
+//    public HandleMessageDto(List<StandardFlowWorkMsg> standardFlowWorkMsgList, StandardFlowViewMsg standardFlowViewMsg) {
+//        this.standardFlowWorkMsgList = standardFlowWorkMsgList;
+//        this.standardFlowViewMsg = standardFlowViewMsg;
+//    }
 
-    public void setStandardFlowWorkMsgList(List<StandardFlowWorkMsg> standardFlowWorkMsgList) {
-        this.standardFlowWorkMsgList = standardFlowWorkMsgList;
+    public List<StandardFlowWorkMsg> getTodoTaskList() {
+        return todoTaskList;
     }
 
-    public StandardFlowViewMsg getStandardFlowViewMsg() {
-        return standardFlowViewMsg;
+    public void setTodoTaskList(List<StandardFlowWorkMsg> todoTaskList) {
+        this.todoTaskList = todoTaskList;
     }
 
-    public void setStandardFlowViewMsg(StandardFlowViewMsg standardFlowViewMsg) {
-        this.standardFlowViewMsg = standardFlowViewMsg;
-    }
+//    public StandardFlowViewMsg getStandardFlowViewMsg() {
+//        return standardFlowViewMsg;
+//    }
+//
+//    public void setStandardFlowViewMsg(StandardFlowViewMsg standardFlowViewMsg) {
+//        this.standardFlowViewMsg = standardFlowViewMsg;
+//    }
 }

+ 0 - 16
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/dto/StandardFlowViewMsg.java

@@ -1,16 +0,0 @@
-package com.qmth.distributed.print.business.bean.flow.dto;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.qmth.distributed.print.business.bean.result.FlowViewResult;
-
-/**
- * @Description: 标准流程详情消息
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2023/6/14
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class StandardFlowViewMsg extends FlowViewResult {
-
-}

+ 5 - 23
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/dto/ToDoTaskDto.java

@@ -3,7 +3,6 @@ package com.qmth.distributed.print.business.bean.flow.dto;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
-import java.util.List;
 
 /**
  * @Description: 流程消息dto
@@ -17,9 +16,6 @@ public class ToDoTaskDto implements Serializable {
     @ApiModelProperty(value = "流程信息")
     StandardFlowData flowData;
 
-    @ApiModelProperty(value = "待办消息")
-    List<StandardFlowWorkMsg> todoTaskList;
-
     @ApiModelProperty(value = "待办详情消息")
     HandleMessageDto handleMessageDto;
 
@@ -27,22 +23,8 @@ public class ToDoTaskDto implements Serializable {
 
     }
 
-    public ToDoTaskDto(StandardFlowData flowData, List<StandardFlowWorkMsg> todoTaskList) {
-        this.flowData = flowData;
-        this.todoTaskList = todoTaskList;
-    }
-
-    public ToDoTaskDto(StandardFlowData flowData, List<StandardFlowWorkMsg> todoTaskList, HandleMessageDto handleMessageDto) {
+    public ToDoTaskDto(StandardFlowData flowData, HandleMessageDto handleMessageDto) {
         this.flowData = flowData;
-        this.todoTaskList = todoTaskList;
-        this.handleMessageDto = handleMessageDto;
-    }
-
-    public HandleMessageDto getHandleMessageDto() {
-        return handleMessageDto;
-    }
-
-    public void setHandleMessageDto(HandleMessageDto handleMessageDto) {
         this.handleMessageDto = handleMessageDto;
     }
 
@@ -54,11 +36,11 @@ public class ToDoTaskDto implements Serializable {
         this.flowData = flowData;
     }
 
-    public List<StandardFlowWorkMsg> getTodoTaskList() {
-        return todoTaskList;
+    public HandleMessageDto getHandleMessageDto() {
+        return handleMessageDto;
     }
 
-    public void setTodoTaskList(List<StandardFlowWorkMsg> todoTaskList) {
-        this.todoTaskList = todoTaskList;
+    public void setHandleMessageDto(HandleMessageDto handleMessageDto) {
+        this.handleMessageDto = handleMessageDto;
     }
 }

+ 17 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java

@@ -9,7 +9,10 @@ import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.activiti.custom.service.DefaultInstanceConvertToMultiInstance;
 import com.qmth.distributed.print.business.activiti.custom.service.MultiWorkFlow;
 import com.qmth.distributed.print.business.bean.flow.*;
-import com.qmth.distributed.print.business.bean.flow.dto.*;
+import com.qmth.distributed.print.business.bean.flow.dto.FlowMsgDto;
+import com.qmth.distributed.print.business.bean.flow.dto.HandleMessageDto;
+import com.qmth.distributed.print.business.bean.flow.dto.StandardFlowData;
+import com.qmth.distributed.print.business.bean.flow.dto.StandardFlowWorkMsg;
 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.bean.result.*;
@@ -1993,7 +1996,7 @@ public class ActivitiServiceImpl implements ActivitiService {
     public HandleMessageDto handleMessage(Long schoolId, Long flowId, FlowApproveOperationEnum flowApproveOperationEnum) {
         SysConfig sysConfigFlowMsgType = commonCacheService.addSysConfigCache(schoolId, SystemConstant.FLOW_MESSAGE_TYPE);
         List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
-        List<StandardFlowWorkMsg> standardFlowWorkMsgList = new LinkedList<>();
+        List<StandardFlowWorkMsg> todoTaskList = new LinkedList<>();
         if (!CollectionUtils.isEmpty(taskList)) {
             for (Task t : taskList) {
                 //待办消息
@@ -2003,7 +2006,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                     standardFlowWorkMsg.setFlowType(TFCustomTypeEnum.ELECTRON_FLOW);
                     standardFlowWorkMsg.setFlowOperation(flowApproveOperationEnum);
                     standardFlowWorkMsg.setMessageType(FlowMsgTypeEnum.valueOf(sysConfigFlowMsgType.getConfigValue()));
-                    standardFlowWorkMsgList.add(standardFlowWorkMsg);
+                    todoTaskList.add(standardFlowWorkMsg);
                 }
             }
         } else {
@@ -2014,18 +2017,19 @@ public class ActivitiServiceImpl implements ActivitiService {
                 standardFlowWorkMsg.setFlowType(TFCustomTypeEnum.ELECTRON_FLOW);
                 standardFlowWorkMsg.setFlowOperation(flowApproveOperationEnum);
                 standardFlowWorkMsg.setMessageType(FlowMsgTypeEnum.valueOf(sysConfigFlowMsgType.getConfigValue()));
-                standardFlowWorkMsgList.add(standardFlowWorkMsg);
+                todoTaskList.add(standardFlowWorkMsg);
             }
         }
-        //流程详情
-        FlowViewResult flowViewResult = this.getFlowView(flowId);
-        StandardFlowViewMsg standardFlowViewMsg = Objects.nonNull(flowViewResult) ? GsonUtil.fromJson(GsonUtil.toJson(flowViewResult), StandardFlowViewMsg.class) : null;
-        if (Objects.nonNull(standardFlowViewMsg)) {
-            standardFlowViewMsg.setFlowType(TFCustomTypeEnum.ELECTRON_FLOW);
-            standardFlowViewMsg.setFlowOperation(flowApproveOperationEnum);
-            standardFlowViewMsg.setMessageType(FlowMsgTypeEnum.valueOf(sysConfigFlowMsgType.getConfigValue()));
-        }
-        return new HandleMessageDto(standardFlowWorkMsgList, standardFlowViewMsg);
+//        //流程详情
+//        FlowViewResult flowViewResult = this.getFlowView(flowId);
+//        StandardFlowViewMsg standardFlowViewMsg = Objects.nonNull(flowViewResult) ? GsonUtil.fromJson(GsonUtil.toJson(flowViewResult), StandardFlowViewMsg.class) : null;
+//        if (Objects.nonNull(standardFlowViewMsg)) {
+//            standardFlowViewMsg.setFlowType(TFCustomTypeEnum.ELECTRON_FLOW);
+//            standardFlowViewMsg.setFlowOperation(flowApproveOperationEnum);
+//            standardFlowViewMsg.setMessageType(FlowMsgTypeEnum.valueOf(sysConfigFlowMsgType.getConfigValue()));
+//        }
+//        return new HandleMessageDto(standardFlowWorkMsgList, standardFlowViewMsg);
+        return new HandleMessageDto(todoTaskList);
     }
 
     /**

+ 2 - 2
distributed-print-business/src/main/resources/db/install/teachcloud_db.sql

@@ -2858,8 +2858,8 @@ INSERT INTO `sys_config` VALUES (10, NULL, NULL, 'attachment.type', '附件类
 INSERT INTO `sys_config` VALUES (11, NULL, NULL, 'attachment.length', '附件名称长度', '100', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (12, NULL, NULL, 'attachment.size', '附件大小 ', '200', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (13, NULL, NULL, 'auto.create.pdf.reset.max.count', '自动重试生成pdf失败最大次数', '5', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (14, NULL, NULL, 'thread.pool.core.size', '自定义线程池大小', '1', NULL, 1, 1, 1, NULL, NULL, NULL);
-INSERT INTO `sys_config` VALUES (15, NULL, NULL, 'custom.thread.pool.core.size', '是否自定义线程池大小', 'false', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (14, NULL, NULL, 'thread.pool.core.size', '自定义线程池大小', '500', NULL, 1, 1, 1, NULL, NULL, NULL);
+INSERT INTO `sys_config` VALUES (15, NULL, NULL, 'custom.thread.pool.core.size', '是否自定义线程池大小', 'true', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (16, NULL, NULL, 'session.active', 'session会话时长', '4h', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (18, NULL, NULL, 'sms.normal.code', '万能短信验证码', 'qmth', NULL, 1, 1, 1, NULL, NULL, NULL);
 INSERT INTO `sys_config` VALUES (19, NULL, NULL, 'code.expired.time', '短信验证码有效时间', '2', NULL, 1, 1, 1, NULL, NULL, NULL);

+ 4 - 1
distributed-print-business/src/main/resources/db/log/脚本-wangl.sql

@@ -61,4 +61,7 @@ ALTER TABLE sys_user MODIFY COLUMN mobile_number varchar(30) NULL COMMENT '手
 -----------------------3.2.5 end----------------------
 
 -----------------------3.2.6 start 需求 2023-06-13----------------------
-ALTER TABLE t_f_flow_log ADD task_id BIGINT NULL COMMENT '流程节点id';
+ALTER TABLE t_f_flow_log ADD task_id BIGINT NULL COMMENT '流程节点id';
+
+UPDATE sys_config SET config_value='500' WHERE config_key='thread.pool.core.size';
+UPDATE sys_config SET config_value='true' WHERE config_key='custom.thread.pool.core.size';

+ 3 - 0
distributed-print-business/src/main/resources/db/upgrade/3.2.6.sql

@@ -1,5 +1,8 @@
 USE teachcloud_db;
 
+UPDATE sys_config SET config_value='500' WHERE config_key='thread.pool.core.size';
+UPDATE sys_config SET config_value='true' WHERE config_key='custom.thread.pool.core.size';
+
 INSERT INTO `sys_privilege` VALUES (875, '我教课程选择', 'MyTeachCourse', 'BUTTON', 40, 10, 'AUTH', '759', 1, 0, 1);
 INSERT INTO `sys_privilege` VALUES (876, '学生库选择', 'StudentLibrary', 'BUTTON', 40, 11, 'AUTH', '759', 1, 0, 1);
 INSERT INTO `sys_privilege` VALUES (877, '选择学生(学生库选择)', 'SelectStudent', 'BUTTON', 40, 12, 'AUTH', NULL, 1, 0, 1);

+ 4 - 3
teachcloud-task/src/main/java/com/qmth/teachcloud/task/config/RedisListenerConfig.java

@@ -1,6 +1,7 @@
 package com.qmth.teachcloud.task.config;
 
 import com.qmth.teachcloud.common.enums.MqTagEnum;
+import com.qmth.teachcloud.common.threadPool.MyThreadPool;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
@@ -27,8 +28,8 @@ public class RedisListenerConfig {
     @Resource
     private RedisMessageListener messageListener;
 
-//    @Resource
-//    MyThreadPool myThreadPool;
+    @Resource
+    MyThreadPool myThreadPool;
 
     @Bean
     public RedisMessageListenerContainer initRedisContainer() {
@@ -36,7 +37,7 @@ public class RedisListenerConfig {
         //redis连接工厂
         container.setConnectionFactory(redisConnectionFactory);
         //设置运行任务池
-//        container.setTaskExecutor(myThreadPool);
+        container.setTaskExecutor(myThreadPool);
         //定义监听渠道名称为
         Topic topicPdf = new ChannelTopic(MqTagEnum.PDF.getCode());
         Topic topicFlowMqWork = new ChannelTopic(MqTagEnum.FLOW_MQ_WORK.getCode());

+ 2 - 2
teachcloud-task/src/main/java/com/qmth/teachcloud/task/config/RedisMessageListener.java

@@ -119,9 +119,9 @@ public class RedisMessageListener implements MessageListener {
                                 FlowMsgDto flowMsgDto = activitiService.getFlowMsgData(schoolId);
                                 StandardFlowData standardFlowData = activitiService.getFlowInfo(Long.parseLong(mqDto.getObjId()));
                                 HandleMessageDto handleMessageDto = activitiService.handleMessage(schoolId, Long.parseLong(mqDto.getObjId()), flowApproveOperationEnum);
-                                if (Objects.nonNull(handleMessageDto) && !CollectionUtils.isEmpty(handleMessageDto.getStandardFlowWorkMsgList())) {
+                                if (Objects.nonNull(handleMessageDto) && !CollectionUtils.isEmpty(handleMessageDto.getTodoTaskList())) {
 //                                    ToDoTaskDto toDoTaskDto = new ToDoTaskDto(standardFlowData, handleMessageDto.getStandardFlowWorkMsgList(), handleMessageDto);
-                                    ToDoTaskDto toDoTaskDto = new ToDoTaskDto(standardFlowData, handleMessageDto.getStandardFlowWorkMsgList());
+                                    ToDoTaskDto toDoTaskDto = new ToDoTaskDto(standardFlowData, handleMessageDto);
                                     log.info("flowMq toDoTaskDto:{}", JacksonUtil.parseJson(toDoTaskDto));
 
                                     BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);