# Order Service
ERP订单服务 - 包含订单管理和订单结算模块

## 基本信息
- **服务端口**: 8082
- **服务名称**: order-service
- **模块分支**: 业务域/功能模块
- **数据库**: erp_db

## 功能清单
1. 订单查询
2. 订单审核
3. 订单匹配
4. 订单拉取

## API接口
| 方法 | 路径 | 描述 |
|------|------|------|
| GET | /api/settlement/{id} | OrderSettlementController接口 |
| GET | /api/settlement/no/{settlementNo} | OrderSettlementController接口 |
| GET | /api/settlement/order/{orderId} | OrderSettlementController接口 |
| GET | /api/settlement/list | OrderSettlementController接口 |
| GET | /api/settlement/period/list | OrderSettlementController接口 |
| GET | /api/settlement/statistics | OrderSettlementController接口 |
| GET | /api/settlement/report/list | OrderSettlementController接口 |
| GET | /api/settlement/shop/{shopId}/pending-amount | OrderSettlementController接口 |
| GET | /api/settlement/platform/{platform}/pending-amount | OrderSettlementController接口 |
| GET | /api/settlement/shop/{shopId}/summary | OrderSettlementController接口 |
| GET | /api/settlement/platform/{platform}/summary | OrderSettlementController接口 |
| POST | /api/settlement/calculate/{orderId} | OrderSettlementController接口 |
| POST | /api/settlement/calculate/batch | OrderSettlementController接口 |
| POST | /api/settlement/{id}/confirm | OrderSettlementController接口 |
| POST | /api/settlement/confirm/batch | OrderSettlementController接口 |
| POST | /api/settlement/{id}/freeze | OrderSettlementController接口 |
| POST | /api/settlement/period | OrderSettlementController接口 |
| POST | /api/settlement/period/{id}/close | OrderSettlementController接口 |
| POST | /api/settlement/period/{id}/settle | OrderSettlementController接口 |
| POST | /api/settlement/report/generate | OrderSettlementController接口 |
| POST | /api/settlement/report/{id}/confirm | OrderSettlementController接口 |
| PUT | /api/settlement/{id} | OrderSettlementController接口 |
| PUT | /api/settlement/batch/status | OrderSettlementController接口 |
| GET | /api/orders/{id} | OrderController接口 |
| GET | /api/orders/pending-audit | 查询 audit_status = 'pending' 的订单 |
| GET | /api/orders/pending-match | 查询存在订单项但 erp_sku_id 为空的订单（商品尚未匹配到ERP商品） |
| GET | /api/orders/statistics | OrderController接口 |
| GET | /api/orders/dashboard | OrderController接口 |
| GET | /api/orders/export | OrderController接口 |
| GET | /api/orders/{id}/logs | OrderController接口 |
| GET | /api/orders/options/status | OrderController接口 |
| GET | /api/orders/options/audit-status | OrderController接口 |
| GET | /api/orders/options/delivery-status | OrderController接口 |
| GET | /api/orders/options/platforms | OrderController接口 |
| GET | /api/orders/options/shops | OrderController接口 |
| POST | /api/orders/pull | OrderController接口 |
| POST | /api/orders/{id}/audit | OrderController接口 |
| POST | /api/orders/batch-audit | OrderController接口 |
| POST | /api/orders/{id}/ship | OrderController接口 |
| POST | /api/orders/{id}/complete | OrderController接口 |
| POST | /api/orders/{id}/cancel | OrderController接口 |
| POST | /api/orders/batch-operation | OrderController接口 |
| POST | /api/orders/{id}/sync | OrderController接口 |
| PUT | /api/orders/{id}/warehouse | OrderController接口 |
| PUT | /api/orders/{id}/remark | OrderController接口 |

## 数据库表
| 表名 | 说明 |
|------|------|
| order_items | OrderItem |
| order_operation_logs | OrderOperationLog |
| orders | Order |
| settlement_report | SettlementReport |
| order_settlement | OrderSettlement |
| settlement_period | SettlementPeriod |

## 配置文件
- bootstrap.yml: Nacos配置
- application.yml: 应用配置

## 启动方式
```bash
mvn clean package
java -jar target/order-service.jar
```
