| | |
| | | private NavigateMapUtils navigateMapUtils; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * AGV补货 => 生成入库通知档 |
| | | */ |
| | | public void robotGenerateAgvTask() { |
| | | public synchronized void robotGenerateAgvTask() { |
| | | try { |
| | | //检测300站是否自动、有物、工作号 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | //判断机械臂拣料站是否空闲 |
| | | StaProtocol staProtocol303 = devpThread.getStation().get(303); |
| | | StaProtocol staProtocol317 = devpThread.getStation().get(317); |
| | | if (staProtocol303.isAutoing() && !staProtocol303.isLoading()) { |
| | | |
| | | List<WrkMast> wrkMasts303 = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 25).eq("sta_no", 303)); |
| | | List<WrkMast> wrkMasts317 = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 25).eq("sta_no", 317)); |
| | | if (staProtocol303.isAutoing() && !staProtocol303.isLoading() && wrkMasts303.isEmpty()) { |
| | | //自动、无物 |
| | | targetSta = (short) 303; |
| | | } else if (staProtocol317.isAutoing() && !staProtocol317.isLoading()) { |
| | | } else if (staProtocol317.isAutoing() && !staProtocol317.isLoading() && wrkMasts317.isEmpty()) { |
| | | //自动、无物 |
| | | targetSta = (short) 317; |
| | | } else { |
| | |
| | | /** |
| | | * AGV补货 => 机械臂拣料 |
| | | */ |
| | | public void agvRestockByRobot() { |
| | | public synchronized void agvRestockByRobot() { |
| | | try { |
| | | //检测300站是否自动、有物、工作号 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | /** |
| | | * AGV补货(通知AGV取货) |
| | | */ |
| | | public void agvRestockInto() { |
| | | public synchronized void agvRestockInto() { |
| | | try { |
| | | //检测309和312站是否自动、有物 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | //通知AGV取货 |
| | | agvRestockCall("301-1", barcode); |
| | | log.info("通知AGV取货,条码号:" + barcode); |
| | | boolean result = agvRestockCall("301-1", barcode); |
| | | log.info("机械臂通知AGV取货,条码号:" + barcode); |
| | | if (result) { |
| | | barcodeThread.setBarcode(""); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | //通知AGV取货 |
| | | agvRestockCall("302-1", barcode); |
| | | log.info("通知AGV取货,条码号:" + barcode); |
| | | boolean result = agvRestockCall("302-1", barcode); |
| | | log.info("机械臂通知AGV取货,条码号:" + barcode); |
| | | if (result) { |
| | | barcodeThread.setBarcode(""); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * AGV补货(悬挂线通知AGV取货) |
| | | */ |
| | | public void agvRestockIntoByHangingWire() { |
| | | public synchronized void agvRestockIntoByHangingWire() { |
| | | try { |
| | | //检测350和351扫码器 |
| | | int[] barcodeStaNo = {11, 12,14,16,18,20};//11 => 350站扫码器,12 => 351站扫码器 |
| | |
| | | /** |
| | | * AGV拣料站点信息 |
| | | */ |
| | | public void agvCurrentContainerCodeInfoWire() { |
| | | public synchronized void agvCurrentContainerCodeInfoWire() { |
| | | try { |
| | | //检测350和351扫码器 |
| | | int[] barcodeStaNo = {13, 15,17,19};//11 => 350站扫码器,12 => 351站扫码器 |
| | |
| | | ledCommand.setBarcode(barcode); |
| | | if (ioType != 110 && ioType != 10) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkNo)); |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | double remainNum = wrkDetl.getStock() - wrkDetl.getAnfme();//剩余数量 |
| | | if (remainNum < 0) { |
| | | remainNum = 0; |
| | | if (!wrkDetls.isEmpty()) { |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | double remainNum = wrkDetl.getStock() - wrkDetl.getAnfme();//剩余数量 |
| | | if (remainNum < 0) { |
| | | remainNum = 0; |
| | | } |
| | | String matnr = wrkDetl.getMatnr(); |
| | | Mat mat = matService.selectByMatnr(wrkDetl.getMatnr()); |
| | | if (mat != null) { |
| | | if (!mat.getMatnr().equals(mat.getMatnr2())) { |
| | | matnr += " - " + mat.getMatnr2(); |
| | | } |
| | | } |
| | | ledCommand.getMatDtos().add(new MatDto(matnr, wrkDetl.getMaktx(), wrkDetl.getAnfme(), remainNum, wrkDetl.getSpecs(), wrkDetl.getSuppCode(), wrkDetl.getOrderNo())); |
| | | }); |
| | | }else { |
| | | List<WrkDetlLog> wrkDetlLogs = wrkDetlLogService.selectLatestByWorkNo(wrkNo, barcode); |
| | | for (WrkDetlLog wrkDetlLog : wrkDetlLogs) { |
| | | double remainNum = wrkDetlLog.getStock() - wrkDetlLog.getAnfme();//剩余数量 |
| | | if (remainNum < 0) { |
| | | remainNum = 0; |
| | | } |
| | | String matnr = wrkDetlLog.getMatnr(); |
| | | Mat mat = matService.selectByMatnr(wrkDetlLog.getMatnr()); |
| | | if (mat != null) { |
| | | if (!mat.getMatnr().equals(mat.getMatnr2())) { |
| | | matnr += " - " + mat.getMatnr2(); |
| | | } |
| | | } |
| | | ledCommand.getMatDtos().add(new MatDto(matnr, wrkDetlLog.getMaktx(), wrkDetlLog.getAnfme(), remainNum, wrkDetlLog.getSpecs(), wrkDetlLog.getSuppCode())); |
| | | } |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), remainNum, wrkDetl.getSpecs(), wrkDetl.getSuppCode(), wrkDetl.getOrderNo())); |
| | | }); |
| | | } |
| | | |
| | | // List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo)); |
| | | // if (ioType == 101) { |