fix: return A0404 for missing PDA pallets
This commit is contained in:
+2
@@ -367,6 +367,7 @@ public class PdaPalletOperationService {
|
||||
|
||||
private PalletPhysicalGateway.PalletReference requirePallet(long warehouseId, String code) {
|
||||
PalletPhysicalGateway.PalletReference pallet = physical.resolve(code(code));
|
||||
if (pallet == null) throw notFound("未找到托盘");
|
||||
if (pallet.warehouseId() != warehouseId) throw conflict("托盘不属于 Token 冻结的海外仓");
|
||||
if ("SCRAPPED".equals(pallet.status())) throw conflict("已报废托盘不能执行作业");
|
||||
return pallet;
|
||||
@@ -517,6 +518,7 @@ public class PdaPalletOperationService {
|
||||
private static long value(Long value) { return value == null ? 0L : value; }
|
||||
private static ResponseStatusException conflict(String message) { return new ResponseStatusException(HttpStatus.CONFLICT, message); }
|
||||
private static ResponseStatusException badRequest(String message) { return new ResponseStatusException(HttpStatus.BAD_REQUEST, message); }
|
||||
private static ResponseStatusException notFound(String message) { return new ResponseStatusException(HttpStatus.NOT_FOUND, message); }
|
||||
|
||||
private record PlannedMove(long positionId, long packages, long expectedVersion,
|
||||
long sourcePalletId, String sourcePalletCode,
|
||||
|
||||
Reference in New Issue
Block a user