cl
2026-04-21 fc634e5b62b85396196e2dd8f51bfe5ba7337522
rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
@@ -156,8 +156,6 @@
        DeviceSiteService deviceSiteService = SpringUtils.getBean(DeviceSiteService.class);
        List<OrderOutItemDto> list = new ArrayList<>();
        //不让站点重复使用问题
        List<BasStation> stations = new ArrayList<>();
        List<ExistDto> existDtos = new ArrayList<>();
        Set<Loc> locs = new HashSet<>();
        for (WaveToLocParams item : params) {
@@ -207,27 +205,24 @@
                                    maps.add(staListDto);
                                }
                                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)
                                List<BasStation> candidateStations = basStationService.list(new LambdaQueryWrapper<BasStation>()
                                        .in(BasStation::getStationName, stationSet)
//                                        .eq(BasStation::getSType, sType)
                                        .notIn(!stas.isEmpty(), BasStation::getStationName, stas)
                                        .last("LIMIT 1"));
                                stations.add(basStation);
                                if (Objects.isNull(basStation)) {
                                    throw new CoolException("站點不存在!!");
                                        .eq(BasStation::getStatus, 1)
                                        .eq(BasStation::getOutAble, 1));
                                if (candidateStations.isEmpty()) {
                                    throw new CoolException("无可出站点,请检查站点状态或能出配置!!");
                                }
                                candidateStations.sort((a, b) -> {
                                    boolean a1001 = "1001".equals(a.getStationName());
                                    boolean b1001 = "1001".equals(b.getStationName());
                                    if (a1001 && !b1001) return -1;
                                    if (!a1001 && b1001) return 1;
                                    return 0;
                                });
                                BasStation basStation = candidateStations.get(0);
                                orderOutItemDto.setSitesNo(basStation.getStationName());
                            }
                        }