#
tqs
2022-12-06 0dd8ea62972ac8e662e784672714d836487d4dd4
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1956,7 +1956,6 @@
        }
    }
    public synchronized void autoEmptyOut() {
        DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        Integer autoOutSite = 12;
@@ -1996,41 +1995,4 @@
        }
    }
    public synchronized void autoEmptyIn() {
        DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        Integer autoInSite = 12;
        StaProtocol staProtocol = devpThread.getStation().get(autoInSite);
        if (staProtocol == null) {
            return;
        } else {
            staProtocol = staProtocol.clone();
        }
        if (staProtocol.isAutoing()  //自动
                && staProtocol.isLoading()  //有物
                && staProtocol.isInEnable()  //可入信号
                && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) //工作号为0或者工作号是9991~9999(输送机留用)
        ) {
            try {
                LocTypeDto locTypeDto = new LocTypeDto((short) 1, (short) 1, (short) 1);
                String response = new HttpHandler.Builder()
                        .setUri(wmsUrl)
                        .setPath("/rpc/auto/emptyIn/v1")
                        .setJson(JSON.toJSONString(locTypeDto))
                        .build()
                        .doPost();
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code").equals(200)) {
                    log.info((String) jsonObject.get("msg"));
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyIn/v1", JSON.toJSONString(locTypeDto), response);
                }
            } catch (Exception e) {
                e.printStackTrace();
                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            }
        }
    }
}