Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-22 13:32:40 +08:00
commit 0dc2b4eac3
1 changed files with 25 additions and 0 deletions

View File

@ -22,6 +22,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricProcessInstanceQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -45,6 +51,9 @@ import java.util.Optional;
@RequestMapping("/act/his")
@Api(tags = "流程历史")
public class HistoryController {
@Autowired
protected HistoryService historyService_;
@Autowired
private ActHistoryService historyService;
@Autowired
@ -59,6 +68,13 @@ public class HistoryController {
@Autowired
private TDemandDataService tDemandDataService;
@Autowired
protected TaskService taskService;
@Autowired
protected RepositoryService repositoryService;
@Autowired
protected RuntimeService runtimeService;
@GetMapping("getInstImage")
@ApiOperation(value = "获取流程活动图", produces = "application/octet-stream")
@LogOperation("获取流程活动图")
@ -136,6 +152,15 @@ public class HistoryController {
return new Result().ok(page);
}
@GetMapping("getVariablesByInstanceId")
@ApiOperation("获取已办任务流程参数")
@LogOperation("获取已办任务流程参数")
public Result getVariablesByInstanceId(String instanceId, String variableName) {
HistoricProcessInstanceQuery query = historyService_.createHistoricProcessInstanceQuery();
Optional<HistoricProcessInstance> processInstance = Optional.ofNullable(query.processInstanceId(instanceId).includeProcessVariables().singleResult());
return new Result().ok(processInstance.get().getProcessVariables().get(variableName));
}
@GetMapping("getDeptHandledInstancePage")
@ApiOperation("已办任务:根据登录账号查询其所在部门的已办任务")
@LogOperation("已办任务:根据登录账号查询其所在部门的已办任务")