Browse Source

单位子流程 发布

tags/24080901
PoffyZhang 1 year ago
parent
commit
dff3315ef1
6 changed files with 133 additions and 18 deletions
  1. +1
    -14
      pmapi/pom.xml
  2. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java
  3. +4
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java
  4. +23
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java
  5. +79
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java
  6. +26
    -0
      pom.xml

+ 1
- 14
pmapi/pom.xml View File

@@ -187,10 +187,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<!-- <exclusion>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </exclusion>-->
</exclusions>
</dependency>
<dependency>
@@ -203,10 +199,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-flowable-starter</artifactId>
</dependency>

<dependency>
<groupId>com.ningdatech</groupId>
@@ -235,12 +227,10 @@
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-cache-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-basic</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.kingbase.dialect</groupId>
@@ -251,17 +241,14 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-file-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-zwdd-starter</artifactId>
<version>1.0.0</version>
<artifactId>nd-flowable-starter</artifactId>
</dependency>
</dependencies>
<!-- 打包 -->


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java View File

@@ -49,5 +49,4 @@ public class DeclaredProjectController {
String instanceId = processService.startProcess(defId, params);
return "启动流程实例 " + instanceId + " 成功";
}

}

+ 4
- 3
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java View File

@@ -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);
}
}

+ 23
- 0
pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java View File

@@ -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<T> 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<Node<?>> branchs;
}

+ 79
- 0
pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java View File

@@ -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<Node> 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<Node> getSubNode() {
return subNode;
}

public void setSubNode(List<Node> subNode) {
this.subNode = subNode;
}
}
}

+ 26
- 0
pom.xml View File

@@ -123,6 +123,32 @@
<artifactId>kingbase8-8.2.0</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-file-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-zwdd-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-cache-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-log-starter</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>



Loading…
Cancel
Save