|
|
|
@ -163,45 +163,45 @@ import java.util.Map; |
|
|
|
/** |
|
|
|
* 执行移库操作 |
|
|
|
*/ |
|
|
|
private void executeWarehouseTransfer(WmsTransportTask transportTask) { |
|
|
|
try { |
|
|
|
// 获取起始站点和目标站点信息 |
|
|
|
Map<String, Object> fromStationInfo = getStationInfo(transportTask.getFromLocation()); |
|
|
|
Map<String, Object> toStationInfo = getStationInfo(transportTask.getToLocation()); |
|
|
|
|
|
|
|
// 检查站点的仓库和库位是否不同 |
|
|
|
String fromWarehouseId = (String) fromStationInfo.get("warehouseCode"); |
|
|
|
String fromLocationId = (String) fromStationInfo.get("locationCode"); |
|
|
|
String toWarehouseId = (String) toStationInfo.get("warehouseCode"); |
|
|
|
String toLocationId = (String) toStationInfo.get("locationCode"); |
|
|
|
|
|
|
|
if (!fromWarehouseId.equals(toWarehouseId) || !fromLocationId.equals(toLocationId)) { |
|
|
|
log.info("站点仓库或库位不同,执行移库操作:从 {}-{} 到 {}-{}", |
|
|
|
fromWarehouseId, fromLocationId, toWarehouseId, toLocationId); |
|
|
|
|
|
|
|
// 构建移库请求 |
|
|
|
WareHouseTransferRequest transferRequest = new WareHouseTransferRequest(); |
|
|
|
transferRequest.setSite(transportTask.getSite()); |
|
|
|
transferRequest.setTransType("移库"); |
|
|
|
transferRequest.setPalletId(transportTask.getPalletId()); |
|
|
|
transferRequest.setToWarehouseId(toWarehouseId); |
|
|
|
transferRequest.setToLocationId(toLocationId); |
|
|
|
transferRequest.setBusinessType("AGV移库"); |
|
|
|
transferRequest.setRemark("AGV任务完成自动移库"); |
|
|
|
transferRequest.setToStation(transportTask.getToLocation()); |
|
|
|
// 调用移库方法 |
|
|
|
wmsMessageService.doWareHouseForPallet(transferRequest); |
|
|
|
log.info("移库操作执行成功"); |
|
|
|
} else { |
|
|
|
log.info("站点仓库和库位相同,无需执行移库操作"); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("移库操作执行失败:{}", e.getMessage(), e); |
|
|
|
throw new RuntimeException("移库操作失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// private void executeWarehouseTransfer(WmsTransportTask transportTask) { |
|
|
|
// try { |
|
|
|
// // 获取起始站点和目标站点信息 |
|
|
|
// Map<String, Object> fromStationInfo = getStationInfo(transportTask.getFromLocation()); |
|
|
|
// Map<String, Object> toStationInfo = getStationInfo(transportTask.getToLocation()); |
|
|
|
// |
|
|
|
// // 检查站点的仓库和库位是否不同 |
|
|
|
// String fromWarehouseId = (String) fromStationInfo.get("warehouseCode"); |
|
|
|
// String fromLocationId = (String) fromStationInfo.get("locationCode"); |
|
|
|
// String toWarehouseId = (String) toStationInfo.get("warehouseCode"); |
|
|
|
// String toLocationId = (String) toStationInfo.get("locationCode"); |
|
|
|
// |
|
|
|
// if (!fromWarehouseId.equals(toWarehouseId) || !fromLocationId.equals(toLocationId)) { |
|
|
|
// log.info("站点仓库或库位不同,执行移库操作:从 {}-{} 到 {}-{}", |
|
|
|
// fromWarehouseId, fromLocationId, toWarehouseId, toLocationId); |
|
|
|
// |
|
|
|
// // 构建移库请求 |
|
|
|
// WareHouseTransferRequest transferRequest = new WareHouseTransferRequest(); |
|
|
|
// transferRequest.setSite(transportTask.getSite()); |
|
|
|
// transferRequest.setTransType("移库"); |
|
|
|
// transferRequest.setPalletId(transportTask.getPalletId()); |
|
|
|
// transferRequest.setToWarehouseId(toWarehouseId); |
|
|
|
// transferRequest.setToLocationId(toLocationId); |
|
|
|
// transferRequest.setBusinessType("AGV移库"); |
|
|
|
// transferRequest.setRemark("AGV任务完成自动移库"); |
|
|
|
// transferRequest.setToStation(transportTask.getToLocation()); |
|
|
|
// // 调用移库方法 |
|
|
|
// wmsMessageService.doWareHouseForPallet(transferRequest); |
|
|
|
// log.info("移库操作执行成功"); |
|
|
|
// } else { |
|
|
|
// log.info("站点仓库和库位相同,无需执行移库操作"); |
|
|
|
// } |
|
|
|
// |
|
|
|
// } catch (Exception e) { |
|
|
|
// log.error("移库操作执行失败:{}", e.getMessage(), e); |
|
|
|
// throw new RuntimeException("移库操作失败:" + e.getMessage()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// |
|
|
|
/** |
|
|
|
* 仅更新栈板位置(复用现有Pallet service逻辑) |
|
|
|
*/ |
|
|
|
|