自动化立体仓库 - WCS系统
999
zhangc
9 天以前 e6f5b482519ee58052a934026c7523cc16f88291
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) {