feat: close overseas wallet and pallet cost flow
This commit is contained in:
+27
@@ -190,6 +190,16 @@ public class WarehouseResourceService {
|
||||
if ("SCRAPPED".equals(pallet.getStatus())) throw new BizException(ResultCode.CONFLICT, "托盘已报废");
|
||||
return new WarehousePalletResolveResponse(pallet.getId(), pallet.getPalletCode(), pallet.getWarehouseId(),
|
||||
pallet.getLocationId(), pallet.getStatus(), pallet.getFbaWarehouseCode(),
|
||||
pallet.getUnitPrice(),
|
||||
pallet.getVersion() == null ? 0 : pallet.getVersion());
|
||||
}
|
||||
|
||||
public WarehousePalletResolveResponse resolvePublicPallet(long palletId) {
|
||||
WarehousePalletEntity pallet = repository.findPublicPallet(palletId);
|
||||
if (pallet == null) throw new BizException(ResultCode.NOT_FOUND, "托盘不存在");
|
||||
if (pallet.getLocationId() == null) throw new BizException(ResultCode.CONFLICT, "托盘未绑定库位");
|
||||
return new WarehousePalletResolveResponse(pallet.getId(), pallet.getPalletCode(), pallet.getWarehouseId(),
|
||||
pallet.getLocationId(), pallet.getStatus(), pallet.getFbaWarehouseCode(), pallet.getUnitPrice(),
|
||||
pallet.getVersion() == null ? 0 : pallet.getVersion());
|
||||
}
|
||||
|
||||
@@ -218,6 +228,23 @@ public class WarehouseResourceService {
|
||||
return repository.pagePallets(customerId, warehouseId, query);
|
||||
}
|
||||
|
||||
public PalletRequests.Summary palletSummary(long customerId, long warehouseId, PalletRequests.QueryRequest query) {
|
||||
requireWarehouse(customerId, warehouseId);
|
||||
long total = repository.countPallets(customerId, warehouseId, query, null);
|
||||
return new PalletRequests.Summary(total,
|
||||
repository.countPallets(customerId, warehouseId, query, "IDLE"),
|
||||
repository.countPallets(customerId, warehouseId, query, "OCCUPIED"),
|
||||
repository.countPallets(customerId, warehouseId, query, "SCRAPPED"));
|
||||
}
|
||||
|
||||
public PalletRequests.Summary publicPalletSummary(long customerId, PalletRequests.QueryRequest query) {
|
||||
long total = repository.countPallets(customerId, (Long) null, query, null);
|
||||
return new PalletRequests.Summary(total,
|
||||
repository.countPallets(customerId, (Long) null, query, "IDLE"),
|
||||
repository.countPallets(customerId, (Long) null, query, "OCCUPIED"),
|
||||
repository.countPallets(customerId, (Long) null, query, "SCRAPPED"));
|
||||
}
|
||||
|
||||
public PageResult<WarehousePalletEntity> publicPallets(long customerId,
|
||||
PalletRequests.QueryRequest query) {
|
||||
return repository.pagePublicPallets(customerId, query);
|
||||
|
||||
Reference in New Issue
Block a user