From 61f1e279c039cb0482b2d1b692c31be5855ad7b1 Mon Sep 17 00:00:00 2001 From: API Changelog Bot Date: Wed, 15 Apr 2026 19:42:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=88=BF=E9=97=B4=E6=95=B0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=AE=A1=E7=AE=97=20+=20=E5=A4=9A=E6=A1=A3=E4=BD=8D?= =?UTF-8?q?=E6=9C=80=E4=BD=8E=E4=BB=B7=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oduct-v2_room-count-auto-and-tier-price.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 changelogs/2026-04/2026-04-15_product-v2_room-count-auto-and-tier-price.md diff --git a/changelogs/2026-04/2026-04-15_product-v2_room-count-auto-and-tier-price.md b/changelogs/2026-04/2026-04-15_product-v2_room-count-auto-and-tier-price.md new file mode 100644 index 0000000..37be5d7 --- /dev/null +++ b/changelogs/2026-04/2026-04-15_product-v2_room-count-auto-and-tier-price.md @@ -0,0 +1,68 @@ +# 小蒙马房间数自动计算 + 多档位最低价 + +- **日期**: 2026-04-15 +- **服务**: hl-product-service-v2 +- **PR**: #595, #596 +- **类型**: feat (新功能) + +## 概述 + +1. 行程设计中的住宿房间数自动取最小值作为班期默认房间数,不再需要班期里单独传 +2. 多档位产品详情返回各档位各自的最低价 + +## 功能1:房间数自动计算 + +### 行为变更 + +- **保存行程(Step2)时**,后端自动计算各天住宿(档位1)的最小 `roomCount`,写入 `defaultRoomCount` + - 例:D1=8间、D2=9间、D3=8间 → `defaultRoomCount = 8` +- **创建班期时**,如果 `maxRooms` 未传或传0,自动使用 `defaultRoomCount` + - 批量创建班期同样适用 +- 如果手动传了 `maxRooms > 0`,仍以手动值为准 + +### 接口影响 + +无新增接口。现有接口行为变更: + +**PUT /admin/product/item/{id}/itinerary**(Step2 保存行程) +- 保存后自动更新 `defaultRoomCount` + +**POST /admin/product/item/{id}/schedule**(创建班期) +- `maxRooms` 为空或0时自动取 `defaultRoomCount` + +**POST /admin/product/item/{id}/schedule/batch-create**(批量创建班期) +- 同上 + +## 功能2:多档位最低价 + +### GET /mp/product/{id} 新增字段 + +| 字段 | 类型 | 说明 | +|------|------|------| +| `tierPrices` | Array/null | 各档位起步价,仅多档位产品返回 | + +`tierPrices` 数组元素结构: + +| 字段 | 类型 | 说明 | +|------|------|------| +| `tierSeq` | Integer | 档位序号 | +| `tierName` | String | 档位名称 | +| `startPrice` | BigDecimal | 该档位未来可售最低成人售价 | + +### 响应示例 + +```json +{ + "startPrice": 7980.0, + "tierPrices": [ + {"tierSeq": 1, "tierName": "精选", "startPrice": 7980.0}, + {"tierSeq": 2, "tierName": "臻享", "startPrice": 9980.0} + ] +} +``` + +### 规则 + +- `startPrice` 保留为全局最低价(向后兼容) +- `tierPrices` 仅多档位产品返回,单档位产品为 `null` +- 每个档位的 `startPrice` 独立计算(未来日期 + 售价>0 的最低值)