baoshiwei
2025-03-12 f1208474f771a1c233d7425c8ed13fbaa0d521ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
package org.dromara.workflow.domain.vo;
 
import lombok.Data;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.warm.flow.core.enums.CooperateType;
import org.dromara.workflow.common.constant.FlowConstant;
 
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
 
/**
 * 历史任务视图
 *
 * @author may
 */
@Data
public class FlowHisTaskVo implements Serializable {
 
    @Serial
    private static final long serialVersionUID = 1L;
 
    private Long id;
 
    /**
     * 创建时间
     */
    private Date createTime;
 
    /**
     * 更新时间
     */
    private Date updateTime;
 
    /**
     * 租户ID
     */
    private String tenantId;
 
    /**
     * 删除标记
     */
    private String delFlag;
 
    /**
     * 对应flow_definition表的id
     */
    private Long definitionId;
 
    /**
     * 流程定义名称
     */
    private String flowName;
 
    /**
     * 流程实例表id
     */
    private Long instanceId;
 
    /**
     * 任务表id
     */
    private Long taskId;
 
    /**
     * 协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)
     */
    private Integer cooperateType;
 
    /**
     * 协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)
     */
    private String cooperateTypeName;
 
    /**
     * 业务id
     */
    private String businessId;
 
    /**
     * 开始节点编码
     */
    private String nodeCode;
 
    /**
     * 开始节点名称
     */
    private String nodeName;
 
    /**
     * 开始节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)
     */
    private Integer nodeType;
 
    /**
     * 目标节点编码
     */
    private String targetNodeCode;
 
    /**
     * 结束节点名称
     */
    private String targetNodeName;
 
    /**
     * 审批者
     */
    private String approver;
 
    /**
     * 审批者
     */
    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "approver")
    private String approveName;
 
    /**
     * 协作人(只有转办、会签、票签、委派)
     */
    private String collaborator;
 
    /**
     * 权限标识 permissionFlag的list形式
     */
    private List<String> permissionList;
 
    /**
     * 跳转类型(PASS通过 REJECT退回 NONE无动作)
     */
    private String skipType;
 
    /**
     * 流程状态
     */
    private String flowStatus;
 
    /**
     * 任务状态
     */
    private String flowTaskStatus;
 
    /**
     * 流程状态
     */
    private String flowStatusName;
 
    /**
     * 审批意见
     */
    private String message;
 
    /**
     * 业务详情 存业务类的json
     */
    private String ext;
 
    /**
     * 创建者
     */
    private String createBy;
 
    /**
     * 申请人
     */
    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy")
    private String createByName;
 
    /**
     * 流程分类id
     */
    private String category;
 
    /**
     * 流程分类名称
     */
    @Translation(type = FlowConstant.CATEGORY_ID_TO_NAME, mapper = "category")
    private String categoryName;
 
    /**
     * 审批表单是否自定义(Y是 N否)
     */
    private String formCustom;
 
    /**
     * 审批表单路径
     */
    private String formPath;
 
    /**
     * 流程定义编码
     */
    private String flowCode;
 
    /**
     * 流程版本号
     */
    private String version;
 
    /**
     * 运行时长
     */
    private String runDuration;
 
    /**
     * 设置创建时间并计算任务运行时长
     *
     * @param createTime 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
        updateRunDuration();
    }
 
    /**
     * 设置更新时间并计算任务运行时长
     *
     * @param updateTime 更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        updateRunDuration();
    }
 
    /**
     * 更新运行时长
     */
    private void updateRunDuration() {
        // 如果创建时间和更新时间均不为空,计算它们之间的时长
        if (this.updateTime != null && this.createTime != null) {
            this.runDuration = DateUtils.getTimeDifference(this.updateTime, this.createTime);
        }
    }
 
    /**
     * 设置协作方式,并通过协作方式获取名称
     */
    public void setCooperateType(Integer cooperateType) {
        this.cooperateType = cooperateType;
        this.cooperateTypeName = CooperateType.getValueByKey(cooperateType);
    }
 
}