pang.jiabao
2025-09-17 cc6aa321c50a855a4eeed8f8e2f420709522b2f4
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -46,8 +46,7 @@
    private short heartBeatVal = 1;
    private StaError1 staError1;
    public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{
        add(100);add(101);add(102);add(103);
        add(104);add(105);add(106);add(107);
        add(101);add(102);add(103);add(104);add(105);add(106);add(107);add(108);
    }};
    public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{
@@ -139,6 +138,24 @@
                    staProtocol.setPakMk(true);
                }
            }
        // 根据实时信息更新数据库
        try {
            List<BasDevp> basDevps = new ArrayList<>();
            for (Integer siteId2 : staNos) {
                StaProtocol staProtocol2 = station.get(siteId2);
                basDevps.add(staProtocol2.toSqlModel());
            }
            BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
            if(basDevps.size() > 0) {
                if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
                    throw new Exception("更新数据库数据失败");
                }
            }
        } catch (Exception e){
        }
    }
    @Override