# Finance Service
ERP财务服务 - 收款、退款、应付账款、付款管理、财务报表

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

## 功能清单
1. 应收管理
2. 应付管理
3. 收款退款

## API接口
| 方法 | 路径 | 描述 |
|------|------|------|
| GET | /api/finance/linkage/aftersale/refund/source/{sourceId} | AfterSalesFinanceLinkageController接口 |
| GET | /api/finance/linkage/aftersale/income/{orderNo} | AfterSalesFinanceLinkageController接口 |
| GET | /api/finance/linkage/aftersale/summary/{orderNo} | AfterSalesFinanceLinkageController接口 |
| POST | /api/finance/linkage/aftersale/refund/create | AfterSalesFinanceLinkageController接口 |
| POST | /api/finance/linkage/aftersale/refund/batch-query | AfterSalesFinanceLinkageController接口 |
| PUT | /api/finance/linkage/aftersale/refund/{id}/confirm | AfterSalesFinanceLinkageController接口 |
| PUT | /api/finance/linkage/aftersale/refund/{id}/complete | AfterSalesFinanceLinkageController接口 |
| PUT | /api/finance/linkage/aftersale/refund/{id}/fail | AfterSalesFinanceLinkageController接口 |
| PUT | /api/finance/linkage/aftersale/refund/{id}/cancel | AfterSalesFinanceLinkageController接口 |
| GET | /api/finance/ap/page | AccountsPayableController接口 |
| GET | /api/finance/ap/{apNo} | AccountsPayableController接口 |
| GET | /api/finance/ap/po/{purchaseOrderNo} | AccountsPayableController接口 |
| GET | /api/finance/ap/stats | AccountsPayableController接口 |
| POST | /api/finance/ap/create | AccountsPayableController接口 |
| POST | /api/finance/ap/payment/confirm | AccountsPayableController接口 |
| PUT | /api/finance/ap/{purchaseOrderNo}/cancel | AccountsPayableController接口 |
| PUT | /api/finance/ap/{purchaseOrderNo}/inbound | AccountsPayableController接口 |
| GET | /api/finance/refund/page | RefundController接口 |
| GET | /api/finance/refund/{id} | RefundController接口 |
| GET | /api/finance/refund/no/{refundNo} | RefundController接口 |
| GET | /api/finance/refund/pending/count | RefundController接口 |
| POST | /api/finance/refund/record | RefundController接口 |
| PUT | /api/finance/refund/{id}/confirm | RefundController接口 |
| PUT | /api/finance/refund/{id}/complete | RefundController接口 |
| PUT | /api/finance/refund/{id}/fail | RefundController接口 |
| PUT | /api/finance/refund/{id}/cancel | RefundController接口 |
| GET | /api/finance/payment/page | PaymentController接口 |
| GET | /api/finance/payment/{id} | PaymentController接口 |
| GET | /api/finance/payment/no/{paymentNo} | PaymentController接口 |
| POST | /api/finance/payment/create | PaymentController接口 |
| PUT | /api/finance/payment/{id}/confirm | PaymentController接口 |
| PUT | /api/finance/payment/{id}/cancel | PaymentController接口 |
| GET | /api/finance/income/page | IncomeController接口 |
| GET | /api/finance/income/{id} | IncomeController接口 |
| GET | /api/finance/income/no/{incomeNo} | IncomeController接口 |
| POST | /api/finance/income/record | IncomeController接口 |
| PUT | /api/finance/income/{id}/confirm | IncomeController接口 |
| PUT | /api/finance/income/{id}/cancel | IncomeController接口 |
| GET | /api/finance/reports/summary | ReportController接口 |
| GET | /api/finance/reports/income-expense | ReportController接口 |
| GET | /api/finance/reports/purchase-payment | ReportController接口 |
| GET | /api/finance/reports/today | ReportController接口 |
| GET | /api/finance/linkage/order/{orderNo}/summary | OrderFinanceLinkageController接口 |
| POST | /api/finance/linkage/order/payment/notify | OrderFinanceLinkageController接口 |
| POST | /api/finance/linkage/order/refund/create | OrderFinanceLinkageController接口 |
| PUT | /api/finance/linkage/order/{orderNo}/cancel | OrderFinanceLinkageController接口 |
| PUT | /api/finance/linkage/order/refund/{refundNo}/complete | OrderFinanceLinkageController接口 |
| PUT | /api/finance/linkage/order/income/{orderNo}/confirm | OrderFinanceLinkageController接口 |

## 数据库表
| 表名 | 说明 |
|------|------|
| fin_refund_record | RefundRecord |
| fin_payment_record | PaymentRecord |
| fin_income_record | IncomeRecord |
| fin_accounts_payable | AccountsPayable |

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

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