|
|
|
@ -120,7 +120,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
|
|
|
// 1. 验证目标库位 |
|
|
|
//validateTargetLocation(dto.getSite(), dto.getTargetLocationId()); |
|
|
|
validateTargetLocation(dto.getSite(), dto.getTargetLocationId()); |
|
|
|
|
|
|
|
// 2. 验证HandlingUnit |
|
|
|
List<HandlingUnit> handlingUnits = validateHandlingUnits(dto); |
|
|
|
@ -186,7 +186,9 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
.update(); |
|
|
|
} |
|
|
|
|
|
|
|
log.info("库存移库完成,处理了{}个HandlingUnit,共{}个库存分组", handlingUnits.size(), inventoryGroups.size()); |
|
|
|
// 合并相同条件的HandlingUnit后调用IFS接口 |
|
|
|
syncToIFSBatchForPallet(dto, handlingUnits); |
|
|
|
log.info("库存移库完成,处理了{}个HandlingUnit", handlingUnits.size()); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("库存移库失败", e); |
|
|
|
@ -197,21 +199,23 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
/** |
|
|
|
* 验证目标库位 |
|
|
|
*/ |
|
|
|
/* private void validateTargetLocation(String site, String targetLocationId) { |
|
|
|
Location location = locationService.lambdaQuery() |
|
|
|
.eq(Location::getSite, site) |
|
|
|
.eq(Location::getLocationId, targetLocationId) |
|
|
|
.one(); |
|
|
|
private String validateTargetLocation(String site, String targetLocationId) { |
|
|
|
if (!locationService.validateTargetLocation(site, targetLocationId)) { |
|
|
|
throw new XJException("目标库位无效或未启用: " + targetLocationId); |
|
|
|
} |
|
|
|
|
|
|
|
// 获取库位详细信息进行额外校验 |
|
|
|
Location location = locationService.getValidLocation(site, targetLocationId); |
|
|
|
if (location == null) { |
|
|
|
throw new XJException("目标库位不存在: " + targetLocationId); |
|
|
|
} |
|
|
|
|
|
|
|
if (!"ACTIVE".equals(location.getStatus())) { |
|
|
|
throw new XJException("目标库位状态不可用: " + targetLocationId); |
|
|
|
// 检查库位是否被冻结 |
|
|
|
if ("Y".equals(location.getHold())) { |
|
|
|
throw new XJException("目标库位已被冻结,无法入库: " + targetLocationId); |
|
|
|
} |
|
|
|
return location.getWarehouseId(); |
|
|
|
} |
|
|
|
*/ |
|
|
|
/** |
|
|
|
* 验证HandlingUnit |
|
|
|
*/ |
|
|
|
|