自动化立体仓库 - WCS系统
#
luxiaotao1123
2021-08-03 b132eaf0d7c8dfd4e808f63ed78eb3bc3bbfcfc8
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()) {
                    // 判断重复工作档
@@ -421,8 +427,7 @@
    /**
     * 入出库  ===>>  堆垛机入出库作业下发
     */
    @Async
    public void crnIoExecute(){
    public synchronized void crnIoExecute(){
        for (CrnSlave crn : slaveProperties.getCrn()) {
            // 获取堆垛机信息
            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
@@ -530,6 +535,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);