#
yxFwq
2024-08-22 ae04f441fe74d4ee68841b8e83c27fcbf399ebbd
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -375,6 +375,21 @@
            }
        }
        if (slave.getId()==2){
            OperateResultExOne<byte[]> result464 = siemensS7Net.Read("DB101.3720",(short)(8));
            if (result464.IsSuccess) {
                String barcode = siemensS7Net.getByteTransform().TransString(result464.Content,0,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 11);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    StaProtocol staProtocol = station.get(464);
                    if (null != staProtocol) {
                        staProtocol.setBarcode(barcode);
                        barcodeThread.setBarcode(barcode);
                    }
                }
            }
        }
//        //RGV小车
//        Thread.sleep(200);
//        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2);
@@ -401,11 +416,15 @@
                    basDevps.add(staProtocol.toSqlModel());
                }
                try{
                BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
                if (null != basDevpService && !basDevpService.updateBatchById(basDevps)) {
                    throw new Exception("更新数据库数据失败");
                }
            } catch (Exception e) {
                    log.error("更新数据库数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
                }
            } 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()));
                log.error("更新数据库数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());