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(),