From 7a92ebbfb8227ff30ebe3300cc9db263a75b7e22 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期四, 05 三月 2026 13:06:15 +0800
Subject: [PATCH] lsh#
---
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java | 54 +++++++++++++++++++++++++++++++-----------------------
1 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
index adbcaeb..74d1b2e 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
@Service
public class AgvServiceImpl implements AgvService {
@@ -83,15 +84,17 @@
if (Cools.isEmpty(basStation)) {
throw new CoolException("鏈壘鍒版帴椹崇珯鐐逛俊鎭紝璇锋鏌ョ珯鐐圭姸鎬�");
}
- List<Long> ids = new ArrayList<>();
- ids.add(basStation.getArea());
- if (basStation.getIsCrossZone() == 1) {
- String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1);
- String[] parts = content.split(",");
- for (int i = 0; i < parts.length; i++) {
- ids.add(Long.parseLong(parts[i].trim()));
- }
- }
+ List<Long> ids = basStation.getCrossZoneArea().stream()
+ .map(Integer::longValue)
+ .collect(Collectors.toList());
+// ids.add(basStation.getArea());
+// if (basStation.getIsCrossZone() == 1) {
+// String content = basStation.getCrossZoneArea().substring(1,.length() - 1);
+// String[] parts = content.split(",");
+// for (int i = 0; i < parts.length; i++) {
+// ids.add(Long.parseLong(parts[i].trim()));
+// }
+// }
List<WarehouseAreas> warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>()
.in(WarehouseAreas::getId, ids)
);
@@ -213,15 +216,17 @@
if (Cools.isEmpty(waitPakinItems)) {
throw new CoolException("鏁版嵁閿欒锛屾湭鎵惧埌缁勬墭鏄庣粏");
}
- List<Long> ids = new ArrayList<>();
- ids.add(basStation.getArea());
- if (basStation.getIsCrossZone() == 1) {
- String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1);
- String[] parts = content.split(",");
- for (int i = 0; i < parts.length; i++) {
- ids.add(Long.parseLong(parts[i].trim()));
- }
- }
+ List<Long> ids = basStation.getCrossZoneArea().stream()
+ .map(Integer::longValue)
+ .collect(Collectors.toList());
+// ids.add(basStation.getArea());
+// if (basStation.getIsCrossZone() == 1) {
+// String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1);
+// String[] parts = content.split(",");
+// for (int i = 0; i < parts.length; i++) {
+// ids.add(Long.parseLong(parts[i].trim()));
+// }
+// }
List<WarehouseAreas> warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>()
.in(WarehouseAreas::getId, ids)
);
@@ -262,7 +267,7 @@
BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
.eq(BasStation::getBarcode, barcode)
- , false
+ .last("limit 1")
);
if (!Cools.isEmpty(isBarcodeSta)) {
throw new CoolException("璇ユ潯鐮佸凡琚�" + isBarcodeSta.getStationName() + "绔欑粦瀹�");
@@ -274,7 +279,9 @@
throw new CoolException("鏈壘鍒扮珯鐐逛俊鎭�");
}
if (!Cools.isEmpty(basStation.getContainerType())) {
- List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class);
+ List<Long> longs1 = basStation.getCrossZoneArea().stream()
+ .map(Integer::longValue)
+ .collect(Collectors.toList());
List<BasContainer> containers = basContainerService.list(
new LambdaQueryWrapper<BasContainer>()
.in(BasContainer::getContainerType, longs1)
@@ -330,12 +337,13 @@
throw new CoolException("绔欑偣涓哄厜鐢电珯鐐癸紝绂佹鍛煎彨AGV");
}
- List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class);
- if (!areaList.contains(area)) {
+ if (!basStation.getCrossZoneArea().contains(Integer.parseInt(area))) {
throw new CoolException("褰撳墠绔欑偣涓嶆敮鎸佺洰鏍囧簱鍖�");
}
if (!Cools.isEmpty(basStation.getContainerType())) {
- List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class);
+ List<Long> longs1 = basStation.getContainerType().stream()
+ .map(Integer::longValue)
+ .collect(Collectors.toList());
List<BasContainer> containers = basContainerService.list(
new LambdaQueryWrapper<BasContainer>()
.in(BasContainer::getContainerType, longs1)
--
Gitblit v1.9.1