| | |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历空板入库口 |
| | | for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = null; |
| | | if (!Cools.isEmpty(emptyInSta.getBarcode())) { |
| | | barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, emptyInSta.getBarcode()); |
| | | } |
| | | |
| | | // 获取空板入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo()); |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 检查条码扫描:如果扫描到条码,则存入,扫描不到,则不存 |
| | | String barcode = null; |
| | | if (barcodeThread != null) { |
| | | barcode = barcodeThread.getBarcode(); |
| | | // 如果条码为空、NG、NoRead或00000000 |
| | | if (Cools.isEmpty(barcode) || barcode.endsWith("NG") || "NoRead".equals(barcode) || "00000000".equals(barcode)) { |
| | | barcode=null; |
| | | } |
| | | } |
| | | |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() //自动 |
| | | && staProtocol.isLoading() //有物 |
| | |
| | | && staProtocol.isPakMk() //防止重复下发信号 站点无物 无任务号会自动变成true |
| | | |
| | | ) { |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货"); |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货,条码:{}", barcode); |
| | | |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | param.setBarcode(barcode); // 设置扫描到的条码 |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // 清空条码 |
| | | if (barcodeThread != null) { |
| | | barcodeThread.setBarcode(""); |
| | | } |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |