|
|
|
@ -357,7 +357,7 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
|
|
|
|
/** |
|
|
|
* @author rqrq |
|
|
|
* @Description 按实际工作位映射的被分拣源盘位查询清单并过滤rfidBarcode;devCode保留实际站点,未知站点拒绝外呼,接口失败回退空列表。 - rqrq |
|
|
|
* @Description 按实际工作位映射的被分拣源盘位查询清单,并按WCS返回工作位过滤rfidBarcode;devCode保留实际站点,未知站点拒绝外呼,接口失败回退空列表。 - rqrq |
|
|
|
*/ |
|
|
|
private HaiAnSortingListResult querySortingListFromWcs(String site, String palletId, String locationCode) { |
|
|
|
HaiAnSortingListResult result = new HaiAnSortingListResult(); |
|
|
|
@ -371,6 +371,10 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
|
|
|
|
// 根据实际托盘位置取得配对源盘位,未知站点直接报错,禁止向WCS发送工作位或历史看板别名 - rqrq |
|
|
|
String sourceStation = HaiAnStationStaticData.requireSortingSourceStation(locationCode); |
|
|
|
String responseWorkStation = HaiAnStationStaticData.resolveSortingWorkStation(sourceStation); |
|
|
|
if (!StringUtils.hasText(responseWorkStation)) { |
|
|
|
throw new RuntimeException("未找到分拣清单响应工作位映射:" + sourceStation); |
|
|
|
} |
|
|
|
HaiAnAutoSortingInfoRequest queryRequest = new HaiAnAutoSortingInfoRequest(); |
|
|
|
queryRequest.setSite(site); |
|
|
|
queryRequest.setPalletId(palletId); |
|
|
|
@ -391,7 +395,7 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
} |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
JsonNode rootNode = mapper.readTree(response); |
|
|
|
// 兼容WCS根对象及resData包裹,统一在同一业务对象中按源盘位过滤,禁止混取其他站点标签 - rqrq |
|
|
|
// 兼容WCS根对象及resData包裹,统一在同一业务对象中按返回工作位过滤,禁止混取其他站点标签 - rqrq |
|
|
|
if (!rootNode.has("sortingStations") && !rootNode.has("materials") && rootNode.path("resData").isObject()) { |
|
|
|
rootNode = rootNode.path("resData"); |
|
|
|
} |
|
|
|
@ -403,24 +407,24 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
throw new RuntimeException("WCS分拣清单sortingStations不是数组"); |
|
|
|
} |
|
|
|
if (sortingStations.isArray()) { |
|
|
|
boolean matchedSource = false; |
|
|
|
boolean matchedWorkStation = false; |
|
|
|
for (JsonNode stationNode : sortingStations) { |
|
|
|
String sortingStation = stationNode.path("sortingStation").asText(""); |
|
|
|
if (!StringUtils.hasText(sortingStation)) { |
|
|
|
sortingStation = stationNode.path("stationCode").asText(""); |
|
|
|
} |
|
|
|
// WCS返回的是被分拣位,必须匹配本次查询源盘位;工作位只用于页面身份与业务权限 - rqrq |
|
|
|
if (!StringUtils.hasText(sortingStation) || !sourceStation.equalsIgnoreCase(sortingStation.trim())) { |
|
|
|
// WCS返回的是分拣工作位,必须匹配本次查询对应工作位;请求侧仍发送源盘位 - rqrq |
|
|
|
if (!StringUtils.hasText(sortingStation) || !responseWorkStation.equalsIgnoreCase(sortingStation.trim())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// 配对源盘位只能出现一次,重复站点可能混入不同批次清单,拒绝后回退空列表以阻断错误扫码 - rqrq |
|
|
|
if (matchedSource) { |
|
|
|
throw new RuntimeException("WCS重复返回被分拣位:" + sourceStation); |
|
|
|
// 配对工作位只能出现一次,重复站点可能混入不同批次清单,拒绝后回退空列表以阻断错误扫码 - rqrq |
|
|
|
if (matchedWorkStation) { |
|
|
|
throw new RuntimeException("WCS重复返回分拣位:" + responseWorkStation); |
|
|
|
} |
|
|
|
matchedSource = true; |
|
|
|
matchedWorkStation = true; |
|
|
|
JsonNode materials = stationNode.path("materials"); |
|
|
|
if (!materials.isArray()) { |
|
|
|
throw new RuntimeException("WCS被分拣位materials不是数组:" + sourceStation); |
|
|
|
throw new RuntimeException("WCS分拣位materials不是数组:" + responseWorkStation); |
|
|
|
} |
|
|
|
if (materials.isArray()) { |
|
|
|
for (JsonNode material : materials) { |
|
|
|
@ -439,7 +443,7 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 仅缺少站点数组时兼容极简materials;有数组但未命中源盘位时保持空清单,禁止兜底混入别站标签 - rqrq |
|
|
|
// 仅缺少站点数组时兼容极简materials;有数组但未命中工作位时保持空清单,禁止兜底混入别站标签 - rqrq |
|
|
|
if (sortingStations.isMissingNode() || sortingStations.isNull()) { |
|
|
|
JsonNode materials = rootNode.path("materials"); |
|
|
|
if (materials.isArray()) { |
|
|
|
|