|
@@ -1,7 +1,7 @@
|
|
|
package com.persagy.apm.energy.report.monthly.outline.service.impl;
|
|
|
|
|
|
import com.persagy.apm.common.context.poems.PoemsContext;
|
|
|
-import com.persagy.apm.energy.report.common.dto.QueryAreaPlatformParamDTO;
|
|
|
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
|
|
|
import com.persagy.apm.energy.report.common.service.CommonService;
|
|
|
import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.ReportTypeStatisticsItemRel;
|
|
|
import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto.QueryReportTypeStatisticsItemRelDTO;
|
|
@@ -9,11 +9,15 @@ import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.servi
|
|
|
import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
|
|
|
import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.dto.QueryStatisticItemsDTO;
|
|
|
import com.persagy.apm.energy.report.monthly.config.statisticsitems.service.IStatisticItemsService;
|
|
|
+import com.persagy.apm.energy.report.monthly.config.type.model.ReportType;
|
|
|
+import com.persagy.apm.energy.report.monthly.config.type.service.IReportTypeService;
|
|
|
import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
|
|
|
import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
|
|
|
import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
|
|
|
import org.assertj.core.util.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -26,7 +30,8 @@ import java.util.stream.Collectors;
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/5/30 10:22 下午
|
|
|
**/
|
|
|
-public class BusinessReportPlatformInfoServiceImpl {
|
|
|
+@Service
|
|
|
+public class BusinessReportPlatformInfoServiceImpl implements com.persagy.apm.energy.report.monthly.outline.service.IBusinessReportPlatformInfoService {
|
|
|
@Autowired
|
|
|
private IReportTypeStatisticsItemRelService reportTypeStatisticsItemRelService;
|
|
|
@Autowired
|
|
@@ -35,19 +40,18 @@ public class BusinessReportPlatformInfoServiceImpl {
|
|
|
private CommonService commonService;
|
|
|
@Autowired
|
|
|
private IReportOutlineService reportOutlineService;
|
|
|
+ @Autowired
|
|
|
+ private IReportTypeService reportTypeService;
|
|
|
+
|
|
|
+ @Value("${group.code}")
|
|
|
+ private String groupCode;
|
|
|
|
|
|
- /**
|
|
|
- * 获取报告平台运维信息
|
|
|
- *
|
|
|
- * @param reportOutline 报告概要
|
|
|
- * @return 平台运维信息点信息列表
|
|
|
- * @author lixing
|
|
|
- * @version V1.0 2021/5/30 10:47 下午
|
|
|
- */
|
|
|
+ @Override
|
|
|
public List<Platform> getPlatforms(ReportOutline reportOutline) {
|
|
|
// 查询报告类型关联的统计条目
|
|
|
QueryReportTypeStatisticsItemRelDTO queryReportTypeStatisticsItemRelDTO = new QueryReportTypeStatisticsItemRelDTO();
|
|
|
- queryReportTypeStatisticsItemRelDTO.setReportTypeId(reportOutline.getReportTypeId());
|
|
|
+ String reportTypeId = reportOutline.getReportTypeId();
|
|
|
+ queryReportTypeStatisticsItemRelDTO.setReportTypeId(reportTypeId);
|
|
|
List<ReportTypeStatisticsItemRel> reportTypeStatisticsItemRels = reportTypeStatisticsItemRelService.
|
|
|
queryReportTypeStatisticsItemRelList(queryReportTypeStatisticsItemRelDTO);
|
|
|
if (CollectionUtils.isEmpty(reportTypeStatisticsItemRels)) {
|
|
@@ -68,15 +72,21 @@ public class BusinessReportPlatformInfoServiceImpl {
|
|
|
// 获取报告关联的项目
|
|
|
List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
|
|
|
|
|
|
+ // 获取报告类型的所属类型
|
|
|
+ ReportType reportType = reportTypeService.queryReportTypeDetail(reportTypeId);
|
|
|
+ String belongType = reportType.getBelongType();
|
|
|
+
|
|
|
// 拼装运维信息查询条件
|
|
|
- QueryAreaPlatformParamDTO queryAreaPlatformParamDTO = new QueryAreaPlatformParamDTO();
|
|
|
- queryAreaPlatformParamDTO.setReportDate(reportOutline.getReportMonth());
|
|
|
- queryAreaPlatformParamDTO.setProjectIdList(projectIds);
|
|
|
- queryAreaPlatformParamDTO.setUserId(PoemsContext.getContext().getUserId());
|
|
|
+ QueryPlatformParamDTO queryPlatformParamDTO = new QueryPlatformParamDTO();
|
|
|
+ queryPlatformParamDTO.setReportDate(reportOutline.getReportMonth());
|
|
|
+ queryPlatformParamDTO.setProjectIdList(projectIds);
|
|
|
+ queryPlatformParamDTO.setGroupCode(groupCode);
|
|
|
+ queryPlatformParamDTO.setUserId(PoemsContext.getContext().getUserId());
|
|
|
+ queryPlatformParamDTO.setBelongType(belongType);
|
|
|
|
|
|
List<Platform> result = new ArrayList<>();
|
|
|
for (StatisticItems statisticItems : statisticItemList) {
|
|
|
- result.add(commonService.getPlatform(statisticItems, queryAreaPlatformParamDTO));
|
|
|
+ result.add(commonService.getPlatform(statisticItems, queryPlatformParamDTO));
|
|
|
}
|
|
|
|
|
|
return result;
|