use of io.choerodon.agile.api.vo.StateMachineSchemeVO in project agile-service by open-hand.
the class ConvertUtils method convertStateMachineSchemeToVO.
public static StateMachineSchemeVO convertStateMachineSchemeToVO(final StateMachineSchemeDTO scheme, final Map<Long, ProjectVO> projectMap) {
ModelMapper modelMapper = new ModelMapper();
StateMachineSchemeVO schemeVO = modelMapper.map(scheme, StateMachineSchemeVO.class);
List<StatusMachineSchemeConfigDTO> schemeConfigs = scheme.getSchemeConfigs();
if (null != schemeConfigs && !schemeConfigs.isEmpty()) {
List<StatusMachineSchemeConfigVO> schemeConfigVOS = modelMapper.map(schemeConfigs, new TypeToken<List<StatusMachineSchemeConfigVO>>() {
}.getType());
schemeVO.setConfigVOS(schemeConfigVOS);
}
List<ProjectConfigDTO> projectConfigs = scheme.getProjectConfigs();
if (null != projectConfigs && !projectConfigs.isEmpty()) {
List<ProjectVO> projectVOS = new ArrayList<>(projectConfigs.size());
for (ProjectConfigDTO config : projectConfigs) {
ProjectVO projectVO = projectMap.get(config.getProjectId());
if (projectVO != null) {
projectVOS.add(projectVO);
}
}
schemeVO.setProjectVOS(projectVOS);
}
return schemeVO;
}
use of io.choerodon.agile.api.vo.StateMachineSchemeVO in project agile-service by open-hand.
the class StateMachineSchemeController method pagingQuery.
@Permission(level = ResourceLevel.ORGANIZATION)
@ApiOperation(value = "查询状态机方案列表")
@CustomPageRequest
@GetMapping
public ResponseEntity<Page<StateMachineSchemeVO>> pagingQuery(@ApiIgnore @SortDefault(value = "id", direction = Sort.Direction.DESC) PageRequest pageRequest, @ApiParam(value = "组织id", required = true) @PathVariable("organization_id") Long organizationId, @ApiParam(value = "名称") @RequestParam(required = false) String name, @ApiParam(value = "描述") @RequestParam(required = false) String description, @ApiParam(value = "模糊查询参数") @RequestParam(required = false) String[] param) {
StateMachineSchemeVO schemeDTO = new StateMachineSchemeVO();
schemeDTO.setOrganizationId(organizationId);
schemeDTO.setName(name);
schemeDTO.setDescription(description);
return new ResponseEntity<>(schemeService.pageQuery(organizationId, pageRequest, schemeDTO, ParamUtils.arrToStr(param)), HttpStatus.OK);
}
use of io.choerodon.agile.api.vo.StateMachineSchemeVO in project agile-service by open-hand.
the class ConvertUtils method convertStateMachineSchemesToVOS.
public static List<StateMachineSchemeVO> convertStateMachineSchemesToVOS(final List<StateMachineSchemeDTO> schemes, final Map<Long, ProjectVO> projectMap) {
List<StateMachineSchemeVO> list = new ArrayList<>(schemes.size());
for (StateMachineSchemeDTO scheme : schemes) {
StateMachineSchemeVO schemeVO = convertStateMachineSchemeToVO(scheme, projectMap);
list.add(schemeVO);
}
return list;
}
Aggregations