From 3903c6f4ef7f5fa7dd931bbffc51d0ce0d6f0af1 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 08 一月 2025 17:40:07 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java | 40 +++++++++++++++++++++++++++++++++------- 1 files changed, 33 insertions(+), 7 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 6070178..d918e48 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 @@ -1,5 +1,6 @@ package com.iailab.module.model.api; +import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.date.DateUtils; import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.data.api.plan.PlanItemApi; @@ -11,7 +12,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 +22,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 +48,9 @@ public class McsApiImpl implements McsApi { @Autowired + private DataPointApi dataPointApi; + + @Autowired private DmModuleService dmModuleService; @Autowired @@ -58,9 +64,6 @@ @Autowired private MmItemResultLastPointService mmItemResultLastPointService; - - @Autowired - private DataPointApi dataPointApi; @Autowired private MmItemResultJsonService mmItemResultJsonService; @@ -82,6 +85,9 @@ @Autowired private StScheduleSchemeService stScheduleSchemeService; + + @Autowired + private ChartParamService chartParamService; private int HOUR_MINS = 60; @@ -235,7 +241,7 @@ @Override public PreDataItemChartRespVO getPreDataItemChart(PreDataItemChartReqVO reqVO) { PreDataItemChartRespVO result = new PreDataItemChartRespVO(); - ItemVO predictItem = mmPredictItemService.getItemByIdFromCache(reqVO.getItemId()); + ItemVO predictItem = mmPredictItemService.getItemById(reqVO.getItemId()); if (predictItem == null) { return result; } @@ -335,7 +341,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 +529,7 @@ @Override public Boolean createScheduleSuggest(ScheduleSuggestRespDTO dto) { + stScheduleSuggestService.create(ConvertUtils.sourceToTarget(dto, StScheduleSuggestSaveReqVO.class)); return true; } @@ -544,10 +555,25 @@ } @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); + } + + @Override + public PageResult<StAlarmAndSuggestRespVO> getAlarmAndSuggestPage(StAlarmAndSuggestPageReqVO reqVO) { + return stScheduleSchemeService.getAlarmAndSuggestPage(reqVO); + } private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { Date[] result = new Date[3]; -- Gitblit v1.9.3