| | |
| | | if (Cools.isEmpty(area)) { |
| | | throw new CoolException("目标库区不能为空"); |
| | | } |
| | | boolean isItAvailable = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableInArea(sta, area, waitPakinPda.getBarcode(), "in"); |
| | | boolean isItAvailable = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableInArea(sta, area, waitPakinPda.getBarcode(), "in"); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | // .eq(DeviceSite::getSite, sta) |
| | | // .eq(DeviceSite::getAreaIdEnd, Long.parseLong(area)) |
| | |
| | | // throw new CoolException("未找到所属库区信息"); |
| | | } |
| | | |
| | | boolean isItAvailable = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableInArea(station.getStationName(), warehouseArea.getId(), param.getContainerNo(), TaskType.TASK_TYPE_EMPTY_IN.type); |
| | | boolean isItAvailable = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableInArea(station.getStationName(), warehouseArea.getId(), param.getContainerNo(), TaskType.TASK_TYPE_EMPTY_IN.type); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | // .eq(DeviceSite::getSite, ) |
| | | // .eq(DeviceSite::getAreaIdEnd,) |
| | |
| | | |
| | | if (loc != null) { |
| | | //查找路径 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableInArea(sourceStaNo, loc.getAreaId().toString() ,loc.getBarcode(),"in"); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableInArea(sourceStaNo, loc.getAreaId().toString() ,loc.getBarcode(),"in"); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | // .eq(DeviceSite::getType, ioType) |
| | | // .eq(DeviceSite::getSite, sourceStaNo) |
| | |
| | | |
| | | if (loc != null) { |
| | | //查找路径 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableInArea(sourceStaNo, loc.getAreaId().toString() ,loc.getBarcode(),"in"); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableInArea(sourceStaNo, loc.getAreaId().toString() ,loc.getBarcode(),"in"); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | // .eq(DeviceSite::getType, ioType) |
| | | // .eq(DeviceSite::getSite, sourceStaNo) |
| | |
| | | //查找路径 |
| | | if (loc != null) { |
| | | //查找路径 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableInArea(sourceStaNo, loc.getAreaId().toString() ,loc.getBarcode(),"in"); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableInArea(sourceStaNo, loc.getAreaId().toString() ,loc.getBarcode(),"in"); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | // .eq(DeviceSite::getType, ioType) |
| | | // .eq(DeviceSite::getSite, sourceStaNo) |
| | |
| | | package com.vincent.rsf.schedule.common.config; |
| | | |
| | | import com.vincent.rsf.framework.common.SnowflakeIdWorker; |
| | | import com.vincent.rsf.schedule.common.domain.QueueTask; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | |
| | | * Created by vincent on 12/19/2023 |
| | | */ |
| | | @Configuration |
| | | @ComponentScan(value = "com.vincent.rsf.schedule.common.config") |
| | | @ComponentScan(value = {"com.vincent.rsf.schedule.common.config", "com.vincent.rsf.common.config"}) |
| | | public class BeanConfig { |
| | | |
| | | @Bean |
| | | public LinkedBlockingQueue<QueueTask> unlockTaskQueue() { |
| | | return new LinkedBlockingQueue<>(); |
| | | } |
| | | |
| | | @Bean |
| | | public SnowflakeIdWorker snowflakeIdWorker() { |
| | | return new SnowflakeIdWorker(); |
| | | } |
| | | |
| | | } |
| | |
| | | .setMemo(map.getMemo()); |
| | | |
| | | if (map.getType().equals(Constants.TASK_TYPE_OUT_STOCK_EMPTY)) {//空容器出库 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_EMPTY_OUT.type.toString()); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_EMPTY_OUT.type.toString()); |
| | | if (!available) { |
| | | throw new CoolException("站点不支持空容器出库!!"); |
| | | } |
| | |
| | | || map.getType().equals(Constants.TASK_TYPE_WAVE_OUT_STOCK)) { |
| | | if (orgQty.compareTo(outQty) > 0) { |
| | | //拣料出库 -- 盘点出库 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_PICK_AGAIN_OUT.type); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_PICK_AGAIN_OUT.type); |
| | | if (!available) { |
| | | throw new CoolException("站点不支持此容器拣选出库!!"); |
| | | } |
| | |
| | | } else { |
| | | if (resouce.equals(TaskResouceType.TASK_RESOUCE_STOCK_NOT_OUT.val)){ |
| | | //全板出库 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type); |
| | | if (!available) { |
| | | throw new CoolException("站点不支持越库!!"); |
| | | } |
| | |
| | | task.setTaskType(TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type).setWarehType(warehouseAreas.getType());//越库 |
| | | } else { |
| | | //全板出库 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_OUT.type); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_OUT.type); |
| | | if (!available) { |
| | | throw new CoolException("站点不支持全板出库!!"); |
| | | } |
| | |
| | | } |
| | | } else if (map.getType().equals(Constants.TASK_TYPE_OUT_CHECK)) { |
| | | //盘点出库 |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_CHECK_OUT.type); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId().toString(), siteNo, loc.getBarcode(),TaskType.TASK_TYPE_CHECK_OUT.type); |
| | | if (!available) { |
| | | throw new CoolException("当前站点不支持盘点出库!!"); |
| | | } |
| | |
| | | if (Objects.isNull(map.getTarLoc()) || StringUtils.isBlank(map.getTarLoc())) { |
| | | //目标库位为空,自动获取新库位 |
| | | |
| | | List<String> outWarehouseAreasByReservoirAreaAndContainer = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).getOutWarehouseAreasByReservoirAreaAndContainer(orgLoc.getAreaId(), orgLoc.getBarcode(), TaskType.TASK_TYPE_LOC_MOVE.type); |
| | | List<String> outWarehouseAreasByReservoirAreaAndContainer = new WarehouseLocationRetrievalUtil().getOutWarehouseAreasByReservoirAreaAndContainer(orgLoc.getAreaId(), orgLoc.getBarcode(), TaskType.TASK_TYPE_LOC_MOVE.type); |
| | | if (!Cools.isEmpty(outWarehouseAreasByReservoirAreaAndContainer) || outWarehouseAreasByReservoirAreaAndContainer.isEmpty()) { |
| | | throw new CoolException("未找到可用目标库区!!!源库区:"+orgLoc.getAreaId()); |
| | | } |
| | |
| | | List<LocItem> locItems = this.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, orgLoc.getCode())); |
| | | boolean sign = false; |
| | | for (LocItem locItem : locItems) { |
| | | if (!SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).retrieveMatnrIsItAvailable(areaId, locItem.getMatnrId())){ |
| | | if (!new WarehouseLocationRetrievalUtil().retrieveMatnrIsItAvailable(areaId, locItem.getMatnrId())){ |
| | | sign = true; |
| | | break; |
| | | } |
| | |
| | | OrderOutItemDto orderOutItemDto = new OrderOutItemDto(); |
| | | // orderOutItemDto.setLocItem(locItem); |
| | | orderOutItemDto.getLocItemList().add(locItem); |
| | | List<String> outboundSiteByReservoirAreaAndContainer = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).getOutboundSiteByReservoirAreaAndContainer(loc.getAreaId(), loc.getBarcode(),itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type.toString() : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type.toString()); |
| | | List<String> outboundSiteByReservoirAreaAndContainer = new WarehouseLocationRetrievalUtil().getOutboundSiteByReservoirAreaAndContainer(loc.getAreaId(), loc.getBarcode(),itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type.toString() : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type.toString()); |
| | | if (!outboundSiteByReservoirAreaAndContainer.isEmpty()) { |
| | | List<OrderOutItemDto.staListDto> maps = new ArrayList<>(); |
| | | for (String staNo : outboundSiteByReservoirAreaAndContainer) { |
| | |
| | | locItem.setBarcode(loc.getBarcode()); |
| | | OrderOutItemDto orderOutItemDto = new OrderOutItemDto(); |
| | | orderOutItemDto.getLocItemList().add(locItem); |
| | | List<String> outboundSiteByReservoirAreaAndContainer = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).getOutboundSiteByReservoirAreaAndContainer(loc.getAreaId(), loc.getBarcode(),itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type); |
| | | List<String> outboundSiteByReservoirAreaAndContainer = new WarehouseLocationRetrievalUtil().getOutboundSiteByReservoirAreaAndContainer(loc.getAreaId(), loc.getBarcode(),itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type); |
| | | if (!outboundSiteByReservoirAreaAndContainer.isEmpty()) { |
| | | List<OrderOutItemDto.staListDto> maps = new ArrayList<>(); |
| | | for (String staNo : outboundSiteByReservoirAreaAndContainer) { |
| | |
| | | throw new CoolException("任务明细保存失败!!"); |
| | | } |
| | | waitPakinItems.forEach(item -> { |
| | | boolean b = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).retrieveMatnrIsItAvailable(areaId, item.getMatnrId()); |
| | | boolean b = new WarehouseLocationRetrievalUtil().retrieveMatnrIsItAvailable(areaId, item.getMatnrId()); |
| | | if (!b){ |
| | | throw new CoolException("入库失败!!物料Id:"+item.getMatnrId()+"不支持此目标库区:"+areaId); |
| | | } |
| | |
| | | // orderOutItemDto.setLocItem(locItem); |
| | | orderOutItemDto.setLoc(loc); |
| | | orderOutItemDto.getLocItemList().add(locItem); |
| | | BasContainer containerType = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).getContainerByBarcode(loc.getBarcode()); |
| | | BasContainer containerType = new WarehouseLocationRetrievalUtil().getContainerByBarcode(loc.getBarcode()); |
| | | if (Cools.isEmpty(containerType)){ |
| | | continue; |
| | | } |
| | |
| | | if (Objects.isNull(basStation)) { |
| | | throw new CoolException("绑定站點不存在!!"); |
| | | } |
| | | boolean available = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId().toString(), stationId, loc.getBarcode(),"out"); |
| | | boolean available = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId().toString(), stationId, loc.getBarcode(),"out"); |
| | | if (!available) { |
| | | throw new CoolException("未找到符合条件路径!!!请检查路径配置!!!"); |
| | | } |
| | |
| | | throw new CoolException("无可用站点!!"); |
| | | } |
| | | for (String stationName : stationNames) { |
| | | boolean isItAvailable = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).queryPathIsItAvailableOutArea(loc.getAreaId(), stationName, loc.getBarcode(), TaskType.TASK_TYPE_CHECK_OUT.type); |
| | | boolean isItAvailable = new WarehouseLocationRetrievalUtil().queryPathIsItAvailableOutArea(loc.getAreaId(), stationName, loc.getBarcode(), TaskType.TASK_TYPE_CHECK_OUT.type); |
| | | if (!isItAvailable) { |
| | | continue; |
| | | } |
| | |
| | | MissionTaskIssueParam missionTaskIssueParam = new MissionTaskIssueParam(flowStepInstance,subsystemFlowTemplate,flowStepTemplate); |
| | | |
| | | missionTaskIssueParam.setType(RcsTaskType.getTypeDesc(task.getTaskType())); |
| | | boolean souSign = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).retrieveMissionmMergeReservoirAreaIsItAvailable(taskInstance.getSourceCode()); |
| | | boolean souSign = new WarehouseLocationRetrievalUtil().retrieveMissionmMergeReservoirAreaIsItAvailable(taskInstance.getSourceCode()); |
| | | if (souSign){ |
| | | missionTaskIssueParam.setSourceCode(taskInstance.getSourceCode()); |
| | | } else { |
| | | BasStation basStation = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).retrieveMissionmMergeSizeIsItAvailable(taskInstance.getSourceCode()); |
| | | BasStation basStation = new WarehouseLocationRetrievalUtil().retrieveMissionmMergeSizeIsItAvailable(taskInstance.getSourceCode()); |
| | | if (Cools.isEmpty(basStation)){ |
| | | flowStepInstance.setRetryTimes(flowStepInstance.getRetryTimes() + 1); |
| | | if (flowStepInstance.getRetryTimes()>5){ |
| | |
| | | missionTaskIssueParam.setSourceCode(basStation.getStationName()); |
| | | } |
| | | } |
| | | boolean endSign = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).retrieveMissionmMergeReservoirAreaIsItAvailable(taskInstance.getTargetCode()); |
| | | boolean endSign = new WarehouseLocationRetrievalUtil().retrieveMissionmMergeReservoirAreaIsItAvailable(taskInstance.getTargetCode()); |
| | | if (endSign){ |
| | | missionTaskIssueParam.setTargetCode(taskInstance.getTargetCode()); |
| | | } else { |
| | | BasStation basStation = SpringUtils.getBean(WarehouseLocationRetrievalUtil.class).retrieveMissionmMergeSizeIsItAvailable(taskInstance.getTargetCode()); |
| | | BasStation basStation = new WarehouseLocationRetrievalUtil().retrieveMissionmMergeSizeIsItAvailable(taskInstance.getTargetCode()); |
| | | if (Cools.isEmpty(basStation)){ |
| | | flowStepInstance.setRetryTimes(flowStepInstance.getRetryTimes() + 1); |
| | | if (flowStepInstance.getRetryTimes()>5){ |