zwl
2 天以前 cd87c057ec64e917105bd85e4f562b54f7b165d7
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -38,6 +38,7 @@
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.LedThread;
import com.zy.core.thread.ScaleThread;
import com.zy.core.thread.SiemensDevpThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
@@ -340,6 +341,7 @@
                        errMsg = "扫码失败";
                        back = true;
                    }
                    // 判断是否满足入库条件
                    if (staProtocol.isAutoing() && staProtocol.isLoading()
                            && staProtocol.isInEnable()
@@ -374,12 +376,23 @@
                            }
                        }
                        ScaleThread scaleThread = (ScaleThread) SlaveConnection.get(SlaveType.Scale, inSta.getBarcode());
                        if(scaleThread != null) {
                            storageEscalationParam.setWeight(scaleThread.getScale());
                        }
                        storageEscalationParam.setBoxNo(BoxNo);
                        //是否满板 1满板  0空板
                        storageEscalationParam.setStaType(staProtocol.isEmptyMk() ? 0 : 1);
                        //库位类型 1高库位 0低库位
                        storageEscalationParam.setLocType(staProtocol.isHigh() ? 1 : 0);
                        //库位类型 2中库位 1高库位 0低库位
                        if(staProtocol.isHigh()){
                            storageEscalationParam.setLocType(1);
                        }else if(staProtocol.isLow()){
                            storageEscalationParam.setLocType(0);
                        }else if (staProtocol.isCentre()){
                            storageEscalationParam.setLocType(2);
                        }
                        storageEscalationParam.setTerminalNo(staProtocol.getSiteId());
                        log.info("组托入库={}", storageEscalationParam);
                        String response = "";
@@ -1118,7 +1131,7 @@
                crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint()));     // 目标库位列
                crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint()));     // 目标库位层
                crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint()));     // 目标库位排
                crnCommand.setCommand((short) 1);
                crnCommand.setCommand((short) 0);
                log.info("堆垛机入库任务下发={}", crnCommand);
                if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand), false)) {
                    log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand));
@@ -1229,7 +1242,7 @@
                        command.setDestinationPosX(crnStn.getRow().shortValue());     // 目标库位排
                        command.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列
                        command.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层
                        command.setCommand((short) 1);
                        command.setCommand((short) 0);
                        if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, command), false)) {
                            log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(command));
@@ -1832,7 +1845,7 @@
        taskWrk.setStatus(TaskStatusType.RECEIVE.id);//任务状态:接收
        taskWrk.setCreateTime(now);
        taskWrk.setIoType(1);//任务类型 入库
        taskWrk.setIoPri(13);//优先级
        taskWrk.setIoPri(10);//优先级
        taskWrk.setBarcode(barcode);//条码
        taskWrk.setTargetPoint(locNo);
        taskWrk.setStartPoint(staNo+"");
@@ -1916,14 +1929,21 @@
            // 获取led线程
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            // led显示默认内容
            if (reset && !ledThread.isLedMk()) {
            if (reset) {
                ledThread.setLedMk(true);
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
                    log.error(""+mark+" - 1"+" - {}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                } else {
                }
            }
//            if (reset) {
//                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
//                    log.error(""+mark+" - 1"+" - {}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
//                } else {
//
//                }
//            }
        }
//        log.info(""+mark+" - 0"+" - 执行完成:其他  ===>> LED显示器复位,显示默认信息");
    }