| | |
| | | throw new CoolException("数据错误,站点不存在!!"); |
| | | } |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | station.setBarcode(null); |
| | | station.setBarcode(""); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | |
| | | } |
| | | |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | station.setBarcode(null); |
| | | station.setBarcode(""); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态修改失败!"); |
| | | } |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) { |
| | | List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode)); |
| | | if (Objects.isNull(pakins) || pakins.isEmpty()) { |
| | | throw new CoolException("组托信息不存在!!"); |
| | | } |
| | | |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode)); |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘已在任务执行中.."); |
| | |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | if (!type.equals("agv_back")) { |
| | | List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode)); |
| | | if (Objects.isNull(pakins) || pakins.isEmpty()) { |
| | | throw new CoolException("组托信息不存在!!"); |
| | | } |
| | | |
| | | for (WaitPakin pakin : pakins) { |
| | | TaskDetl wrkDetl = new TaskDetl(); |
| | | BeanUtils.copyProperties(pakin, wrkDetl); |
| | |
| | | throw new CoolException("更新组托信息失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type) || station.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type)) { |
| | | station.setLocSts("R"); // S.入库预约 |
| | | // station.setBarcode(barcode); |
| | | station.setBarcode(barcode); |
| | | station.setModiTime(new Date()); |
| | | station.setModiUser(userId); |
| | | if (!basStationService.updateById(station)) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 呼叫AGV返回 |
| | | * 呼叫AGV空台车返回 |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @param callAgvBackParam |
| | |
| | | return R.error("未查询到可用库位"); |
| | | } |
| | | |
| | | // 修改目标站点信息 |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", callAgvBackParam.getOrgSite())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | try { |
| | | generateAgvTask("agv", locCache, callAgvBackParam.getOrgSite(), callAgvBackParam.getBarcode(), userId); |
| | | //空台车回库 |
| | | generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |