| | |
| | | import com.fzzy.gateway.hx2023.data.CloudSendData; |
| | | import com.fzzy.gateway.hx2023.data.SyncReqData; |
| | | import com.fzzy.mqtt.MqttProviderConfig; |
| | | import com.fzzy.mqtt.MqttPublishService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | @Resource |
| | | private GatewayRemoteManager gatewayRemoteManager; |
| | | @Resource |
| | | private MqttProviderConfig providerClient; |
| | | private MqttPublishService publishService; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | //自动推送 |
| | | if (200 == resp.getCode() && syncReqData.isAutoReplay()) { |
| | | String topic = "/${productId}/${deviceId}/properties/report"; |
| | | String topic = ScConstant.TOPIC_REPORT; |
| | | |
| | | topic = topic.replace("${productId}", device.getProductId()).replace("${deviceId}", device.getDeviceId()); |
| | | |
| | | providerClient.publish(topic, resp.getData()); |
| | | publishService.publishMsg(topic, resp.getData()); |
| | | |
| | | log.info("=======粮情推送==========={}", resp.getData()); |
| | | } |