mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 17:03:39 +08:00
Merge branch 'master' of github.com:/hs-web/hsweb-framework
# Conflicts: # hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/test/java/org/hswebframework/web/workflow/flowable/TestApplication.java
This commit is contained in:
@@ -95,7 +95,16 @@
|
||||
<artifactId>hsweb-system-authorization-service-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-datasource-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
@@ -118,6 +127,20 @@
|
||||
<version>4.3.7.RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-spring-boot-starter</artifactId>
|
||||
@@ -141,5 +164,20 @@
|
||||
<artifactId>hsweb-system-dynamic-form-service-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-authorization-basic</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-access-logging-aop</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-organizational-starter</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.hswebframework.web.workflow.flowable.controller;
|
||||
|
||||
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||
import org.hswebframework.web.commons.entity.DataStatus;
|
||||
import org.hswebframework.web.controller.message.ResponseMessage;
|
||||
import org.hswebframework.web.entity.organizational.RelationDefineEntity;
|
||||
import org.hswebframework.web.entity.organizational.SimpleRelationDefineEntity;
|
||||
import org.hswebframework.web.service.organizational.RelationDefineService;
|
||||
import org.hswebframework.web.service.organizational.RelationInfoService;
|
||||
import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author wangwei
|
||||
* @Date 2017/9/4.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("workflow/utils/")
|
||||
public class FlowableUtilsController {
|
||||
|
||||
@Autowired
|
||||
BpmActivityService bpmActivityService;
|
||||
@Autowired
|
||||
RelationDefineService relationDefineService;
|
||||
@Autowired
|
||||
RelationInfoService relationInfoService;
|
||||
|
||||
@GetMapping("{procDefId}/acts")
|
||||
public ResponseMessage<Map<String, Object>> acts(@PathVariable String procDefId){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<ActivityImpl> activities = bpmActivityService.getActivitiesById(procDefId,null);
|
||||
for (ActivityImpl activity: activities) {
|
||||
if(activity.getProperty("type").equals("userTask")) map.put(activity.getId(), activity.getProperty("name"));
|
||||
}
|
||||
return ResponseMessage.ok(map);
|
||||
}
|
||||
|
||||
@GetMapping("relation-define")
|
||||
public ResponseMessage<List<RelationDefineEntity>> getRelationDefines(){
|
||||
SimpleRelationDefineEntity entity = new SimpleRelationDefineEntity();
|
||||
entity.setStatus(DataStatus.STATUS_ENABLED);
|
||||
List<RelationDefineEntity> list = relationDefineService.select(entity);
|
||||
|
||||
return ResponseMessage.ok(list);
|
||||
}
|
||||
|
||||
// @PostMapping("act/{actId}-{defineId}")
|
||||
// public ResponseMessage
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.hswebframework.web.workflow.flowable.entity;
|
||||
|
||||
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||
import org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl;
|
||||
|
||||
/**
|
||||
* @Author wangwei
|
||||
* @Date 2017/9/4.
|
||||
*/
|
||||
public class SimpleActivityImp extends ActivityImpl {
|
||||
|
||||
public SimpleActivityImp(String id, ProcessDefinitionImpl processDefinition) {
|
||||
super(id, processDefinition);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
spring:
|
||||
aop:
|
||||
auto: true
|
||||
proxy-target-class: true
|
||||
# datasource:
|
||||
# url : jdbc:h2:file:target/workflow-test
|
||||
# username : sa
|
||||
# password :
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name : org.h2.Driver
|
||||
datasource:
|
||||
url : jdbc:mysql://localhost:3306/hsweb?useSSL=false&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
|
||||
username : root
|
||||
password : root
|
||||
driver-class-name : com.mysql.jdbc.Driver
|
||||
cache:
|
||||
type: simple
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.flowable: debug
|
||||
# org.activiti: debug
|
||||
mybatis:
|
||||
dynamic-datasource: false
|
||||
mapper-locations: classpath*:org/hswebframework/web/workflow/**/*Mapper.xml
|
||||
server:
|
||||
port: 8080
|
||||
@@ -55,15 +55,15 @@ public class ControllerTest extends SimpleWebApplicationTests {
|
||||
}
|
||||
|
||||
// 流程图元数据test
|
||||
@Test
|
||||
public void activityImplTest() {
|
||||
ActivityImpl activity = bpmTaskService.selectActivityImplByTask("");
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testid").latestVersion().active().singleResult();
|
||||
Map<String, List<String>> map = bpmActivityService.getNextClaim(processDefinition.getId(), activity.getId());
|
||||
System.out.println("=========>>>");
|
||||
System.out.println(JSON.toJSONString(map));
|
||||
System.out.println("=========>>>");
|
||||
}
|
||||
// @Test
|
||||
// public void activityImplTest() {
|
||||
// ActivityImpl activity = bpmTaskService.selectActivityImplByTask("");
|
||||
// ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testid").latestVersion().active().singleResult();
|
||||
// Map<String, List<String>> map = bpmActivityService.getNextClaim(processDefinition.getId(), activity.getId());
|
||||
// System.out.println("=========>>>");
|
||||
// System.out.println(JSON.toJSONString(map));
|
||||
// System.out.println("=========>>>");
|
||||
// }
|
||||
|
||||
// 流程流转test
|
||||
@Test
|
||||
@@ -113,18 +113,18 @@ public class ControllerTest extends SimpleWebApplicationTests {
|
||||
|
||||
}
|
||||
|
||||
@Autowired
|
||||
RepositoryService repositoryService;
|
||||
|
||||
@Test
|
||||
public void task() {
|
||||
ActivityImpl activity = bpmTaskService.selectActivityImplByTask("");
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testid").orderByProcessDefinitionVersion().desc().singleResult();
|
||||
Map<String, List<String>> map = bpmActivityService.getNextClaim(processDefinition.getId(), activity.getId());
|
||||
System.out.println("=========>>>");
|
||||
System.out.println(JSON.toJSONString(map));
|
||||
System.out.println("=========>>>");
|
||||
}
|
||||
// @Autowired
|
||||
// RepositoryService repositoryService;
|
||||
//
|
||||
// @Test
|
||||
// public void task() {
|
||||
// ActivityImpl activity = bpmTaskService.selectActivityImplByTask("");
|
||||
// ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testid").orderByProcessDefinitionVersion().desc().singleResult();
|
||||
// Map<String, List<String>> map = bpmActivityService.getNextClaim(processDefinition.getId(), activity.getId());
|
||||
// System.out.println("=========>>>");
|
||||
// System.out.println(JSON.toJSONString(map));
|
||||
// System.out.println("=========>>>");
|
||||
// }
|
||||
|
||||
@Configuration
|
||||
public static class config {
|
||||
@@ -137,6 +137,7 @@ public class ControllerTest extends SimpleWebApplicationTests {
|
||||
configuration
|
||||
.setAsyncExecutorActivate(false)
|
||||
.setJobExecutorActivate(false)
|
||||
.setDatabaseSchemaUpdate("false")
|
||||
.setActivityFontName("宋体")
|
||||
.setLabelFontName("宋体")
|
||||
.setAnnotationFontName("宋体");
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
spring:
|
||||
aop:
|
||||
auto: true
|
||||
proxy-target-class: true
|
||||
datasource:
|
||||
url : jdbc:mysql://localhost:3306/hsweb?useSSL=false&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
|
||||
username : root
|
||||
password : root
|
||||
driver-class-name : com.mysql.jdbc.Driver
|
||||
datasource:
|
||||
url : jdbc:h2:file:./target/workflow-test
|
||||
username : sa
|
||||
password :
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
cache:
|
||||
type: simple
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.flowable: debug
|
||||
# org.activiti: debug
|
||||
mybatis:
|
||||
dynamic-datasource: false
|
||||
server:
|
||||
port: 8088
|
||||
Reference in New Issue
Block a user