From 7a7bbc66b5d3200f3f6703d7e560b4ac7cc95489 Mon Sep 17 00:00:00 2001 From: zhangchao <zc857179121@qq.com> Date: 星期一, 04 十一月 2024 13:51:08 +0800 Subject: [PATCH] 请求超时导致直接生成了工作档,入库失败 --- src/main/java/com/zy/core/thread/SiemensDevpThread.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java index 288fb99..bb12fe9 100644 --- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java +++ b/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)); } -- Gitblit v1.9.1