| | |
| | | /**生成缓存区出库任务*/ |
| | | generateCacheOutTask(station, locCaches, userId); |
| | | |
| | | // /**生成立库出库任务*/ |
| | | /**生成立库出库任务*/ |
| | | generateCRNOutTask(station, locCaches, userId); |
| | | |
| | | return R.ok(); |
| | |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type) |
| | | .eq("area_id", basAreas.getId()) |
| | | ); |
| | | if (locCaches.isEmpty()){ |
| | | if (locCaches.isEmpty()) { |
| | | throw new CoolException("暂无空板库位"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", params.getBarcode())); |
| | | if (!tasks.isEmpty()){ |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘码已生成任务"); |
| | | } |
| | | |
| | |
| | | |
| | | List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>() |
| | | .in("loc_sts", LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_D.type) |
| | | .eq("area_id", basAreas.getId()) |
| | | ); |
| | | .eq("area_id", basAreas.getId())); |
| | | if (locCaches.isEmpty()) { |
| | | throw new CoolException("当前暂无空库位!!"); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 缓存出库组托上架 |
| | | * @author Ryan |
| | | * @date 2025/12/8 13:47 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | public R combOutPub(AgvCallParams params) { |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 缓存组托数据 |
| | | * @author Ryan |
| | | * @date 2025/12/8 15:37 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | public R combCacehList(AgvCallParams params) { |
| | | if (Objects.isNull(params.getBarcode())) { |
| | | throw new CoolException("托盘码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getBsCode())) { |
| | | throw new CoolException("BS码不能为空!!"); |
| | | } |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | .eq("io_type", TaskIOType.PICK_OUT.type) |
| | | .eq("wrk_sts", 14) |
| | | .eq("barcode", params.getBarcode())); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误:任务信息存在!!"); |
| | | } |
| | | |
| | | List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>() |
| | | .eq("three_code", params.getBsCode()) |
| | | .eq("zpallet", params.getBarcode())); |
| | | |
| | | if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) { |
| | | throw new CoolException("当前BS编码不存在!!"); |
| | | } |
| | | |
| | | return R.ok().add(taskDetl); |
| | | } |
| | | |
| | | /** |
| | | * 生成立库出库任务 |
| | | * |
| | | * @param locCaches |
| | | * @author Ryan |
| | | * @date 2025/12/3 8:06 |
| | | * @param locCaches |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | /** |
| | | * 生成堆垛机出库任务 |
| | | * |
| | | * @param locMasts |
| | | * @author Ryan |
| | | * @date 2025/12/6 14:44 |
| | | * @param locMasts |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateOutTask(List<LocMast> locMasts, Integer ioType, BasDevp devp, Long userId) { |
| | |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | | .setWrkSts(11L) // 工作状态:11.生成出库ID |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 101) // 入出库状态: 11.库格移载 |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 103) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setFullPlt(loc.getLocSts().equals("D") ? "N" : "Y") // 满板:Y |
| | |
| | | if (!taskService.insert(task)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_id", loc.getId())); |
| | | |
| | | List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", loc.getLocNo())); |
| | | if (!detls.isEmpty()) { |
| | | List<TaskDetl> taskDetls = new ArrayList<>(); |
| | | detls.forEach(pakin -> { |
| | |
| | | } |
| | | |
| | | // 修改目标站点信息 |
| | | if (station.getLocSts().equals("O")) { |
| | | station.setLocSts("S"); // S.入库预约 |
| | | if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_S.type); // S.入库预约 |
| | | station.setModiTime(new Date()); |
| | | station.setModiUser(userId); |
| | | if (!basStationService.updateById(station)) { |
| | |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | |
| | | pakins.forEach(pakin -> {pakin.setIoStatus("Y");}); |
| | | pakins.forEach(pakin -> { |
| | | pakin.setIoStatus("Y"); |
| | | }); |
| | | |
| | | if (!waitPakinService.updateBatchById(pakins)) { |
| | | throw new CoolException("更新组托信息失败"); |
| | |
| | | } |
| | | |
| | | |
| | | public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO,String path){ |
| | | public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO, String path) { |
| | | HIKResultDTO result = new HIKResultDTO(); |
| | | |
| | | ForwardAGVTaskDTO forwardAGVTaskParam = new ForwardAGVTaskDTO(); |