1
0
forked from erp-dev/erp

feat: added shipments list api

This commit is contained in:
2026-01-15 16:47:12 +08:00
parent ea9f378de9
commit a0cd168397
6 changed files with 284 additions and 8 deletions

View File

@@ -33,3 +33,12 @@
- 新增独立说明文档:`docs/business_object_relink_fix.md`(背景、风险、修正案与规则)
---
## Shipment 模块补充
- 补齐出货单查询接口:
- `GET /api/v1/shipment/shipments/`出货单列表merchant 隔离 + LimitOffsetPagination
- `GET /api/v1/shipment/shipments/<id>/`出货单详情merchant 隔离)
- 更新 `docs/shipment_api.md`:补充“查询出货单(列表/详情)”说明
- 新增 API 测试:覆盖列表/详情的商户隔离与未登录行为

View File

@@ -4,11 +4,68 @@
## 目录
- [查询出货单](#查询出货单)
- [创建出货单](#创建出货单)
- [通过生产订单查询销售品](#通过生产订单查询销售品)
---
## 查询出货单
### 出货单列表
- **URL**: `/api/v1/shipment/shipments/`
- **Method**: `GET`
- **认证**: 需要登录JWT Token
#### 查询参数(可选)
| 参数 | 类型 | 说明 |
|------|------|------|
| limit | int | 分页大小LimitOffsetPagination |
| offset | int | 偏移量 |
| customer | int | 客户ID |
| status | int | 状态1=待送货, 2=已交付, 3=已取消) |
| external_id | string | 外部订单号(精确匹配) |
| shipment_date_from | string | 出货日期起始YYYY-MM-DD |
| shipment_date_to | string | 出货日期结束YYYY-MM-DD |
#### 响应格式
使用 LimitOffsetPagination
```json
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"merchant_id": 1,
"merchant_name": "测试印花厂",
"customer": 1,
"customer_name": "客户A",
"shipment_date": "2026-01-14",
"remark": "备注信息",
"items_count": 3,
"created_by_id": 1,
"created_by_name": "张三",
"created_at": "2026-01-14T10:00:00Z",
"updated_at": "2026-01-14T10:00:00Z"
}
]
}
```
### 出货单详情
- **URL**: `/api/v1/shipment/shipments/<id>/`
- **Method**: `GET`
- **认证**: 需要登录JWT Token
---
## 创建出货单
创建出货单并关联销售品。