| | |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | // led 入库信息显示 |
| | | if (ledThread != null) { |
| | | // 命令集合 |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(dto.getWorkNo()); |
| | | ledCommand.setIoType(1); |
| | | ledCommand.setTitle("全板入库"); |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | commands.add(ledCommand); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); |
| | | // ledThread.errorReset(); |
| | | } |
| | | // // led 入库信息显示 |
| | | // if (ledThread != null) { |
| | | // // 命令集合 |
| | | // List<LedCommand> commands = new ArrayList<>(); |
| | | // // 组装命令 |
| | | // LedCommand ledCommand = new LedCommand(); |
| | | // ledCommand.setWorkNo(dto.getWorkNo()); |
| | | // ledCommand.setIoType(1); |
| | | // ledCommand.setTitle("全板入库"); |
| | | // ledCommand.setLocNo(dto.getLocNo()); |
| | | // ledCommand.setStaNo(dto.getStaNo()); |
| | | // commands.add(ledCommand); |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); |
| | | //// ledThread.errorReset(); |
| | | // } |
| | | } else { |
| | | News.error(""+mark+" - 5"+" - 请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // staProtocol.setWorkNo((short)9992); |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()) { |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.getWorkNo() > 0 |
| | | && staProtocol.isPakMk()) { |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行"); |
| | | |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | News.info(""+mark+" - 1"+" - {}号条码扫描器检测条码信息:{}", 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)) { |
| | | // News.info(""+mark+" - 1"+" - {}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | // if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { |
| | | // continue; |
| | | // } |
| | | // } else { |
| | | // continue; |
| | | // } |
| | | |
| | | WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); |
| | | // WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue()); |
| | | // WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue()); |
| | | if (wrkMast == null) { |
| | | // 无拣料数据 |
| | | continue; |
| | |
| | | .eq("crn_no", wrkMast.getCrnNo()); // 堆垛机号 |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | News.error(""+mark+" - 2"+" - 入库路径不存在!type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); |
| | | staProtocol.setWorkNo((short) 9989); |
| | | staProtocol.setStaNo((short) (pickSta.getStaNo().shortValue()-(short)1)); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error(""+mark+" - 2"+" - 入库路径不存在!type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); |
| | | // staProtocol.setWorkNo((short) 9989); |
| | | // staProtocol.setStaNo((short) (pickSta.getStaNo().shortValue()-(short)1)); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | //LED |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | // led 异常显示 |
| | |
| | | // ledCommand.setSourceStaNo(wrkMast.getSourceStaNo()); |
| | | if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); |
| | | try{ |
| | | if (wrkMast.getIoType()>100){ |
| | | for (WrkDetl wrkDetl : wrkDetls){ |
| | | LocDetl locDetl = locDetlService.selectMatnrSpecs(wrkDetl.getMatnr(), wrkDetl.getSpecs(), wrkMast.getSourceLocNo()); |
| | | wrkDetl.setWeight(locDetl.getAnfme()); |
| | | } |
| | | }else { |
| | | for (WrkDetl wrkDetl : wrkDetls){ |
| | | wrkDetl.setWeight(wrkDetl.getAnfme()); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("工作档案明细输入电视机失败1:异常信息==》"+e); |
| | | } |
| | | // try{ |
| | | // if (wrkMast.getIoType()>100){ |
| | | // for (WrkDetl wrkDetl : wrkDetls){ |
| | | // LocDetl locDetl = locDetlService.selectMatnrSpecs(wrkDetl.getMatnr(), wrkDetl.getSpecs(), wrkMast.getSourceLocNo()); |
| | | // wrkDetl.setWeight(locDetl.getAnfme()); |
| | | // } |
| | | // }else { |
| | | // for (WrkDetl wrkDetl : wrkDetls){ |
| | | // wrkDetl.setWeight(wrkDetl.getAnfme()); |
| | | // } |
| | | // } |
| | | // }catch (Exception e){ |
| | | // log.error("工作档案明细输入电视机失败1:异常信息==》"+e); |
| | | // } |
| | | wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(),wrkDetl.getWeight(),wrkDetl.getSpecs(),wrkDetl.getSku()))); |
| | | } |
| | | commands.add(ledCommand); |
| | |
| | | continue; |
| | | } |
| | | |
| | | Integer ctnType = 1; |
| | | if (ctnType.equals(loc.getCtnType())) { |
| | | continue; |
| | | } |
| | | |
| | | String sourceLocNo = sourceLoc.getLocNo(); |
| | | String locNo = loc.getLocNo(); |
| | | |
| | |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setCtnType(1); |
| | | loc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("更新目标库位状态失败"); |