feat: gate overseas receiving and harden phase4 workflows
This commit is contained in:
+20
@@ -6,6 +6,7 @@ import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.dto.LocationRequests;
|
||||
import com.baiyue.warehouse.dto.PalletRequests;
|
||||
import com.baiyue.warehouse.dto.WarehousePalletResolveResponse;
|
||||
import com.baiyue.warehouse.dto.WarehouseLocationResolveResponse;
|
||||
import com.baiyue.warehouse.entity.WarehouseLocationEntity;
|
||||
import com.baiyue.warehouse.entity.WarehousePalletEntity;
|
||||
import com.baiyue.warehouse.entity.WarehouseEntity;
|
||||
@@ -191,6 +192,25 @@ public class WarehouseResourceService {
|
||||
pallet.getVersion() == null ? 0 : pallet.getVersion());
|
||||
}
|
||||
|
||||
public WarehouseLocationResolveResponse resolvePublicLocation(long warehouseId, String locationCode) {
|
||||
if (!StringUtils.hasText(locationCode)) throw new BizException(ResultCode.BAD_REQUEST, "库位码不能为空");
|
||||
WarehouseLocationEntity location = repository.findLocationByCode(PUBLIC_RESOURCE_SCOPE, warehouseId,
|
||||
locationCode.trim());
|
||||
if (location == null) throw new BizException(ResultCode.NOT_FOUND, "库位码不存在或不属于当前仓库");
|
||||
return locationReference(location);
|
||||
}
|
||||
|
||||
public WarehouseLocationResolveResponse resolvePublicLocation(long warehouseId, long locationId) {
|
||||
WarehouseLocationEntity location = repository.findLocation(PUBLIC_RESOURCE_SCOPE, warehouseId, locationId);
|
||||
if (location == null) throw new BizException(ResultCode.NOT_FOUND, "库位不存在或不属于当前仓库");
|
||||
return locationReference(location);
|
||||
}
|
||||
|
||||
private static WarehouseLocationResolveResponse locationReference(WarehouseLocationEntity location) {
|
||||
return new WarehouseLocationResolveResponse(location.getId(), location.getLocationCode(),
|
||||
location.getLocationType(), location.getMaxLoadKg(), location.getStatus());
|
||||
}
|
||||
|
||||
public PageResult<WarehousePalletEntity> pallets(long customerId, long warehouseId,
|
||||
PalletRequests.QueryRequest query) {
|
||||
requireWarehouse(customerId, warehouseId);
|
||||
|
||||
Reference in New Issue
Block a user