From 6d610662a6869dbbca6d75e490321130452bb4b6 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 12 Jul 2024 09:48:46 +0800 Subject: [PATCH] =?UTF-8?q?#app=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E3=80=81=E5=91=8A=E8=AD=A6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/operational/history/vo/HistoricalCurveVo.java | 11 +++++++++-- .../main/java/com/hnac/hzims/alarm/mqtt/MqttConfigHzims.java | 8 ++++---- .../operational/history/controller/HistoryController.java | 4 ++-- .../operational/history/service/impl/PointServiceImpl.java | 3 ++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/history/vo/HistoricalCurveVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/history/vo/HistoricalCurveVo.java index 1ba4a0a..b0a5fbe 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/history/vo/HistoricalCurveVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/history/vo/HistoricalCurveVo.java @@ -1,9 +1,12 @@ package com.hnac.hzims.operational.history.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @@ -29,10 +32,14 @@ public class HistoricalCurveVo { @ApiModelProperty(value = "第五个点位") private String fifthAttrId; - @ApiModelProperty(value = "第五个点位") + @ApiModelProperty(value = "开始时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime startTime; - @ApiModelProperty(value = "第五个点位") + @ApiModelProperty(value = "结束时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime endTime; @ApiModelProperty(value = "厂组点/设备") diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfigHzims.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfigHzims.java index 8c75506..b190753 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfigHzims.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfigHzims.java @@ -56,12 +56,12 @@ public class MqttConfigHzims { mqttConfig.setPassword(mqtt_fdp_password); mqttConfig.setUsername(mqtt_fdp_username); //fdp - AnalysisSubscribe analysisSubscribe = new AnalysisSubscribe(); + /*AnalysisSubscribe analysisSubscribe = new AnalysisSubscribe(); MqttAsyncClient fdpClient = analysisSubscribe.subscribe(mqttConfig, Collections.singletonList("#"), fdpMqttConsumer); log.info(fdpClient.toString()+fdpClient.getClientId()); //drools DroolsSoeSubscribe droolsSoeSubscribe = new DroolsSoeSubscribe(); - MqttAsyncClient droolsClient = droolsSoeSubscribe.subscribe(mqttConfig, Collections.singletonList("#"), droolsMqttConsumer); + MqttAsyncClient droolsClient = droolsSoeSubscribe(mqttConfig, Collections.singletonList("#"), droolsMqttConsumer); log.info(droolsClient.toString()+droolsClient.getClientId()); //Soe SoeSubscribe soeSubscribe = new SoeSubscribe(); @@ -74,8 +74,8 @@ public class MqttConfigHzims { //视频 SoeSubscribe subscribe = new SoeSubscribe(); MqttAsyncClient videoClient = subscribe.subscribe(mqttConfig, Collections.singletonList("#"), videoMqttConsumer); - log.info(videoClient.toString()+videoClient.getClientId()); - }catch (MqttException e){ + log.info(videoClient.toString()+videoClient.getClientId());*/ + }catch (Exception e){ log.error(e.toString()) ; } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/controller/HistoryController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/controller/HistoryController.java index f5d1b9a..93c10b9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/controller/HistoryController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/controller/HistoryController.java @@ -81,14 +81,14 @@ public class HistoryController extends BladeController { @PostMapping("/historicalCurve") @ApiOperationSupport(order = 5) @ApiOperation(value = "查询历史数据曲线图", notes = "获取历史数据折线图数据") - public R> historicalCurve(HistoricalCurveVo curve) { + public R> historicalCurve(@RequestBody HistoricalCurveVo curve) { return R.data(pointService.historicalCurve(curve)); } @PostMapping("/attrStatistics") @ApiOperationSupport(order = 6) @ApiOperation(value = "历史数据统计", notes = "获取历史数据统计数据") - public R> attrStatistics(HistoricalCurveVo curve) { + public R> attrStatistics(@RequestBody HistoricalCurveVo curve) { return R.data(pointService.attrStatistics(curve)); } } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java index a123379..341dbca 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java @@ -133,7 +133,8 @@ public class PointServiceImpl implements PointService { */ @Override public Map attrStatistics(HistoricalCurveVo curve) { - Result> result = deviceDataClient.getAttrStatistics(curve.getFirstAttrId(), + Result> result = deviceDataClient.getAttrStatistics( + curve.getFirstAttrId(), curve.getSecondAttrId(), curve.getThirdlyAttrId(), curve.getFourthAttrId(),