瀏覽代碼

修改内容列表行为指标的区域报告条目类型function -> area/project

lixing 3 年之前
父節點
當前提交
bc876850d1

+ 2 - 2
src/main/java/com/persagy/apm/report/common/schedule/ReportGenerateFailScheduleTask.java

@@ -30,7 +30,7 @@ public class ReportGenerateFailScheduleTask {
     IReportOutlineService reportOutlineService;
     @Value("${maxGenerateMinutes:5}")
     private int maxGenerateMinutes;
-    @Value("${failReportPeriod:15}")
+    @Value("${failReportPeriod:600000}")
     private String failReportPeriod;
 
     /**
@@ -39,7 +39,7 @@ public class ReportGenerateFailScheduleTask {
      * @author lixing
      * @version V1.0 2021/8/9 12:01 下午
      */
-    @Scheduled(fixedRateString = "${failReportPeriod:15}")
+    @Scheduled(fixedRateString = "${failReportPeriod:600000}")
     public void checkAndFailReportGenerateState() {
         log.info("开始检查生成时间超过{}ms, 依然处于生成中的报告", failReportPeriod);
         // 查询生成状态为生成中的报告

+ 3 - 3
src/main/java/com/persagy/apm/report/dependencies/iotdataanalysis/service/impl/IDataAnalysisWebServiceImpl.java

@@ -30,9 +30,9 @@ public class IDataAnalysisWebServiceImpl implements IDataAnalysisWebService {
         try {
             JSONObject paramObject = new JSONObject();
             paramObject.put("userId", DataConstants.USER_ID);
-                        paramObject.put("groupCode", "BL");
-                        projectId = "Pj1101080259";
-//            paramObject.put("groupCode", groupCode);
+//                        paramObject.put("groupCode", "BL");
+//                        projectId = "Pj1101080259";
+            paramObject.put("groupCode", groupCode);
             paramObject.put("projectIdList", Lists.newArrayList(projectId));
             Date startTime = DateUtils.getStartTimeOfDay(date);
             Date endTime = DateUtils.getMonthOff(startTime, 1);

+ 5 - 3
src/main/java/com/persagy/apm/report/dependencies/manualfilling/model/dto/SaveEnergyItemDataDTO.java

@@ -16,10 +16,12 @@ public class SaveEnergyItemDataDTO {
     private String projectId;
 
     @NotNull(message = "energyType不能为空")
-    @ApiModelProperty(value = "能耗类型", required = true)
-    private String energyType;
+    @ApiModelProperty(value = "能耗类型", required = true,
+            notes = "com.persagy.apm.report.dependencies.manualfilling.enums.EnergyTypeEnum")
+    private Integer energyType;
 
-    @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
+    @ApiModelProperty(value = "信息点类型", required = true,
+            notes = "com.persagy.apm.report.dependencies.manualfilling.enums.ManualFillingDataTypeEnum")
     private String functionType;
 
     @NotNull(message = "dataList不能为空")

+ 1 - 0
src/main/java/com/persagy/apm/report/dependencies/manualfilling/service/impl/IEnergyItemDataServiceImpl.java

@@ -137,6 +137,7 @@ public class IEnergyItemDataServiceImpl implements IEnergyItemDataService {
             }
         } catch (Exception e) {
             log.error("保存分项录入数据异常", e);
+            throw new IllegalArgumentException("保存分项录入数据异常", e);
         }
     }
 

+ 1 - 2
src/main/java/com/persagy/apm/report/indicator/manualfilling/service/impl/ManualFillingDataServiceImpl.java

@@ -240,8 +240,7 @@ public class ManualFillingDataServiceImpl extends ServiceImpl<ManualFillingDataM
     @Override
     public void batchDelete(String functionId, String projectId, List<Date> deleteDates) {
         if (StringUtils.isBlank(functionId) || StringUtils.isBlank(projectId) || CollectionUtils.isEmpty(deleteDates)) {
-            String exceptionMsg = "批量删除人工填报数据,缺少删除条件, functionId:s%, projectId: s%, deleteDates: s%";
-            throw new IllegalArgumentException(String.format(exceptionMsg, functionId, projectId, deleteDates));
+            return;
         }
         QueryWrapper<ManualFillingData> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq(ManualFillingData.PROP_FUNCTION_ID, functionId);

+ 14 - 1
src/main/java/com/persagy/apm/report/paragraphs/service/impl/AreaIndicatorsParagraphBuilder.java

@@ -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;
     }