From 9aa63389a2124c76fd28fa6ee3271bf5b5eb3bf1 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期四, 20 三月 2025 08:53:03 +0800 Subject: [PATCH] 测试运行支持string类型 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java | 48 +++++++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 23 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 a08edd1..c7ef32f 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 @@ -200,6 +200,7 @@ Calendar calendar = Calendar.getInstance(); calendar.setTime(predictTime); calendar.add(Calendar.HOUR_OF_DAY, 1); + calendar.add(Calendar.MINUTE, 1); endTime = calendar.getTime(); } @@ -352,6 +353,7 @@ result.setViewMap(viewMap); return result; } + @Override public PreDataSingleChartRespVO getPreDataSingleChart(PreDataSingleChartReqVO reqVO) { @@ -722,9 +724,11 @@ } MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), itemNo[1], itemNo[2]); String outputId = outPut.getId(); - // 如果第5个参数为1,则取累计值 - if ("1".equals(itemNo[4])){ - outputId = outPut.getId() + CommonDict.CUMULANT_SUFFIX; + // 判断是否有第五个参数,如果有第5个参数为1,则取累计值 + if (itemNo.length >= 5){ + if (StringUtils.isNotBlank(itemNo[4]) && "1".equals(itemNo[4])){ + outputId = outPut.getId() + CommonDict.CUMULANT_SUFFIX; + } } Date predictTime = predictItem.getLastTime(); List<Object[]> curData = mmItemResultJsonService.getData(outputId, predictTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); @@ -819,12 +823,6 @@ } @Override - public List<StAdjustConfigDetDTO> getAdjustConfigListByModelId(String modelId) { - List<StAdjustConfigDetEntity> list = stAdjustConfigService.getDetByModelId(modelId); - return ConvertUtils.sourceToTarget(list, StAdjustConfigDetDTO.class); - } - - @Override public Boolean updateAlarmConfig(String alarmObj,String upperLimit,String lowerLimit) { MmPredictAlarmConfigSaveReqVO reqVO = new MmPredictAlarmConfigSaveReqVO(); reqVO.setAlarmObj(alarmObj); @@ -845,20 +843,24 @@ return true; } - /** - * 计算功率因数 p²/(根号:p²+Q²) - **/ - public Double calculateCos(Double PValue,Double QValue) { - // 绝对值 - PValue = Math.abs(PValue); - QValue = Math.abs(QValue); - //PValue [0,0.001] 直接判断为关闭返回0 - if (PValue >= 0 && PValue <= 0.001) { - return 0.0; - }else { - BigDecimal result = new BigDecimal(PValue).divide(BigDecimal.valueOf(Math.sqrt(Math.pow(PValue, 2) + Math.pow(QValue, 2))), 2, BigDecimal.ROUND_HALF_UP); - return result.doubleValue(); - } + @Override + public MmItemOutputDTO getItemOutputByItemid(String itemid, String resultstr, String resultIndex) { + return ConvertUtils.sourceToTarget(mmItemOutputService.getByItemid(itemid,resultstr,resultIndex),MmItemOutputDTO.class); + } + + @Override + public List<Object[]> getItemResult(String outputid, Date startTime, Date endTime, String timeFormat) { + return mmItemResultService.getData(outputid,startTime,endTime,timeFormat); + } + + @Override + public PredictItemVO getPredictItemByItemNo(String itemNo) { + return ConvertUtils.sourceToTarget(mmPredictItemService.getItemByItemNo(itemNo),PredictItemVO.class); + } + + @Override + public List<Object[]> getItemResultLastPoint(String outputid, Date startTime, Date endTime, String timeFormat) { + return mmItemResultLastPointService.getData(outputid,startTime,endTime,timeFormat); } private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { -- Gitblit v1.9.3