zhangchao
2024-11-04 7a7bbc66b5d3200f3f6703d7e560b4ac7cc95489
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -329,8 +329,8 @@
                    StaProtocol staProtocol = station.get(siteId);
                    basDevps.add(staProtocol.toSqlModel());
                }
                BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
                BasDevpService basDevpService = SpringContextUtil.getBean(BasDevpService.class);
                //BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
                if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
                    throw new Exception("更新数据库数据失败");
                }
@@ -387,6 +387,17 @@
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线站点数据失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol)));
            News.error("SiemensDevp"+" - 4"+" - 写入输送线站点数据失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol));
        } else {
            //dang 101,201zhan xaifazhiling qingchu tiaoxingsaomaolide shuju shanchu
            if (staProtocol.getSiteId()==101){
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 1);
                log.info("qingchutiaoma,{}",barcodeThread.getBarcode());
                barcodeThread.clearBarcode();
            }
            if (staProtocol.getSiteId()==201){
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 2);
                log.info("qingchutiaoma,{}",barcodeThread.getBarcode());
                barcodeThread.clearBarcode();
            }
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
            News.info("SiemensDevp"+" - 5"+" - 输送线命令下发 [id:{}] >>>>> 命令下发: {}",  slave.getId(), JSON.toJSON(staProtocol));
        }