#
luxiaotao1123
2021-05-18 94f49da050e1c24844a2a4bd7a67517e5050cfac
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
@@ -221,7 +224,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()) {
                    // 判断重复工作档
@@ -530,6 +533,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);