houzhongjian
2024-11-07 a874b928e16320839315b9abcdf2cece1229a424
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
package com.iailab.module.bpm.service.task;
 
import com.iailab.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO;
import com.iailab.module.bpm.convert.task.BpmActivityConvert;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.HistoryService;
import org.flowable.engine.history.HistoricActivityInstance;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
 
import javax.annotation.Resource;
import java.util.List;
 
 
/**
 * BPM 活动实例 Service 实现类
 *
 * @author iailab
 */
@Service
@Slf4j
@Validated
public class BpmActivityServiceImpl implements BpmActivityService {
 
    @Resource
    private HistoryService historyService;
 
    @Override
    public List<BpmActivityRespVO> getActivityListByProcessInstanceId(String processInstanceId) {
        List<HistoricActivityInstance> activityList = historyService.createHistoricActivityInstanceQuery()
                .processInstanceId(processInstanceId).list();
        return BpmActivityConvert.INSTANCE.convertList(activityList);
    }
 
    @Override
    public List<HistoricActivityInstance> getHistoricActivityListByExecutionId(String executionId) {
        return historyService.createHistoricActivityInstanceQuery().executionId(executionId).list();
    }
 
}