rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -500,12 +500,13 @@ .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getAreaId, area) ); if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } if (!Cools.isEmpty(locMast2)) { if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } loc = locMast2; break; } @@ -516,7 +517,13 @@ .in(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type, LocStsType.LOC_STS_TYPE_F.type) .eq(Loc::getAreaId, area) ); if (!Cools.isEmpty(locMast2)) { if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } loc = locMast1; break; } else { @@ -525,12 +532,13 @@ .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getAreaId, area) ); if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } if (!Cools.isEmpty(locMast2)) { if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } loc = locMast2; break; } @@ -549,12 +557,13 @@ .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getAreaId, area) ); if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } if (!Cools.isEmpty(locMast2)) { if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } loc = locMast2; break; } else { @@ -563,12 +572,13 @@ .in(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type, LocStsType.LOC_STS_TYPE_D.type) .eq(Loc::getAreaId, area) ); if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } if (!Cools.isEmpty(locMast2)) { if (null != orgMoveLoc){ if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { break; } } loc = locMast1; break; } rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -125,7 +125,6 @@ Double useQty = Math.round((outQty + workQty) * 10000) / 10000.0; if (orgQty.compareTo(useQty) > 0) { //拣料出库 DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() .eq(DeviceSite::getSite, siteNo) .eq(DeviceSite::getChannel, loc.getChannel()) @@ -162,6 +161,14 @@ if (!taskService.save(task)) { throw new CoolException("任务创建失败!!"); } if (!Objects.isNull(moveTask.getId())) { moveTask.setParentId(task.getId()); if (!taskService.saveOrUpdate(moveTask)) { throw new CoolException("任务信息修改失败!!"); } } List<TaskItem> taskItems = new ArrayList<>(); listMap.get(key).forEach(item -> { TaskItem taskItem = new TaskItem(); @@ -230,11 +237,11 @@ throw new CoolException("源库位不存在!!"); } if (orgLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type) || orgLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || orgLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_X.type ) ) { throw new CoolException("源库位有任务正在执行中..."); } // if (orgLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type) // || orgLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) // || orgLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_X.type ) ) { // throw new CoolException("源库位有任务正在执行中..."); // } orgLoc.setUseStatus(LocStsType.LOC_STS_TYPE_R.type); @@ -309,8 +316,8 @@ .setSourceCode(item.getLocCode()) .setSource(item.getId()) .setUpdateTime(new Date()) .setOrderType(OrderType.ORDER_IN.type) .setWkType(Short.parseShort(OrderWorkType.ORDER_WORK_TYPE_OTHER_IN.type)); .setOrderType(OrderType.ORDER_OUT.type) .setWkType(Short.parseShort(OrderWorkType.ORDER_WORK_TYPE_OTHER.type)); taskItems.add(taskItem); } if (!taskItemService.saveBatch(taskItems)) { rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -501,6 +501,16 @@ task.setSort(i); } } // else if (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { // //如果为在库状态,生成移库任务 // LocToTaskParams params = new LocToTaskParams(); // params.setOrgLoc(curLoc); // //生成移深库位任务 // Task moveTask = locItemService.genMoveTask(params, loginUserId); // moveTask.setTaskType(task.getSort() + 1); // // return moveTask; // } } else { //浅库位,判断深对应深库位是否为空,如果为空生成一个移库任务,将托盘送入深库位 String deepLoc = LocUtils.getDeepLoc(curLoc); @@ -708,6 +718,38 @@ throw new CoolException("任务已处执行状态不可取消!!"); } for (Task task : tasks) { //取消移库任务 if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) && task.getTaskStatus().equals(TaskStsType.GENERATE_OUT.id)) { if (!locService.update(new LambdaUpdateWrapper<Loc>() .eq(Loc::getCode, task.getOrgLoc()) .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type))) { throw new CoolException("源库位状态修改失败!!"); } if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()).set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type))) { throw new CoolException("移库目标库位状态修改失败!!"); } Task outTask = taskService.getById(task.getParentId()); if (!Objects.isNull(outTask)) { LocToTaskParams params = new LocToTaskParams(); params.setOrgLoc(task.getOrgLoc()).setSiteNo(task.getOrgSite()); //生成移深库位任务 Task moveTask = locItemService.genMoveTask(params, loginUserId); moveTask.setSort(task.getSort() + 1).setParentId(outTask.getId()); if (!this.updateById(moveTask)) { throw new CoolException("任务信息修改失败!!"); } outTask.setParentId(moveTask.getId()); if (!this.updateById(outTask)) { throw new CoolException("任务信息修改失败!!"); } } else { throw new CoolException("无法生成新的移库任务,取消失败!!"); } } if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.val)) { BasStation basStation = null; if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) { @@ -719,8 +761,7 @@ || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type) ) { || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type)) { basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() .eq(BasStation::getStationName, task.getTargLoc()) .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type));