Browse Source

移库

master
han\hanst 5 months ago
parent
commit
7c452e0d3a
  1. 24
      src/main/java/com/gaotao/modules/other/service/impl/InventoryMoveServiceImpl.java

24
src/main/java/com/gaotao/modules/other/service/impl/InventoryMoveServiceImpl.java

@ -120,7 +120,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
// 1. 验证目标库位 // 1. 验证目标库位
//validateTargetLocation(dto.getSite(), dto.getTargetLocationId());
validateTargetLocation(dto.getSite(), dto.getTargetLocationId());
// 2. 验证HandlingUnit // 2. 验证HandlingUnit
List<HandlingUnit> handlingUnits = validateHandlingUnits(dto); List<HandlingUnit> handlingUnits = validateHandlingUnits(dto);
@ -186,7 +186,9 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
.update(); .update();
} }
log.info("库存移库完成,处理了{}个HandlingUnit,共{}个库存分组", handlingUnits.size(), inventoryGroups.size());
// 合并相同条件的HandlingUnit后调用IFS接口
syncToIFSBatchForPallet(dto, handlingUnits);
log.info("库存移库完成,处理了{}个HandlingUnit", handlingUnits.size());
} catch (Exception e) { } catch (Exception e) {
log.error("库存移库失败", 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) { if (location == null) {
throw new XJException("目标库位不存在: " + targetLocationId); 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 * 验证HandlingUnit
*/ */

Loading…
Cancel
Save