vince
2024-12-13 d3e48589ea2719cdde41b87fc1ad80f4ee509bac
优化测温协议
已修改8个文件
38 ■■■■■ 文件已修改
src/main/java/com/fzzy/gateway/GatewayTimerScheduled.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/ProtocolRunner.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/bhzn/v0/cmd/CommandBuild.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/bhzn/v0/server/BhznGrainV0ServerUtils.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/bhzn/v0/service/Bhzn0GatewayGrainService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/youxian0/analysis/AnalysisService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/protocol/youxian1/analysis/AnalysisService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/GatewayTimerScheduled.java
@@ -64,7 +64,7 @@
     * <p>
     * 粮情每天11点穿上区
     */
    @Scheduled(cron = "0 0 11 * * ?")
//    @Scheduled(cron = "0 0 11 * * ?")
    public void scheduledGrain() {
        //获取设备配置,只针对粮情设备进行执行
        log.info("定时kafka粮情推送");
@@ -107,8 +107,9 @@
     * 粮情每天8点采集粮情
     *
     */
    @Scheduled(cron = "0 30 5 ? * *")
//    @Scheduled(cron = "0 30 5 ? * *")
//    @Scheduled(cron = "0 32 11 ? * 1,4")
    @Scheduled(cron = "0 32 11 ? * *")
    public void scheduledGrain2() {
        //获取设备配置,只针对粮情设备进行执行
        log.info("定时粮情采集kafka推送");
src/main/java/com/fzzy/protocol/ProtocolRunner.java
@@ -37,9 +37,9 @@
        //邦海智能纯网口设备协议
        BhznGrainV2ServerEngine.start(null);
        //邦海智能无线主机设备协议
        //BhznGrainV0ServerEngine.start(null);
        BhznGrainV0ServerEngine.start(null);
        //邦海智能无线主机设备协议
        BhznGrainV01ServerEngine.start(null);
        //BhznGrainV01ServerEngine.start(null);
    }
}
src/main/java/com/fzzy/protocol/bhzn/v0/cmd/CommandBuild.java
@@ -79,7 +79,7 @@
        sb.append(BytesUtil.tran_LH(BytesUtil.intToHexStr(i)));
        //发送方地址
        sb.append("0001");
        sb.append("0000");
        //命令ID
        sb.append(BhznGrainV0ServerUtils.FUNCTION_ID_83);
src/main/java/com/fzzy/protocol/bhzn/v0/server/BhznGrainV0ServerUtils.java
@@ -93,6 +93,12 @@
        return BytesUtil.intToHexStr(256 - check).substring(2);
    }
    public static void main(String[] args) {
        System.out.println(getCheck("AA630A0001830108"));
    }
    public static void addSession(IoSession session) {
        contextIoSession.put(DEFAULT_MAC_ID, session);
    }
src/main/java/com/fzzy/protocol/bhzn/v0/service/Bhzn0GatewayGrainService.java
@@ -66,7 +66,7 @@
            // 发送命令
            InvokeResult message = BhznGrainV0ServerEngine.pushByMin(hexStr);
            log.error("平台------>>>>控制柜:发送粮情检测命令-{}", message);
            log.error("平台------>>>>控制柜:发送粮情检测命令-{} -------------- {}", message,hexStr);
            // 封装返回信息
            if (!InvokeResult.SUCCESS.getCode().equals(message.getCode())) {
src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java
@@ -143,7 +143,7 @@
            }
            //数据优化
            if (curTemp > 35) {
            if (curTemp > 40) {
                curTemp = response.getTAvg();
            }
src/main/java/com/fzzy/protocol/youxian0/analysis/AnalysisService.java
@@ -277,14 +277,14 @@
            temperature.add(new GrainTemp(cableNum + "", z + "", curTemp + "", position + ""));
            sumT += curTemp;
            if (curTemp > max) {
            if (curTemp > max  && curTemp < 38) {
                max = curTemp;
            }
            if (curTemp < min && new Double(curTemp).intValue()!= -100) {
            if (curTemp < min && curTemp > 5) {
                min = curTemp;
            }
            if(new Double(curTemp).intValue()!= -100){
            if(curTemp > 5 &&  curTemp < 38){
                sumT += curTemp;
                sumNum++;
            }
        }
src/main/java/com/fzzy/protocol/youxian1/analysis/AnalysisService.java
@@ -228,13 +228,16 @@
            temperature.add(new GrainTemp(cableNum + "", z + "", curTemp + "", position + ""));
            sumT += curTemp;
            if (curTemp > max) {
            if (curTemp > max  && curTemp < 38) {
                max = curTemp;
            }
            if (curTemp < min) {
            if (curTemp < min && curTemp > 5) {
                min = curTemp;
            }
            if(curTemp > 5 &&  curTemp < 38){
                sumT += curTemp;
                sumNum++;
            }
        }
        if (sumNum == 0) {