| | |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { |
| | | 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 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | String errorMsg = "扫码失败,请重试"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | } else { |
| | | 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 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | String errorMsg = "扫码失败,请重试"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()){ |
| | | |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | // BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); |
| | | // if (barcodeThread == null) { |
| | | // continue; |
| | | // } |
| | | // String barcode = barcodeThread.getBarcode(); |
| | | // if(!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | // if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // continue; |
| | | // } |
| | | // } else { |
| | | // continue; |
| | | // } |
| | | |
| | | WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); |
| | | WrkMast wrkMast = wrkMastMapper.selectPickStep(staProtocol.getWorkNo()); |
| | | if (wrkMast == null) { |
| | | // 无拣料数据 |
| | | continue; |
| | |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | if (wrkMastMapper.setSteEmpty(wrkMast.getWrkNo()) == 0) { |
| | | // throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | |
| | | } |
| | | } |
| | | |
| | | log.info("{}号堆垛机对{}库位进行演示", crn.getId(), locNo); |
| | | // log.info("{}号堆垛机对{}库位进行演示", crn.getId(), locNo); |
| | | |
| | | // 获取移库工作档信息 |
| | | // WrkMast wrkMast = wrkMastMapper.selectLocMove(crn.getId()); |
| | | // if (null != wrkMast) { continue; } |
| | | // |
| | | // LocMast sourceLoc = locMastService.queryDemoSourceLoc(crn.getId()); |
| | | // LocMast loc = locMastService.queryDemoLoc(crn.getId()); |
| | | // if (null == sourceLoc || null == loc) { continue; } |
| | | // |
| | | // String sourceLocNo = sourceLoc.getLocNo(); |
| | | // String locNo = loc.getLocNo(); |
| | | // |
| | | // // 获取工作号 |
| | | // int workNo = commonService.getWorkNo(WorkNoType.PICK.type); |
| | | // // 保存工作档 |
| | | // wrkMast = new WrkMast(); |
| | | // wrkMast.setWrkNo(workNo); |
| | | // wrkMast.setIoTime(new Date()); |
| | | // wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | // wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | // wrkMast.setIoPri(13D); |
| | | // wrkMast.setCrnNo(crn.getId()); |
| | | // wrkMast.setSourceLocNo(sourceLocNo); // 源库位 |
| | | // wrkMast.setLocNo(locNo); // 目标库位 |
| | | // wrkMast.setFullPlt("N"); // 满板:Y |
| | | // wrkMast.setPicking("N"); // 拣料 |
| | | // wrkMast.setExitMk("N"); // 退出 |
| | | // wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D")?"Y":"N"); // 空板 |
| | | // wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | // wrkMast.setLinkMis("N"); |
| | | // wrkMast.setAppeTime(new Date()); |
| | | // wrkMast.setModiTime(new Date()); |
| | | // int res = wrkMastMapper.insert(wrkMast); |
| | | // if (res == 0) { |
| | | // throw new CoolException("保存工作档失败"); |
| | | // } |
| | | |
| | | } |
| | | |