pjb
2024-07-03 62ed44f8c15a0d2ce8aff83129f23c1656ee9968
解决设备断电报错写日志把磁盘写满问题
3个文件已修改
16 ■■■■■ 已修改文件
src/main/java/com/zy/core/cache/MessageQueue.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/cache/MessageQueue.java
@@ -92,7 +92,11 @@
            case Barcode:
                return BARCODE_EXCHANGE.get(id).poll();
            case Led:
                return LED_EXCHANGE.get(id).poll();
                try {
                    return LED_EXCHANGE.get(id).poll();
                }catch (Exception e) {
                }
            case Scale:
                return SCALE_EXCHANGE.get(id).poll();
            case Car:
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -185,7 +185,7 @@
            } else {
                initCrn();
                OutputQueue.CRN.offer(MessageFormat.format("【{0}】读取堆垛机plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
                News.error("SiemensCrn" + " - 4" + " - 读取堆垛机plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
//                News.error("SiemensCrn" + " - 4" + " - 读取堆垛机plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
            }
            // 复位信号
            if (crnProtocol.getStatusType().equals(CrnStatusType.WAITING) && resetFlag) {
@@ -216,7 +216,7 @@
        } catch (Exception e) {
            e.printStackTrace();
            OutputQueue.CRN.offer(MessageFormat.format("【{0}】读取堆垛机plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
            News.error("SiemensCrn" + " - 5" + " - 读取堆垛机plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
//            News.error("SiemensCrn" + " - 5" + " - 读取堆垛机plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
            initCrn();
        }
    }
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -224,7 +224,7 @@
                }
            } else {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】读取输送线plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
                log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
//                log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
            }
            //条码扫描器
@@ -271,7 +271,7 @@
                }
            } else {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】读取输送线plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
                log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
//                log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] ", slave.getId(), slave.getIp(), slave.getPort());
            }
            //外形检测
@@ -306,6 +306,7 @@
        }
        // 根据实时信息更新数据库
        try {
            if (!station.isEmpty()) {
            List<BasDevp> basDevps = new ArrayList<>();
            for (Integer siteId : staNos) {
                StaProtocol staProtocol = station.get(siteId);
@@ -316,6 +317,7 @@
            if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
                throw new Exception("更新数据库数据失败");
            }
            }
        } catch (Exception e) {
            e.printStackTrace();
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】更新数据库数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));