修改提交
This commit is contained in:
@@ -11,6 +11,8 @@ import com.njcn.csharmonic.pojo.vo.CsRtDataVO;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.csharmonic.service.ILineTargetService;
|
||||
import com.njcn.csharmonic.service.StableDataService;
|
||||
import com.njcn.csharmonic.service.TemperatureService;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -43,6 +45,8 @@ public class MqttMessageHandler {
|
||||
private final ILineTargetService lineTargetService;
|
||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||
private final StableDataService stableDataService;
|
||||
|
||||
private final TemperatureService temperatureService;
|
||||
private final DecimalFormat df = new DecimalFormat("#0.000");
|
||||
/**
|
||||
* 实时数据应答
|
||||
@@ -54,6 +58,13 @@ public class MqttMessageHandler {
|
||||
publisher.send("/zl/rtData/"+pageId,gson.toJson(list),1,false);
|
||||
}
|
||||
|
||||
@MqttSubscribe(value = "/zl/askTemperData/{devId}",qos = 1)
|
||||
public void responseTemperData(String topic, @NamedValue("devId") String devId, MqttMessage message, @Payload String payload) {
|
||||
List<StatisticalDataDTO> statisticalDataDTOS = temperatureService.queryTemperature(devId);
|
||||
Gson gson = new Gson();
|
||||
publisher.send("/zl/TemperData/"+devId,gson.toJson(statisticalDataDTOS),1,false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时数据应答
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user