zhangchao
2024-09-01 f2ae2101bbc93c120209b008a52ff470a9d2ffee
对照协议调整
3个文件已修改
98 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -116,10 +116,7 @@
            for (DevpSlave.Sta inSta : devp.getInSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                if (barcodeThread == null) {
                    continue;
                }
                // 获取入库站信息
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
                if (staProtocol == null) {
@@ -128,8 +125,79 @@
                    staProtocol = staProtocol.clone();
                }
                if (barcodeThread == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
                if (staProtocol.isFrontErr()) {
                    errMsg = "前超限";
                    back = true;
                }
                if (!back && staProtocol.isBackErr()) {
                    errMsg = "后超限";
                    back = true;
                }
                if (!back && staProtocol.isHighErr()) {
                    errMsg = "高超限";
                    back = true;
                }
                if (!back && staProtocol.isLeftErr()) {
                    errMsg = "左超限";
                    back = true;
                }
                if (!back && staProtocol.isRightErr()) {
                    errMsg = "右超限";
                    back = true;
                }
                if (!back && staProtocol.isWeightErr()) {
                    errMsg = "超重";
                    back = true;
                }
                if (!back && staProtocol.isBarcodeErr()) {
                    errMsg = "扫码失败";
                    back = true;
                }
                // 退回
                if (back) {
                    log.info("errmsg: " + errMsg);
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg));
                    if (!staProtocol.isLoading()) {
                        continue;
                    }
                    if (!staProtocol.isPakMk()) {
                        continue;
                    }
                    staProtocol.setWorkNo((short) 9999);
                    News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg, (short) 9999);
                    staProtocol.setStaNo(inSta.getBackSta().shortValue());
                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                    MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    log.error("输送线下发1:" + 9999 + "," + inSta.getBackSta());
                }
                // 获取条码扫描仪信息
                //BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                if (barcodeThread == null) {
                    continue;
                }
                // 获取入库站信息
                //SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                //StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
                    staProtocol = staProtocol.clone();
                }
                //LED
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                //LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                // 入出库模式判断
//                if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; }
//                if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) {
@@ -165,7 +233,7 @@
//                        Thread.sleep(300);
//                    }catch (Exception e){}
                    String barcode = barcodeThread.getBarcode();
                    //String barcode = barcodeThread.getBarcode();
                    if (!Cools.isEmpty(barcode)) {
                        News.info("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) {
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -337,14 +337,6 @@
                                || !command.getSourcePosZ().equals(one.getSourcePosZ()) || !command.getDestinationPosX().equals(one.getDestinationPosX())
                                || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ())
                        ) {
                            System.out.println(command.getTaskNo().equals(one.getTaskNo()));
                            System.out.println(command.getTaskMode().equals(one.getTaskMode()));
                            System.out.println(command.getDestinationPosX().equals(one.getDestinationPosX()));
                            System.out.println(command.getDestinationPosY().equals(one.getDestinationPosY()));
                            System.out.println(command.getDestinationPosZ().equals(one.getDestinationPosZ()));
                            System.out.println(command.getSourcePosZ().equals(one.getSourcePosZ()));
                            System.out.println(command.getSourcePosY().equals(one.getSourcePosY()));
                            System.out.println(command.getSourcePosX().equals(one.getSourcePosX()));
                            try {
                                log.error("堆垛机命令地址写入后回读失败==>不一致[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSONString(command), JSON.toJSONString(one));
                            } catch (Exception e) {
@@ -373,14 +365,6 @@
                                || !command.getSourcePosZTwo().equals(one.getSourcePosZTwo()) || !command.getDestinationPosXTwo().equals(one.getDestinationPosXTwo())
                                || !command.getDestinationPosYTwo().equals(one.getDestinationPosYTwo()) || !command.getDestinationPosZTwo().equals(one.getDestinationPosZTwo())
                        ) {
                            System.out.println(command.getTaskNo().equals(one.getTaskNo()));
                            System.out.println(command.getTaskMode().equals(one.getTaskMode()));
                            System.out.println(command.getSourcePosXTwo().equals(one.getSourcePosXTwo()));
                            System.out.println(command.getDestinationPosYTwo().equals(one.getDestinationPosYTwo()));
                            System.out.println(command.getDestinationPosZTwo().equals(one.getDestinationPosZTwo()));
                            System.out.println(command.getSourcePosZTwo().equals(one.getSourcePosZTwo()));
                            System.out.println(command.getSourcePosYTwo().equals(one.getSourcePosYTwo()));
                            System.out.println(command.getDestinationPosXTwo().equals(one.getDestinationPosXTwo()));
                            try {
                                log.error("堆垛机命令地址写入后回读失败==>不一致[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSONString(command), JSON.toJSONString(one));
                            } catch (Exception e) {
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -50,7 +50,7 @@
        add(101);
        add(102);
        add(103);
        //add(104);
        add(104);
    }};
    public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{