24282 1 năm trước cách đây
mục cha
commit
af3fe3774a

+ 5 - 0
hx-flow/pom.xml

@@ -25,6 +25,11 @@
             <artifactId>ruoyi-framework</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>hx-file</artifactId>
+        </dependency>
+
         <!--el表达式计算-->
         <dependency>
             <groupId>com.googlecode.aviator</groupId>

+ 7 - 0
hx-flow/src/main/java/com/fjhx/flow/entity/flow/dto/InitiateDto.java

@@ -1,10 +1,12 @@
 package com.fjhx.flow.entity.flow.dto;
 
 import com.alibaba.fastjson.JSONObject;
+import com.fjhx.file.entity.ObsFile;
 import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
+import java.util.List;
 
 @Getter
 @Setter
@@ -31,4 +33,9 @@ public class InitiateDto {
      */
     private JSONObject data;
 
+    /**
+     * 节点附件
+     */
+    private List<ObsFile> fileList;
+
 }

+ 7 - 0
hx-flow/src/main/java/com/fjhx/flow/entity/flow/dto/JumpDto.java

@@ -1,10 +1,12 @@
 package com.fjhx.flow.entity.flow.dto;
 
 import com.alibaba.fastjson.JSONObject;
+import com.fjhx.file.entity.ObsFile;
 import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 @Getter
 @Setter
@@ -43,4 +45,9 @@ public class JumpDto {
      */
     private JSONObject data;
 
+    /**
+     * 节点附件
+     */
+    private List<ObsFile> fileList;
+
 }

+ 7 - 0
hx-flow/src/main/java/com/fjhx/flow/service/flow/impl/FlowProcessServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.flow.core.FlowBean;
 import com.fjhx.flow.core.FlowDelegate;
 import com.fjhx.flow.core.FlowThreadLocalUtil;
@@ -180,6 +181,9 @@ public class FlowProcessServiceImpl implements FlowProcessService {
         flowExampleService.save(flowExample);
         flowExampleDetailService.saveBatch(flowExampleDetailList);
 
+        // 保存节点附件
+        ObsFileUtil.saveFile(dto.getFileList(), startExampleDetail.getId());
+
         FlowResult flowResult = new FlowResult();
         flowResult.setSuccess(true);
         return flowResult;
@@ -377,6 +381,9 @@ public class FlowProcessServiceImpl implements FlowProcessService {
         }
         flowExampleDetailService.saveBatch(flowExampleDetailList);
 
+        // 保存节点附件
+        ObsFileUtil.saveFile(dto.getFileList(), nodeExampleDetail.getId());
+
         FlowResult flowResult = new FlowResult();
         flowResult.setSuccess(true);
         return flowResult;