Junjie
2024-03-04 7603004d9eed2904a823861e7cd6f5c2f0016500
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -44,7 +44,6 @@
 */
@Slf4j
@Service("mainService")
@Transactional
public class MainServiceImpl {
    @Value("${wms.url}")
@@ -2576,7 +2575,7 @@
                                    }
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
//                                e.printStackTrace();
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                            }
@@ -2601,7 +2600,7 @@
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
//            e.printStackTrace();
        }
    }
@@ -2985,7 +2984,7 @@
                    if (ioType != 110 && ioType != 10) {
                        List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkNo));
                        wrkDetls.forEach(wrkDetl -> {
                            ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), wrkDetl.getStock(), wrkDetl.getSpecs(), wrkDetl.getSuppCode(), wrkDetl.getOrderNo()));
                            ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), (wrkDetl.getStock() - wrkDetl.getAnfme()), wrkDetl.getSpecs(), wrkDetl.getSuppCode(), wrkDetl.getOrderNo()));
                        });
//                        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo));
@@ -4101,32 +4100,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();
        }
    }