202 lines
6.2 KiB
Markdown
202 lines
6.2 KiB
Markdown
|
|
# 特色处方模块
|
|||
|
|
|
|||
|
|
## 概述
|
|||
|
|
|
|||
|
|
特色处方模块是 XK 系统的特色功能,提供标准化的处方产品,具有独立的 SKU 和定价体系。
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 特色处方管理
|
|||
|
|
|
|||
|
|
### 接口
|
|||
|
|
|
|||
|
|
| 方法 | 路径 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| GET | `special-prescription/list` | 处方列表 |
|
|||
|
|
| GET | `special-prescription/detail` | 处方详情 |
|
|||
|
|
| POST | `special-prescription/create` | 创建处方 |
|
|||
|
|
| POST | `special-prescription/update` | 更新处方 |
|
|||
|
|
| POST | `special-prescription/status` | 上下架 |
|
|||
|
|
| GET | `special-prescription/sku-list` | SKU 列表 |
|
|||
|
|
| POST | `special-prescription/sku/create` | 创建 SKU |
|
|||
|
|
| POST | `special-prescription/sku/update` | 更新 SKU |
|
|||
|
|
| POST | `special-prescription/sku/delete` | 删除 SKU |
|
|||
|
|
|
|||
|
|
### 关联类
|
|||
|
|
|
|||
|
|
| 类 | 文件 | 说明 |
|
|||
|
|
|----|------|------|
|
|||
|
|
| `SpecialPrescriptionController` | `app/Http/Controllers/admin/business/special_prescription/SpecialPrescriptionController.php` | 控制器 |
|
|||
|
|
| `SpecialPrescriptionService` | `app/Service/admin/business/special_prescription/SpecialPrescriptionService.php` | 业务服务 |
|
|||
|
|
| `SpecialPrescriptionPriceConfigService` | `app/Service/admin/business/special_prescription/SpecialPrescriptionPriceConfigService.php` | 价格配置 |
|
|||
|
|
| `SpecialPrescriptionPriceResolver` | `app/Service/admin/business/special_prescription/SpecialPrescriptionPriceResolver.php` | 价格解析 |
|
|||
|
|
| `SpecialPrescriptionPriceDistributor` | `app/Service/admin/business/special_prescription/SpecialPrescriptionPriceDistributor.php` | 价格分发 |
|
|||
|
|
| `SpecialPrescriptionShippingResolver` | `app/Service/admin/business/special_prescription/SpecialPrescriptionShippingResolver.php` | 运费解析 |
|
|||
|
|
|
|||
|
|
### 关联模型
|
|||
|
|
|
|||
|
|
| 模型 | 表名 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `SpecialPrescriptionModel` | `xk_special_prescription` | 特色处方主表 |
|
|||
|
|
| `SpecialPrescriptionSkuModel` | `xk_special_prescription_sku` | SKU 剂量规格 |
|
|||
|
|
| `SpecialPrescriptionDrugPriceModel` | `xk_special_prescription_drug_price` | 药品分摊价格 |
|
|||
|
|
| `SpecialPrescriptionIntroductionImageModel` | `xk_special_prescription_introduction_images` | 介绍图片 |
|
|||
|
|
|
|||
|
|
### 字段说明
|
|||
|
|
|
|||
|
|
| 字段 | 类型 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `prescription_sub_type` | tinyint | 1=中药, 2=西药, 3=颗粒 |
|
|||
|
|
| `name` | varchar | 处方名称 |
|
|||
|
|
| `category_id` | int | 分类 ID |
|
|||
|
|
| `cover_image` | varchar | 封面图 |
|
|||
|
|
| `intro_text` | mediumtext | 介绍文本 |
|
|||
|
|
| `tags` | json | 标签 |
|
|||
|
|
| `price_per_dose` | decimal | 每剂价格 |
|
|||
|
|
| `price_calc_scheme` | tinyint | 1=固定价, 3=门店浮动价 |
|
|||
|
|
| `buy_price_per_dose` | decimal | 每剂采购价 |
|
|||
|
|
| `sale_price_per_dose` | decimal | 每剂销售价 |
|
|||
|
|
| `sales_count` | int | 销量 |
|
|||
|
|
| `status` | tinyint | 状态 |
|
|||
|
|
| `is_free_shipping` | tinyint | 是否包邮 |
|
|||
|
|
| `free_shipping_min_doses` | int | 包邮最小剂量数 |
|
|||
|
|
| `store_id` | int | 门店 ID |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 特色处方分类
|
|||
|
|
|
|||
|
|
### 接口
|
|||
|
|
|
|||
|
|
| 方法 | 路径 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| GET | `special-prescription-category/list` | 分类列表 |
|
|||
|
|
| POST | `special-prescription-category/create` | 创建分类 |
|
|||
|
|
| POST | `special-prescription-category/update` | 更新分类 |
|
|||
|
|
| POST | `special-prescription-category/delete` | 删除分类 |
|
|||
|
|
|
|||
|
|
### 关联类
|
|||
|
|
|
|||
|
|
| 类 | 文件 | 说明 |
|
|||
|
|
|----|------|------|
|
|||
|
|
| `SpecialPrescriptionCategoryController` | `app/Http/Controllers/admin/business/special_prescription/SpecialPrescriptionCategoryController.php` | 控制器 |
|
|||
|
|
| `SpecialPrescriptionCategoryService` | `app/Service/admin/business/special_prescription/SpecialPrescriptionCategoryService.php` | 业务服务 |
|
|||
|
|
|
|||
|
|
### 关联模型
|
|||
|
|
|
|||
|
|
| 模型 | 表名 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `SpecialPrescriptionCategoryModel` | `xk_special_prescription_category` | 处方分类 |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## SKU 管理
|
|||
|
|
|
|||
|
|
### 关联模型
|
|||
|
|
|
|||
|
|
| 模型 | 表名 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `SpecialPrescriptionSkuModel` | `xk_special_prescription_sku` | SKU 剂量规格 |
|
|||
|
|
|
|||
|
|
### SKU 字段说明
|
|||
|
|
|
|||
|
|
| 字段 | 类型 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `special_prescription_id` | int | 特色处方 ID |
|
|||
|
|
| `store_id` | int | 门店 ID |
|
|||
|
|
| `sku_name` | varchar | SKU 名称(如"7剂") |
|
|||
|
|
| `dose_count` | int | 剂量数 |
|
|||
|
|
| `status` | tinyint | 状态 |
|
|||
|
|
| `is_free_shipping` | tinyint | 是否包邮 |
|
|||
|
|
| `is_default` | tinyint | 是否默认 SKU |
|
|||
|
|
| `buy_price` | decimal | 采购价 |
|
|||
|
|
| `sale_price` | decimal | 销售价 |
|
|||
|
|
| `sort` | int | 排序 |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 药品分摊价格
|
|||
|
|
|
|||
|
|
### 关联模型
|
|||
|
|
|
|||
|
|
| 模型 | 表名 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `SpecialPrescriptionDrugPriceModel` | `xk_special_prescription_drug_price` | 药品分摊价格 |
|
|||
|
|
|
|||
|
|
### 分摊逻辑
|
|||
|
|
|
|||
|
|
```mermaid
|
|||
|
|
graph TB
|
|||
|
|
subgraph 特色处方
|
|||
|
|
SP[特色处方总价]
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
subgraph SKU
|
|||
|
|
SKU1[SKU1: 7剂 ¥70]
|
|||
|
|
SKU2[SKU2: 14剂 ¥130]
|
|||
|
|
SKU3[SKU3: 21剂 ¥189]
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
subgraph 药品分摊
|
|||
|
|
DRUG1[药品A: ¥10/剂]
|
|||
|
|
DRUG2[药品B: ¥8/剂]
|
|||
|
|
DRUG3[药品C: ¥5/剂]
|
|||
|
|
DRUG4[药品D: ¥7/剂]
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
SP --> SKU1
|
|||
|
|
SP --> SKU2
|
|||
|
|
SP --> SKU3
|
|||
|
|
SKU1 --> DRUG1
|
|||
|
|
SKU1 --> DRUG2
|
|||
|
|
SKU1 --> DRUG3
|
|||
|
|
SKU1 --> DRUG4
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 特色处方订单
|
|||
|
|
|
|||
|
|
### 关联模型
|
|||
|
|
|
|||
|
|
| 模型 | 表名 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `SpecialPrescriptionOrderModel` | `xk_special_prescription_order` | 处方订单快照 |
|
|||
|
|
|
|||
|
|
### 关联类
|
|||
|
|
|
|||
|
|
| 类 | 文件 | 说明 |
|
|||
|
|
|----|------|------|
|
|||
|
|
| `SpecialPrescriptionOrderPricingService` | `app/Service/admin/business/special_prescription/SpecialPrescriptionOrderPricingService.php` | 订单定价 |
|
|||
|
|
| `SpecialPrescriptionPackageOrderItemBuilder` | `app/Service/admin/business/special_prescription/SpecialPrescriptionPackageOrderItemBuilder.php` | 订单项构建 |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 患者处方记录
|
|||
|
|
|
|||
|
|
### 关联模型
|
|||
|
|
|
|||
|
|
| 模型 | 表名 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `SpecialPrescriptionPatientRecordModel` | `xk_special_prescription_patient_record` | 患者处方记录 |
|
|||
|
|
|
|||
|
|
### 状态流转
|
|||
|
|
|
|||
|
|
```mermaid
|
|||
|
|
stateDiagram-v2
|
|||
|
|
[*] --> 待应用: 患者选择
|
|||
|
|
待应用 --> 已应用: 应用到处方
|
|||
|
|
已应用 --> 完成: 购药完成
|
|||
|
|
待应用 --> 取消: 患者取消
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 特色处方模板
|
|||
|
|
|
|||
|
|
### 关联类
|
|||
|
|
|
|||
|
|
| 类 | 文件 | 说明 |
|
|||
|
|
|----|------|------|
|
|||
|
|
| `SpecialPrescriptionTemplateService` | `app/Service/admin/business/special_prescription/SpecialPrescriptionTemplateService.php` | 模板服务 |
|