From e711c834aec2293c53b07efe53e81e3573c289b6 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期三, 01 四月 2026 11:42:44 +0800
Subject: [PATCH] lsh#

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java |   53 ++++++++++++++++++++++-------------------------------
 1 files changed, 22 insertions(+), 31 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java
index e4bc088..f5b76c6 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java
@@ -19,6 +19,7 @@
 import com.vincent.rsf.server.manager.service.*;
 import com.vincent.rsf.server.manager.utils.LocManageUtil;
 import com.vincent.rsf.server.manager.utils.OptimalAlgorithmUtil;
+import com.vincent.rsf.server.manager.utils.WarehouseLocationRetrievalUtil;
 import com.vincent.rsf.server.system.constant.SerialRuleCode;
 import com.vincent.rsf.server.system.utils.SerialRuleUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -78,6 +79,8 @@
     private WaveOrderRelaServiceImpl waveOrderRelaService;
     @Autowired
     private AsnOrderService asnOrderService;
+    @Autowired
+    private BasStationServiceImpl basStationService;
 
 
     /**
@@ -747,12 +750,13 @@
      */
     @Override
     public R getSiteNos() {
-        List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_MERGE_OUT.type,
-                TaskType.TASK_TYPE_OUT.type,
-                TaskType.TASK_TYPE_MERGE_OUT.type,
-                TaskType.TASK_TYPE_PICK_AGAIN_OUT.type);
-        List<DeviceSite> sites = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>().in(DeviceSite::getType, list).groupBy(DeviceSite::getSite));
-        return R.ok(sites);
+//        List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_MERGE_OUT.type,
+//                TaskType.TASK_TYPE_OUT.type,
+//                TaskType.TASK_TYPE_MERGE_OUT.type,
+//                TaskType.TASK_TYPE_PICK_AGAIN_OUT.type);sites
+//        List<DeviceSite>  = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>().in(DeviceSite::getType, list).groupBy(DeviceSite::getSite));
+        List<BasStation> basStationList = basStationService.list(new LambdaQueryWrapper<BasStation>().eq(BasStation::getOutAble, true));
+        return R.ok(basStationList);
     }
 
     @Override
@@ -828,24 +832,18 @@
                         OrderOutItemDto orderOutItemDto = new OrderOutItemDto();
 //                        orderOutItemDto.setLocItem(locItem);
                         orderOutItemDto.getLocItemList().add(locItem);
-
-                        List<DeviceSite> deviceSites = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>()
-                                .eq(DeviceSite::getChannel, loc.getChannel())
-                                .eq(DeviceSite::getType, issued.doubleValue() >= locItem.getAnfme() && itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)
-                        );
-
-                        if (!deviceSites.isEmpty()) {
+                        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 (DeviceSite sta : deviceSites) {
+                            for (String staNo : outboundSiteByReservoirAreaAndContainer) {
                                 OrderOutItemDto.staListDto staListDto = new OrderOutItemDto.staListDto();
-                                staListDto.setStaNo(sta.getSite());
-                                staListDto.setStaName(sta.getSite());
+                                staListDto.setStaNo(staNo);
+                                staListDto.setStaName(staNo);
                                 maps.add(staListDto);
                             }
                             orderOutItemDto.setStaNos(maps);
                             //榛樿鑾峰彇绗竴绔欑偣
-                            DeviceSite deviceSite = deviceSites.stream().findFirst().get();
-                            orderOutItemDto.setSiteNo(deviceSite.getSite());
+                            orderOutItemDto.setSiteNo(outboundSiteByReservoirAreaAndContainer.get(0));
                         }
 
                         list.add(orderOutItemDto);
@@ -918,26 +916,19 @@
                         locItem.setOutQty(issued.doubleValue() >= locItem.getAnfme() ? locItem.getAnfme() : issued.doubleValue());
                         locItem.setBarcode(loc.getBarcode());
                         OrderOutItemDto orderOutItemDto = new OrderOutItemDto();
-//                        orderOutItemDto.setLocItem(locItem);
                         orderOutItemDto.getLocItemList().add(locItem);
-
-                        List<DeviceSite> deviceSites = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>()
-                                .eq(DeviceSite::getChannel, loc.getChannel())
-                                .eq(DeviceSite::getType, issued.doubleValue() >= locItem.getAnfme() && itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)
-                        );
-
-                        if (!deviceSites.isEmpty()) {
+                        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 (DeviceSite sta : deviceSites) {
+                            for (String staNo : outboundSiteByReservoirAreaAndContainer) {
                                 OrderOutItemDto.staListDto staListDto = new OrderOutItemDto.staListDto();
-                                staListDto.setStaNo(sta.getSite());
-                                staListDto.setStaName(sta.getSite());
+                                staListDto.setStaNo(staNo);
+                                staListDto.setStaName(staNo);
                                 maps.add(staListDto);
                             }
                             orderOutItemDto.setStaNos(maps);
                             //榛樿鑾峰彇绗竴绔欑偣
-                            DeviceSite deviceSite = deviceSites.stream().findFirst().get();
-                            orderOutItemDto.setSiteNo(deviceSite.getSite());
+                            orderOutItemDto.setSiteNo(outboundSiteByReservoirAreaAndContainer.get(0));
                         }
 
                         list.add(orderOutItemDto);

--
Gitblit v1.9.1