From 1d4ac27e8a9428aff4dd3ba1c9e2bb8b2ed826f7 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期二, 07 一月 2025 18:16:38 +0800 Subject: [PATCH] influxdb查询bug --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java index b5abf3a..8ea2538 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java @@ -11,7 +11,7 @@ import com.iailab.module.data.common.ApiDataQueryDTO; import com.iailab.module.model.api.mcs.McsApi; import com.iailab.module.model.api.mcs.dto.*; -import com.iailab.module.model.common.enums.CommonConstant; +import com.iailab.module.model.enums.CommonConstant; import com.iailab.module.model.common.enums.PreLineTypeEnum; import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; @@ -21,7 +21,9 @@ import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; +import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; import com.iailab.module.model.mdk.vo.ItemVO; +import com.iailab.module.model.mpk.service.ChartParamService; import com.iailab.module.model.mpk.service.ChartService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -45,6 +47,9 @@ public class McsApiImpl implements McsApi { @Autowired + private DataPointApi dataPointApi; + + @Autowired private DmModuleService dmModuleService; @Autowired @@ -58,9 +63,6 @@ @Autowired private MmItemResultLastPointService mmItemResultLastPointService; - - @Autowired - private DataPointApi dataPointApi; @Autowired private MmItemResultJsonService mmItemResultJsonService; @@ -82,6 +84,9 @@ @Autowired private StScheduleSchemeService stScheduleSchemeService; + + @Autowired + private ChartParamService chartParamService; private int HOUR_MINS = 60; @@ -335,7 +340,11 @@ dataView.setRangeL(rangeL); dataView.setLimitH(limitH); dataView.setLimitL(limitL); - dataView.setRealData(getHisData(outPut.getPointid(), startTime, endTime, timeFormat)); + if (StringUtils.isNotBlank(outPut.getPointid())) { + dataView.setRealData(getHisData(outPut.getPointid(), startTime, endTime, timeFormat)); + } else { + dataView.setRealData(new ArrayList<>()); + } dataView.setCurData(mmItemResultJsonService.getData(outPut.getId(), predictTime, timeFormat)); switch (lineType) { case TN: @@ -519,6 +528,7 @@ @Override public Boolean createScheduleSuggest(ScheduleSuggestRespDTO dto) { + stScheduleSuggestService.create(ConvertUtils.sourceToTarget(dto, StScheduleSuggestSaveReqVO.class)); return true; } @@ -544,10 +554,20 @@ } @Override - public List<StScheduleSchemeDTO> listScheduleScheme(Map<String, Object> params) { + public List<StScheduleSchemeDTO> listScheduleScheme(String triggerMethod, String triggerCondition) { + Map<String, Object> params = new HashMap<>(); + params.put("triggerMethod", triggerMethod); + params.put("triggerCondition", triggerCondition); return stScheduleSchemeService.list(params); } + @Override + public List<ChartParamDTO> getChartParamList(String chartCode) { + if (StringUtils.isBlank(chartCode)) { + return null; + } + return chartParamService.list(chartCode); + } private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { Date[] result = new Date[3]; -- Gitblit v1.9.3