use of com.ruoyi.workflow.domain.vo.WfDefinitionVo in project RuoYi-Flowable-Plus by KonBAI-Q.
the class WfDefinitionServiceImpl method publishList.
@Override
public TableDataInfo<WfDefinitionVo> publishList(String processKey, PageQuery pageQuery) {
Page<WfDefinitionVo> page = new Page<>();
// 创建查询条件
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(processKey).orderByProcessDefinitionVersion().asc();
long pageTotal = processDefinitionQuery.count();
if (pageTotal <= 0) {
return TableDataInfo.build();
}
// 根据查询条件,查询所有版本
int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(offset, pageQuery.getPageSize());
List<WfDefinitionVo> definitionVoList = processDefinitionList.stream().map(item -> {
WfDefinitionVo vo = new WfDefinitionVo();
vo.setDefinitionId(item.getId());
vo.setProcessKey(item.getKey());
vo.setProcessName(item.getName());
vo.setVersion(item.getVersion());
vo.setCategory(item.getCategory());
vo.setDeploymentId(item.getDeploymentId());
vo.setSuspended(item.isSuspended());
// BeanUtil.copyProperties(item, vo);
return vo;
}).collect(Collectors.toList());
page.setRecords(definitionVoList);
page.setTotal(pageTotal);
return TableDataInfo.build(page);
}
use of com.ruoyi.workflow.domain.vo.WfDefinitionVo in project RuoYi-Flowable-Plus by KonBAI-Q.
the class WfProcessServiceImpl method processList.
/**
* 流程定义列表
*
* @param pageQuery 分页参数
* @return 流程定义分页列表数据
*/
@Override
public TableDataInfo<WfDefinitionVo> processList(PageQuery pageQuery) {
Page<WfDefinitionVo> page = new Page<>();
// 流程定义列表数据查询
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().latestVersion().active().orderByProcessDefinitionKey().asc();
long pageTotal = processDefinitionQuery.count();
if (pageTotal <= 0) {
return TableDataInfo.build();
}
int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
List<ProcessDefinition> definitionList = processDefinitionQuery.listPage(offset, pageQuery.getPageSize());
List<WfDefinitionVo> definitionVoList = new ArrayList<>();
for (ProcessDefinition processDefinition : definitionList) {
String deploymentId = processDefinition.getDeploymentId();
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
WfDefinitionVo vo = new WfDefinitionVo();
vo.setDefinitionId(processDefinition.getId());
vo.setProcessKey(processDefinition.getKey());
vo.setProcessName(processDefinition.getName());
vo.setVersion(processDefinition.getVersion());
vo.setCategory(processDefinition.getCategory());
vo.setDeploymentId(processDefinition.getDeploymentId());
vo.setSuspended(processDefinition.isSuspended());
// 流程定义时间
vo.setCategory(deployment.getCategory());
vo.setDeploymentTime(deployment.getDeploymentTime());
definitionVoList.add(vo);
}
page.setRecords(definitionVoList);
page.setTotal(pageTotal);
return TableDataInfo.build(page);
}
use of com.ruoyi.workflow.domain.vo.WfDefinitionVo in project RuoYi-Flowable-Plus by KonBAI-Q.
the class WfDefinitionServiceImpl method list.
/**
* 流程定义列表
*
* @param pageQuery 分页参数
* @return 流程定义分页列表数据
*/
@Override
public TableDataInfo<WfDefinitionVo> list(PageQuery pageQuery) {
Page<WfDefinitionVo> page = new Page<>();
// 流程定义列表数据查询
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().latestVersion().orderByProcessDefinitionKey().asc();
long pageTotal = processDefinitionQuery.count();
if (pageTotal <= 0) {
return TableDataInfo.build();
}
int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
List<ProcessDefinition> definitionList = processDefinitionQuery.listPage(offset, pageQuery.getPageSize());
List<WfDefinitionVo> definitionVoList = new ArrayList<>();
for (ProcessDefinition processDefinition : definitionList) {
String deploymentId = processDefinition.getDeploymentId();
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
WfDefinitionVo vo = new WfDefinitionVo();
vo.setDefinitionId(processDefinition.getId());
vo.setProcessKey(processDefinition.getKey());
vo.setProcessName(processDefinition.getName());
vo.setVersion(processDefinition.getVersion());
vo.setCategory(processDefinition.getCategory());
vo.setDeploymentId(processDefinition.getDeploymentId());
vo.setSuspended(processDefinition.isSuspended());
WfFormVo formVo = deployFormService.selectDeployFormByDeployId(deploymentId);
if (Objects.nonNull(formVo)) {
vo.setFormId(formVo.getFormId());
vo.setFormName(formVo.getFormName());
}
// 流程定义时间
vo.setCategory(deployment.getCategory());
vo.setDeploymentTime(deployment.getDeploymentTime());
definitionVoList.add(vo);
}
page.setRecords(definitionVoList);
page.setTotal(pageTotal);
return TableDataInfo.build(page);
}
Aggregations