vince
2024-01-27 facc0ea3fa37091a98aa1e0a0d1081fd32fba28e
src/main/java/com/fzzy/protocol/bhzn/v0/analysis/AnalysisService.java
@@ -108,19 +108,19 @@
    private void analysisGrain(IoMessage message) {
        try {
            //根据分机SN获取设备配置信息
            GatewayDevice gatewayDevice = GatewayUtils.getCacheByDeviceSn(message.getAddr());
            GatewayDevice gatewayDevice = BhznGrainV0ServerUtils.contextOrder;
            if (null == gatewayDevice) {
                replayGrain(message);
                log.error("主机-------->>平台,解析粮情失败,未获取到系统设备配置信息:" + message.getAddr());
                return;
            }
            //根据分机地址获取分机信息
            ApiCommonDevice commonDevice = Constant.getCommonDeviceCache(message.getIp());
            if (commonDevice == null) {
                replayGrain(message);
                log.error("主机-------->>平台,解析粮情失败,未获取到系统粮情主机配置:" + message.getAddr());
                return;
            }
//            ApiCommonDevice commonDevice = Constant.getCommonDeviceCache(message.getIp());
//            if (commonDevice == null) {
//                replayGrain(message);
//                log.error("主机-------->>平台,解析粮情失败,未获取到系统粮情主机配置:" + message.getAddr());
//                return;
//            }
            //获取请求信息
            BaseReqData reqData = ProtocolUtils.getSyncReq(gatewayDevice.getDepotIdSys());
@@ -188,7 +188,7 @@
        String hexStr = CommandBuild.getMsgGrainReply(message.getAddr());
        log.info("平台--------->>>主机,返回粮情报文收到信息,报文={}", hexStr);
        BhznGrainV0ServerEngine.push(message.getIp(), message.getPort(), BytesUtil.hexStrToBytes(hexStr));
        BhznGrainV0ServerEngine.pushByMin(hexStr);
    }
    /**
@@ -562,7 +562,7 @@
        } finally {
            String hexStr = CommandBuild.getMsgTHReply(message.getAddr());
            log.info("平台--------->>>主机,返回仓温仓湿收到信息,报文={}", hexStr);
            BhznGrainV0ServerEngine.push(message.getIp(), message.getPort(), BytesUtil.hexStrToBytes(hexStr));
            BhznGrainV0ServerEngine.pushByMin(hexStr);
        }
    }