From dff3315ef1f10138252525348a6f1abe360046fd Mon Sep 17 00:00:00 2001
From: PoffyZhang <99775271@qq.com>
Date: Sat, 4 Feb 2023 22:52:27 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=AD=90=E6=B5=81=E7=A8=8B?=
=?UTF-8?q?=20=E5=8F=91=E5=B8=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pmapi/pom.xml | 15 +---
.../controller/DeclaredProjectController.java | 1 -
.../pmapi/sys/controller/SysProcdefController.java | 7 +-
.../com/ningdatech/pmapi/sys/processDef/Node.java | 23 +++++++
.../pmapi/sys/processDef/ProcessDefTest.java | 79 ++++++++++++++++++++++
pom.xml | 26 +++++++
6 files changed, 133 insertions(+), 18 deletions(-)
create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java
create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java
diff --git a/pmapi/pom.xml b/pmapi/pom.xml
index 3748d36..27b7fc7 100644
--- a/pmapi/pom.xml
+++ b/pmapi/pom.xml
@@ -187,10 +187,6 @@
org.slf4j
slf4j-log4j12
-
-
-
-
@@ -203,10 +199,6 @@
-
- com.ningdatech
- nd-flowable-starter
-
com.ningdatech
@@ -235,12 +227,10 @@
com.ningdatech
nd-cache-starter
- 1.0.0
com.ningdatech
nd-basic
- 1.0.0
com.kingbase.dialect
@@ -251,17 +241,14 @@
com.alibaba
easyexcel-core
- 3.1.2
com.ningdatech
nd-file-starter
- 1.0.0
com.ningdatech
- nd-zwdd-starter
- 1.0.0
+ nd-flowable-starter
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java
index cabc31e..6984acb 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java
@@ -49,5 +49,4 @@ public class DeclaredProjectController {
String instanceId = processService.startProcess(defId, params);
return "启动流程实例 " + instanceId + " 成功";
}
-
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java
index 6e93851..7d11e1f 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java
@@ -50,16 +50,17 @@ public class SysProcdefController {
return processModelService.saveProcess(modelHistory);
}
+ @ApiOperation(value = "系统流程配置启用(停用)", notes = "系统流程配置启用(停用)")
@PutMapping("/{formId}/active/{state}")
- public Object enOrDisModel(@PathVariable String formId,
+ public String enOrDisModel(@PathVariable String formId,
@PathVariable Boolean state) {
modelGroupService.enOrDisModel(formId, !state);
- return R.ok(Boolean.TRUE.equals(state) ? "启用流程成功":"停用流程成功");
+ return Boolean.TRUE.equals(state) ? "启用流程成功":"停用流程成功";
}
@ApiOperation(value = "系统流程配置发布", notes = "系统流程配置发布")
@PostMapping("/deploy/{formId}")
- public String save(@Validated @PathVariable String formId) {
+ public String deploy(@Validated @PathVariable String formId) {
return processModelService.deployProcess(formId);
}
}
diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java
new file mode 100644
index 0000000..2f74135
--- /dev/null
+++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java
@@ -0,0 +1,23 @@
+package com.ningdatech.pmapi.sys.processDef;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class Node implements Serializable {
+ private static final long serialVersionUID = -45475579271153023L;
+
+ private String id;
+
+ private String parentId;
+
+ private String name;
+
+ private T props;
+
+ private Node> children;
+
+ private List> branchs;
+}
\ No newline at end of file
diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java
new file mode 100644
index 0000000..8c47dd8
--- /dev/null
+++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java
@@ -0,0 +1,79 @@
+package com.ningdatech.pmapi.sys.processDef;
+
+import com.alibaba.fastjson.JSON;
+import org.junit.Test;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Classname ProcessTest
+ * @Description
+ * @Date 2023/2/4 9:54
+ * @Author PoffyZhang
+ */
+public class ProcessDefTest {
+
+
+ @Test
+ public void test() {
+ String processStr = "{\"id\":\"node_039152532706\",\"name\":\"审批单位\",\"type\":\"ORG\",\"props\":{\"regionCode\":\"\",\"orgCode\":\"GO_3bc86256687a4884ae410af00682b762\",\"type\":\"DEFAULT\",\"processDefId\":\"\",\"subNode\":[]},\"children\":{},\"parentId\":\"root\"}";
+
+ Node node = JSON.parseObject(processStr, Node.class);
+
+ OrgProps props = JSON.parseObject(node.getProps().toString(), OrgProps.class);
+ System.out.println(props.getOrgCode());
+ }
+
+ public static class OrgProps {
+ private String regionCode;
+
+ private String orgCode;
+
+ private String type;
+
+ private String processDefId;
+
+ private List subNode;
+
+ public String getRegionCode() {
+ return regionCode;
+ }
+
+ public void setRegionCode(String regionCode) {
+ this.regionCode = regionCode;
+ }
+
+ public String getOrgCode() {
+ return orgCode;
+ }
+
+ public void setOrgCode(String orgCode) {
+ this.orgCode = orgCode;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getProcessDefId() {
+ return processDefId;
+ }
+
+ public void setProcessDefId(String processDefId) {
+ this.processDefId = processDefId;
+ }
+
+ public List getSubNode() {
+ return subNode;
+ }
+
+ public void setSubNode(List subNode) {
+ this.subNode = subNode;
+ }
+ }
+}
diff --git a/pom.xml b/pom.xml
index bd757f0..beccbd0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,6 +123,32 @@
kingbase8-8.2.0
1.0
+
+
+ com.alibaba
+ easyexcel-core
+ 3.1.2
+
+
+ com.ningdatech
+ nd-file-starter
+ 1.0.0
+
+
+ com.ningdatech
+ nd-zwdd-starter
+ 1.0.0
+
+
+ com.ningdatech
+ nd-cache-starter
+ 1.0.0
+
+
+ com.ningdatech
+ nd-log-starter
+ 1.0.0
+