Skip to content

Commit 5cbdc3e

Browse files
committed
add FlowDetail.java opinions
1 parent c95de12 commit 5cbdc3e

File tree

13 files changed

+78
-18
lines changed

13 files changed

+78
-18
lines changed

example/example-application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.2.1.dev</version>
8+
<version>3.3.2.2.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-domain/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.2.1.dev</version>
8+
<version>3.3.2.2.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.2.1.dev</version>
8+
<version>3.3.2.2.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-jpa/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.2.1.dev</version>
8+
<version>3.3.2.2.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.2.1.dev</version>
8+
<version>3.3.2.2.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<parent>
1414
<groupId>com.codingapi.springboot</groupId>
1515
<artifactId>springboot-parent</artifactId>
16-
<version>3.3.2.1.dev</version>
16+
<version>3.3.2.2.dev</version>
1717
</parent>
1818

1919
<artifactId>springboot-example</artifactId>
20-
<version>3.3.2.1.dev</version>
20+
<version>3.3.2.2.dev</version>
2121

2222
<name>springboot-example</name>
2323
<description>springboot-example project for Spring Boot</description>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.codingapi.springboot</groupId>
1414
<artifactId>springboot-parent</artifactId>
15-
<version>3.3.2.1.dev</version>
15+
<version>3.3.2.2.dev</version>
1616

1717
<url>https://github.com/codingapi/springboot-framewrok</url>
1818
<name>springboot-parent</name>

springboot-starter-data-fast/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.2.1.dev</version>
8+
<version>3.3.2.2.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-flow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>3.3.2.1.dev</version>
9+
<version>3.3.2.2.dev</version>
1010
</parent>
1111

1212
<name>springboot-starter-flow</name>

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/pojo/FlowDetail.java

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.codingapi.springboot.flow.bind.IBindData;
55
import com.codingapi.springboot.flow.domain.FlowNode;
66
import com.codingapi.springboot.flow.domain.FlowWork;
7+
import com.codingapi.springboot.flow.domain.Opinion;
78
import com.codingapi.springboot.flow.record.FlowRecord;
89
import com.codingapi.springboot.flow.user.IFlowOperator;
910
import lombok.Getter;
@@ -12,30 +13,85 @@
1213

1314

1415
/**
15-
* 流程详情的阻止对象
16+
* 流程详情的阻止对象
1617
*/
1718
@Getter
1819
public class FlowDetail {
1920

21+
/**
22+
* 当前流程
23+
*/
2024
private final FlowRecord flowRecord;
25+
/**
26+
* 流程设计器
27+
*/
2128
private final FlowWork flowWork;
29+
/**
30+
* 流程节点
31+
*/
2232
private final FlowNode flowNode;
33+
/**
34+
* 历史流程
35+
*/
2336
private final List<FlowRecord> historyRecords;
24-
private final BindDataSnapshot snapshot;
37+
/**
38+
* 绑定数据
39+
*/
2540
private final IBindData bindData;
41+
/**
42+
* 全部的操作人
43+
*/
2644
private final List<? extends IFlowOperator> operators;
2745

46+
/**
47+
* 创建者
48+
*/
49+
private final IFlowOperator flowCreator;
50+
51+
/**
52+
* 创建时间
53+
*/
54+
private final long flowCreateTime;
55+
56+
/**
57+
* 流程的意见
58+
*/
59+
private final List<FlowOpinion> opinions;
60+
61+
2862
public FlowDetail(FlowRecord flowRecord,
2963
BindDataSnapshot snapshot,
3064
FlowWork flowWork,
3165
List<FlowRecord> historyRecords,
32-
List<? extends IFlowOperator> operators) {
66+
List<? extends IFlowOperator> operators) {
3367
this.operators = operators;
3468
this.flowRecord = flowRecord;
35-
this.snapshot = snapshot;
3669
this.flowWork = flowWork;
3770
this.bindData = snapshot.toBindData();
38-
this.historyRecords = historyRecords;
71+
this.historyRecords = historyRecords.
72+
stream().
73+
sorted((o1, o2) -> (int) (o1.getCreateTime() - o2.getCreateTime()))
74+
.toList();
75+
this.opinions = historyRecords.stream().map(FlowOpinion::new).toList();
76+
this.flowCreator = operators.stream().filter(o -> o.getUserId() == flowRecord.getCreateOperatorId()).findFirst().orElse(null);
77+
this.flowCreateTime = flowRecord.getCreateTime();
3978
this.flowNode = flowWork.getNodeByCode(flowRecord.getNodeCode());
4079
}
80+
81+
82+
@Getter
83+
public final class FlowOpinion {
84+
private final long recordId;
85+
private final Opinion opinion;
86+
private final IFlowOperator operator;
87+
private final long createTime;
88+
89+
public FlowOpinion(FlowRecord flowRecord) {
90+
this.recordId = flowRecord.getId();
91+
this.opinion = flowRecord.getOpinion();
92+
this.operator = operators.stream().filter(o -> o.getUserId() == flowRecord.getCurrentOperatorId()).findFirst().orElse(null);
93+
this.createTime = flowRecord.getUpdateTime();
94+
}
95+
}
96+
4197
}

0 commit comments

Comments
 (0)