From 70e0a1a07c29a54912d36fc44eb03c5491112477 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期六, 07 三月 2026 09:59:26 +0800
Subject: [PATCH] lsh#
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java | 39 +++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
index 124e0bb..cd7487f 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
@@ -201,7 +201,6 @@
locItems = LocManageUtil.getFirstInFirstOutItemList(item.getMatnrCode(), item.getBatch(), item.getAnfme());
}
}
-
for (LocItem locItem : locItems) {
Loc loc = locService.getById(locItem.getLocId());
List<LocItem> itemList = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, loc.getId()));
@@ -238,22 +237,31 @@
}
List<BasStationArea> basStationAreas = basStationAreaService.list(new LambdaQueryWrapper<BasStationArea>()
.apply("cross_zone_area != '[]'") // 涓嶆槸绌烘暟缁�
- .apply("container_type != '[]'") // 涓嶆槸绌烘暟缁�
- .apply("station_alias != '[]'") // 涓嶆槸绌烘暟缁�
- .apply("JSON_CONTAINS(cross_zone_area, '{0}') = 1", loc.getAreaId().toString())//鍙墽琛屽簱鍖哄尯鍖哄煙id
- .apply("JSON_CONTAINS(container_type, '{0}') = 1", containerType.getContainerType().toString())//瀹瑰櫒绫诲瀷
- .eq(BasStationArea::getDeleted, 0));// 閫氬父闇�瑕佸姞涓婃湭鍒犻櫎鏉′欢
+ .apply("container_type != '[]'")
+ .apply("station_alias != '[]'")
+ .apply("JSON_CONTAINS(cross_zone_area, {0}) = 1", loc.getAreaId().toString())//鍙墽琛屽簱鍖哄尯鍖哄煙id
+ .apply("JSON_CONTAINS(container_type, {0}) = 1", containerType.getContainerType().toString())//瀹瑰櫒绫诲瀷
+ .eq(BasStationArea::getDeleted, 0));
// .apply("JSON_CONTAINS(station_alias, '\"{0}\"') = 1", null)//鍖哄煙鍖呭惈绔欑偣闆�
+ if (basStationAreas.isEmpty()){
+ throw new CoolException("鏈壘鍒扮鍚堟潯浠剁珯鐐癸紒锛侊紒璇锋鏌ュ簱鍖洪厤缃紒锛侊紒");
+ }
List<String> targSiteAreaList = new ArrayList<>();
for (BasStationArea basStationArea : basStationAreas) {
- targSiteAreaList.add(basStationArea.getStationAreaId());
+ if (basStationArea.getStationAliasStaNo().isEmpty()){
+ continue;
+ }
+ targSiteAreaList.add(basStationArea.getId().toString());
+ }
+ if (targSiteAreaList.isEmpty()){
+ throw new CoolException("鏈壘鍒扮鍚堟潯浠剁珯鐐癸紒锛侊紒璇锋鏌ュ簱鍖洪厤缃紒锛侊紒");
}
int count = 0;
for (BasStationArea basStationArea : basStationAreas) {
count++;
- if (!basStationArea.getStationAlias().isEmpty()) {
+ if (!basStationArea.getStationAliasStaNo().isEmpty()) {
List<OrderOutItemDto.staListDto> maps = new ArrayList<>();
- for (String site : basStationArea.getStationAlias()) {
+ for (String site : basStationArea.getStationAliasStaNo()) {
OrderOutItemDto.staListDto staListDto = new OrderOutItemDto.staListDto();
staListDto.setStaNo(site);
staListDto.setStaName(site);
@@ -261,11 +269,15 @@
}
orderOutItemDto.setStaNos(maps);
//鑾峰彇婊¤冻鏉′欢绔欑偣
- Set<String> stationSet = new HashSet<>(basStationArea.getStationAlias());
+ Set<String> stationSet = new HashSet<>(basStationArea.getStationAliasStaNo());
// Set<String> stationSet = basStationArea.getStationAlias().stream().collect(Collectors.toSet());
// Set<String> stationSet = deviceSites.stream().map(DeviceSite::getSite).collect(Collectors.toSet());
//宸蹭娇鐢ㄧ珯鐐�
Set<String> stas = stations.stream().map(BasStation::getStationName).collect(Collectors.toSet());
+ if (stas.size() == maps.size()) {
+ stations = new ArrayList<>();
+ 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)
@@ -278,14 +290,21 @@
if (count == basStationAreas.size()) {
if (!Objects.isNull(basStation)) {
+ orderOutItemDto.setTargSiteAreaNow(basStationArea.getStationAreaId());
orderOutItemDto.setSiteNo(basStation.getStationName());
// throw new CoolException("绔欓粸涓嶅瓨鍦紒锛�");
+ } else if (!stas.isEmpty()) {
+ orderOutItemDto.setTargSiteAreaNow(basStationArea.getStationAreaId());
+ orderOutItemDto.setSiteNo(basStationArea.getStationAliasStaNo().get(0));
+ } else {
+ throw new CoolException("鏈壘鍒扮鍚堟潯浠剁珯鐐癸紒锛侊紒璇锋鏌ュ簱鍖烘垨鑰呰矾寰勯厤缃紒锛侊紒");
}
} else {
if (Objects.isNull(basStation)) {
continue;
// throw new CoolException("绔欓粸涓嶅瓨鍦紒锛�");
}
+ orderOutItemDto.setTargSiteAreaNow(basStationArea.getStationAreaId());
orderOutItemDto.setSiteNo(basStation.getStationName());
}
--
Gitblit v1.9.1