Pārlūkot izejas kodu

新增流程发送

wangliang 2 gadi atpakaļ
vecāks
revīzija
0dd748a377

+ 60 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/dto/DoneTaskDto.java

@@ -1,7 +1,11 @@
 package com.qmth.distributed.print.business.bean.flow.dto;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
-import com.qmth.distributed.print.business.bean.result.TFFlowViewLogResult;
+import com.qmth.distributed.print.business.bean.result.TFFlowLogResult;
+import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;
+import com.qmth.teachcloud.common.enums.FlowMsgTypeEnum;
+import com.qmth.teachcloud.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 
@@ -13,6 +17,60 @@ import java.io.Serializable;
  * @Date: 2023/6/14
  */
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class DoneTaskDto extends TFFlowViewLogResult implements Serializable {
+public class DoneTaskDto extends TFFlowLogResult implements Serializable {
 
+    @ApiModelProperty(value = "流程类型")
+    TFCustomTypeEnum flowType;
+
+    @ApiModelProperty(value = "流程操作")
+    FlowApproveOperationEnum flowOperation;
+
+    @ApiModelProperty(value = "消息类型")
+    FlowMsgTypeEnum messageType;
+
+    @ApiModelProperty(value = "待办链接")
+    String url;
+
+    @ApiModelProperty(value = "移动待办链接")
+    String mobileUrl;
+
+    public TFCustomTypeEnum getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(TFCustomTypeEnum flowType) {
+        this.flowType = flowType;
+    }
+
+    public FlowApproveOperationEnum getFlowOperation() {
+        return flowOperation;
+    }
+
+    public void setFlowOperation(FlowApproveOperationEnum flowOperation) {
+        this.flowOperation = flowOperation;
+    }
+
+    public FlowMsgTypeEnum getMessageType() {
+        return messageType;
+    }
+
+    public void setMessageType(FlowMsgTypeEnum messageType) {
+        this.messageType = messageType;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getMobileUrl() {
+        return mobileUrl;
+    }
+
+    public void setMobileUrl(String mobileUrl) {
+        this.mobileUrl = mobileUrl;
+    }
 }

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

@@ -57,6 +57,18 @@ public class StandardFlowData extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "最后更新人")
     private String updateName;
 
+    @ApiModelProperty(value = "流程id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long flowId;
+
+    public Long getFlowId() {
+        return flowId;
+    }
+
+    public void setFlowId(Long flowId) {
+        this.flowId = flowId;
+    }
+
     public String getUpdateName() {
         return updateName;
     }

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

@@ -20,6 +20,9 @@ public class ToDoTaskDto implements Serializable {
     @ApiModelProperty(value = "待办消息")
     List<StandardFlowWorkMsg> todoTaskList;
 
+    @ApiModelProperty(value = "待办详情消息")
+    HandleMessageDto handleMessageDto;
+
     public ToDoTaskDto() {
 
     }
@@ -29,6 +32,20 @@ public class ToDoTaskDto implements Serializable {
         this.todoTaskList = todoTaskList;
     }
 
+    public ToDoTaskDto(StandardFlowData flowData, List<StandardFlowWorkMsg> todoTaskList, HandleMessageDto handleMessageDto) {
+        this.flowData = flowData;
+        this.todoTaskList = todoTaskList;
+        this.handleMessageDto = handleMessageDto;
+    }
+
+    public HandleMessageDto getHandleMessageDto() {
+        return handleMessageDto;
+    }
+
+    public void setHandleMessageDto(HandleMessageDto handleMessageDto) {
+        this.handleMessageDto = handleMessageDto;
+    }
+
     public StandardFlowData getFlowData() {
         return flowData;
     }

+ 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', '自定义线程池大小', '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 (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 (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);

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

@@ -61,7 +61,4 @@ 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';
-
-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';
+ALTER TABLE t_f_flow_log ADD task_id BIGINT NULL COMMENT '流程节点id';

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

@@ -1,8 +1,5 @@
 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);

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

@@ -58,6 +58,7 @@
     <select id="findByFlowId" resultType="com.qmth.distributed.print.business.bean.flow.dto.StandardFlowData">
         select
             tfcf.*,
+            tfcfe.flow_id as flowId,
             if(tbu2.real_name is not null,tbu2.real_name,tbu1.real_name) as updateName
         from
             t_f_custom_flow tfcf

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

@@ -1,7 +1,6 @@
 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;
@@ -28,8 +27,8 @@ public class RedisListenerConfig {
     @Resource
     private RedisMessageListener messageListener;
 
-    @Resource
-    MyThreadPool myThreadPool;
+//    @Resource
+//    MyThreadPool myThreadPool;
 
     @Bean
     public RedisMessageListenerContainer initRedisContainer() {
@@ -37,7 +36,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());

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

@@ -120,6 +120,7 @@ public class RedisMessageListener implements MessageListener {
                                 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())) {
+//                                    ToDoTaskDto toDoTaskDto = new ToDoTaskDto(standardFlowData, handleMessageDto.getStandardFlowWorkMsgList(), handleMessageDto);
                                     ToDoTaskDto toDoTaskDto = new ToDoTaskDto(standardFlowData, handleMessageDto.getStandardFlowWorkMsgList());
                                     log.info("flowMq toDoTaskDto:{}", JacksonUtil.parseJson(toDoTaskDto));