12
TQS
2025-04-15 624b93640b504a33837fddb3fb9ef1ebb510f20c
12
2个文件已修改
114 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -95,6 +95,8 @@
    @Autowired
    private WaitPakinMapper waitPakinMapper;
    private Map<String, Integer> flagData = new HashMap<>();
    /**
     * 组托
     * 入库站,根据条码扫描生成入库工作档,工作状态 2
@@ -225,6 +227,7 @@
                        JSONObject jsonObject = JSON.parseObject(response);
                        LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                        Integer code = jsonObject.getInteger("code");
                        Object redata = jsonObject.get("data");
                        if (code.equals(200)) {
                            StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                            // plc 处理
@@ -247,19 +250,7 @@
//                                }
//                            }
//                            News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                        }else if (code == 800) {
                            staProtocol.setWorkNo((short) 9995);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            // led 异常显示
                            if (ledThread != null) {
                                String errorMsg = barcode + "没有对应空库位";
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            }
                        }
                        else if (code == 700) {
                        } else if (code == 700) {
                            staProtocol.setWorkNo((short) 9995);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -270,40 +261,71 @@
                                String errorMsg = barcode + "托盘识别异常,请先进行组托!";
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            }
                        } else if (code == 500 || code == 1000) {
                            if (inSta.getStaNo().equals(103)) {
                                staProtocol.setWorkNo((short) 9996);
                                staProtocol.setStaNo((short) 203);
                            }
                            if (inSta.getStaNo().equals(203)) {
                                staProtocol.setWorkNo((short) 9996);
                                staProtocol.setStaNo((short) 103);
                            }
                            if (inSta.getStaNo().equals(113)) {
                                staProtocol.setWorkNo((short) 9995);
                                staProtocol.setStaNo((short) 114);
                            } else if (inSta.getStaNo().equals(213)) {
                                staProtocol.setWorkNo((short) 9995);
                                staProtocol.setStaNo((short) 214);
                            }
                        } else if (redata.toString().contains("物料类型和实际种类不一致")) {
                            staProtocol.setWorkNo((short) 9995);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            String data = jsonObject.getString("data");
                            String msg = jsonObject.getString("msg");
                            if (code == 500) {
                                // led 异常显示
                                if (ledThread != null) {
                                    String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "检索库位失败,请检查库存剩余。===>>" + data + "--" + msg;
                                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                                }
                            } else if (code == 1000) {
                                // led 异常显示
                                if (ledThread != null) {
                                    String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "需要换入库站。";
                                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            // led 异常显示
                            if (ledThread != null) {
                                String errorMsg = barcode + "物料类型和实际种类不一致!";
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            }
                        } else if ((code == 500 || code == 1000)) {
                            if (redata != null && redata.toString().startsWith("800")) {
                                Integer num = flagData.get(param.getBarcode());
                                if (num != null) {
                                    flagData.put(param.getBarcode(), num + 1);
                                } else {
                                    flagData.put(param.getBarcode(), 1);
                                }
                            }
                            if (flagData.get(param.getBarcode()) != null && flagData.get(param.getBarcode()) >= 2) {
                                staProtocol.setWorkNo((short) 9995);
                                staProtocol.setStaNo(inSta.getBackSta().shortValue());
                                devpThread.setPakMk(staProtocol.getSiteId(), false);
                                MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                                // led 异常显示
                                if (ledThread != null && redata != null) {
                                    String errorMsg = barcode + redata.toString();
                                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                                }
                            } else {
                                if (inSta.getStaNo().equals(103)) {
                                    staProtocol.setWorkNo((short) 9996);
                                    staProtocol.setStaNo((short) 203);
                                }
                                if (inSta.getStaNo().equals(203)) {
                                    staProtocol.setWorkNo((short) 9996);
                                    staProtocol.setStaNo((short) 103);
                                }
                                if (inSta.getStaNo().equals(113)) {
                                    staProtocol.setWorkNo((short) 9995);
                                    staProtocol.setStaNo((short) 114);
                                } else if (inSta.getStaNo().equals(213)) {
                                    staProtocol.setWorkNo((short) 9995);
                                    staProtocol.setStaNo((short) 214);
                                }
                                devpThread.setPakMk(staProtocol.getSiteId(), false);
                                MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                                String data = jsonObject.getString("data");
                                String msg = jsonObject.getString("msg");
                                if (code == 500) {
                                    // led 异常显示
                                    if (ledThread != null) {
                                        String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "检索库位失败,请检查库存剩余。===>>" + data + "--" + msg;
                                        MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                                    }
                                } else if (code == 1000) {
                                    // led 异常显示
                                    if (ledThread != null) {
                                        String errorMsg = "入库站:" + staProtocol.getStaNo() + "---" + barcode + "需要换入库站。";
                                        MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                                    }
                                }
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
@@ -2821,7 +2843,7 @@
    /**
     * 让小车从 远点 ====>> 待机
     *  等待堆垛机搬运
     * 等待堆垛机搬运
     */
    public synchronized void letCarBeWaiting(WrkMast wrkMast, Integer steNo, String locNo) {
        // 获取穿梭车信息
@@ -2905,7 +2927,7 @@
    /**
     * 让小车从 远点 ====>> 移动到近点
     *  等待堆垛机搬运
     * 等待堆垛机搬运
     */
    public synchronized void letCarBeReady(WrkMast wrkMast, Integer steNo, String locNo) {
        // 获取穿梭车信息
@@ -2949,7 +2971,7 @@
    /**
     * 让小车从 远点 ====>> 移动到近点
     *  等待堆垛机搬运
     * 等待堆垛机搬运
     */
    public synchronized void letCarBeReady(WrkCharge wrkCharge, Integer steNo) {
        // 获取穿梭车信息
src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
  port: 9090
  port: 9091
  servlet:
    context-path: /@pom.build.finalName@