This commit is contained in:
2025-09-18 21:17:44 +08:00
parent e560e90970
commit bff3d0414d
49 changed files with 1063 additions and 90 deletions

View File

@@ -223,7 +223,7 @@
| mobile | VARCHAR(32) | YES | | 手机 |
| level | VARCHAR(32) | YES | | 客户等级标签 |
| contact_name | VARCHAR(64) | YES | | 联系人 |
| price_level | ENUM('retail','distribution','wholesale','big_client') | NOT NULL | retail | 默认售价列 |
| price_level | ENUM('零售价','批发价','大单报价') | NOT NULL | 零售价 | 默认售价列(中文存储) |
| status | TINYINT UNSIGNED | NOT NULL | 1 | |
| ar_opening | DECIMAL(18,2) | NOT NULL | 0.00 | 期初应收 |
| remark | VARCHAR(255) | YES | | |
@@ -241,14 +241,19 @@
| shop_id | BIGINT UNSIGNED | NOT NULL | | |
| user_id | BIGINT UNSIGNED | NOT NULL | | |
| name | VARCHAR(120) | NOT NULL | | |
| phone | VARCHAR(32) | YES | | |
| contact_name | VARCHAR(64) | YES | | 联系人 |
| mobile | VARCHAR(32) | YES | | 手机 |
| phone | VARCHAR(32) | YES | | 电话 |
| address | VARCHAR(255) | YES | | 经营地址 |
| status | TINYINT UNSIGNED | NOT NULL | 1 | |
| ap_opening | DECIMAL(18,2) | NOT NULL | 0.00 | 期初应付 |
| ap_payable | DECIMAL(18,2) | NOT NULL | 0.00 | 当前应付(实时维护) |
| remark | VARCHAR(255) | YES | | |
| created_at | TIMESTAMP | NOT NULL | CURRENT_TIMESTAMP | |
| updated_at | TIMESTAMP | NOT NULL | CURRENT_TIMESTAMP | |
| deleted_at | DATETIME | YES | | |
**Indexes**: - PRIMARY KEY: `id` - KEY: `idx_suppliers_shop` (`shop_id`) - KEY: `idx_suppliers_phone` (`phone`)
**Indexes**: - PRIMARY KEY: `id` - KEY: `idx_suppliers_shop` (`shop_id`) - KEY: `idx_suppliers_phone` (`phone`) - KEY: `idx_suppliers_mobile` (`mobile`)
**Foreign Keys**: - `fk_suppliers_shop`: `shop_id``shops(id)` - `fk_suppliers_user`: `user_id``users(id)`
### accounts

View File

@@ -84,12 +84,26 @@ paths:
$ref: '#/components/schemas/Account'
/api/suppliers:
get:
summary: 供应商搜索(❌ Partially Implemented
summary: 供应商搜索(✅ Fully Implemented
parameters:
- in: query
name: kw
schema:
type: string
- in: query
name: debtOnly
schema:
type: boolean
- in: query
name: page
schema:
type: integer
default: 1
- in: query
name: size
schema:
type: integer
default: 50
responses:
'200':
description: 成功
@@ -106,6 +120,32 @@ paths:
type: array
items:
$ref: '#/components/schemas/Supplier'
post:
summary: 新建供应商(✅ Fully Implemented
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSupplierRequest'
responses:
'200': { description: 成功 }
/api/suppliers/{id}:
put:
summary: 更新供应商(✅ Fully Implemented
parameters:
- in: path
name: id
required: true
schema: { type: integer, format: int64 }
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSupplierRequest'
responses:
'200': { description: 成功 }
/api/other-transactions:
post:
summary: 新建其他收入/支出(❌ Partially Implemented
@@ -735,13 +775,26 @@ components:
Supplier:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
mobile:
type: string
id: { type: integer, format: int64 }
name: { type: string }
contactName: { type: string, nullable: true }
mobile: { type: string, nullable: true }
phone: { type: string, nullable: true }
address: { type: string, nullable: true }
apOpening: { type: number }
apPayable: { type: number }
remark: { type: string, nullable: true }
CreateSupplierRequest:
type: object
properties:
name: { type: string }
contactName: { type: string, nullable: true }
mobile: { type: string, nullable: true }
phone: { type: string, nullable: true }
address: { type: string, nullable: true }
apOpening: { type: number, nullable: true }
apPayable: { type: number, nullable: true }
remark: { type: string, nullable: true }
CreateOtherTransactionRequest:
type: object
properties:
@@ -860,7 +913,7 @@ components:
mobile: { type: string }
phone: { type: string }
level: { type: string }
priceLevel: { type: string, enum: [retail, distribution, wholesale, big_client] }
priceLevel: { type: string, enum: [零售价, 批发价, 大单报价] }
remark: { type: string }
receivable: { type: number }
CreateCustomerRequest:
@@ -868,7 +921,7 @@ components:
properties:
name: { type: string }
level: { type: string, nullable: true }
priceLevel: { type: string, enum: [retail, distribution, wholesale, big_client] }
priceLevel: { type: string, enum: [零售价, 批发价, 大单报价] }
contactName: { type: string, nullable: true }
mobile: { type: string, nullable: true }
phone: { type: string, nullable: true }