| | |
| | | orderOutItemDto.setStaNos(maps); |
| | | //获取满足条件站点 |
| | | Set<String> stationSet = deviceSites.stream().map(DeviceSite::getSite).collect(Collectors.toSet()); |
| | | String sType = "H"; |
| | | //获取高低站点类型 |
| | | if (startsWithTwoChars(loc.getBarcode(), "31")) { |
| | | sType = "L"; |
| | | } |
| | | //已使用站点 |
| | | Set<String> stas = stations.stream().map(BasStation::getStationName).collect(Collectors.toSet()); |
| | | BasStationService basStationService = SpringUtils.getBean(BasStationService.class); |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | .in(BasStation::getStationName, stationSet) |
| | | .eq(BasStation::getSType, sType) |
| | | .notIn(!stas.isEmpty(), BasStation::getStationName, stas) |
| | | .last("LIMIT 1")); |
| | | stations.add(basStation); |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 检查字符串前两个字符是否包含指定内容 |
| | | * |
| | | * @param str 要检查的字符串 |
| | | * @param target 目标字符串(长度应为2) |
| | | * @return 是否包含 |
| | | */ |
| | | public static boolean startsWithTwoChars(String str, String target) { |
| | | if (str == null || target == null || target.length() != 2) { |
| | | return false; |
| | | } |
| | | return str.length() >= 2 && str.substring(0, 2).equals(target); |
| | | } |
| | | |
| | | |
| | | } |