自动化立体仓库 - WCS系统
999
zhangc
2025-04-19 e6f5b482519ee58052a934026c7523cc16f88291
999
3个文件已修改
60 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/WrkMastScheduler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/FyDevpThread.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -260,7 +260,56 @@
                            e.printStackTrace();
                        }
                    }
                } else if (inSta.getStaNo() == 1012 || inSta.getStaNo() == 1022) {
                    // 获取入库站信息
                    DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
                    StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
                    if (staProtocol == null) {
                        continue;
                    } else {
                        staProtocol = staProtocol.clone();
                    }
                    Short workNo = staProtocol.getWorkNo();
                    if (staProtocol.isAutoing() && staProtocol.isLoading() && isInEnable(devpThread, inSta.getStaNo()) && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999)) && staProtocol.isPakMk()) {
                        String barcode = staProtocol.getBarcode();
                        // 判断重复工作档
                        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_sta_no", inSta.getStaNo()).eq("wrk_sts", WrkStsType.NEW_INBOUND.sts).eq("barcode", barcode));
                        if (wrkMast == null) {
                            try {
                                String wmsUrl = "192.168.10.201:8080/fyxcwms";
                                SearchLocParam param = new SearchLocParam();
                                param.setBarcode(barcode);
                                param.setIoType(1);
                                param.setSourceStaNo(inSta.getStaNo());
                                param.setLocType1((short) 1);
                                String response = new HttpHandler.Builder()
                                        .setUri(wmsUrl)
                                        .setPath("/rpc/pakin/loc/v1")
                                        .setJson(JSON.toJSONString(param))
                                        .build()
                                        .doPost();
                                JSONObject jsonObject = JSON.parseObject(response);
                                Integer code = jsonObject.getInteger("code");
                                if (code.equals(200)) {
                                } else {
                                    String msg = jsonObject.getString("msg");
                                    HashMap<String, String> hashMap = new HashMap<>();
                                    hashMap.put("msg", msg);
                                    hashMap.put("sta", inSta.getStaNo().toString());
                                    new HttpHandler.Builder()
                                            .setUri(wmsUrl)
                                            .setPath("/rpc/led/getError")
                                            .setJson(JSON.toJSONString(hashMap))
                                            .build()
                                            .doPost();
                                    News.error("入库申请失败,任务数据={},请求响应={}", JSON.toJSON(param), JSON.toJSON(jsonObject));
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    }
                }
            }
        } catch (Exception e) {
src/main/java/com/zy/asrs/task/WrkMastScheduler.java
@@ -245,7 +245,7 @@
            }
            //上报
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_CHARGE_COMPLETE, JSON.toJSONString(wrkMast));
            //notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_CHARGE_COMPLETE, JSON.toJSONString(wrkMast));
        }
    }
src/main/java/com/zy/core/thread/impl/FyDevpThread.java
@@ -41,7 +41,7 @@
    private SiemensS7Net siemensS7Net;
    private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
    public IoModeType ioModeOf2_5 = IoModeType.NONE;
    public IoModeType ioModeOf2_5 = IoModeType.PAKIN_MODE;
    private short heartBeatVal = 1;
    private int barcodeSize = 10;
@@ -303,10 +303,13 @@
    private void updateIoMode() throws InterruptedException {
        if (this.ioModeOf2_5 != null && (this.ioModeOf2_5.id == 0 || this.ioModeOf2_5.id == 1)) {
            if (!siemensS7Net.Write("DB83.80", this.ioModeOf2_5.id).IsSuccess) {
                station.get(1031).setOutInModel(this.ioModeOf2_5.id);
                station.get(1032).setOutInModel(this.ioModeOf2_5.id);
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2.5F入出库模式失败", this.ioModeOf2_5));
                log.error("【{0}】写入输送线2.5F入出库模式失败。输送线plc编号={}", this.ioModeOf2_5);
            } else {
                if (station.get(1031) != null) {
                    station.get(1031).setOutInModel(this.ioModeOf2_5.id);
                    station.get(1032).setOutInModel(this.ioModeOf2_5.id);
                }
            }
        }