docs: add interface field expansion design and plan

This commit is contained in:
zgw
2026-07-21 11:39:40 +08:00
parent 5ba4f1fdb3
commit 56beeacbfe
2 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
# Interface and WMS Field Expansion Design
## Scope
Extend three MES-to-WMS contracts without changing their existing business flow:
- `getDeliveryApplicationMsg`: accept `requiredTm` and `isExpedited`.
- `getCompletionRecordMsg`: accept `effectiveDate` and `expirationDate` on each detail.
- `getGoodsSaleSendMsg`: accept `oaProductShipNum`.
The existing `out_stockout.require_time` column is retained as the persistence target for the new API property `requiredTm`; the legacy API property `requireTime` remains accepted for compatibility where practical.
## Data Flow
`PortController` deserializes the request DTOs. `PortServiceImpl` maps DTO values into the existing WMS domain objects and MyBatis insert statements. WMS list/detail queries map the new columns into domain properties and Thymeleaf Bootstrap Table definitions display them.
Field ownership:
| API field | Domain/table | Physical column | WMS view |
| --- | --- | --- | --- |
| `requiredTm` | `OutStockout` / `out_stockout` | existing `require_time` | 出库主表需求时间 |
| `isExpedited` | `OutStockout` / `out_stockout` | new `is_expedited` | 出库主表是否加急 |
| `effectiveDate` | `StockinDetail` / `in_stockin_detail` | new `effective_date` | 入库明细生效日期 |
| `expirationDate` | `StockinDetail` / `in_stockin_detail` | new `expiration_date` | 入库明细失效日期 |
| `oaProductShipNum` | `OutStockoutDetail` / `out_stockout_detail` | new `oa_product_ship_num` | 出库明细 OA 产品发货流水号 |
## Database Migration
Provide an idempotent SQL Server script under `sql/` which uses `COL_LENGTH` checks before adding the four missing runtime columns and their `_finish` archive-table counterparts. The existing `require_time` column is not duplicated. New columns are nullable so older interface payloads and existing rows remain valid; matching archive columns preserve the existing `select *` archive procedures.
## Compatibility and Errors
Missing new fields are accepted as `null`/empty values and do not change existing insert behavior. `isExpedited` uses integer values `0` and `1` when supplied. Existing transaction and response handling remain unchanged.
## Verification
- DTO JSON binding tests assert the exact camel-case API names.
- Mapper XML checks assert every new property is present in result, select, insert, and value mappings where applicable.
- Service tests assert the three mapping paths copy values into persistence objects.
- Maven tests/compilation run for both projects where the local environment permits.
- Static checks verify WMS table columns use the exact new property names and Chinese labels.