#
tzsk
2024-03-04 9550fcfc2ac0c9c0e5c4aa0600361c4b4f908689
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4101,32 +4101,36 @@
    //扫描设备PakMk标记是否超时
    public synchronized void scanDevicePakMk() {
        //扫描小车
        for (ShuttleSlave slave : slaveProperties.getShuttle()) {
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
            if (shuttleProtocol == null) {
                continue;
        try {
            //扫描小车
            for (ShuttleSlave slave : slaveProperties.getShuttle()) {
                NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
                NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
                if (shuttleProtocol == null) {
                    continue;
                }
                if ((System.currentTimeMillis() - shuttleProtocol.getSendTime() > (1000 * 60 * 5)) && shuttleProtocol.getPakMk()) {
                    //设备超过5分钟还没复位标记
                    shuttleProtocol.setPakMk(false);//复位标记
                }
            }
            if ((System.currentTimeMillis() - shuttleProtocol.getSendTime() > (1000*60*5)) && shuttleProtocol.getPakMk()) {
                //设备超过5分钟还没复位标记
                shuttleProtocol.setPakMk(false);//复位标记
            }
        }
            //扫描提升机
            for (LiftSlave slave : slaveProperties.getLift()) {
                LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, slave.getId());
                LiftProtocol liftProtocol = liftThread.getLiftProtocol();
                if (liftProtocol == null) {
                    continue;
                }
        //扫描提升机
        for (LiftSlave slave : slaveProperties.getLift()) {
            LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, slave.getId());
            LiftProtocol liftProtocol = liftThread.getLiftProtocol();
            if (liftProtocol == null) {
                continue;
                if ((System.currentTimeMillis() - liftProtocol.getSendTime() > (1000 * 60 * 5)) && liftProtocol.getPakMk()) {
                    //设备超过5分钟还没复位标记
                    liftProtocol.setPakMk(false);//复位标记
                }
            }
            if ((System.currentTimeMillis() - liftProtocol.getSendTime() > (1000*60*5)) && liftProtocol.getPakMk()) {
                //设备超过5分钟还没复位标记
                liftProtocol.setPakMk(false);//复位标记
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }