feat(REQ-2752) - 简单调整 module, 添加 ES 文档模型
This commit is contained in:
parent
f2a4424778
commit
94851ce665
19
pom.xml
19
pom.xml
@ -27,6 +27,8 @@
|
||||
<arthas.version>3.7.1</arthas.version>
|
||||
<apache-maven.version>3.2.5</apache-maven.version>
|
||||
<javaparse.version>3.26.0</javaparse.version>
|
||||
<elasticsearch.version>7.14.0</elasticsearch.version>
|
||||
<easy-es.version>2.0.0-beta7</easy-es.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -121,6 +123,23 @@
|
||||
<artifactId>javaparser-core</artifactId>
|
||||
<version>${javaparse.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>${elasticsearch.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>${elasticsearch.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.easy-es</groupId>
|
||||
<artifactId>easy-es-boot-starter</artifactId>
|
||||
<version>${easy-es.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
@ -13,8 +13,6 @@
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<elasticsearch.version>7.14.0</elasticsearch.version>
|
||||
<easy-es.version>2.0.0-beta7</easy-es.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -22,22 +20,20 @@
|
||||
<groupId>cn.axzo.workflow</groupId>
|
||||
<artifactId>workflow-engine-axzo-ext</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>${elasticsearch.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>${elasticsearch.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.easy-es</groupId>
|
||||
<artifactId>easy-es-boot-starter</artifactId>
|
||||
<version>2.0.0-beta7</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package cn.axzo.workflow.es.mapper;
|
||||
|
||||
import cn.axzo.workflow.es.model.ProcessInstance;
|
||||
import org.dromara.easyes.core.kernel.BaseEsMapper;
|
||||
|
||||
/**
|
||||
* 流程实例的 EsMapper
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2024-09-23 10:52
|
||||
*/
|
||||
public interface ProcessInstanceMapper extends BaseEsMapper<ProcessInstance> {
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package cn.axzo.workflow.es.mapper;
|
||||
|
||||
import cn.axzo.workflow.es.model.ProcessTask;
|
||||
import org.dromara.easyes.core.kernel.BaseEsMapper;
|
||||
|
||||
/**
|
||||
* 流程任务的 EsMapper
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2024-09-23 10:52
|
||||
*/
|
||||
public interface ProcessTaskMapper extends BaseEsMapper<ProcessTask> {
|
||||
}
|
||||
@ -46,6 +46,21 @@ public class ProcessTask {
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 任务状态:审批中/通过/驳回/转交/加签...
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 操作建议
|
||||
*/
|
||||
private String advice;
|
||||
|
||||
/**
|
||||
* 操作描述
|
||||
*/
|
||||
private String operationDesc;
|
||||
|
||||
/**
|
||||
* 流程实例的发起时间
|
||||
*/
|
||||
@ -61,6 +76,11 @@ public class ProcessTask {
|
||||
*/
|
||||
private Long duration;
|
||||
|
||||
/**
|
||||
* 上次操作时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 归属租户,与 processInstance#tenantId 一致
|
||||
*/
|
||||
@ -71,6 +91,19 @@ public class ProcessTask {
|
||||
*/
|
||||
private BpmnTaskDelegateAssigner assigner;
|
||||
|
||||
/**
|
||||
* 审批方式:配置审批人/业务指定/业务触发(不含人)
|
||||
*/
|
||||
private String approvalMethod;
|
||||
|
||||
/**
|
||||
* 节点类型:审批节点/业务节点/评论节点/抄送节点
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 节点模式:会签/或签
|
||||
*/
|
||||
private String nodeMode;
|
||||
|
||||
}
|
||||
|
||||
@ -67,6 +67,10 @@
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>workflow-engine-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>workflow-engine-elasticsearch</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.workflow.server;
|
||||
|
||||
import org.dromara.easyes.starter.register.EsMapperScan;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@ -16,9 +17,10 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
@SpringBootApplication(exclude = RabbitAutoConfiguration.class)
|
||||
@EnableTransactionManagement
|
||||
@EnableCaching
|
||||
public class WorkflowEnginApplication {
|
||||
@EsMapperScan("cn.axzo.workflow.es.mapper")
|
||||
public class WorkflowEngineApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WorkflowEnginApplication.class, args);
|
||||
SpringApplication.run(WorkflowEngineApplication.class, args);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.axzo.workflow.server.controller.es;
|
||||
|
||||
import cn.axzo.workflow.es.mapper.ProcessInstanceMapper;
|
||||
import cn.axzo.workflow.es.mapper.ProcessTaskMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* ES 相关操作
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2024-09-26 14:47
|
||||
*/
|
||||
@Slf4j
|
||||
@RequestMapping("/web/v1/api/es")
|
||||
@RestController
|
||||
@Validated
|
||||
public class EsIndexController {
|
||||
|
||||
@Resource
|
||||
public ProcessInstanceMapper processInstanceMapper;
|
||||
|
||||
@Resource
|
||||
private ProcessTaskMapper processTaskMapper;
|
||||
|
||||
@GetMapping("/index/create")
|
||||
public void init() {
|
||||
processInstanceMapper.createIndex();
|
||||
processTaskMapper.createIndex();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user