zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
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
package org.jeecg.common.base.vo;
 
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.activiti.engine.history.HistoricTaskInstance;
import org.jeecg.common.base.entity.ActivitiConstant;
import org.jeecg.common.base.entity.Assignee;
 
import java.util.Date;
import java.util.List;
import java.util.Map;
 
/**
 * @author pmc
 */
@Data
public class HistoricTaskVo {
 
    private String id;
 
    private String name;
 
    private String key;
 
    private String description;
 
    private String executionId;
 
    private String assignee;
 
    private String owner;
 
    private String procDefId;
 
    private String procInstId;
 
    private String applyer;
 
    private String category;
 
    private Integer priority;
 
    private String deleteReason;
 
    private String comment;
 
    private Long duration;
 
    private Long workTime;
 
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
 
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
 
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
 
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date dueTime;
 
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;
 
    private String processName;
 
    private String routeName;
 
    private String businessKey;
 
    private String tableId;
    private String tableName;
 
    private List<Assignee> assignees;
    private String title;
    private Integer status;
    private Integer result;
    private Map dataMap;
 
    public HistoricTaskVo(HistoricTaskInstance task){
        this.id = task.getId();
        this.name = task.getName();
        this.key = task.getTaskDefinitionKey();
        this.description = task.getDescription();
        this.executionId = task.getExecutionId();
        this.assignee = task.getAssignee();
        this.owner = task.getOwner();
        this.procDefId = task.getProcessDefinitionId();
        this.procInstId = task.getProcessInstanceId();
        this.priority = task.getPriority();
        this.category = task.getCategory();
        this.deleteReason = getMyDeleteReason(task.getDeleteReason());
        this.duration = task.getDurationInMillis();
        this.workTime = task.getWorkTimeInMillis();
        this.createTime = task.getCreateTime();
        this.startTime = task.getStartTime();
        this.endTime = task.getEndTime();
        this.dueTime = task.getDueDate();
    }
 
    public String getMyDeleteReason(String deleteReason){
 
        if(StrUtil.isBlank(deleteReason)){
            return "";
        }
        if(ActivitiConstant.PASSED_FLAG.equals(deleteReason)){
            deleteReason = "审批通过";
        }else if(ActivitiConstant.BACKED_FLAG.equals(deleteReason)){
            deleteReason = "审批驳回";
        }else if(deleteReason.contains(ActivitiConstant.DELETE_PRE)){
            String reason = "";
            if(ActivitiConstant.DELETE_PRE.equals(deleteReason)){
                reason = "未填写";
            }else if(deleteReason.length()>8){
                reason = deleteReason.substring(8);
            }
            deleteReason = "删除撤回-原因"+reason;
        }else if(deleteReason.contains(ActivitiConstant.CANCEL_PRE)){
            String reason = "";
            if(ActivitiConstant.CANCEL_PRE.equals(deleteReason)){
                reason = "未填写";
            }else if(deleteReason.length()>9){
                reason = deleteReason.substring(9);
            }
            deleteReason = "发起人撤回-原因"+reason;
        }else{
            deleteReason="已删除-原因"+deleteReason;
        }
        return deleteReason;
    }
}