# 接口变更记录 — 2026-03-20 16:45

> **提交** `297ce93` · **作者** wx · **时间** 2026-03-20 16:45:40 +0800
>
> feat: 订单自动保险+合同 + 产品合同/保险字段 + 房间升级预览 + 订单价差服务

## 变更总览

- **产品服务**
  - InternalProduct (+1)
- **保险服务**
  - InternalInsurance (+1)
- **合同服务**
  - InternalContract (+2)
- **订单服务**
  - AdminOrder (+1, 改1)
  - InternalPaymentOrder (+1)
- **资源服务**
  - InternalResourcePrice (+1)

---

## 产品服务

### InternalProduct

> 📖 **接口文档**: [http://192.168.100.236:8085/doc.html](http://192.168.100.236:8085/doc.html) → 标签 **「【内部接口】产品（Feign调用）」**

### 🆕 `GET` /internal/product/{productId}/automation-config

**参数**

  - `{productId}` (`Long`) — 路径参数

**响应** `Result<ProductAutomationConfigVO>`

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `insuranceSchemeId` | `Long` |  |
| `contractPlatform` | `String` |  |
| `contractTemplateCode` | `String` |  |
| `contractMode` | `String` |  |
| `signatoryMode` | `Integer` |  |
| `agencyCode` | `String` |  |
| `disputeResolution` | `Integer` |  |
| `supplementaryClause` | `String` |  |
| `transactorName` | `String` |  |
| `transactorPhone` | `String` |  |
| `productName` | `String` |  |
| `destinationCity` | `String` |  |
| `departureCity` | `String` |  |
| `tripDays` | `Integer` |  |
| `tripNights` | `Integer` |  |

---

## 保险服务

### InternalInsurance

> 📖 **接口文档**: [http://192.168.100.236:8098/doc.html](http://192.168.100.236:8098/doc.html) → 标签 **「【内部接口】保险（Feign调用）」**

### 🆕 `POST` /internal/insurance/auto-purchase — 按方案自动投保(内部调用)

> 内部服务间调用。根据保险方案自动为订单所有出行人投保：

**响应** `Result<AutoPurchaseResultVO>`

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `success` | `boolean` | 是否全部成功 |
| `purchasedCount` | `int` | 成功投保段数 |
| `failedCount` | `int` | 失败段数 |
| `failureReason` | `String` | 失败原因（部分失败或全部失败时返回第一个错误） |

---

## 合同服务

### InternalContract

> 📖 **接口文档**: [http://192.168.100.236:8095/doc.html](http://192.168.100.236:8095/doc.html) → 标签 **「【内部接口】合同（Feign调用）」**

### 🆕 `POST` /internal/contract/create — 创建合同（内部调用）

> 内部服务调用创建合同，adminId固定为0表示系统自动创建。返回contractId和status

**请求体** `CreateContractRequest`

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `orderId` | `Long` | 订单ID |
| `contractType` | `String` | 合同类型: TOUR-旅游合同(默认), INSURANCE-保险单 |
| `platform` | `String` | 合同平台（字典：contract_platform）: 12301-全国旅游监管平台, FADADA-法大大, ESIGN-e签宝, TENCENT_ESS-腾讯电子签。不传则根据模板自动确定 |
| `templateCode` | `String` | 模板编码 |
| `agencyCode` | `String` | 旅行社编号（可选，默认使用配置值） |
| `transactorName` | `String` | 经办人姓名 |
| `transactorPhone` | `String` | 经办人电话 |
| `destination` | `String` | 目的地 |
| `routeName` | `String` | 线路名称 |
| `days` | `Integer` | 行程天数 |
| `nights` | `Integer` | 住宿晚数 |
| `departureDate` | `LocalDate` | 出发日期 |
| `returnDate` | `LocalDate` | 返回日期 |
| `departureCity` | `String` | 出发城市 |
| `groupId` | `String` | 团号 |
| `signatoryName` | `String` | 签署人姓名 |
| `signatoryPhone` | `String` | 签署人电话 |
| `signatoryIdNumber` | `String` | 签署人证件号码 |
| `signingPlace` | `String` | 签约地点 |
| `adultCost` | `BigDecimal` | 成人费用 |
| `childCost` | `BigDecimal` | 儿童费用 |
| `totalAmount` | `BigDecimal` | 合同总金额 |
| `contactName` | `String` | 联系人姓名 |
| `contactPhone` | `String` | 联系人电话 |
| `supplementaryClause` | `String` | 补充约定内容 |
| `vehicleModel` | `String` | 车型名称(产品快照) |
| `travelers` | `List<TravelerDTO>` | 出行人列表 |
| `name` | `String` | 姓名 |
| `gender` | `String` | 性别: male/female |
| `age` | `Integer` | 年龄 |
| `idCardNo` | `String` | 证件号码 |
| `phone` | `String` | 手机号 |
| `health` | `String` | 健康信息 |

**响应** `Result<Map<String, Object>>`

### 🆕 `POST` /internal/contract/report — 报备合同（内部调用）

> 内部服务调用报备合同（同步模式），adminId固定为0表示系统自动创建。返回contractId和status

**请求体** `ReportContractRequest`

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `orderId` | `Long` | 订单ID |
| `contractType` | `String` | 合同类型: TOUR-旅游合同(默认), INSURANCE-保险单 |
| `platform` | `String` | 合同平台（字典：contract_platform）: 12301-全国旅游监管平台, FADADA-法大大, ESIGN-e签宝, TENCENT_ESS-腾讯电子签 |
| `templateCode` | `String` | 模板编码 |
| `agencyCode` | `String` | 旅行社编号 |
| `transactorName` | `String` | 经办人姓名 |
| `transactorPhone` | `String` | 经办人电话 |
| `destination` | `String` | 目的地 |
| `routeName` | `String` | 线路名称 |
| `days` | `Integer` | 行程天数 |
| `nights` | `Integer` | 住宿晚数 |
| `departureDate` | `LocalDate` | 出发日期 |
| `returnDate` | `LocalDate` | 返回日期 |
| `departureCity` | `String` | 出发城市 |
| `groupId` | `String` | 团号 |
| `signatoryName` | `String` | 签署人姓名 |
| `signatoryPhone` | `String` | 签署人电话 |
| `signatoryIdNumber` | `String` | 签署人证件号码 |
| `signingPlace` | `String` | 签约地点 |
| `adultCost` | `BigDecimal` | 成人费用 |
| `childCost` | `BigDecimal` | 儿童费用 |
| `totalAmount` | `BigDecimal` | 合同总金额 |
| `contactName` | `String` | 联系人姓名 |
| `contactPhone` | `String` | 联系人电话 |
| `supplementaryClause` | `String` | 补充约定内容 |

**响应** `Result<Map<String, Object>>`

---

## 订单服务

### AdminOrder

> 📖 **接口文档**: [http://192.168.100.236:8084/doc.html](http://192.168.100.236:8084/doc.html) → 分组 **「3.1 订单管理」** → 标签 **「管理端订单接口」**

### 🆕 `POST` /admin/order/{orderId}/hotel-assignment/preview — 配房升级差价预览

> 预览配房时的房型升级差价（不创建记录）。

**参数**

  - `{orderId}` (`Long`) — 路径参数：订单ID

**响应** `Result<RoomUpgradePreviewVO>`

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `details` | `List<DayUpgradeDetail>` | 各天差价明细 |
| `totalDiff` | `BigDecimal` | 差价合计（正数=需补款，负数=可退款） |
| `direction` | `String` | 差价方向：UPGRADE=升级加价, DOWNGRADE=降级减价, SAME=价格不变, MIXED=部分升级部分降级 |
| `description` | `String` | 描述 |
| `familyIndex` | `Integer` | 家庭序号 |
| `date` | `String` | 日期 |
| `defaultRoomTypeId` | `Long` | 产品默认房型ID |
| `defaultRoomTypeName` | `String` | 产品默认房型名称 |
| `assignedRoomTypeId` | `Long` | 实际分配房型ID |
| `assignedRoomTypeName` | `String` | 实际分配房型名称 |
| `defaultPrice` | `BigDecimal` | 默认房型当天单价 |
| `assignedPrice` | `BigDecimal` | 实际房型当天单价 |
| `dayDiff` | `BigDecimal` | 当天差价 |
| `direction` | `String` | 差价方向 |
| `remark` | `String` | 备注 |

### ✏️ `GET` /admin/order/{orderId}/available-hotels — 配房可选酒店列表

- 参数: orderId(Long) → orderId(Long), dayIndex(Integer)

### InternalPaymentOrder

> 📖 **接口文档**: [http://192.168.100.236:8084/doc.html](http://192.168.100.236:8084/doc.html) → 标签 **「【内部接口】订单-支付/合同/保险（Feign调用）」**

### 🆕 `GET` /internal/order/{orderId}/travelers — 获取订单出行人列表(供保险服务调用)

> 内部服务间调用。返回订单下所有出行人的基本信息（姓名、证件号、性别、生日、手机号），

**参数**

  - `{orderId}` (`Long`) — 路径参数：旅行订单ID

**响应** `Result<List<Map<String, Object>>>`

---

## 资源服务

### InternalResourcePrice

> 📖 **接口文档**: [http://192.168.100.236:8082/doc.html](http://192.168.100.236:8082/doc.html) → 标签 **「【内部接口】资源价格（Feign调用）」**

### 🆕 `GET` /internal/resource/prices/standard-room-type/{hotelId}

**参数**

  - `{hotelId}` (`Long`) — 路径参数

**响应** `Result<RoomTypeSimpleVO>`

---

## 📦 其他数据对象变更

> 以下变更未直接关联到本次接口变更，但可能影响现有接口的请求/响应

### 产品服务

#### ✏️ ProductCreateRequest

  - 🆕 `insuranceSchemeId` (`Long`) — 保险方案ID
  - 🆕 `contractPlatform` (`String`) — 合同平台(12301/FADADA)
  - 🆕 `contractTemplateCode` (`String`) — 合同模板编码
  - 🆕 `contractMode` (`String`) — 签约模式(STANDARD/SYNC)
  - 🆕 `signatoryMode` (`Integer`) — 签署模式(1=短信/2=现场/3=线下)
  - 🆕 `agencyCode` (`String`) — 旅行社编码
  - 🆕 `disputeResolution` (`Integer`) — 争议解决方式(1=仲裁/2=诉讼)
  - 🆕 `supplementaryClause` (`String`) — 补充条款
  - 🆕 `transactorName` (`String`) — 经办人姓名
  - 🆕 `transactorPhone` (`String`) — 经办人电话

#### ✏️ ProductListVO

  - 🆕 `insuranceSchemeId` (`String`) — 保险方案ID
  - 🆕 `contractPlatform` (`String`) — 合同平台(12301/FADADA)
  - 🆕 `contractTemplateCode` (`String`) — 合同模板编码
  - 🆕 `contractMode` (`String`) — 签约模式(STANDARD/SYNC)
  - 🆕 `signatoryMode` (`Integer`) — 签署模式(1=短信/2=现场/3=线下)
  - 🆕 `agencyCode` (`String`) — 旅行社编码
  - 🆕 `disputeResolution` (`Integer`) — 争议解决方式(1=仲裁/2=诉讼)
  - 🆕 `supplementaryClause` (`String`) — 补充条款
  - 🆕 `transactorName` (`String`) — 经办人姓名
  - 🆕 `transactorPhone` (`String`) — 经办人电话

#### ✏️ ProductSaveRequest

  - 🆕 `insuranceSchemeId` (`Long`) — 保险方案ID
  - 🆕 `contractPlatform` (`String`) — 合同平台(12301/FADADA)
  - 🆕 `contractTemplateCode` (`String`) — 合同模板编码
  - 🆕 `contractMode` (`String`) — 签约模式(STANDARD/SYNC)
  - 🆕 `signatoryMode` (`Integer`) — 签署模式(1=短信/2=现场/3=线下)
  - 🆕 `agencyCode` (`String`) — 旅行社编码
  - 🆕 `disputeResolution` (`Integer`) — 争议解决方式(1=仲裁/2=诉讼)
  - 🆕 `supplementaryClause` (`String`) — 补充条款
  - 🆕 `transactorName` (`String`) — 经办人姓名
  - 🆕 `transactorPhone` (`String`) — 经办人电话

#### ✏️ ProductUpdateRequest

  - 🆕 `insuranceSchemeId` (`Long`) — 保险方案ID
  - 🆕 `contractPlatform` (`String`) — 合同平台(12301/FADADA)
  - 🆕 `contractTemplateCode` (`String`) — 合同模板编码
  - 🆕 `contractMode` (`String`) — 签约模式(STANDARD/SYNC)
  - 🆕 `signatoryMode` (`Integer`) — 签署模式(1=短信/2=现场/3=线下)
  - 🆕 `agencyCode` (`String`) — 旅行社编码
  - 🆕 `disputeResolution` (`Integer`) — 争议解决方式(1=仲裁/2=诉讼)
  - 🆕 `supplementaryClause` (`String`) — 补充条款
  - 🆕 `transactorName` (`String`) — 经办人姓名
  - 🆕 `transactorPhone` (`String`) — 经办人电话

#### ✏️ ProductVO

  - 🆕 `insuranceSchemeId` (`String`) — 保险方案ID
  - 🆕 `contractPlatform` (`String`) — 合同平台(12301/FADADA)
  - 🆕 `contractTemplateCode` (`String`) — 合同模板编码
  - 🆕 `contractMode` (`String`) — 签约模式(STANDARD/SYNC)
  - 🆕 `signatoryMode` (`Integer`) — 签署模式(1=短信/2=现场/3=线下)
  - 🆕 `agencyCode` (`String`) — 旅行社编码
  - 🆕 `disputeResolution` (`Integer`) — 争议解决方式(1=仲裁/2=诉讼)
  - 🆕 `supplementaryClause` (`String`) — 补充条款
  - 🆕 `transactorName` (`String`) — 经办人姓名
  - 🆕 `transactorPhone` (`String`) — 经办人电话

### 保险服务

#### 🆕 AutoPurchaseRequest

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `orderId` | `Long` | 旅行订单ID |
| `schemeId` | `Long` | 保险方案ID |

### 订单服务

#### ✏️ HotelAssignmentRequest

  - 🆕 `hotelId` (`Long`) — 酒店ID
  - 🆕 `roomTypeId` (`Long`) — 房型ID
  - 🆕 `date` (`String`) — 日期(yyyy-MM-dd)，单天
  - 🆕 `remark` (`String`) — 当天备注
  - 🆕 `upgradePrice` (`BigDecimal`) — 手动覆盖升级差价（null=使用系统计算值，仅当房型与产品默认不同时有效）
  - ❌ ~~`checkInDate`~~ (`String`) — 入住日期(yyyy-MM-dd)
  - ❌ ~~`checkOutDate`~~ (`String`) — 退房日期(yyyy-MM-dd)
  - ✏️ `assignments`: 说明 "酒店分配列表" → "酒店分配列表（按天粒度，每天每个家庭一条记录）"
  - ✏️ `roomType`: 说明 "房型" → "房型名称"

<details>
<summary>📁 全部变更文件 (点击展开)</summary>

```
M	docs/CLAUDE_WORKFLOW/README.md
A	docs/requirements/order-auto-insurance-contract.md
M	hl-contract-service/src/main/java/com/hulalv/contract/controller/InternalContractController.java
M	hl-insurance-service/src/main/java/com/hulalv/insurance/controller/InternalInsuranceController.java
A	hl-insurance-service/src/main/java/com/hulalv/insurance/dto/AutoPurchaseRequest.java
M	hl-insurance-service/src/main/java/com/hulalv/insurance/feign/OrderInsuranceFeignClient.java
M	hl-insurance-service/src/main/java/com/hulalv/insurance/service/InsuranceOrderService.java
A	hl-insurance-service/src/main/java/com/hulalv/insurance/vo/AutoPurchaseResultVO.java
M	hl-mp-service/src/main/java/com/hulalv/mp/config/WebMvcConfig.java
M	hl-order-service/src/main/java/com/hulalv/order/constant/OrderConstants.java
M	hl-order-service/src/main/java/com/hulalv/order/controller/AdminOrderController.java
M	hl-order-service/src/main/java/com/hulalv/order/controller/InternalPaymentOrderController.java
M	hl-order-service/src/main/java/com/hulalv/order/dto/HotelAssignmentRequest.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/ContractFeignClient.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/ContractFeignFallbackFactory.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/InsuranceFeignClient.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/InsuranceFeignFallbackFactory.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/ProductFeignClient.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/ProductFeignFallbackFactory.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/ResourcePriceFeignClient.java
M	hl-order-service/src/main/java/com/hulalv/order/feign/ResourcePriceFeignFallbackFactory.java
M	hl-order-service/src/main/java/com/hulalv/order/service/NotificationEventHelper.java
A	hl-order-service/src/main/java/com/hulalv/order/service/OrderAutoProcessingService.java
M	hl-order-service/src/main/java/com/hulalv/order/service/OrderItineraryEditService.java
M	hl-order-service/src/main/java/com/hulalv/order/service/OrderPriceDiffService.java
M	hl-order-service/src/main/java/com/hulalv/order/service/OrderService.java
M	hl-order-service/src/main/java/com/hulalv/order/service/OrderTodoService.java
A	hl-order-service/src/main/java/com/hulalv/order/vo/RoomUpgradePreviewVO.java
M	hl-order-service/src/test/java/com/hulalv/order/constant/OrderConstantsTest.java
M	hl-order-service/src/test/java/com/hulalv/order/service/OrderPriceDiffServiceTest.java
M	hl-order-service/src/test/java/com/hulalv/order/service/OrderServiceTest.java
M	hl-order-service/src/test/java/com/hulalv/order/service/OrderTodoServiceTest.java
M	hl-order-service/src/test/java/com/hulalv/order/service/RefundPolicyServiceTest.java
A	hl-product-service/src/main/java/com/hulalv/product/config/MapOrNullDeserializer.java
M	hl-product-service/src/main/java/com/hulalv/product/controller/InternalProductController.java
M	hl-product-service/src/main/java/com/hulalv/product/dto/ProductCreateRequest.java
M	hl-product-service/src/main/java/com/hulalv/product/dto/ProductSaveRequest.java
M	hl-product-service/src/main/java/com/hulalv/product/dto/ProductUpdateRequest.java
M	hl-product-service/src/main/java/com/hulalv/product/entity/Product.java
A	hl-product-service/src/main/java/com/hulalv/product/vo/ProductAutomationConfigVO.java
M	hl-product-service/src/main/java/com/hulalv/product/vo/ProductListVO.java
M	hl-product-service/src/main/java/com/hulalv/product/vo/ProductVO.java
M	hl-resource-service/src/main/java/com/hulalv/resource/controller/InternalResourcePriceController.java
A	sql/product_automation_fields.sql
```
</details>