#
luxiaotao1123
2021-08-02 c2927a5c32e19f8f860b81438fcb3a37c8e462a9
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -58,6 +58,9 @@
@Transactional
public class MainServiceImpl {
    public static final long COMMAND_TIMEOUT = 5 * 1000;
    @Autowired
    private CommonService commonService;
    @Autowired
@@ -97,6 +100,9 @@
            for (DevpSlave.Sta inSta : devp.getInSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                if (barcodeThread == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                if(!Cools.isEmpty(barcode)) {
                    log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
@@ -221,7 +227,7 @@
                    staProtocol = staProtocol.clone();
                }
                // 判断是否满足入库条件
                if (staProtocol.isAutoing() && staProtocol.isLoading()
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
                        && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() == 9999)
                        && staProtocol.isPakMk()) {
                    // 判断重复工作档
@@ -456,6 +462,9 @@
                    }
                }
            }
            try {
                Thread.sleep(1500L);
            } catch (InterruptedException ignore) {}
            // 库位移转
            this.locToLoc(crn, crnProtocol);
        }
@@ -530,6 +539,19 @@
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
            } else {
//                long startTime = System.currentTimeMillis();
//                while ((System.currentTimeMillis() - startTime) < COMMAND_TIMEOUT) {
//
//                    if (true) {
//                        break;
//                    }
//
//                    try{
//                        Thread.sleep(500);
//                    }catch(Exception ignore){}
//                }
                // 修改工作档状态 2.设备上走 => 3.吊车入库中
                Date now = new Date();
                wrkMast.setWrkSts(3L);