瀏覽代碼

feat:解析文件流得到xml文本标签

韩帛霖 1 年之前
父節點
當前提交
96c1c68cce

+ 12 - 0
ruoyi-system/pom.xml

@@ -7,6 +7,18 @@
         <groupId>com.ruoyi</groupId>
         <version>3.8.5</version>
     </parent>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>9</source>
+                    <target>9</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>ruoyi-system</artifactId>

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BpmProcessServiceImpl.java

@@ -1,5 +1,9 @@
 package com.ruoyi.system.service.impl;
 
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
 import java.util.List;
 
 import com.ruoyi.common.utils.DateUtils;
@@ -51,6 +55,11 @@ public class BpmProcessServiceImpl implements IBpmProcessService {
      */
     @Override
     public int insertBpmProcess(BpmProcess bpmProcess) {
+        // 解析到字节流中的xml内容进行存储
+        byte[] decodedBytes = Base64.getDecoder().decode(bpmProcess.getProcessXml().split("data:text/xml;base64,")[1]);
+//        String decodedString = new String(decodedBytes);
+        // 存储标签内容
+        bpmProcess.setProcessXmlContent(decodedBytes.toString());
         bpmProcess.setCreateTime(DateUtils.getNowDate());
         bpmProcess.setCreateBy(SecurityUtils.getUsername());
         bpmProcess.setProcessVersion(0L);