src/main/java/com/fzzy/gateway/controller/GatewayDeviceTestController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/gateway/hx2023/service/OnReceiveMqttService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/gateway/service/GatewayDeviceTestPR.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/gateway/view/GatewayDevice.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/protocol/weightyh/MessageConsumer.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application-devGateway.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/fzzy/gateway/controller/GatewayDeviceTestController.java
@@ -105,7 +105,8 @@ reqData.setData(resp.getData()); gatewayRemoteManager.getDeviceReportService(device.getPushProtocol()).reportGrainData(reqData); } return "SUCCESS:执行完成"; return "SUCCESS"; } src/main/java/com/fzzy/gateway/hx2023/service/OnReceiveMqttService.java
@@ -1,14 +1,14 @@ package com.fzzy.gateway.hx2023.service; import com.alibaba.fastjson2.JSONObject; import com.fzzy.api.data.GatewayDeviceProtocol; import com.fzzy.gateway.GatewayUtils; import com.fzzy.gateway.api.GatewayRemoteManager; import com.fzzy.gateway.data.BaseReqData; import com.fzzy.gateway.data.BaseResp; import com.fzzy.gateway.entity.GatewayDevice; import com.fzzy.gateway.hx2023.ScConstant; import com.fzzy.gateway.hx2023.data.CloudSendData; import com.fzzy.gateway.data.BaseReqData; import com.fzzy.mqtt.MqttGatewayService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -23,8 +23,6 @@ @Resource private GatewayRemoteManager gatewayRemoteManager; @Resource private MqttGatewayService mqttGatewayService; /** @@ -32,7 +30,7 @@ * * @param message */ public void onReceiveMessage(String topic,String message) { public void onReceiveMessage(String topic, String message) { try { CloudSendData cloudSendData = JSONObject.parseObject(message, CloudSendData.class); @@ -44,7 +42,7 @@ } } catch (Exception e) { log.error("--------执行异常-----{}",e); log.error("--------执行异常-----{}", e); } } @@ -57,6 +55,8 @@ BaseReqData syncReqData = new BaseReqData(); syncReqData.setDeviceId(deviceId); syncReqData.setProductId(device.getProductId()); syncReqData.setDeviceName(device.getDeviceName()); syncReqData.setMessageId(cloudSendData.getMessageId()); syncReqData.setMessageType(cloudSendData.getMessageType()); syncReqData.setFunctionId(cloudSendData.getFunctionId()); @@ -64,11 +64,12 @@ syncReqData.setDevice(device); //TODO --->>暂时返回测试数据 //BaseResp resp = gatewayRemoteManager.getSyncGrainService(device.getSyncProtocol()).syncGrain(syncReqData); BaseResp resp = gatewayRemoteManager.getGatewayTestService(device.getPushProtocol()).testGrain(syncReqData); BaseResp resp; if (GatewayDeviceProtocol.DEVICE_TEST.getCode().equals(device.getSyncProtocol())) { resp = gatewayRemoteManager.getGatewayTestService(device.getPushProtocol()).testGrain(syncReqData); } else { resp = gatewayRemoteManager.getSyncGrainService(device.getSyncProtocol()).syncGrain(syncReqData); } //自动推送 if (200 == resp.getCode() && syncReqData.isAutoReplay()) { src/main/java/com/fzzy/gateway/service/GatewayDeviceTestPR.java
@@ -73,7 +73,7 @@ return "ERROR:当前设备没有配置布线规则,无法执行"; } BaseResp resp = gatewayRemoteManager.getSyncGrainService(data.getSyncProtocol()).syncGrain2(reqData); BaseResp resp = gatewayRemoteManager.getSyncGrainService(data.getSyncProtocol()).syncGrain(reqData); //自动推送 if (200 == resp.getCode() && reqData.isAutoReplay()) { @@ -153,11 +153,11 @@ if (null == deviceReportService) { deviceReportService = gatewayRemoteManager.getDeviceReportService(device.getProvinceProtocol()); deviceReportService = gatewayRemoteManager.getDeviceReportService(device.getPushProtocol()); } deviceReportService.pushGrainData2Cloud(pushData); // deviceReportService.pushGrainData2Cloud(pushData); } src/main/java/com/fzzy/gateway/view/GatewayDevice.js
@@ -6,7 +6,7 @@ $.ajax({ type:"POST", contentType:"application/json;charset=UTF-8", url:"/sc2023/gateway/test/deviceTest", url:"/gateway/test/deviceTest", data:JSON.stringify(param), success:function(result){ $alert(result); src/main/java/com/fzzy/protocol/weightyh/MessageConsumer.java
@@ -75,7 +75,7 @@ reportService = SpringUtil.getBean(GatewayRemoteManager.class); } reportService.getDeviceReportService(device.getProvinceProtocol()).report2GatewayBySn(weigh, device); reportService.getDeviceReportService(device.getPushProtocol()).report2GatewayBySn(weigh, device); } /** src/main/resources/application-devGateway.yml
@@ -73,8 +73,8 @@ host: tcp://127.0.0.1:1883 username: admin password: admin123321 client-inId: fzzy-clientInId-igds-api client-outId: fzzy-clientInOutId-igds-api client-inId: fzzy_client_id_in_igds_api client-outId: fzzy_client_id_out_igds_api completionTimeout: 3000 keep-alive-interval: 2 max-connect-times: 5