|
@@ -1,12 +1,15 @@
|
|
|
package com.persagy.apm.report.paragraphs.service.impl;
|
|
|
|
|
|
+import com.persagy.apm.report.dependencies.saasweb.model.vo.PartitionVO;
|
|
|
import com.persagy.apm.report.userconfig.paragraph.model.Paragraph;
|
|
|
import com.persagy.apm.report.detail.enums.ParagraphContentItemTypeEnum;
|
|
|
import com.persagy.apm.report.detail.model.vo.ItemVO;
|
|
|
import com.persagy.apm.report.detail.paragraphvalue.model.vo.ParagraphContentVO;
|
|
|
import com.persagy.apm.report.outline.model.ReportOutline;
|
|
|
import com.persagy.apm.report.outline.service.IReportOutlineService;
|
|
|
+import com.persagy.apm.report.userconfig.reporttype.service.IReportTypeService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
@@ -21,6 +24,8 @@ import java.util.List;
|
|
|
public abstract class AreaIndicatorsParagraphBuilder extends ParagraphBuilder {
|
|
|
@Autowired
|
|
|
IReportOutlineService reportOutlineService;
|
|
|
+ @Autowired
|
|
|
+ IReportTypeService reportTypeService;
|
|
|
|
|
|
/**
|
|
|
* 计算段落内容部分
|
|
@@ -62,7 +67,15 @@ public abstract class AreaIndicatorsParagraphBuilder extends ParagraphBuilder {
|
|
|
ItemVO itemVO = getIndicatorItem(reportOutline.getReportMonth(), projectIds, itemId);
|
|
|
items.add(itemVO);
|
|
|
}
|
|
|
- paragraphContentVO.setItemType(ParagraphContentItemTypeEnum.FUNCTION);
|
|
|
+
|
|
|
+ // 获取分区下的子分区
|
|
|
+ List<PartitionVO> sonAreas = reportTypeService.getSonAreas(
|
|
|
+ reportOutline.getReportTypeId(), reportOutline.getBelong());
|
|
|
+ if (CollectionUtils.isEmpty(sonAreas)) {
|
|
|
+ paragraphContentVO.setItemType(ParagraphContentItemTypeEnum.PROJECT);
|
|
|
+ } else {
|
|
|
+ paragraphContentVO.setItemType(ParagraphContentItemTypeEnum.AREA);
|
|
|
+ }
|
|
|
return paragraphContentVO;
|
|
|
}
|
|
|
|