From 68fd566d21b3efc3a670a5295289b1801f5a4155 Mon Sep 17 00:00:00 2001
From: ludc <ludc@vci-tech.com>
Date: 星期四, 16 一月 2025 18:18:55 +0800
Subject: [PATCH] 流程部署接口上传

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebFlowServiceImpl.java |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebFlowServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebFlowServiceImpl.java
index aa34f8e..34970af 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebFlowServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebFlowServiceImpl.java
@@ -1,20 +1,28 @@
 package com.vci.web.service.impl;
 
+import com.mxgraph.model.mxCell;
+import com.mxgraph.view.mxGraph;
 import com.vci.corba.common.PLException;
 import com.vci.corba.wf.data.ProcessCategoryInfo;
 import com.vci.corba.wf.data.ProcessDefinitionInfo;
+import com.vci.pagemodel.DeployProcessVO;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.BaseQueryObject;
+import com.vci.starter.web.pagemodel.BaseResult;
 import com.vci.starter.web.pagemodel.DataGrid;
 import com.vci.starter.web.util.Lcm.Func;
 import com.vci.starter.web.util.VciBaseUtil;
+import com.vci.web.dao.WebProcessDaoI;
 import com.vci.web.service.WebFlowServiceI;
 import com.vci.web.util.PlatformClientUtil;
+import com.vci.web.util.WebUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.swing.*;
 import java.util.Arrays;
 import java.util.Comparator;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -31,6 +39,9 @@
      */
     @Autowired
     private PlatformClientUtil platformClientUtil;
+
+    @Autowired
+    private WebProcessDaoI webProcessDaoI;
 
     /**
      * 娴佺▼鍒嗙被鍏ㄦ煡璇�
@@ -79,7 +90,12 @@
         if(Func.isBlank(category.parentId)){
             category.parentId = "root";
         }
-
+        long time = new Date().getTime();
+        String userId = WebUtil.getCurrentUserId();
+        category.createTime = time;
+        category.modifyTime = time;
+        category.creator = userId;
+        category.modifer = userId;
         return platformClientUtil.getWFService().saveProcessCategory(category);
     }
 
@@ -95,6 +111,8 @@
             category.parentId = "root";
         }
         this.checkNameExisted(category);
+        category.modifyTime = new Date().getTime();
+        category.modifer = WebUtil.getCurrentUserId();
         return platformClientUtil.getWFService().updateProcessCategory(category);
     }
 
@@ -115,6 +133,47 @@
     }
 
     /**
+     * 閮ㄧ讲娴佺▼
+     * @param deployProcessVO
+     * @return
+     * @throws VciBaseException
+     */
+    @Override
+    public BaseResult deployProcess(DeployProcessVO deployProcessVO) throws Exception {
+        VciBaseUtil.alertNotNull(
+                deployProcessVO,"娴佺▼閮ㄧ讲瀵硅薄",
+                deployProcessVO.getProcessCategoryId(),"娴佺▼鍒嗙被",
+                deployProcessVO.getXmlContext(),"娴佺▼妯℃澘鍐呭"
+        );
+        //鍩虹鏍¢獙
+        /*if(!checkTask()){
+            BaseResult.fail("娴佺▼浠诲姟涓嶈兘閲嶅悕锛岃纭");
+        }
+        if(!checkJoin()){
+            BaseResult.fail("鍚堝苟鑺傜偣涓嶈兘閲嶅悕锛岃纭");
+        }
+        if(!checkFork()){
+            BaseResult.fail("鍒嗘敮鑺傜偣涓嶈兘閲嶅悕锛岃纭");
+        }
+        if(!checkDecision()){
+            BaseResult.fail("鍒ゆ柇鑺傜偣涓嶈兘閲嶅悕锛岃纭");
+        }
+        if(!checkEdge()){
+            BaseResult.fail("璺敱鍚嶇О鍜岃妭鐐瑰悕绉伴噸鍚嶏紝璇风‘璁�");
+        }
+        */
+
+        boolean res = platformClientUtil.getWFService().deployProcess(
+                null,
+                deployProcessVO.getXmlContext(),
+                null,
+                deployProcessVO.getProcessCategoryId(),
+                deployProcessVO.getTaskInfos()
+        );
+        return res ? BaseResult.success("娴佺▼閮ㄧ讲鎴愬姛锛�"):BaseResult.success("娴佺▼閮ㄧ讲澶辫触锛�");
+    }
+
+    /**
      * 鏍规嵁涓婚敭鍜屽悕绉版煡璇㈡祦绋嬪垎绫绘槸鍚﹀瓨鍦�
      * @param category
      * @return

--
Gitblit v1.9.3