后端仓库配送逻辑完善
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-07-17 08:57:19 +08:00
parent c204fb0a92
commit e9537ce052
2 changed files with 81 additions and 35 deletions
@@ -135,10 +135,10 @@ export class AdminOrdersService {
if (dto.warehouseId) {
const warehouseId = BigInt(dto.warehouseId);
const warehouseRow = await this.prisma.cityWarehouse.findFirst({
where: { id: warehouseId, cityId: order.cityId, status: 'ACTIVE' },
where: { id: warehouseId, status: 'ACTIVE' },
});
if (!warehouseRow) {
throw new BadRequestException('仓库不存在或不属于该订单开城城市');
throw new BadRequestException('仓库不存在或已停用');
}
if (order.fulfillmentWarehouseId !== warehouseId) {
await this.prisma.order.update({