org.modelmapper.TypeToken Java Examples
The following examples show how to use
org.modelmapper.TypeToken.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StateMachineServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public PageInfo<StateMachineListVO> pageQuery(Long organizationId, PageRequest pageRequest, String name, String description, String param) { StateMachineDTO stateMachine = new StateMachineDTO(); stateMachine.setName(name); stateMachine.setDescription(description); stateMachine.setOrganizationId(organizationId); PageInfo<StateMachineDTO> page = PageHelper.startPage(pageRequest.getPage(), pageRequest.getSize(), PageUtil.sortToSql(pageRequest.getSort())).doSelectPageInfo( () -> stateMachineMapper.fulltextSearch(stateMachine, param)); List<StateMachineListVO> stateMachineVOS = modelMapper.map(page.getList(), new TypeToken<List<StateMachineListVO>>() { }.getType()); for (StateMachineListVO stateMachineVO : stateMachineVOS) { List<StateMachineSchemeVO> list = schemeService.querySchemeByStateMachineId(organizationId, stateMachineVO.getId()); //列表去重 List<StateMachineSchemeVO> unique = list.stream().collect( collectingAndThen( toCollection(() -> new TreeSet<>(comparingLong(StateMachineSchemeVO::getId))), ArrayList::new) ); stateMachineVO.setStateMachineSchemeVOS(unique); } return PageUtil.buildPageInfoWithPageInfoList(page, stateMachineVOS); }
Example #2
Source File: StateMachineServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
private void deleteDraftHandleNode(Long organizationId, Long stateMachineId) { StateMachineNodeDTO nodeDeploy = new StateMachineNodeDTO(); nodeDeploy.setStateMachineId(stateMachineId); nodeDeploy.setOrganizationId(organizationId); List<StateMachineNodeDTO> nodeDeploys = nodeDeployMapper.select(nodeDeploy); if (nodeDeploys != null && !nodeDeploys.isEmpty()) { List<StateMachineNodeDraftDTO> nodes = modelMapper.map(nodeDeploys, new TypeToken<List<StateMachineNodeDraftDTO>>() { }.getType()); for (StateMachineNodeDraftDTO insertNode : nodes) { int nodeInsert = nodeDraftMapper.insert(insertNode); if (nodeInsert != 1) { throw new CommonException(ERROR_STATEMACHINENODE_CREATE); } } } }
Example #3
Source File: ObjectSchemeFieldServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public Map<String, Object> listQuery(Long organizationId, Long projectId, String schemeCode) { Map<String, Object> result = new HashMap<>(2); if (!EnumUtil.contain(ObjectSchemeCode.class, schemeCode)) { throw new CommonException(ERROR_SCHEMECODE_ILLEGAL); } ObjectSchemeFieldSearchVO searchDTO = new ObjectSchemeFieldSearchVO(); searchDTO.setSchemeCode(schemeCode); List<ObjectSchemeFieldVO> fieldDTOS = modelMapper.map(listQuery(organizationId, projectId, searchDTO), new TypeToken<List<ObjectSchemeFieldVO>>() { }.getType()); fillContextName(fieldDTOS); ObjectSchemeDTO select = new ObjectSchemeDTO(); select.setSchemeCode(schemeCode); result.put("name", objectSchemeMapper.selectOne(select).getName()); result.put("content", fieldDTOS); return result; }
Example #4
Source File: IterativeWorktableServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public List<AssigneeDistributeVO> queryAssigneeDistribute(Long projectId, Long sprintId) { Integer total = iterativeWorktableMapper.queryAssigneeAll(projectId, sprintId); List<AssigneeDistributeVO> assigneeDistributeVOList = modelMapper.map(iterativeWorktableMapper.queryAssigneeDistribute(projectId, sprintId, total), new TypeToken<List<AssigneeDistributeVO>>() { }.getType()); if (assigneeDistributeVOList != null && !assigneeDistributeVOList.isEmpty()) { List<Long> userIds = assigneeDistributeVOList.stream().filter(assigneeDistributeVO -> assigneeDistributeVO.getAssigneeId() != null).map(assigneeDistributeVO -> (assigneeDistributeVO.getAssigneeId())).collect(Collectors.toList()); Map<Long, UserMessageDTO> usersMap = userService.queryUsersMap(userIds, true); assigneeDistributeVOList.parallelStream().forEach(assigneeDistributeVO -> { if (assigneeDistributeVO.getAssigneeId() != null && usersMap.get(assigneeDistributeVO.getAssigneeId()) != null) { assigneeDistributeVO.setAssigneeName(usersMap.get(assigneeDistributeVO.getAssigneeId()).getName()); } else { assigneeDistributeVO.setAssigneeName("未分配"); } }); } return assigneeDistributeVOList; }
Example #5
Source File: StateMachineSchemeConfigServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override @ChangeSchemeStatus public StateMachineSchemeVO create(Long organizationId, Long schemeId, Long stateMachineId, List<StateMachineSchemeConfigVO> schemeVOS) { List<StateMachineSchemeConfigDraftDTO> configs = modelMapper.map(schemeVOS, new TypeToken<List<StateMachineSchemeConfigDraftDTO>>() { }.getType()); //删除之前的草稿配置 StateMachineSchemeConfigDraftDTO delConfig = new StateMachineSchemeConfigDraftDTO(); delConfig.setSchemeId(schemeId); delConfig.setStateMachineId(stateMachineId); delConfig.setDefault(false); configDraftMapper.delete(delConfig); for (StateMachineSchemeConfigDraftDTO config : configs) { delConfig.setStateMachineId(null); delConfig.setSchemeId(schemeId); delConfig.setIssueTypeId(config.getIssueTypeId()); configDraftMapper.delete(delConfig); config.setSchemeId(schemeId); config.setStateMachineId(stateMachineId); config.setOrganizationId(organizationId); config.setDefault(false); } configs.forEach(c -> configDraftMapper.insert(c)); return stateMachineSchemeService.querySchemeWithConfigById(true, organizationId, schemeId); }
Example #6
Source File: StateMachineSchemeConfigServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public void copyDraftToDeploy(Boolean isDeleteOldDeploy, Long organizationId, Long schemeId) { //删除发布配置 if (isDeleteOldDeploy) { StateMachineSchemeConfigDTO deploy = new StateMachineSchemeConfigDTO(); deploy.setSchemeId(schemeId); deploy.setOrganizationId(organizationId); configMapper.delete(deploy); } //复制草稿配置到发布配置 StateMachineSchemeConfigDraftDTO draft = new StateMachineSchemeConfigDraftDTO(); draft.setSchemeId(schemeId); draft.setOrganizationId(organizationId); List<StateMachineSchemeConfigDraftDTO> configs = configDraftMapper.select(draft); if (configs != null && !configs.isEmpty()) { List<StateMachineSchemeConfigDTO> configDrafts = modelMapper.map(configs, new TypeToken<List<StateMachineSchemeConfigDTO>>() { }.getType()); for (StateMachineSchemeConfigDTO insertConfig : configDrafts) { int result = configMapper.insert(insertConfig); if (result != 1) { throw new CommonException("error.stateMachineSchemeConfig.create"); } } } }
Example #7
Source File: StateMachineSchemeConfigServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public void copyDeployToDraft(Boolean isDeleteOldDraft, Long organizationId, Long schemeId) { //删除草稿配置 if (isDeleteOldDraft) { StateMachineSchemeConfigDraftDTO draft = new StateMachineSchemeConfigDraftDTO(); draft.setSchemeId(schemeId); draft.setOrganizationId(organizationId); configDraftMapper.delete(draft); } //复制发布配置到草稿配置 StateMachineSchemeConfigDTO config = new StateMachineSchemeConfigDTO(); config.setSchemeId(schemeId); config.setOrganizationId(organizationId); List<StateMachineSchemeConfigDTO> configs = configMapper.select(config); if (configs != null && !configs.isEmpty()) { List<StateMachineSchemeConfigDraftDTO> configDrafts = modelMapper.map(configs, new TypeToken<List<StateMachineSchemeConfigDraftDTO>>() { }.getType()); for (StateMachineSchemeConfigDraftDTO insertConfig : configDrafts) { int result = configDraftMapper.insert(insertConfig); if (result != 1) { throw new CommonException("error.stateMachineSchemeConfig.create"); } } } }
Example #8
Source File: StateMachineNodeServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public StateMachineNodeVO queryById(Long organizationId, Long nodeId) { StateMachineNodeDraftDTO node = nodeDraftMapper.getNodeById(nodeId); if (node == null) { throw new CommonException("error.stateMachineNode.noFound"); } StateMachineNodeVO nodeVO = modelMapper.map(node, StateMachineNodeVO.class); nodeVO.setStatusVO(modelMapper.map(node.getStatus(), StatusVO.class)); //获取进入的转换 StateMachineTransformDraftDTO intoTransformSearch = new StateMachineTransformDraftDTO(); intoTransformSearch.setEndNodeId(nodeId); List<StateMachineTransformDraftDTO> intoTransforms = transformDraftMapper.select(intoTransformSearch); nodeVO.setIntoTransform(modelMapper.map(intoTransforms, new TypeToken<List<StateMachineTransformVO>>() { }.getType())); //获取出去的转换 StateMachineTransformDraftDTO outTransformSerach = new StateMachineTransformDraftDTO(); outTransformSerach.setStartNodeId(nodeId); List<StateMachineTransformDraftDTO> outTransforms = transformDraftMapper.select(outTransformSerach); nodeVO.setOutTransform(modelMapper.map(outTransforms, new TypeToken<List<StateMachineTransformVO>>() { }.getType())); return nodeVO; }
Example #9
Source File: ProjectConfigServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public List<IssueTypeVO> queryIssueTypesByProjectId(Long projectId, String applyType) { if (!EnumUtil.contain(SchemeApplyType.class, applyType)) { throw new CommonException(ERROR_APPLYTYPE_ILLEGAL); } Long organizationId = projectUtil.getOrganizationId(projectId); ProjectConfigDTO projectConfig = projectConfigMapper.queryBySchemeTypeAndApplyType(projectId, SchemeType.ISSUE_TYPE, applyType); //获取问题类型方案 if (projectConfig.getSchemeId() != null) { //根据方案配置表获取 问题类型 List<IssueTypeDTO> issueTypes = issueTypeMapper.queryBySchemeId(organizationId, projectConfig.getSchemeId()); return modelMapper.map(issueTypes, new TypeToken<List<IssueTypeVO>>() { }.getType()); } else { throw new CommonException("error.queryIssueTypesByProjectId.issueTypeSchemeId.null"); } }
Example #10
Source File: PriorityServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public List<PriorityVO> updateByList(List<PriorityVO> list, Long organizationId) { int seq = 1; for (PriorityVO priorityVO : list) { PriorityDTO p = modelMapper.map(priorityVO, PriorityDTO.class); p.setSequence(new BigDecimal(seq)); seq++; int isUpdate = priorityMapper.updateSequenceById(p); if (isUpdate != 1) { throw new CommonException("error.priority.update"); } } List<PriorityDTO> priorities = priorityMapper.fulltextSearch(new PriorityDTO(), null); return modelMapper.map(priorities, new TypeToken<List<PriorityVO>>() { }.getType()); }
Example #11
Source File: PageFieldServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public List<PageFieldViewVO> queryPageFieldViewList(Long organizationId, Long projectId, PageFieldViewParamVO paramDTO) { if (!EnumUtil.contain(PageCode.class, paramDTO.getPageCode())) { throw new CommonException(ERROR_PAGECODE_ILLEGAL); } if (!EnumUtil.contain(ObjectSchemeCode.class, paramDTO.getSchemeCode())) { throw new CommonException(ERROR_SCHEMECODE_ILLEGAL); } if (!EnumUtil.contain(ObjectSchemeFieldContext.class, paramDTO.getContext())) { throw new CommonException(ERROR_CONTEXT_ILLEGAL); } List<PageFieldDTO> pageFields = queryPageField(organizationId, projectId, paramDTO.getPageCode(), paramDTO.getContext()); //modelMapper设置严格匹配策略 modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); pageFields = pageFields.stream().filter(PageFieldDTO::getDisplay).collect(Collectors.toList()); List<PageFieldViewVO> pageFieldViews = modelMapper.map(pageFields, new TypeToken<List<PageFieldViewVO>>() { }.getType()); //填充option optionService.fillOptions(organizationId, projectId, pageFieldViews); FieldValueUtil.handleDefaultValue(pageFieldViews); return pageFieldViews; }
Example #12
Source File: PageFieldServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public Map<String, Object> listQuery(Long organizationId, Long projectId, String pageCode, String context) { Map<String, Object> result = new HashMap<>(2); if (!EnumUtil.contain(PageCode.class, pageCode)) { throw new CommonException(ERROR_PAGECODE_ILLEGAL); } if (context != null && !EnumUtil.contain(ObjectSchemeFieldContext.class, context)) { throw new CommonException(ERROR_CONTEXT_ILLEGAL); } List<PageFieldDTO> pageFields = queryPageField(organizationId, projectId, pageCode, context); List<PageFieldVO> pageFieldVOS = modelMapper.map(pageFields, new TypeToken<List<PageFieldVO>>() { }.getType()); fillContextName(pageFieldVOS); PageDTO select = new PageDTO(); select.setPageCode(pageCode); result.put("name", pageMapper.selectOne(select).getName()); result.put("content", pageFieldVOS); return result; }
Example #13
Source File: ReportServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
private void handleAddDoneIssueValueDuringSprint(SprintDTO sprintDTO, List<ReportIssueConvertDTO> reportIssueConvertDTOList, String field, List<Long> issueAllList) { // 获取当前冲刺期间移动到done状态的issue List<Long> issueIdAddDoneList = issueAllList != null && !issueAllList.isEmpty() ? reportMapper.queryAddDoneIssueIdsDuringSprint(sprintDTO, issueAllList) : null; List<ReportIssueDTO> reportIssueDTOS = Collections.synchronizedList(new ArrayList<>()); List<ReportIssueConvertDTO> issueAddDoneList = new ArrayList<>(); if (issueIdAddDoneList != null && !issueIdAddDoneList.isEmpty()) { //todo 还需要优化 issueIdAddDoneList.parallelStream().forEach(issueIdAddDone -> reportIssueDTOS.addAll(reportMapper.queryAddIssueDoneValueDuringSprint(issueIdAddDone, sprintDTO, field))); issueAddDoneList = !reportIssueDTOS.isEmpty() ? modelMapper.map(reportIssueDTOS, new TypeToken<List<ReportIssueConvertDTO>>() { }.getType()) : null; } if (issueAddDoneList != null && !issueAddDoneList.isEmpty()) { reportIssueConvertDTOList.addAll(issueAddDoneList); } // 如果有移动到done的issue,判断如果该issue之后有被移出冲刺,则移出时时间不再计算(置为false) List<ReportIssueConvertDTO> remove = reportIssueConvertDTOList.stream().filter(x -> x.getType().equals("removeDuringSprint")).collect(Collectors.toList()); // 查看上一个resolution是完成,则移出时时间不再计算(置为false) remove.forEach(x -> { ReportIssueDTO reportIssueDTO = reportMapper.queryLastResolutionBeforeMoveOutSprint(sprintDTO.getProjectId(), x.getIssueId(), x.getDate()); if (reportIssueDTO != null && reportIssueDTO.getNewValue() != null) { x.setStatistical(false); } }); }
Example #14
Source File: IssueServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
private void batchCreateCopyIssueLink(Boolean condition, Long issueId, Long newIssueId, Long projectId) { if (condition) { List<IssueLinkDTO> issueLinkDTOList = modelMapper.map(issueLinkMapper.queryIssueLinkByIssueId(issueId, projectId, false), new TypeToken<List<IssueLinkDTO>>() { }.getType()); issueLinkDTOList.forEach(issueLinkDTO -> { IssueLinkDTO copy = new IssueLinkDTO(); if (issueLinkDTO.getIssueId().equals(issueId)) { copy.setIssueId(newIssueId); copy.setLinkedIssueId(issueLinkDTO.getLinkedIssueId()); } if (issueLinkDTO.getLinkedIssueId().equals(issueId)) { copy.setIssueId(issueLinkDTO.getIssueId()); copy.setLinkedIssueId(newIssueId); } copy.setLinkTypeId(issueLinkDTO.getLinkTypeId()); copy.setProjectId(projectId); if (issueLinkValidator.checkUniqueLink(copy)) { issueLinkService.create(copy); } }); } }
Example #15
Source File: FeatureCommonAssembler.java From agile-service-old with Apache License 2.0 | 6 votes |
public List<FeatureCommonVO> featureCommonDTOToVO(List<FeatureCommonDTO> featureCommonDTOList, Map<Long, StatusVO> statusMapDTOMap, Map<Long, IssueTypeVO> issueTypeDTOMap) { List<FeatureCommonVO> result = new ArrayList<>(); List<Long> reporterIds = new ArrayList<>(); reporterIds.addAll(featureCommonDTOList.stream().filter(issue -> issue.getReporterId() != null && !Objects.equals(issue.getReporterId(), 0L)).map(FeatureCommonDTO::getReporterId).collect(Collectors.toSet())); Map<Long, UserMessageDTO> userMessageDOMap = userService.queryUsersMap( reporterIds.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList()), true); featureCommonDTOList.forEach(featureCommonDO -> { FeatureCommonVO featureCommonVO = modelMapper.map(featureCommonDO, FeatureCommonVO.class); featureCommonVO.setPiNameVOList(modelMapper.map(featureCommonDO.getPiNameDTOList(), new TypeToken<List<PiNameVO>>(){}.getType())); featureCommonVO.setStatusVO(statusMapDTOMap.get(featureCommonDO.getStatusId())); featureCommonVO.setIssueTypeVO(issueTypeDTOMap.get(featureCommonDO.getIssueTypeId())); UserMessageDTO userMessageDTO = userMessageDOMap.get(featureCommonDO.getReporterId()); if (userMessageDTO != null) { featureCommonVO.setReporterName(userMessageDTO.getName()); featureCommonVO.setReporterImageUrl(userMessageDTO.getImageUrl()); } result.add(featureCommonVO); }); return result; }
Example #16
Source File: IssueTypeSchemeServiceImpl.java From agile-service-old with Apache License 2.0 | 6 votes |
@Override public PageInfo<IssueTypeSchemeWithInfoVO> queryIssueTypeSchemeList(PageRequest pageRequest, Long organizationId, IssueTypeSchemeSearchVO issueTypeSchemeSearchVO) { PageInfo<Long> issueTypeSchemeIdsPage = PageHelper.startPage(pageRequest.getPage(), pageRequest.getSize(), PageUtil.sortToSql(pageRequest.getSort())).doSelectPageInfo(() -> issueTypeSchemeMapper.selectIssueTypeSchemeIds(organizationId, issueTypeSchemeSearchVO)); List<IssueTypeSchemeWithInfoVO> issueTypeSchemeWithInfoVOList = new ArrayList<>(issueTypeSchemeIdsPage.getList().size()); if (issueTypeSchemeIdsPage.getList() != null && !issueTypeSchemeIdsPage.getList().isEmpty()) { List<IssueTypeSchemeWithInfoDTO> issueTypeSchemeWithInfoList = issueTypeSchemeMapper.queryIssueTypeSchemeList(organizationId, issueTypeSchemeIdsPage.getList()); issueTypeSchemeWithInfoVOList = modelMapper.map(issueTypeSchemeWithInfoList, new TypeToken<List<IssueTypeSchemeWithInfoVO>>() { }.getType()); for (IssueTypeSchemeWithInfoVO type : issueTypeSchemeWithInfoVOList) { for (ProjectWithInfoDTO projectWithInfo : type.getProjectWithInfoList()) { projectWithInfo.setProjectName(projectUtil.getName(projectWithInfo.getProjectId())); } } } return PageUtil.buildPageInfoWithPageInfoList(issueTypeSchemeIdsPage, issueTypeSchemeWithInfoVOList); }
Example #17
Source File: ConvertUtils.java From agile-service-old with Apache License 2.0 | 6 votes |
public static StateMachineSchemeVO convertStateMachineSchemeToVO(final StateMachineSchemeDTO scheme, final Map<Long, ProjectVO> projectMap) { ModelMapper modelMapper = new ModelMapper(); StateMachineSchemeVO schemeVO = modelMapper.map(scheme, StateMachineSchemeVO.class); List<StateMachineSchemeConfigDTO> schemeConfigs = scheme.getSchemeConfigs(); if (null != schemeConfigs && !schemeConfigs.isEmpty()) { List<StateMachineSchemeConfigVO> schemeConfigVOS = modelMapper.map(schemeConfigs, new TypeToken<List<StateMachineSchemeConfigVO>>() { }.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; }
Example #18
Source File: PiObjectiveServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<PiObjectiveVO> queryPiObjectiveListByProject(Long projectId, Long piId) { List<PiObjectiveDTO> piObjectiveDTOList = piObjectiveMapper.selectPiObjectiveListByProject(projectId, piId); if (piObjectiveDTOList != null && !piObjectiveDTOList.isEmpty()) { return modelMapper.map(piObjectiveDTOList, new TypeToken<List<PiObjectiveVO>>(){}.getType()); } else { return new ArrayList<>(); } }
Example #19
Source File: PageFieldServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
private void handleInitPageFieldE(Long organizationId, Map<String, Map<String, Long>> schemeCodeFieldMap, Map<String, Long> pageMap) { Class[] clzes = InitPageFieldE.class.getClasses(); Arrays.asList(clzes).forEach(cls -> { List<InitPageFieldVO> initPageFields = modelMapper.map(Arrays.asList(cls.getEnumConstants()), new TypeToken<List<InitPageFieldVO>>() { }.getType()); String rank = RankUtil.mid(); for (InitPageFieldVO pageField : initPageFields) { Map<String, Long> fieldMap = schemeCodeFieldMap.get(pageField.getSchemeCode()); if (fieldMap == null) { throw new CommonException(ERROR_SCHEMECODE_ILLEGAL); } Long fieldId = fieldMap.get(pageField.getFieldCode()); if (fieldId == null) { throw new CommonException(ERROR_FIELDCODE_ILLEGAL); } pageField.setFieldId(fieldId); Long pageId = pageMap.get(pageField.getPageCode()); if (pageId == null) { throw new CommonException(ERROR_PAGECODE_ILLEGAL); } pageField.setPageId(pageId); //设置rank pageField.setRank(rank); rank = RankUtil.genPre(rank); } List<PageFieldDTO> pageFields = modelMapper.map(initPageFields, new TypeToken<List<PageFieldDTO>>() { }.getType()); pageFieldMapper.batchInsert(organizationId, null, pageFields); }); }
Example #20
Source File: DataLogServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<DataLogVO> listByIssueId(Long projectId, Long issueId) { List<DataLogVO> dataLogVOS = modelMapper.map(dataLogMapper.selectByIssueId(projectId, issueId), new TypeToken<List<DataLogVO>>() { }.getType()); List<FieldDataLogVO> fieldDataLogVOS = fieldDataLogService.queryByInstanceId(projectId, issueId, ObjectSchemeCode.AGILE_ISSUE); for (FieldDataLogVO fieldDataLogVO : fieldDataLogVOS) { DataLogVO dataLogVO = modelMapper.map(fieldDataLogVO, DataLogVO.class); dataLogVO.setField(fieldDataLogVO.getFieldCode()); dataLogVO.setIssueId(fieldDataLogVO.getInstanceId()); dataLogVO.setIsCusLog(true); dataLogVOS.add(dataLogVO); } fillUserAndStatus(projectId, dataLogVOS); return dataLogVOS.stream().sorted(Comparator.comparing(DataLogVO::getCreationDate).reversed()).collect(Collectors.toList()); }
Example #21
Source File: IssueServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<FeatureCommonVO> queryFeatureListByPiId(Long programId, Long organizationId, Long piId) { Map<Long, IssueTypeVO> issueTypeDTOMap = issueTypeService.listIssueTypeMap(organizationId); List<FeatureCommonVO> featureCommonVOS = modelMapper.map(issueMapper.selectFeatureByPiId(programId, piId), new TypeToken<List<FeatureCommonVO>>() { }.getType()); for (FeatureCommonVO featureCommon : featureCommonVOS) { featureCommon.setIssueTypeVO(issueTypeDTOMap.get(featureCommon.getIssueTypeId())); } return featureCommonVOS; }
Example #22
Source File: StateMachineServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<StateMachineVO> queryByOrgId(Long organizationId) { StateMachineDTO select = new StateMachineDTO(); select.setOrganizationId(organizationId); List<StateMachineDTO> stateMachines = stateMachineMapper.select(select); return modelMapper.map(stateMachines, new TypeToken<List<StateMachineVO>>() { }.getType()); }
Example #23
Source File: StatusServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<StatusVO> queryByStateMachineIds(Long organizationId, List<Long> stateMachineIds) { if (!stateMachineIds.isEmpty()) { List<StatusDTO> statuses = statusMapper.queryByStateMachineIds(organizationId, stateMachineIds); return modelMapper.map(statuses, new TypeToken<List<StatusVO>>() { }.getType()); } return Collections.emptyList(); }
Example #24
Source File: StatusServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public Map<Long, StatusVO> queryAllStatusMap(Long organizationId) { StatusDTO status = new StatusDTO(); status.setOrganizationId(organizationId); List<StatusDTO> statuses = statusMapper.select(status); Map<Long, StatusVO> statusMap = new HashMap<>(); for (StatusDTO sta : statuses) { StatusVO statusVO = modelMapper.map(sta, new TypeToken<StatusVO>() { }.getType()); statusMap.put(statusVO.getId(), statusVO); } return statusMap; }
Example #25
Source File: StatusServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<StatusVO> queryAllStatus(Long organizationId) { StatusDTO status = new StatusDTO(); status.setOrganizationId(organizationId); List<StatusDTO> statuses = statusMapper.select(status); return modelMapper.map(statuses, new TypeToken<List<StatusVO>>() { }.getType()); }
Example #26
Source File: LookupValueServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public LookupTypeWithValuesVO queryConstraintLookupValue(Long organizationId) { LookupTypeWithValuesDTO typeWithValues = lookupValueMapper.queryLookupValueByCode("constraint"); LookupTypeWithValuesVO result = modelMapper.map(typeWithValues, LookupTypeWithValuesVO.class); result.setLookupValues(modelMapper.map(typeWithValues.getLookupValues(), new TypeToken<List<LookupValueVO>>() { }.getType())); return result; }
Example #27
Source File: FieldValueServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public void fillValues(Long organizationId, Long projectId, Long instanceId, String schemeCode, List<PageFieldViewVO> pageFieldViews) { List<FieldValueVO> values = modelMapper.map(fieldValueMapper.queryList(projectId, instanceId, schemeCode, null), new TypeToken<List<FieldValueVO>>() { }.getType()); Map<Long, UserDTO> userMap = FieldValueUtil.handleUserMap(values.stream().filter(x -> x.getFieldType().equals(FieldType.MEMBER)).map(FieldValueVO::getOptionId).collect(Collectors.toList())); Map<Long, List<FieldValueVO>> valueGroup = values.stream().collect(Collectors.groupingBy(FieldValueVO::getFieldId)); pageFieldViews.forEach(view -> { List<FieldValueVO> fieldValues = valueGroup.get(view.getFieldId()); FieldValueUtil.handleDTO2Value(view, view.getFieldType(), fieldValues, userMap, false); }); }
Example #28
Source File: IterativeWorktableServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<StatusCategoryVO> queryStatusCategoryDistribute(Long projectId, Long sprintId, Long organizationId) { SprintDTO sprintDTO = sprintMapper.selectByPrimaryKey(sprintId); IterativeWorktableValidator.checkSprintExist(sprintDTO); List<StatusCategoryDTO> statusCategoryDTOList = iterativeWorktableMapper.queryStatusCategoryDistribute(projectId, sprintId); Map<Long, StatusVO> statusMapDTOMap = statusService.queryAllStatusMap(organizationId); for (StatusCategoryDTO statusCategoryDTO : statusCategoryDTOList) { statusCategoryDTO.setCategoryCode(statusMapDTOMap.get(statusCategoryDTO.getStatusId()).getType()); } return modelMapper.map(statusCategoryDTOList, new TypeToken<List<StatusCategoryVO>>() { }.getType()); }
Example #29
Source File: PersonalFilterServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<PersonalFilterVO> listByProjectId(Long projectId, Long userId, String searchStr) { List<PersonalFilterVO> list = modelMapper.map(personalFilterMapper.queryByProjectIdAndUserId(projectId, userId, searchStr), new TypeToken<List<PersonalFilterVO>>() { }.getType()); list.stream().forEach(PersonalFilterServiceImpl::parseJson); return list; }
Example #30
Source File: ArtServiceImpl.java From agile-service-old with Apache License 2.0 | 5 votes |
@Override public List<ArtVO> queryAllArtList(Long programId) { List<ArtDTO> artDTOList = artMapper.selectArtList(programId); if (artDTOList != null && !artDTOList.isEmpty()) { return modelMapper.map(artDTOList, new TypeToken<List<ArtVO>>() { }.getType()); } else { return new ArrayList<>(); } }