12
TQS
2025-04-15 624b93640b504a33837fddb3fb9ef1ebb510f20c
12
2个文件已修改
54 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 52 ●●●● 补丁 | 查看 | 原始文档 | 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,7 +261,38 @@
                                String errorMsg = barcode + "托盘识别异常,请先进行组托!";
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            }
                        } else if (code == 500 || code == 1000) {
                        } 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));
                            // 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);
@@ -303,7 +325,7 @@
                                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                                }
                            }
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
  port: 9090
  port: 9091
  servlet:
    context-path: /@pom.build.finalName@