src/main/java/com/fzzy/api/Constant.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/gateway/GatewayTimerScheduled.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/protocol/ProtocolUtils.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/fzzy/api/Constant.java
@@ -339,11 +339,11 @@ } return null; } public static ApiCommonDevice getCommonDeviceCacheBySn(String sn) { public static synchronized ApiCommonDevice getCommonDeviceCacheBySn(String sn) { if (null == sn) return null; if (contextDeviceMap.isEmpty()) return null; log.info("在线设备:" + JSON.toJSONString(contextDeviceMap)); //log.info("在线设备:" + JSON.toJSONString(contextDeviceMap)); for (ApiCommonDevice device : contextDeviceMap.values()) { if (sn.equals(device.getSn())) return device; } src/main/java/com/fzzy/gateway/GatewayTimerScheduled.java
@@ -109,7 +109,7 @@ */ // @Scheduled(cron = "0 30 5 ? * *") // @Scheduled(cron = "0 32 11 ? * 1,4") @Scheduled(cron = "0 32 11 ? * *") @Scheduled(cron = "0 32 5 ? * *") public void scheduledGrain2() { //获取设备配置,只针对粮情设备进行执行 log.info("定时粮情采集kafka推送"); @@ -119,7 +119,7 @@ log.error("为获取到系统中设备配置,取消执行\""); return ; } BaseReqData reqData = new BaseReqData(); BaseReqData reqData ; BaseResp resp; for (int i = 0 ;i<3;i++){ @@ -132,6 +132,7 @@ if( i>0 && !(device.getDeviceId().startsWith("91510704731594658J001") ||device.getDeviceId().startsWith("91510704731594658J002") || device.getDeviceId().startsWith("91510700205404914T001"))){ continue; } reqData = new BaseReqData(); reqData.setDeviceId(device.getDeviceId()); reqData.setProductId(device.getProductId()); reqData.setDeviceName(device.getDeviceName()); src/main/java/com/fzzy/protocol/ProtocolUtils.java
@@ -1,9 +1,11 @@ package com.fzzy.protocol; import com.alibaba.fastjson.JSON; import com.fzzy.gateway.data.BaseReqData; import com.fzzy.protocol.data.THDto; import io.netty.channel.Channel; import lombok.extern.slf4j.Slf4j; import java.util.HashMap; import java.util.Map; @@ -11,6 +13,7 @@ /** * 协议解析全局常量 */ @Slf4j public class ProtocolUtils { @@ -46,7 +49,8 @@ contextSyncReqMap.put(depotId, reqData); } public static BaseReqData getSyncReq(String depotId) { public static synchronized BaseReqData getSyncReq(String depotId) { log.info(JSON.toJSONString(contextSyncReqMap)); return contextSyncReqMap.get(depotId); } src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java
@@ -95,12 +95,12 @@ //获取请求信息 BaseReqData reqData = ProtocolUtils.getSyncReq(response.getHouseId()); log.info("--粮情封装解析,获取到请求命令参数----"); if (null == reqData) { log.error("--粮情封装解析,未获取到请求相关参数----"); return; } log.info(reqData.toString()); int cableZ = Integer.valueOf(response.getLay()); int cableY = Integer.valueOf(response.getRow()); src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisService.java
@@ -48,6 +48,8 @@ //执行的分机信息 ApiCommonDevice commonDevice = Constant.getCommonDeviceCacheBySn(message.getSn()); log.info("获取到的设备信息"); log.info(commonDevice.toString()); if (null == commonDevice) { log.warn("控制柜------>>>平台:当前组织编码={},分机ID={},系统没有获取到分机信息,报文无法进行解析", message.getCompanyId(), message.getIedId()); return;