| | |
| | | throw new CoolException(barcode+ ":条码存在agv搬运任务!"); |
| | | } |
| | | |
| | | // 根据whs_type选择站点和机器人组 |
| | | // 根据whs_type和库位编号前缀选择站点和机器人组 |
| | | Long whsType = locCache.getWhsType(); |
| | | String locNo = locCache.getLocNo(); |
| | | List<String> targetStations; |
| | | String robotGroup; |
| | | |
| | | // 判断库位编号前缀:CA开头只做入库,WA开头才会被出库分配缓存区(从配置读取) |
| | | String inboundOnlyPrefix = agvProperties.getLocationPrefix().getInboundOnly(); |
| | | String cacheAreaPrefix = agvProperties.getLocationPrefix().getCacheArea(); |
| | | boolean isCA = locNo != null && locNo.startsWith(inboundOnlyPrefix); |
| | | boolean isWA = locNo != null && locNo.startsWith(cacheAreaPrefix); |
| | | |
| | | if (whsType != null && whsType.equals(agvProperties.getWhsTypeMapping().getInboundArea())) { |
| | | // whs_type = 1: 入库区,使用东侧站点和Group-001 |
| | | targetStations = agvProperties.getEastStations(); |
| | | robotGroup = agvProperties.getRobotGroupEast(); |
| | | log.info("库位whs_type={},使用入库区配置(东侧站点和Group-001)", whsType); |
| | | log.info("库位whs_type={},库位编号={}({}),使用入库区配置({}站点和{})", |
| | | whsType, locNo, isCA ? "CA" : (isWA ? "WA" : "其他"), |
| | | agvProperties.getEastDisplayName(), robotGroup); |
| | | } else if (whsType != null && whsType.equals(agvProperties.getWhsTypeMapping().getCacheArea())) { |
| | | // whs_type = 2: 缓存区,使用西侧站点和Group-002 |
| | | // 注意:如果有CA开头的入库,但是标记在西侧的(whs_type=2),也会分配到西侧的站点入库 |
| | | targetStations = agvProperties.getWestStations(); |
| | | robotGroup = agvProperties.getRobotGroupWest(); |
| | | log.info("库位whs_type={},使用缓存区配置(西侧站点和Group-002)", whsType); |
| | | log.info("库位whs_type={},库位编号={}({}),使用缓存区配置({}站点和{})", |
| | | whsType, locNo, isCA ? "CA" : (isWA ? "WA" : "其他"), |
| | | agvProperties.getWestDisplayName(), robotGroup); |
| | | } else { |
| | | // whs_type为空或其他值,根据type判断(兼容旧逻辑) |
| | | if (type == 1) { |
| | |
| | | } else { |
| | | // 没有可入站点,记录日志但不阻止下单,站点分配将在定时任务中处理 |
| | | String groupName = (whsType != null && whsType.equals(agvProperties.getWhsTypeMapping().getInboundArea())) |
| | | ? "东侧" : "西侧"; |
| | | ? agvProperties.getEastDisplayName() : agvProperties.getWestDisplayName(); |
| | | log.warn("{}可用站点({})中没有可入站点(in_enable='Y'且canining='Y'),暂不分配站点,将在定时任务中分配", groupName, canInSites); |
| | | } |
| | | |