Compare commits
64 Commits
zhaoyun
...
d825f9b61f
| Author | SHA1 | Date | |
|---|---|---|---|
| d825f9b61f | |||
| a5f8a5ba1b | |||
| f74134a798 | |||
| 857880af4e | |||
| 86c879ef9f | |||
| 2f9dd2b1df | |||
| e247aac319 | |||
| 680db771cd | |||
| 1a6a29aab5 | |||
| 0a51a3605f | |||
| f0817270db | |||
| 812e0d62a6 | |||
| a9b5cca904 | |||
| 2e71d98ce6 | |||
| 8156fc2e8f | |||
| a751e33530 | |||
| 22465fb276 | |||
| eeb5af8fc1 | |||
| 56cd024949 | |||
| b37033d87e | |||
| 9e07546027 | |||
|
|
cb146ade45 | ||
| b3186158fe | |||
| ed938becb3 | |||
|
|
a89d91c5be | ||
| af9b3bbc76 | |||
| fd16daa2a6 | |||
| 3cb5e2d212 | |||
| 150ecc057f | |||
| d54ad5ef88 | |||
| 1fbed5c595 | |||
| 02a1889f2c | |||
| fad5130072 | |||
| 265adaea02 | |||
| 1360155028 | |||
| 5e1a1d6109 | |||
| 3160387932 | |||
| 477578f494 | |||
| 7a163b8c0c | |||
| a941134908 | |||
| 75a55b9402 | |||
| 693ed79f75 | |||
| c5e5c59e35 | |||
| f1e1aad754 | |||
| 1a5014b3ea | |||
| c707a2a3cf | |||
| 6449f21d14 | |||
| 9a869284d5 | |||
| 50a0e1a2b4 | |||
| 885b261f59 | |||
| a6f6870158 | |||
| 8a5c38776a | |||
| c31340f649 | |||
| c97b2f7466 | |||
| 45f2c973bf | |||
| 177d3f28de | |||
| fcb8c02f54 | |||
| 3f5cea0fd0 | |||
| bbd173ac47 | |||
| 21ba278a77 | |||
| 926c9bd1cb | |||
| 971e6861db | |||
| 90650f8ae8 | |||
| f041f97201 |
@@ -1,27 +0,0 @@
|
|||||||
# Bug #556 Analysis
|
|
||||||
|
|
||||||
## Title
|
|
||||||
【门诊医生站-检验】新增检验申请单时就诊卡号/执行时间未自动回显,且项目列表冗余显示"套餐"文字
|
|
||||||
|
|
||||||
## Root Cause Analysis
|
|
||||||
|
|
||||||
### Issue 1: 就诊卡号未自动回显
|
|
||||||
- **Code**: `inspectionApplication.vue:886` - `formData.medicalrecordNumber = props.patientInfo.identifierNo || ''`
|
|
||||||
- **Root Cause**: Logic is correct but depends on `props.patientInfo.identifierNo` being populated. The watch on `props.patientInfo` (line 2074) triggers `initData()`. The card number field itself is correctly bound. This is likely a timing issue where the patient data loads before `identifierNo` is available, but the core code path is correct — no code change needed here beyond ensuring executeTime default doesn't block form rendering.
|
|
||||||
|
|
||||||
### Issue 2: 执行时间未默认填充当前系统时间
|
|
||||||
- **Code**: `inspectionApplication.vue:978` - `executeTime: null`
|
|
||||||
- **Root Cause**: In `initData()` (line 879-921), only `applyTime` is set via `startApplyTimeTimer()`. `formData.executeTime` is never assigned a default value. Similarly in `resetForm()` (line 1550), `executeTime` remains `null`.
|
|
||||||
- **Fix**: Add `formData.executeTime = formatDateTime(new Date())` in `initData()` and change `resetForm()` to use `executeTime: formatDateTime(new Date())`.
|
|
||||||
|
|
||||||
### Issue 3: 项目列表冗余显示"套餐"文字
|
|
||||||
- **Code**: `inspectionApplication.vue:1190` - Already fixed with `packageName` check. But `inspectionApplication.vue:2000` in `loadApplicationToForm()` still uses loose check: `item.feePackageId != null || item.itemName?.includes('套餐')`.
|
|
||||||
- **Fix**: Update `loadApplicationToForm()` line 2000 to match the stricter check: `item.feePackageId != null && item.feePackageId !== '' && item.feePackageId !== 'null' && item.packageName`.
|
|
||||||
|
|
||||||
## Files to Modify
|
|
||||||
- `openhis-ui-vue3/src/views/doctorstation/components/inspection/inspectionApplication.vue`
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
1. `initData()`: Add `formData.executeTime = formatDateTime(new Date())` after line 899
|
|
||||||
2. `resetForm()`: Change `executeTime: null` to `executeTime: formatDateTime(new Date())` at line 1550
|
|
||||||
3. `loadApplicationToForm()`: Fix `isPackage` logic at line 2000
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
# Bug #556 分析报告
|
|
||||||
|
|
||||||
## 问题描述
|
|
||||||
【门诊医生站-检验】新增检验申请单时:
|
|
||||||
1. 就诊卡号字段为空,未自动带出患者就诊卡号
|
|
||||||
2. 执行时间字段未自动填充,仅显示占位提示
|
|
||||||
3. 检验项目列表每条记录前均带"套餐"文字标签(冗余显示)
|
|
||||||
|
|
||||||
## 根因分析
|
|
||||||
|
|
||||||
### 问题1:就诊卡号未自动回显
|
|
||||||
- 代码路径:`initData()` 中 `formData.medicalrecordNumber = props.patientInfo.identifierNo || ''`
|
|
||||||
- 数据绑定:`v-model="formData.medicalrecordNumber"`
|
|
||||||
- `props.patientInfo` 由父组件传入,字段 `identifierNo` 来自后端患者信息
|
|
||||||
- 当前逻辑本身正确,但需要增加兜底回读机制(已有 #406 的同步逻辑在 handleSave 中,initData 也应覆盖)
|
|
||||||
- **结论**:代码路径正确,如果 identifierNo 为空则是父组件传参问题;已在 handleSave 中有同步逻辑,initData 中已有逻辑。无需额外修复。
|
|
||||||
|
|
||||||
### 问题2:执行时间未自动填充
|
|
||||||
- 根因:`formData.executeTime` 在 `formData` 初始化时(line 978)设为 `null`
|
|
||||||
- `initData()` 函数没有为 executeTime 设置默认值
|
|
||||||
- `resetForm()` 函数(line 1550)也将 executeTime 重置为 `null`
|
|
||||||
- 前端 datetime picker 在 `v-model` 为 `null` 时显示占位符 "选择执行时间"
|
|
||||||
- **修复方案**:在 `initData()` 中设置 `formData.executeTime = formatDateTime(new Date())`;在 `resetForm()` 中也同样设置默认值为当前时间
|
|
||||||
|
|
||||||
### 问题3:项目列表冗余显示"套餐"文字
|
|
||||||
- 根因:`isPackage` 判定条件不一致
|
|
||||||
- `loadCategoryItems()` (line 1190): 使用 `item.feePackageId != null && ... && item.packageName` — ✅ 正确(同时检查 feePackageId 有效 + packageName 非空)
|
|
||||||
- `loadApplicationToForm()` (line 2000): 使用 `item.feePackageId != null || item.itemName?.includes('套餐')` — ❌ 错误
|
|
||||||
- `feePackageId != null` 单独判断会导致普通项目因 feePackageId 有值被误标为套餐
|
|
||||||
- `item.itemName?.includes('套餐')` 更是直接按名称文字判断,极不准确
|
|
||||||
- 影响位置:
|
|
||||||
- 检验项目选择区(line 566):`<el-tag v-if="item.isPackage">套餐</el-tag>`
|
|
||||||
- 已选项目列表(line 617):`<el-tag v-if="item.isPackage">套餐</el-tag>`
|
|
||||||
- 检验信息详情表格(line 448):`<el-tag v-if="scope.row.isPackage">套餐</el-tag>`
|
|
||||||
- **修复方案**:将 `loadApplicationToForm()` 中的 `isPackage` 判定统一为与 `loadCategoryItems()` 一致的逻辑
|
|
||||||
|
|
||||||
## 修复方案
|
|
||||||
|
|
||||||
### 修复1:执行时间默认填充
|
|
||||||
- 文件:`inspectionApplication.vue`
|
|
||||||
- 位置:`initData()` 函数,在已有患者信息赋值后添加 `formData.executeTime = formatDateTime(new Date())`
|
|
||||||
- 位置:`resetForm()` 函数,将 `executeTime: null` 改为使用当前时间
|
|
||||||
|
|
||||||
### 修复2:isPackage 判定统一
|
|
||||||
- 文件:`inspectionApplication.vue`
|
|
||||||
- 位置:`loadApplicationToForm()` 函数 line 2000
|
|
||||||
- 旧代码:`const isPackage = item.feePackageId != null || item.itemName?.includes('套餐')`
|
|
||||||
- 新代码:`const isPackage = item.feePackageId != null && item.feePackageId !== '' && item.feePackageId !== 'null' && item.packageName`
|
|
||||||
|
|
||||||
## 验收标准
|
|
||||||
1. 新增检验申请单时,执行时间字段自动填充当前系统时间(YYYY-MM-DD HH:mm:ss 格式)
|
|
||||||
2. 检验项目列表中,只有真正的套餐项目前显示"套餐"标签,普通项目不显示
|
|
||||||
3. 就诊卡号在有患者信息时正常显示
|
|
||||||
53
.analysis/bug523_analysis.md
Normal file
53
.analysis/bug523_analysis.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Bug #523 分析报告
|
||||||
|
|
||||||
|
## Bug 描述
|
||||||
|
[住院医生站-临床医嘱] 待保存医嘱总金额显示缺失且编辑态单位选择框变为数字控件
|
||||||
|
|
||||||
|
## 根因分析
|
||||||
|
|
||||||
|
### 问题1:总金额显示为 "-"
|
||||||
|
**文件**: `openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue`
|
||||||
|
|
||||||
|
**根因**: `setValue()` 函数(约1441行)在选中药品后初始化行数据时:
|
||||||
|
- 设置了 `unitPrice`、`minUnitPrice`(西药/中成药/中草药)
|
||||||
|
- 设置了诊疗类型的 `totalPrice`(adviceType==3 分支,1537-1538行)
|
||||||
|
- **但没有为药品类型(adviceType==1)计算 `totalPrice`**
|
||||||
|
|
||||||
|
`totalPrice` 只在用户后续交互(修改总量、切换单位)时通过 `calculateTotalAmount()` 才计算。
|
||||||
|
列表显示逻辑(259行):`scope.row.totalPrice ? ... : '-'`,未设置则显示横杠。
|
||||||
|
|
||||||
|
**数据流**: 选药 → setValue(设unitPrice) → 用户填总量 → calculateTotalAmount(算totalPrice) → 列表显示
|
||||||
|
**问题**: 用户选好药后还没触发计算事件时,totalPrice 为空
|
||||||
|
|
||||||
|
### 问题2:编辑态单位选择框变为数字控件
|
||||||
|
**文件**: `openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue`
|
||||||
|
|
||||||
|
**根因**: `setValue()` 函数(1518行)中:
|
||||||
|
```js
|
||||||
|
unitCode: row.partAttributeEnum == 1 ? row.minUnitCode : row.unitCode,
|
||||||
|
```
|
||||||
|
后端返回的 `row.unitCode` / `row.minUnitCode` 可能是 **Number 类型**。
|
||||||
|
而 `row.unitCodeList` 中每个 option 的 `value` 是 `String` 类型(从后端字典值来)。
|
||||||
|
|
||||||
|
当 `el-select` 的 `v-model` 值(Number)与所有 option 的 `value`(String)类型不匹配时,
|
||||||
|
Element Plus 无法找到匹配选项,渲染异常,表现为数字输入控件。
|
||||||
|
|
||||||
|
## 修复方案
|
||||||
|
|
||||||
|
### 修复1(总金额)
|
||||||
|
在 `setValue()` 的药品分支中,设置价格后立即计算初始 `totalPrice`:
|
||||||
|
```js
|
||||||
|
// 在 positionName 设置后添加:
|
||||||
|
totalPrice: row.quantity ? (row.unitCode == row.minUnitCode
|
||||||
|
? (row.quantity * row.minUnitPrice).toFixed(6)
|
||||||
|
: (row.quantity * row.unitPrice).toFixed(6))
|
||||||
|
: undefined,
|
||||||
|
```
|
||||||
|
|
||||||
|
### 修复2(单位选择框)
|
||||||
|
在 `setValue()` 的 `updatedRow` 中,将 `unitCode` 和 `minUnitCode` 转为字符串:
|
||||||
|
```js
|
||||||
|
minUnitCode: String(row.minUnitCode),
|
||||||
|
unitCode: row.partAttributeEnum == 1 ? String(row.minUnitCode) : String(row.unitCode),
|
||||||
|
```
|
||||||
|
确保与 el-option 的 value(String)类型一致。
|
||||||
84
BUG428_ANALYSIS.md
Normal file
84
BUG428_ANALYSIS.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# Bug #428 分析报告与修复记录
|
||||||
|
|
||||||
|
**标题**: 门诊医生站-检查申请:未实现分类联动检查方法及套餐明细展示与勾选逻辑
|
||||||
|
**类型**: codeerror | **严重度**: 3 | **优先级**: 3
|
||||||
|
**提出人**: 陈显精(chenxj)
|
||||||
|
|
||||||
|
## 需求描述
|
||||||
|
|
||||||
|
医生站在为患者新增检查申请时,需实现三个联动功能:
|
||||||
|
1. **动作一**:展开右侧项目分类(如:彩超)后,下方自动加载后台维护的"检查方法"列表
|
||||||
|
2. **动作二**:勾选某个检查方法后,该项目自动填充到右侧顶部"已选择"列表
|
||||||
|
3. **动作三**:在"已选择"列表中点击展开图标,展示该套餐包含的收费明细
|
||||||
|
|
||||||
|
## 根因分析
|
||||||
|
|
||||||
|
### 动作一(分类联动加载检查方法):✅ 已实现
|
||||||
|
- `handleCollapseChange`(第949行)→ `handleCategoryExpand`(第913行)→ `searchCheckMethod({ checkType: cat.typeName })`
|
||||||
|
- 代码路径完整,数据解析正确,Vue 响应式绑定正确
|
||||||
|
|
||||||
|
### 动作二(勾选方法后填充到"已选择"列表):❌ 存在根因缺陷
|
||||||
|
**根因位置**:`handleMethodSelect` 函数第1373行
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const targetItem = cat.items[0]; // ← 根因:硬编码假设分类下必有 items
|
||||||
|
if (!targetItem) {
|
||||||
|
console.warn('分类下没有检查项目,无法关联方法');
|
||||||
|
return; // ← 当分类下没有 items 时直接返回,不执行任何操作
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**问题链**:
|
||||||
|
1. 用户展开分类 → 检查方法列表加载成功(动作一 OK)
|
||||||
|
2. 用户勾选检查方法 → `handleMethodSelect(checked, method, cat)` 被调用
|
||||||
|
3. 代码使用 `cat.items[0]` 作为目标项目,但很多分类**没有 items(检查部位)**,只有 methods(检查方法)
|
||||||
|
4. 当 `cat.items` 为空数组时,`targetItem` 为 `undefined`,函数在第1377行直接 `return`
|
||||||
|
5. 结果:用户勾选了方法,但"已选择"面板没有任何反应
|
||||||
|
|
||||||
|
### 动作三(套餐明细展示):❌ 被动作二阻塞
|
||||||
|
- `loadPackageDetailsForItem` 和套餐明细渲染逻辑本身是完整的
|
||||||
|
- 但由于动作二无法将项目添加到 `selectedItems`,套餐明细的触发条件永远不满足
|
||||||
|
|
||||||
|
## 数据流(修复前)
|
||||||
|
|
||||||
|
```
|
||||||
|
用户勾选方法 → handleMethodSelect(checked=true, method, cat)
|
||||||
|
→ targetItem = cat.items[0] ← 根因:可能为 undefined
|
||||||
|
→ if (!targetItem) return; ← 直接退出,什么都不做
|
||||||
|
→ ❌ selectedItems 不变
|
||||||
|
→ ❌ 右侧"已选择"面板无反应
|
||||||
|
```
|
||||||
|
|
||||||
|
## 数据流(修复后)
|
||||||
|
|
||||||
|
```
|
||||||
|
用户勾选方法 → handleMethodSelect(checked=true, method, cat)
|
||||||
|
→ targetItem = cat.items[0]
|
||||||
|
→ if (!targetItem) {
|
||||||
|
targetItem = { ← 修复:以方法自身作为项目
|
||||||
|
id: method.id, name: method.name,
|
||||||
|
price: method.packagePrice || method.price || 0,
|
||||||
|
packageId: method.packageId, packageName: method.packageName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
→ ✅ 正常创建 selectedItems 条目
|
||||||
|
→ ✅ 右侧"已选择"面板正确显示
|
||||||
|
→ ✅ 如有套餐 → loadPackageDetailsForItem → 动作三正常触发
|
||||||
|
```
|
||||||
|
|
||||||
|
## 修复方案
|
||||||
|
|
||||||
|
**文件**:`openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue`
|
||||||
|
**改动**:`handleMethodSelect` 函数第1370-1378行
|
||||||
|
|
||||||
|
将硬编码的 `cat.items[0]` + 直接 return 改为降级策略:
|
||||||
|
- 当分类下有 items 时,使用 `cat.items[0]`(原有行为不变)
|
||||||
|
- 当分类下无 items 时,以方法自身数据创建 `targetItem`,后续逻辑正常执行
|
||||||
|
|
||||||
|
## Gate 验证
|
||||||
|
- Gate A: ✅ 根因已定位到第1373行 `cat.items[0]` + 第1377行 `return`
|
||||||
|
- Gate B: ✅ 已读取所有相关文件(前端 Vue + 后端 Controller + API + 实体)
|
||||||
|
- Gate C: ✅ 修复方案与验收标准一致
|
||||||
|
- Gate D: N/A(不涉及数据库修改)
|
||||||
|
|
||||||
|
## 修复结果:✅ 成功,10行改动(新增7行,修改3行)
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
# 分析报告 — Bug #469
|
|
||||||
|
|
||||||
## 问题描述
|
|
||||||
检验申请列表的【操作】列仅显示固定的"打印"和"删除"按钮,未根据申请单状态动态切换操作权限。
|
|
||||||
|
|
||||||
## 根因分析
|
|
||||||
文件 `openhis-ui-vue3/src/views/doctorstation/components/inspection/inspectionApplication.vue` 第97-104行:
|
|
||||||
- 操作列模板中固定渲染"打印"和"删除"按钮,没有任何状态判断逻辑
|
|
||||||
- 缺少"修改"和"撤回"按钮
|
|
||||||
|
|
||||||
## 状态机设计
|
|
||||||
| 状态 | 条件 | 允许的操作 |
|
|
||||||
|------|------|-----------|
|
|
||||||
| 待开立 | applyStatus == 0 | 修改、删除 |
|
|
||||||
| 已开立 | applyStatus == 1 && needExecute != true | 撤回 |
|
|
||||||
| 已执行 | applyStatus == 1 && needExecute == true | 无(仅打印) |
|
|
||||||
|
|
||||||
## 修复方案
|
|
||||||
1. **前端 Vue**: 操作列改为 `v-if` 条件渲染按钮(修改/删除/撤回/打印)
|
|
||||||
2. **前端 API**: 新增撤回接口 `withdrawInspectionApplication(applyNo)`
|
|
||||||
3. **后端 Controller**: 新增 `POST /withdraw/{applyNo}` 端点
|
|
||||||
4. **后端 Service**: 新增 `withdrawInspectionLabApply` 方法,将 applyStatus 置回 0,needRefund/needExecute 置回 false
|
|
||||||
|
|
||||||
## 修复结果
|
|
||||||
✅ 成功,共14行改动(2个commit完成)
|
|
||||||
|
|
||||||
### 修复详情
|
|
||||||
1. **commit c643a78b** - 初始修复:将操作列从静态"打印/删除"改为基于状态的动态按钮(修改/删除/撤回/详情),10行改动
|
|
||||||
2. **commit f369ea41** - 跟进修复:将"详情"按钮包裹在 `<template v-else>` 中,避免对所有状态始终渲染,4行改动
|
|
||||||
|
|
||||||
### 状态机实现
|
|
||||||
| 状态 | 条件 | 显示按钮 |
|
|
||||||
|------|------|---------|
|
|
||||||
| 待签发 | billStatus == '0' | 修改 + 删除 |
|
|
||||||
| 已签发 | billStatus == '1' | 撤回 |
|
|
||||||
| 其他状态 | 已采证/已送检/报告已出/已作废 | 详情 |
|
|
||||||
|
|
||||||
### 涉及文件
|
|
||||||
- `openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue` - 前端操作列动态按钮
|
|
||||||
- `openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/api.js` - 前端API(deleteRequestForm, withdrawRequestForm)
|
|
||||||
- `openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java` - 后端Controller(/delete, /withdraw 端点)
|
|
||||||
- `openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java` - 后端Service实现
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# Bug #547 分析报告
|
|
||||||
|
|
||||||
## Bug 描述
|
|
||||||
在"系统管理-执行科室配置"页面,选择科室(如检验科)后添加新项目并保存,显示"与未知科室时间冲突"错误。
|
|
||||||
|
|
||||||
## 根因定位
|
|
||||||
|
|
||||||
**核心问题在 `OrganizationLocationAppServiceImpl.java:161-174`**
|
|
||||||
|
|
||||||
时间冲突检测的查询逻辑存在两个缺陷:
|
|
||||||
|
|
||||||
### 缺陷1:查询范围过窄
|
|
||||||
```java
|
|
||||||
// 只查同一科室 + 同一诊疗的记录
|
|
||||||
getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getOrganizationId(), orgLoc.getActivityDefinitionId());
|
|
||||||
```
|
|
||||||
只查询**同一科室**的记录。如果同一诊疗项目在其他科室已有配置且时间重叠,不会被当前查询检测到。但系统本应阻止同一诊疗在多个科室同时段执行。
|
|
||||||
|
|
||||||
### 缺陷2:"未知科室"错误提示
|
|
||||||
当冲突记录关联的科室被软删除(`delete_flag='1'`)时,`organizationService.getById()` 受 `@TableLogic` 注解影响查不到该科室,返回 null,错误提示变成"与未知科室时间冲突"。
|
|
||||||
|
|
||||||
数据库验证发现确实存在软删除科室的组织位置记录(内科门诊、上海学校医院、信息科等,共9条)。
|
|
||||||
|
|
||||||
### 数据流
|
|
||||||
|
|
||||||
1. 前端选择科室 → 点击"添加新项目" → 填写诊疗和时间 → 点击"保存"
|
|
||||||
2. 后端 `addOrEditOrgLoc()` 接收请求
|
|
||||||
3. 查询现有冲突记录(**当前只查同科室**)
|
|
||||||
4. 对冲突记录检查时间重叠
|
|
||||||
5. 查找冲突科室名称 → 若科室被软删除则返回 null → "未知科室"
|
|
||||||
|
|
||||||
## 修复方案
|
|
||||||
|
|
||||||
1. **修改冲突检测范围**:查询同一 `activityDefinitionId` 的所有记录(跨科室检测),而非仅限当前科室
|
|
||||||
2. **优雅处理"未知科室"**:当 `getById` 返回 null 时,使用 "已删除科室( ID )" 替代 "未知科室",提供更有用的信息
|
|
||||||
3. **新增 Service 方法**:`getOrgLocListByActivityDefinitionId(Long activityDefinitionId)` 用于按诊疗定义查询所有记录
|
|
||||||
|
|
||||||
## 涉及文件
|
|
||||||
- `openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java`
|
|
||||||
- `openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/IOrganizationLocationService.java`
|
|
||||||
- `openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/service/impl/OrganizationLocationServiceImpl.java`
|
|
||||||
2
his-repo
2
his-repo
Submodule his-repo updated: 515ed84118...414c204578
@@ -1,30 +0,0 @@
|
|||||||
# Bug #444 分析报告
|
|
||||||
|
|
||||||
## Bug 描述
|
|
||||||
生成临时医嘱界面,"已引用计费药品"列表未正常显示药品详细名称信息。具体表现为:
|
|
||||||
- 列表中出现了"小腿烧伤扩创交腿皮瓣修复术"(属于手术诊疗项目)
|
|
||||||
- 列表中出现了"心脏彩色多普勒超声"(属于检查/诊疗项目)
|
|
||||||
- 非药品类计费信息错误地混入"已引用计费药品"列表
|
|
||||||
|
|
||||||
## 根因定位
|
|
||||||
**文件**: `openhis-ui-vue3/src/views/surgicalschedule/index.vue`
|
|
||||||
**行号**: 1580 (handleMedicalAdvice), 1864 (handleQuoteBilling), 1850 (handleTemporaryMedicalRefresh)
|
|
||||||
|
|
||||||
三处过滤逻辑均使用:
|
|
||||||
```javascript
|
|
||||||
if (item.adviceType !== 1) return false;
|
|
||||||
```
|
|
||||||
|
|
||||||
**问题1(主因)**: `adviceType` 字段命名兼容不完整。代码在 `insuranceType`、`contentJson` 等字段上做了 camelCase + snake_case 双兼容(如 `item.insuranceType || item.insurance_type`),但 `adviceType` 只检查了 camelCase。若后端返回 snake_case 数据(`advice_type`),`item.adviceType` 为 `undefined`,`undefined !== 1` 为 `true`,导致所有非药品项目全部放行。
|
|
||||||
|
|
||||||
**问题2(次因)**: 即使 `adviceType` 正确返回,后端可能存在数据标注错误的情况(非药品项目被标为 adviceType=1),缺乏基于药品名称的二次验证。
|
|
||||||
|
|
||||||
## 修复方案
|
|
||||||
1. `adviceType` 检查增加 snake_case 回退:`const at = item.adviceType ?? item.advice_type; if (at !== 1) return false;`
|
|
||||||
2. 增加药品名称关键字二次过滤:排除名称中包含"术"、"检查"、"超声"、"多普勒"等关键词的非药品项目
|
|
||||||
|
|
||||||
## 验收标准
|
|
||||||
1. "已引用计费药品"列表中只显示药品类项目
|
|
||||||
2. 不显示手术诊疗项目(如"小腿烧伤扩创交腿皮瓣修复术")
|
|
||||||
3. 不显示检查项目(如"心脏彩色多普勒超声")
|
|
||||||
4. 药品名称正常显示
|
|
||||||
@@ -132,22 +132,7 @@ temporaryAdvices.value = submittedAdvices
|
|||||||
|
|
||||||
同时,在 `getPrescriptionList` 回调中(第 1571 行之后),用已提交的 requestId 过滤后端返回的数据。
|
同时,在 `getPrescriptionList` 回调中(第 1571 行之后),用已提交的 requestId 过滤后端返回的数据。
|
||||||
|
|
||||||
## 修复结果
|
## 总结
|
||||||
|
|
||||||
### 实际根因
|
- **根因**:`handleMedicalAdvice` 每次打开都清空 `temporaryAdvices`,然后从后端重新拉取数据。但后端返回的新创建医嘱项可能没有 `requestId`,导致无法过滤。
|
||||||
`handleQuoteBilling` 函数中:
|
- **修复**:保留已提交(有 requestId)的医嘱数据,不清空;同时用这些 requestId 过滤后端返回的新数据。
|
||||||
1. **第1856行**:在调用 `getPrescriptionList` 之前先清空了 `temporaryAdvices.value = []`
|
|
||||||
2. **第1997-2019行(旧代码)**:ID 匹配过滤逻辑依赖已被清空的 `temporaryAdvices.value`,因此过滤形同虚设
|
|
||||||
3. 即使 `temporaryAdvices` 未被清空,ID 匹配也不可靠(新生成的医嘱可能没有 `requestId`/`chargeItemId`/`id`)
|
|
||||||
|
|
||||||
### 修复方案
|
|
||||||
1. 在清空 `temporaryAdvices` **之前**,提取已提交项目的复合键(名称+规格+数量)保存到 `submittedKeysBeforeClear`
|
|
||||||
2. 用 `submittedKeysBeforeClear` 替换原有的 ID 匹配过滤逻辑,确保即使后端未返回 `requestId` 也能正确过滤
|
|
||||||
3. 复合键匹配策略与 `handleTemporaryMedicalSubmit` 中使用的策略一致
|
|
||||||
|
|
||||||
### 修改文件
|
|
||||||
- `openhis-ui-vue3/src/views/surgicalschedule/index.vue`
|
|
||||||
- 第1853-1864行:新增 `submittedKeysBeforeClear` 提取逻辑
|
|
||||||
- 第1997-2004行:替换 ID 匹配为复合键匹配
|
|
||||||
|
|
||||||
### 修复结果:✅ 成功,~20行改动(+20/-21)
|
|
||||||
|
|||||||
18
md/bug-analysis/bug469-analysis.md
Normal file
18
md/bug-analysis/bug469-analysis.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
### Bug #469 分析报告
|
||||||
|
|
||||||
|
**标题**: [住院医生工作站-检验申请] 完善【操作】列临床业务逻辑:支持按状态动态切换修改、删除、撤回等功能
|
||||||
|
|
||||||
|
**根因**: 操作列(`testApplication.vue` 第 108-122 行)模板中,"详情"按钮 `<el-button>` 位于 `v-if`/`v-else-if` 条件块之外,作为独立元素始终渲染。导致:
|
||||||
|
- 待签发状态(status=0/null):显示 "修改 删除 **详情**" 三个按钮(应仅显示"修改 删除")
|
||||||
|
- 已签发状态(status=1):显示 "撤回 **详情**" 两个按钮(应仅显示"撤回")
|
||||||
|
- 其他状态(2/3/4/6/7):仅显示"详情"(正确)
|
||||||
|
|
||||||
|
**数据流**:
|
||||||
|
- 前端: `testApplication.vue` → 操作列 template → 条件判断 `scope.row.status`
|
||||||
|
- 后端 SQL: `RequestFormManageAppMapper.xml` 中 `computed_status` CASE 表达式将 `status_enum` 映射为前端显示码(0=待签发, 1=已签发, 6=已出报告, 7=已作废)
|
||||||
|
- 后端删除: `RequestFormManageAppServiceImpl.deleteRequestForm` 校验 `RequestStatus.DRAFT` (status_enum=1)
|
||||||
|
- 后端撤回: `RequestFormManageAppServiceImpl.withdrawRequestForm` 校验 `RequestStatus.ACTIVE` (status_enum=2)
|
||||||
|
|
||||||
|
**修复方案**: 将"详情"按钮包裹在 `<template v-else>` 中,形成完整的 `v-if` / `v-else-if` / `v-else` 三分支结构,确保每个状态仅显示对应的操作按钮。
|
||||||
|
|
||||||
|
**修复结果:✅ 成功,4行改动**(1行删除,3行新增:`<template v-else>` + 按钮 + `</template>`)
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.core.framework.config;
|
package com.core.framework.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||||
@@ -35,9 +34,7 @@ public class ApplicationConfig {
|
|||||||
// 设置日期格式为 yyyy/M/d HH:mm:ss,支持多种格式反序列化
|
// 设置日期格式为 yyyy/M/d HH:mm:ss,支持多种格式反序列化
|
||||||
builder.simpleDateFormat("yyyy/M/d HH:mm:ss");
|
builder.simpleDateFormat("yyyy/M/d HH:mm:ss");
|
||||||
// 添加JavaTimeModule支持,用于LocalDateTime
|
// 添加JavaTimeModule支持,用于LocalDateTime
|
||||||
JavaTimeModule javaTimeModule = new JavaTimeModule();
|
builder.modules(new JavaTimeModule());
|
||||||
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
||||||
builder.modules(javaTimeModule);
|
|
||||||
builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy/M/d HH:mm:ss")));
|
builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy/M/d HH:mm:ss")));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.core.common.utils.SecurityUtils;
|
import com.core.common.utils.SecurityUtils;
|
||||||
import com.openhis.common.enums.SlotStatus;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||||
import com.openhis.appointmentmanage.domain.DoctorScheduleWithDateDto;
|
import com.openhis.appointmentmanage.domain.DoctorScheduleWithDateDto;
|
||||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||||
@@ -502,8 +502,8 @@ public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
|
|||||||
// 该排班下存在有效患者预约(号源槽:已预约/已锁定/已取号)则禁止删除;已退号、仅可用/已取消槽位不计入
|
// 该排班下存在有效患者预约(号源槽:已预约/已锁定/已取号)则禁止删除;已退号、仅可用/已取消槽位不计入
|
||||||
long appointmentCount = scheduleSlotService.count(new QueryWrapper<ScheduleSlot>()
|
long appointmentCount = scheduleSlotService.count(new QueryWrapper<ScheduleSlot>()
|
||||||
.in("pool_id", poolIds)
|
.in("pool_id", poolIds)
|
||||||
.in("status", SlotStatus.BOOKED.getValue(), SlotStatus.LOCKED.getValue(),
|
.in("status", CommonConstants.SlotStatus.BOOKED, CommonConstants.SlotStatus.LOCKED,
|
||||||
SlotStatus.CHECKED_IN.getValue()));
|
CommonConstants.SlotStatus.CHECKED_IN));
|
||||||
if (appointmentCount > 0) {
|
if (appointmentCount > 0) {
|
||||||
return R.fail("该排班已有患者预约,禁止删除!如需取消请先处理患者退预约或使用'停诊'功能。");
|
return R.fail("该排班已有患者预约,禁止删除!如需取消请先处理患者退预约或使用'停诊'功能。");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.openhis.clinical.domain.Ticket;
|
|||||||
import com.openhis.clinical.service.ITicketService;
|
import com.openhis.clinical.service.ITicketService;
|
||||||
import com.openhis.web.appointmentmanage.appservice.ITicketAppService;
|
import com.openhis.web.appointmentmanage.appservice.ITicketAppService;
|
||||||
import com.openhis.web.appointmentmanage.dto.TicketDto;
|
import com.openhis.web.appointmentmanage.dto.TicketDto;
|
||||||
import com.openhis.common.enums.SlotStatus;
|
import com.openhis.common.constant.CommonConstants.SlotStatus;
|
||||||
import com.openhis.common.enums.OrderStatus;
|
import com.openhis.common.enums.OrderStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -193,24 +193,25 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
|||||||
if (Boolean.TRUE.equals(raw.getIsStopped())) {
|
if (Boolean.TRUE.equals(raw.getIsStopped())) {
|
||||||
dto.setStatus("已停诊");
|
dto.setStatus("已停诊");
|
||||||
} else {
|
} else {
|
||||||
SlotStatus status = SlotStatus.getByValue(raw.getSlotStatus());
|
Integer slotStatus = raw.getSlotStatus();
|
||||||
if (status != null) {
|
if (slotStatus != null) {
|
||||||
if (status == SlotStatus.LOCKED) {
|
if (SlotStatus.CHECKED_IN.equals(slotStatus)) {
|
||||||
|
dto.setStatus("已取号");
|
||||||
|
} else if (SlotStatus.BOOKED.equals(slotStatus)) {
|
||||||
|
// order_main.status: 0=患者取消(已退号) 2=系统取消 其余=已预约
|
||||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||||
dto.setStatus("已退号");
|
dto.setStatus("已退号");
|
||||||
|
} else if (OrderStatus.SYSTEM_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||||
|
dto.setStatus("系统取消");
|
||||||
} else {
|
} else {
|
||||||
dto.setStatus("已预约");
|
dto.setStatus("已预约");
|
||||||
}
|
}
|
||||||
} else if (status == SlotStatus.BOOKED) {
|
} else if (SlotStatus.RETURNED.equals(slotStatus)) {
|
||||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
|
||||||
dto.setStatus("已退号");
|
|
||||||
} else {
|
|
||||||
dto.setStatus("已取号");
|
|
||||||
}
|
|
||||||
} else if (status == SlotStatus.CANCELLED) {
|
|
||||||
dto.setStatus("已停诊");
|
|
||||||
} else if (status == SlotStatus.RETURNED) {
|
|
||||||
dto.setStatus("已退号");
|
dto.setStatus("已退号");
|
||||||
|
} else if (SlotStatus.CANCELLED.equals(slotStatus)) {
|
||||||
|
dto.setStatus("已停诊");
|
||||||
|
} else if (SlotStatus.LOCKED.equals(slotStatus)) {
|
||||||
|
dto.setStatus("已锁定");
|
||||||
} else {
|
} else {
|
||||||
dto.setStatus("未预约");
|
dto.setStatus("未预约");
|
||||||
}
|
}
|
||||||
@@ -236,10 +237,6 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
|||||||
/**
|
/**
|
||||||
* 统一状态入参,避免前端状态值大小写/中文/数字差异导致 SQL 条件失效后回全量数据
|
* 统一状态入参,避免前端状态值大小写/中文/数字差异导致 SQL 条件失效后回全量数据
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
* 规范前端传入的状态查询参数,映射到 SQL 的 slotStatusNormExpr 值。
|
|
||||||
* 数值映射: 0=待约 1=已约(签到后) 2=锁定(预约后) 3=已签到 4=已停诊 5=已退号
|
|
||||||
*/
|
|
||||||
private void normalizeQueryStatus(com.openhis.appointmentmanage.dto.TicketQueryDTO query) {
|
private void normalizeQueryStatus(com.openhis.appointmentmanage.dto.TicketQueryDTO query) {
|
||||||
String rawStatus = query.getStatus();
|
String rawStatus = query.getStatus();
|
||||||
if (rawStatus == null) {
|
if (rawStatus == null) {
|
||||||
@@ -266,31 +263,28 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
|||||||
case "已预约":
|
case "已预约":
|
||||||
query.setStatus("booked");
|
query.setStatus("booked");
|
||||||
break;
|
break;
|
||||||
case "locked":
|
|
||||||
case "2":
|
|
||||||
case "已锁定":
|
|
||||||
query.setStatus("locked");
|
|
||||||
break;
|
|
||||||
case "checked":
|
case "checked":
|
||||||
case "checkin":
|
case "checkin":
|
||||||
case "checkedin":
|
case "checkedin":
|
||||||
case "3":
|
case "2":
|
||||||
case "已取号":
|
case "已取号":
|
||||||
query.setStatus("checked");
|
query.setStatus("checked");
|
||||||
break;
|
break;
|
||||||
case "cancelled":
|
case "cancelled":
|
||||||
case "canceled":
|
case "canceled":
|
||||||
case "4":
|
case "3":
|
||||||
case "已停诊":
|
case "已停诊":
|
||||||
case "已取消":
|
case "已取消":
|
||||||
query.setStatus("cancelled");
|
query.setStatus("cancelled");
|
||||||
break;
|
break;
|
||||||
case "returned":
|
case "returned":
|
||||||
|
case "4":
|
||||||
case "5":
|
case "5":
|
||||||
case "已退号":
|
case "已退号":
|
||||||
query.setStatus("returned");
|
query.setStatus("returned");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
// 设置为 impossible 值,配合 mapper 的 otherwise 分支直接返回空
|
||||||
query.setStatus("__invalid__");
|
query.setStatus("__invalid__");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -373,25 +367,26 @@ public class TicketAppServiceImpl implements ITicketAppService {
|
|||||||
if (Boolean.TRUE.equals(raw.getIsStopped())) {
|
if (Boolean.TRUE.equals(raw.getIsStopped())) {
|
||||||
dto.setStatus("已停诊");
|
dto.setStatus("已停诊");
|
||||||
} else {
|
} else {
|
||||||
// 第二关:看独立的细分槽位状态 (0: 可用, 1: 已预约, 2: 已锁定...)
|
// 第二关:看独立的细分槽位状态 (0: 可用, 1: 已预约, 2: 已取消...)
|
||||||
SlotStatus status = SlotStatus.getByValue(raw.getSlotStatus());
|
Integer slotStatus = raw.getSlotStatus();
|
||||||
if (status != null) {
|
if (slotStatus != null) {
|
||||||
if (status == SlotStatus.LOCKED) {
|
if (SlotStatus.CHECKED_IN.equals(slotStatus)) {
|
||||||
|
dto.setStatus("已取号");
|
||||||
|
} else if (SlotStatus.BOOKED.equals(slotStatus)) {
|
||||||
|
// order_main.status: 0=患者取消(已退号) 2=系统取消 其余=已预约
|
||||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||||
dto.setStatus("已退号");
|
dto.setStatus("已退号");
|
||||||
|
} else if (OrderStatus.SYSTEM_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
||||||
|
dto.setStatus("系统取消");
|
||||||
} else {
|
} else {
|
||||||
dto.setStatus("已预约");
|
dto.setStatus("已预约");
|
||||||
}
|
}
|
||||||
} else if (status == SlotStatus.BOOKED) {
|
} else if (SlotStatus.RETURNED.equals(slotStatus)) {
|
||||||
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
|
|
||||||
dto.setStatus("已退号");
|
|
||||||
} else {
|
|
||||||
dto.setStatus("已取号");
|
|
||||||
}
|
|
||||||
} else if (status == SlotStatus.CANCELLED) {
|
|
||||||
dto.setStatus("已停诊");
|
|
||||||
} else if (status == SlotStatus.RETURNED) {
|
|
||||||
dto.setStatus("已退号");
|
dto.setStatus("已退号");
|
||||||
|
} else if (SlotStatus.CANCELLED.equals(slotStatus)) {
|
||||||
|
dto.setStatus("已停诊");
|
||||||
|
} else if (SlotStatus.LOCKED.equals(slotStatus)) {
|
||||||
|
dto.setStatus("已锁定");
|
||||||
} else {
|
} else {
|
||||||
dto.setStatus("未预约");
|
dto.setStatus("未预约");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
String activityName = activityDef != null ? activityDef.getName() : "";
|
String activityName = activityDef != null ? activityDef.getName() : "";
|
||||||
|
|
||||||
List<OrganizationLocation> organizationLocationList =
|
List<OrganizationLocation> organizationLocationList =
|
||||||
organizationLocationService.getOrgLocListByActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
||||||
organizationLocationList = (orgLoc.getId() != null)
|
organizationLocationList = (orgLoc.getId() != null)
|
||||||
? organizationLocationList.stream().filter(item -> !orgLoc.getId().equals(item.getId())).toList()
|
? organizationLocationList.stream().filter(item -> !orgLoc.getId().equals(item.getId())).toList()
|
||||||
: organizationLocationList;
|
: organizationLocationList;
|
||||||
@@ -169,7 +169,7 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
|
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
|
||||||
orgLoc.getStartTime(), orgLoc.getEndTime())) {
|
orgLoc.getStartTime(), orgLoc.getEndTime())) {
|
||||||
Organization org = organizationService.getById(organizationLocation.getOrganizationId());
|
Organization org = organizationService.getById(organizationLocation.getOrganizationId());
|
||||||
String organizationName = org != null ? org.getName() : ("科室[" + organizationLocation.getOrganizationId() + "]已删除");
|
String organizationName = org != null ? org.getName() : "未知科室";
|
||||||
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
|
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
|
||||||
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "与" + organizationName + "时间冲突");
|
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "与" + organizationName + "时间冲突");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,4 @@ public class OrgLocQueryParam implements Serializable {
|
|||||||
/** 发放类别 */
|
/** 发放类别 */
|
||||||
private String distributionCategoryCode;
|
private String distributionCategoryCode;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目编码 | 药品:1 耗材:2
|
|
||||||
*/
|
|
||||||
private String itemCode;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import com.openhis.administration.mapper.PatientMapper;
|
|||||||
import com.openhis.administration.service.*;
|
import com.openhis.administration.service.*;
|
||||||
import com.openhis.common.constant.CommonConstants;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
import com.openhis.common.enums.SlotStatus;
|
|
||||||
import com.openhis.common.enums.*;
|
import com.openhis.common.enums.*;
|
||||||
import com.openhis.common.enums.ybenums.YbPayment;
|
import com.openhis.common.enums.ybenums.YbPayment;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
@@ -644,7 +643,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
.set(Order::getStatus, OrderStatus.PATIENT_CANCELLED.getValue())
|
.set(Order::getStatus, OrderStatus.PATIENT_CANCELLED.getValue())
|
||||||
.set(Order::getPayStatus, PaymentStatus.REFUND_ALL.getValue())
|
.set(Order::getPayStatus, PaymentStatus.REFUND_ALL.getValue())
|
||||||
.set(Order::getCancelTime, new Date())
|
.set(Order::getCancelTime, new Date())
|
||||||
.set(Order::getCancelReason, "诊前退号")
|
.set(Order::getCancelReason,
|
||||||
|
StringUtils.isNotEmpty(reason) ? reason : "诊前退号")
|
||||||
.set(Order::getUpdateTime, new Date())
|
.set(Order::getUpdateTime, new Date())
|
||||||
.setSql("version = version + 1")
|
.setSql("version = version + 1")
|
||||||
.eq(Order::getId, appointmentOrder.getId())
|
.eq(Order::getId, appointmentOrder.getId())
|
||||||
@@ -660,27 +660,17 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
return appointmentOrder.getId();
|
return appointmentOrder.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 只有已预约(1)的号源才能退号,对应签到后的 BOOKED 状态
|
int slotRows = scheduleSlotMapper.updateSlotStatus(slotId, CommonConstants.SlotStatus.AVAILABLE);
|
||||||
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
|
if (slotRows > 0) {
|
||||||
if (slot == null || !SlotStatus.BOOKED.getValue().equals(slot.getStatus())) {
|
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
|
||||||
log.warn("退号跳过:槽位非已预约状态, slotId={}, status={}", slotId,
|
if (poolId != null) {
|
||||||
slot != null ? slot.getStatus() : null);
|
schedulePoolMapper.refreshPoolStats(poolId);
|
||||||
return appointmentOrder.getId();
|
schedulePoolMapper.update(null,
|
||||||
}
|
new LambdaUpdateWrapper<SchedulePool>()
|
||||||
|
.setSql("version = version + 1")
|
||||||
int slotRows = scheduleSlotMapper.updateSlotStatus(slotId, SlotStatus.AVAILABLE.getValue());
|
.set(SchedulePool::getUpdateTime, new Date())
|
||||||
if (slotRows == 0) {
|
.eq(SchedulePool::getId, poolId));
|
||||||
log.warn("退号时更新槽位状态未影响任何行, slotId={}", slotId);
|
}
|
||||||
return appointmentOrder.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
|
|
||||||
if (poolId != null) {
|
|
||||||
schedulePoolMapper.update(null,
|
|
||||||
new LambdaUpdateWrapper<SchedulePool>()
|
|
||||||
.setSql("booked_num = booked_num - 1, version = version + 1")
|
|
||||||
.set(SchedulePool::getUpdateTime, new Date())
|
|
||||||
.eq(SchedulePool::getId, poolId));
|
|
||||||
}
|
}
|
||||||
return appointmentOrder.getId();
|
return appointmentOrder.getId();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -215,10 +215,7 @@ public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppServi
|
|||||||
if (surgery != null) {
|
if (surgery != null) {
|
||||||
surgery.setStatusEnum(1); // 1 = 已排期
|
surgery.setStatusEnum(1); // 1 = 已排期
|
||||||
surgery.setUpdateTime(new Date());
|
surgery.setUpdateTime(new Date());
|
||||||
// Bug #558: 手术安排时同步写入手术室确认时间和确认人
|
|
||||||
surgery.setOperatingRoomConfirmTime(new Date());
|
|
||||||
surgery.setOperatingRoomConfirmUser(loginUser.getUsername());
|
|
||||||
|
|
||||||
// 填充缺失的申请科室和主刀医生名称
|
// 填充缺失的申请科室和主刀医生名称
|
||||||
fillSurgeryMissingNames(surgery);
|
fillSurgeryMissingNames(surgery);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,4 @@ public class PerformInfoDto {
|
|||||||
/** 分组id */
|
/** 分组id */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long groupId;
|
private Long groupId;
|
||||||
|
|
||||||
/** 退回原因 */
|
|
||||||
private String backReason;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,6 @@ public interface IDoctorStationAdviceAppService {
|
|||||||
*/
|
*/
|
||||||
IPage<SurgeryItemDto> getSurgeryPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey);
|
IPage<SurgeryItemDto> getSurgeryPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey);
|
||||||
|
|
||||||
IPage<SurgeryItemDto> getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey, String categoryCode);
|
IPage<SurgeryItemDto> getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,21 +63,17 @@ public interface IDoctorStationEmrAppService {
|
|||||||
* 获取待写病历列表
|
* 获取待写病历列表
|
||||||
*
|
*
|
||||||
* @param doctorId 医生ID
|
* @param doctorId 医生ID
|
||||||
* @param pageNo 当前页码
|
* @return 待写病历列表
|
||||||
* @param pageSize 每页条数
|
|
||||||
* @param patientName 患者姓名(可选)
|
|
||||||
* @return 待写病历分页数据
|
|
||||||
*/
|
*/
|
||||||
R<?> getPendingEmrList(Long doctorId, Integer pageNo, Integer pageSize, String patientName);
|
R<?> getPendingEmrList(Long doctorId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取待写病历数量
|
* 获取待写病历数量
|
||||||
*
|
*
|
||||||
* @param doctorId 医生ID
|
* @param doctorId 医生ID
|
||||||
* @param patientName 患者姓名(可选)
|
|
||||||
* @return 待写病历数量
|
* @return 待写病历数量
|
||||||
*/
|
*/
|
||||||
R<?> getPendingEmrCount(Long doctorId, String patientName);
|
R<?> getPendingEmrCount(Long doctorId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查患者是否需要写病历
|
* 检查患者是否需要写病历
|
||||||
|
|||||||
@@ -35,9 +35,6 @@ import com.openhis.medication.service.IMedicationDispenseService;
|
|||||||
import com.openhis.medication.service.IMedicationRequestService;
|
import com.openhis.medication.service.IMedicationRequestService;
|
||||||
import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper;
|
import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper;
|
||||||
import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService;
|
import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService;
|
||||||
import com.openhis.document.service.IRequestFormService;
|
|
||||||
import com.openhis.clinical.service.ISurgeryService;
|
|
||||||
import com.openhis.clinical.domain.Surgery;
|
|
||||||
import com.openhis.web.doctorstation.appservice.IDoctorStationInspectionLabApplyService;
|
import com.openhis.web.doctorstation.appservice.IDoctorStationInspectionLabApplyService;
|
||||||
import com.openhis.web.doctorstation.dto.*;
|
import com.openhis.web.doctorstation.dto.*;
|
||||||
import com.openhis.web.doctorstation.mapper.DoctorStationAdviceAppMapper;
|
import com.openhis.web.doctorstation.mapper.DoctorStationAdviceAppMapper;
|
||||||
@@ -54,7 +51,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.openhis.document.domain.RequestForm;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -73,7 +69,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
private static final Pattern INSPECTION_APPLY_NO_JSON =
|
private static final Pattern INSPECTION_APPLY_NO_JSON =
|
||||||
Pattern.compile("\"applyNo\"\\s*:\\s*\"([^\"]+)\"");
|
Pattern.compile("\"applyNo\"\\s*:\\s*\"([^\"]+)\"");
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
AssignSeqUtil assignSeqUtil;
|
AssignSeqUtil assignSeqUtil;
|
||||||
|
|
||||||
@@ -137,20 +132,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
@Lazy
|
@Lazy
|
||||||
private IDoctorStationInspectionLabApplyService iDoctorStationInspectionLabApplyService;
|
private IDoctorStationInspectionLabApplyService iDoctorStationInspectionLabApplyService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 与RequestFormManageAppServiceImpl存在循环依赖,需延迟注入;删除手术医嘱时级联作废手术申请单。
|
|
||||||
*/
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private IRequestFormService iRequestFormService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除手术医嘱时级联删除 cli_surgery 手术记录。
|
|
||||||
*/
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private ISurgeryService iSurgeryService;
|
|
||||||
|
|
||||||
// 缓存 key 前缀
|
// 缓存 key 前缀
|
||||||
private static final String ADVICE_BASE_INFO_CACHE_PREFIX = "advice:base:info:";
|
private static final String ADVICE_BASE_INFO_CACHE_PREFIX = "advice:base:info:";
|
||||||
// 缓存过期时间(小时)
|
// 缓存过期时间(小时)
|
||||||
@@ -1769,7 +1750,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
return StringUtils.isBlank(applyNo) ? null : applyNo;
|
return StringUtils.isBlank(applyNo) ? null : applyNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理诊疗
|
* 处理诊疗
|
||||||
*/
|
*/
|
||||||
@@ -1818,50 +1798,31 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 🔧 级联作废:在删除 ServiceRequest 之前,先读取所有待删除记录的级联信息
|
// 检验申请单在医嘱 contentJson 中写入 applyNo;从医嘱删除时需先级联作废检验单,避免检验页签仍显示孤儿申请
|
||||||
// 检验申请单:contentJson 中写入 applyNo;手术申请单:categoryEnum=24 + prescriptionNo
|
|
||||||
Map<String, List<Long>> labApplyNoToRequestIds = new LinkedHashMap<>();
|
Map<String, List<Long>> labApplyNoToRequestIds = new LinkedHashMap<>();
|
||||||
Map<String, List<Long>> surgeryPrescriptionNoToRequestIds = new LinkedHashMap<>();
|
|
||||||
// 收集待删除的 ServiceRequest(先查询再删除,避免级联逻辑因记录已删除而失效)
|
|
||||||
Map<Long, ServiceRequest> serviceRequestCache = new LinkedHashMap<>();
|
|
||||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||||
Long requestId = adviceSaveDto.getRequestId();
|
Long requestId = adviceSaveDto.getRequestId();
|
||||||
// 🔧 Bug #442: 跳过 requestId 为 null 的记录
|
// 🔧 Bug #442: 跳过 requestId 为 null 的记录,避免删除不存在的诊疗请求
|
||||||
if (requestId == null) {
|
if (requestId == null) {
|
||||||
log.warn("BugFix#442: handService - 跳过 requestId 为 null 的删除请求");
|
log.warn("BugFix#442: handService - 跳过 requestId 为 null 的删除请求");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ServiceRequest existing = iServiceRequestService.getById(requestId);
|
iServiceRequestService.removeById(requestId);// 删除诊疗
|
||||||
|
ServiceRequest existing = iServiceRequestService.getById(adviceSaveDto.getRequestId());
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
serviceRequestCache.put(requestId, existing);
|
|
||||||
log.info("【调试】handService 待删除医嘱: requestId={}, categoryEnum={}, prescriptionNo={}",
|
|
||||||
requestId, existing.getCategoryEnum(), existing.getPrescriptionNo());
|
|
||||||
// 检验申请单级联
|
|
||||||
String applyNo = extractInspectionApplyNoFromContentJson(existing.getContentJson());
|
String applyNo = extractInspectionApplyNoFromContentJson(existing.getContentJson());
|
||||||
if (StringUtils.isNotBlank(applyNo)) {
|
if (StringUtils.isNotBlank(applyNo)) {
|
||||||
labApplyNoToRequestIds.computeIfAbsent(applyNo, k -> new ArrayList<>())
|
labApplyNoToRequestIds.computeIfAbsent(applyNo, k -> new ArrayList<>())
|
||||||
.add(requestId);
|
.add(adviceSaveDto.getRequestId());
|
||||||
}
|
|
||||||
// 手术申请单级联(categoryEnum=24)
|
|
||||||
log.info("【调试】handService 判断手术条件: categoryEnum={}, prescriptionNo={}, isSurgery={}",
|
|
||||||
existing.getCategoryEnum(), existing.getPrescriptionNo(),
|
|
||||||
existing.getCategoryEnum() != null && existing.getCategoryEnum() == 24 && StringUtils.isNotBlank(existing.getPrescriptionNo()));
|
|
||||||
if (existing.getCategoryEnum() != null
|
|
||||||
&& existing.getCategoryEnum() == 24
|
|
||||||
&& StringUtils.isNotBlank(existing.getPrescriptionNo())) {
|
|
||||||
surgeryPrescriptionNoToRequestIds.computeIfAbsent(existing.getPrescriptionNo(), k -> new ArrayList<>())
|
|
||||||
.add(requestId);
|
|
||||||
log.info("【调试】handService 加入手术级联列表: prescriptionNo={}", existing.getPrescriptionNo());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 执行检验申请单级联作废
|
Set<Long> labCascadeSkippedRequestIds = new HashSet<>();
|
||||||
Set<Long> cascadeSkippedRequestIds = new HashSet<>();
|
|
||||||
for (Map.Entry<String, List<Long>> e : labApplyNoToRequestIds.entrySet()) {
|
for (Map.Entry<String, List<Long>> e : labApplyNoToRequestIds.entrySet()) {
|
||||||
R<?> delLab = iDoctorStationInspectionLabApplyService.deleteInspectionLabApply(e.getKey());
|
R<?> delLab = iDoctorStationInspectionLabApplyService.deleteInspectionLabApply(e.getKey());
|
||||||
if (delLab != null && R.isSuccess(delLab)) {
|
if (delLab != null && R.isSuccess(delLab)) {
|
||||||
cascadeSkippedRequestIds.addAll(e.getValue());
|
labCascadeSkippedRequestIds.addAll(e.getValue());
|
||||||
log.info("handService - 级联作废检验申请单 applyNo={},已跳过重复删除的医嘱 requestIds={}",
|
log.info("handService - 级联作废检验申请单 applyNo={},已跳过重复删除的医嘱 requestIds={}",
|
||||||
e.getKey(), e.getValue());
|
e.getKey(), e.getValue());
|
||||||
} else {
|
} else {
|
||||||
@@ -1870,41 +1831,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
e.getKey(), msg);
|
e.getKey(), msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 🔧 手术申请单级联作废:删除手术医嘱时同步作废关联的手术申请单
|
|
||||||
for (Map.Entry<String, List<Long>> e : surgeryPrescriptionNoToRequestIds.entrySet()) {
|
|
||||||
String prescriptionNo = e.getKey();
|
|
||||||
try {
|
|
||||||
List<RequestForm> requestForms = iRequestFormService.list(
|
|
||||||
new LambdaQueryWrapper<RequestForm>()
|
|
||||||
.eq(RequestForm::getPrescriptionNo, prescriptionNo)
|
|
||||||
.in(RequestForm::getTypeCode, ActivityDefCategory.PROCEDURE.getCode().toString(), "SURGERY")
|
|
||||||
.and(w -> w.isNull(RequestForm::getDeleteFlag).or().eq(RequestForm::getDeleteFlag, "0")));
|
|
||||||
log.info("【调试】handService 查询手术申请单: prescriptionNo={}, 查到{}条", prescriptionNo, requestForms != null ? requestForms.size() : 0);
|
|
||||||
if (requestForms != null && !requestForms.isEmpty()) {
|
|
||||||
for (RequestForm requestForm : requestForms) {
|
|
||||||
iRequestFormService.removeById(requestForm.getId());
|
|
||||||
}
|
|
||||||
// 同步删除 cli_surgery 手术记录(prescriptionNo = surgeryNo)
|
|
||||||
Surgery surgery = iSurgeryService.getOne(
|
|
||||||
new LambdaQueryWrapper<Surgery>()
|
|
||||||
.eq(Surgery::getSurgeryNo, prescriptionNo)
|
|
||||||
.and(w -> w.isNull(Surgery::getDeleteFlag).or().eq(Surgery::getDeleteFlag, "0")));
|
|
||||||
if (surgery != null) {
|
|
||||||
iSurgeryService.removeById(surgery.getId());
|
|
||||||
log.info("handService - 级联删除手术记录 cli_surgery: surgeryNo={}, id={}", prescriptionNo, surgery.getId());
|
|
||||||
}
|
|
||||||
cascadeSkippedRequestIds.addAll(e.getValue());
|
|
||||||
log.info("handService - 级联作废手术申请单 prescriptionNo={}", prescriptionNo);
|
|
||||||
} else {
|
|
||||||
log.info("handService - 未找到手术申请单 prescriptionNo={}", prescriptionNo);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
log.warn("handService - 级联作废手术申请单失败 prescriptionNo={} msg={}", prescriptionNo, ex.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 级联作废完成后,统一删除 ServiceRequest 及其子项、费用项
|
|
||||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||||
if (cascadeSkippedRequestIds.contains(adviceSaveDto.getRequestId())) {
|
if (labCascadeSkippedRequestIds.contains(adviceSaveDto.getRequestId())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Long requestId = adviceSaveDto.getRequestId();
|
Long requestId = adviceSaveDto.getRequestId();
|
||||||
@@ -1914,6 +1842,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
requestId));// 删除诊疗套餐对应的子项
|
requestId));// 删除诊疗套餐对应的子项
|
||||||
// 🔧 Bug Fix #219: 删除费用项
|
// 🔧 Bug Fix #219: 删除费用项
|
||||||
String serviceTable = CommonConstants.TableName.WOR_SERVICE_REQUEST;
|
String serviceTable = CommonConstants.TableName.WOR_SERVICE_REQUEST;
|
||||||
|
// 直接删除费用项
|
||||||
iChargeItemService.deleteByServiceTableAndId(serviceTable, requestId);
|
iChargeItemService.deleteByServiceTableAndId(serviceTable, requestId);
|
||||||
log.info("BugFix#219: 诊疗医嘱删除完成, requestId={}, serviceTable={}", requestId, serviceTable);
|
log.info("BugFix#219: 诊疗医嘱删除完成, requestId={}, serviceTable={}", requestId, serviceTable);
|
||||||
}
|
}
|
||||||
@@ -2192,6 +2121,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||||
sourceEnum, sourceBillNo);
|
sourceEnum, sourceBillNo);
|
||||||
|
// 手术计费场景:sourceBillNo 不为空时,过滤掉药品(1),保留耗材(2)和诊疗(3/6)
|
||||||
|
if (sourceBillNo != null && !sourceBillNo.isEmpty()) {
|
||||||
|
requestBaseInfo.removeIf(dto -> dto.getAdviceType() != null
|
||||||
|
&& dto.getAdviceType() == 1);
|
||||||
|
}
|
||||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||||
// 请求状态
|
// 请求状态
|
||||||
requestBaseDto
|
requestBaseDto
|
||||||
@@ -2205,10 +2139,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
// 收费状态
|
// 收费状态
|
||||||
requestBaseDto.setChargeStatus_enumText(
|
requestBaseDto.setChargeStatus_enumText(
|
||||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||||
// 单位字典翻译失败时回退使用原始值(如手术申请硬编码了中文单位名)
|
|
||||||
if (StringUtils.isNotBlank(requestBaseDto.getUnitCode()) && StringUtils.isBlank(requestBaseDto.getUnitCode_dictText())) {
|
|
||||||
requestBaseDto.setUnitCode_dictText(requestBaseDto.getUnitCode());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return R.ok(requestBaseInfo);
|
return R.ok(requestBaseInfo);
|
||||||
}
|
}
|
||||||
@@ -2551,17 +2481,21 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用 MyBatis Plus 分页查询
|
// 使用直接 LIMIT 查询,不触发 MyBatis Plus 的 COUNT 开销
|
||||||
IPage<SurgeryItemDto> result = doctorStationAdviceAppMapper.getSurgeryPage(
|
List<SurgeryItemDto> records = doctorStationAdviceAppMapper.getSurgeryPage(
|
||||||
new Page<>(pageNo, pageSize),
|
new Page<>(pageNo, pageSize),
|
||||||
PublicationStatus.ACTIVE.getValue(),
|
PublicationStatus.ACTIVE.getValue(),
|
||||||
organizationId,
|
organizationId,
|
||||||
searchKey);
|
searchKey);
|
||||||
|
|
||||||
|
// 手动构造 Page 对象,total 设为 records.size()(前端 el-transfer 不需要精确的 total 总数)
|
||||||
|
IPage<SurgeryItemDto> result = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize);
|
||||||
|
result.setRecords(records);
|
||||||
|
result.setTotal(records.size());
|
||||||
log.info("getSurgeryPage 完成: {}ms, total={}, records={}", System.currentTimeMillis() - start, result.getTotal(), result.getRecords().size());
|
log.info("getSurgeryPage 完成: {}ms, total={}, records={}", System.currentTimeMillis() - start, result.getTotal(), result.getRecords().size());
|
||||||
|
|
||||||
// 无搜索时将结果写入缓存
|
// 无搜索时将结果写入缓存
|
||||||
if (useCache && result instanceof com.baomidou.mybatisplus.extension.plugins.pagination.Page) {
|
if (useCache) {
|
||||||
redisCache.setCacheObject(cacheKey, result, (int) CACHE_EXPIRE_HOURS, java.util.concurrent.TimeUnit.HOURS);
|
redisCache.setCacheObject(cacheKey, result, (int) CACHE_EXPIRE_HOURS, java.util.concurrent.TimeUnit.HOURS);
|
||||||
log.info("缓存手术项目, key: {}, 过期时间: {} 小时", cacheKey, CACHE_EXPIRE_HOURS);
|
log.info("缓存手术项目, key: {}, 过期时间: {} 小时", cacheKey, CACHE_EXPIRE_HOURS);
|
||||||
}
|
}
|
||||||
@@ -2570,13 +2504,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<SurgeryItemDto> getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey, String categoryCode) {
|
public IPage<SurgeryItemDto> getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey) {
|
||||||
IPage<SurgeryItemDto> result = doctorStationAdviceAppMapper.getExaminationPage(
|
IPage<SurgeryItemDto> result = doctorStationAdviceAppMapper.getExaminationPage(
|
||||||
new Page<>(pageNo, pageSize),
|
new Page<>(pageNo, pageSize),
|
||||||
PublicationStatus.ACTIVE.getValue(),
|
PublicationStatus.ACTIVE.getValue(),
|
||||||
organizationId,
|
organizationId,
|
||||||
searchKey,
|
searchKey);
|
||||||
categoryCode);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.openhis.document.service.IEmrTemplateService;
|
|||||||
import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService;
|
import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService;
|
||||||
import com.openhis.web.doctorstation.dto.EmrTemplateDto;
|
import com.openhis.web.doctorstation.dto.EmrTemplateDto;
|
||||||
import com.openhis.web.doctorstation.dto.PatientEmrDto;
|
import com.openhis.web.doctorstation.dto.PatientEmrDto;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 医生站-电子病历 应用实现类
|
* 医生站-电子病历 应用实现类
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
|
||||||
@Service
|
@Service
|
||||||
public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppService {
|
public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppService {
|
||||||
|
|
||||||
@@ -62,7 +60,13 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
|||||||
IDocRecordService docRecordService;
|
IDocRecordService docRecordService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private com.openhis.web.doctorstation.mapper.DoctorStationEmrAppMapper doctorStationEmrAppMapper;
|
private EncounterMapper encounterMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PatientMapper patientMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private com.openhis.administration.mapper.EncounterParticipantMapper encounterParticipantMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加病人病历信息
|
* 添加病人病历信息
|
||||||
@@ -219,29 +223,52 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
|||||||
* @return 待写病历列表
|
* @return 待写病历列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> getPendingEmrList(Long doctorId, Integer pageNo, Integer pageSize, String patientName) {
|
public R<?> getPendingEmrList(Long doctorId) {
|
||||||
// 先查询总数
|
// 由于Encounter实体中没有jzPractitionerUserId字段,我们需要通过关联查询来获取相关信息
|
||||||
Long total = doctorStationEmrAppMapper.getPendingEmrCount(doctorId, patientName);
|
// 使用医生工作站的mapper来查询相关数据
|
||||||
|
// 这里我们直接使用医生工作站的查询逻辑
|
||||||
|
|
||||||
// 计算分页偏移量,再查询分页数据
|
// 查询当前医生负责的、状态为"就诊中"但还没有写病历的患者
|
||||||
int offset = (pageNo - 1) * pageSize;
|
// 需要通过EncounterParticipant表来关联医生信息
|
||||||
List<Map<String, Object>> pageRows = doctorStationEmrAppMapper.getPendingEmrList(doctorId, patientName, pageSize, offset);
|
List<Encounter> encounters = encounterMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<Encounter>()
|
||||||
|
.eq(Encounter::getStatusEnum, EncounterStatus.IN_PROGRESS.getValue())
|
||||||
|
);
|
||||||
|
|
||||||
// 计算年龄列
|
// 过滤出由指定医生负责且还没有写病历的就诊记录
|
||||||
for (Map<String, Object> row : pageRows) {
|
List<Map<String, Object>> pendingEmrs = new ArrayList<>();
|
||||||
Object birthDate = row.get("birthDate");
|
for (Encounter encounter : encounters) {
|
||||||
if (birthDate instanceof Date) {
|
// 检查该就诊记录是否已经有病历
|
||||||
row.put("age", calculateAge((Date) birthDate));
|
Emr existingEmr = emrService.getOne(
|
||||||
} else {
|
new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounter.getId())
|
||||||
row.put("age", null);
|
);
|
||||||
|
|
||||||
|
// 检查该就诊是否由指定医生负责
|
||||||
|
boolean isAssignedToDoctor = isEncounterAssignedToDoctor(encounter.getId(), doctorId);
|
||||||
|
|
||||||
|
if (existingEmr == null && isAssignedToDoctor) {
|
||||||
|
// 如果没有病历且由该医生负责,则添加到待写病历列表
|
||||||
|
Map<String, Object> pendingEmr = new java.util.HashMap<>();
|
||||||
|
|
||||||
|
// 获取患者信息
|
||||||
|
Patient patient = patientMapper.selectById(encounter.getPatientId());
|
||||||
|
|
||||||
|
pendingEmr.put("encounterId", encounter.getId());
|
||||||
|
pendingEmr.put("patientId", encounter.getPatientId());
|
||||||
|
pendingEmr.put("patientName", patient != null ? patient.getName() : "未知");
|
||||||
|
pendingEmr.put("gender", patient != null ? patient.getGenderEnum() : null);
|
||||||
|
// 使用出生日期计算年龄
|
||||||
|
pendingEmr.put("age", patient != null && patient.getBirthDate() != null ?
|
||||||
|
calculateAge(patient.getBirthDate()) : null);
|
||||||
|
// 使用创建时间作为挂号时间
|
||||||
|
pendingEmr.put("registerTime", encounter.getCreateTime());
|
||||||
|
pendingEmr.put("busNo", encounter.getBusNo()); // 病历号
|
||||||
|
|
||||||
|
pendingEmrs.add(pendingEmr);
|
||||||
}
|
}
|
||||||
row.remove("birthDate");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> result = new java.util.HashMap<>();
|
return R.ok(pendingEmrs);
|
||||||
result.put("rows", pageRows);
|
|
||||||
result.put("total", total != null ? total : 0L);
|
|
||||||
return R.ok(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,9 +278,14 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
|||||||
* @return 待写病历数量
|
* @return 待写病历数量
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> getPendingEmrCount(Long doctorId, String patientName) {
|
public R<?> getPendingEmrCount(Long doctorId) {
|
||||||
Long count = doctorStationEmrAppMapper.getPendingEmrCount(doctorId, patientName);
|
// 获取待写病历列表,然后返回数量
|
||||||
return R.ok(count != null ? count.intValue() : 0);
|
R<?> result = getPendingEmrList(doctorId);
|
||||||
|
if (result.getCode() == 200) {
|
||||||
|
List<?> pendingEmrs = (List<?>) result.getData();
|
||||||
|
return R.ok(pendingEmrs.size());
|
||||||
|
}
|
||||||
|
return R.ok(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -274,6 +306,24 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
|
|||||||
return R.ok(needWrite);
|
return R.ok(needWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查就诊是否分配给指定医生
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊ID
|
||||||
|
* @param doctorId 医生ID
|
||||||
|
* @return 是否分配给指定医生
|
||||||
|
*/
|
||||||
|
private boolean isEncounterAssignedToDoctor(Long encounterId, Long doctorId) {
|
||||||
|
// 查询就诊参与者表,检查是否有指定医生的接诊记录
|
||||||
|
com.openhis.administration.domain.EncounterParticipant participant =
|
||||||
|
encounterParticipantMapper.selectOne(
|
||||||
|
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.openhis.administration.domain.EncounterParticipant>()
|
||||||
|
.eq(com.openhis.administration.domain.EncounterParticipant::getEncounterId, encounterId)
|
||||||
|
.eq(com.openhis.administration.domain.EncounterParticipant::getPractitionerId, doctorId)
|
||||||
|
);
|
||||||
|
|
||||||
|
return participant != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据出生日期计算年龄
|
* 根据出生日期计算年龄
|
||||||
|
|||||||
@@ -77,10 +77,8 @@ public class DoctorStationAdviceController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping(value = "/save-advice")
|
@PostMapping(value = "/save-advice")
|
||||||
@RepeatSubmit(interval = 5000, message = "请勿重复提交医嘱,请稍候再试")
|
@RepeatSubmit(interval = 5000, message = "请勿重复提交医嘱,请稍候再试")
|
||||||
public R<?> saveAdvice(@RequestBody AdviceSaveParam adviceSaveParam,
|
public R<?> saveAdvice(@RequestBody AdviceSaveParam adviceSaveParam) {
|
||||||
@RequestParam(required = false, defaultValue = "1") String adviceOpType) {
|
return iDoctorStationAdviceAppService.saveAdvice(adviceSaveParam, AdviceOpType.SAVE_ADVICE.getCode());
|
||||||
// 🔧 Bug #445 修复:使用前端传入的 adviceOpType 参数(1=保存草稿,2=签发),而非硬编码
|
|
||||||
return iDoctorStationAdviceAppService.saveAdvice(adviceSaveParam, adviceOpType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -228,9 +226,8 @@ public class DoctorStationAdviceController {
|
|||||||
@RequestParam(value = "organizationId", required = false) Long organizationId,
|
@RequestParam(value = "organizationId", required = false) Long organizationId,
|
||||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize", defaultValue = "500") Integer pageSize,
|
@RequestParam(value = "pageSize", defaultValue = "500") Integer pageSize,
|
||||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey) {
|
||||||
@RequestParam(value = "categoryCode", defaultValue = "23") String categoryCode) {
|
return R.ok(iDoctorStationAdviceAppService.getExaminationPage(organizationId, pageNo, pageSize, searchKey));
|
||||||
return R.ok(iDoctorStationAdviceAppService.getExaminationPage(organizationId, pageNo, pageSize, searchKey, categoryCode));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,36 +26,34 @@ public class PendingEmrController {
|
|||||||
* 获取待写病历列表
|
* 获取待写病历列表
|
||||||
*
|
*
|
||||||
* @param doctorId 医生ID
|
* @param doctorId 医生ID
|
||||||
* @param pageNo 当前页码
|
* @return 待写病历列表
|
||||||
* @param pageSize 每页条数
|
|
||||||
* @param patientName 患者姓名(可选)
|
|
||||||
* @return 待写病历分页数据
|
|
||||||
*/
|
*/
|
||||||
@GetMapping("/pending-list")
|
@GetMapping("/pending-list")
|
||||||
public R<?> getPendingEmrList(@RequestParam(required = false) Long doctorId,
|
public R<?> getPendingEmrList(@RequestParam(required = false) Long doctorId) {
|
||||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
// 如果没有传递医生ID,则使用当前登录用户ID
|
||||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
|
||||||
@RequestParam(required = false) String patientName) {
|
|
||||||
if (doctorId == null) {
|
if (doctorId == null) {
|
||||||
doctorId = com.core.common.utils.SecurityUtils.getLoginUser().getPractitionerId();
|
doctorId = com.core.common.utils.SecurityUtils.getLoginUser().getUserId();
|
||||||
}
|
}
|
||||||
return iDoctorStationEmrAppService.getPendingEmrList(doctorId, pageNum, pageSize, patientName);
|
|
||||||
|
// 调用服务获取待写病历列表
|
||||||
|
return iDoctorStationEmrAppService.getPendingEmrList(doctorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取待写病历数量
|
* 获取待写病历数量
|
||||||
*
|
*
|
||||||
* @param doctorId 医生ID
|
* @param doctorId 医生ID
|
||||||
* @param patientName 患者姓名(可选)
|
|
||||||
* @return 待写病历数量
|
* @return 待写病历数量
|
||||||
*/
|
*/
|
||||||
@GetMapping("/pending-count")
|
@GetMapping("/pending-count")
|
||||||
public R<?> getPendingEmrCount(@RequestParam(required = false) Long doctorId,
|
public R<?> getPendingEmrCount(@RequestParam(required = false) Long doctorId) {
|
||||||
@RequestParam(required = false) String patientName) {
|
// 如果没有传递医生ID,则使用当前登录用户ID
|
||||||
if (doctorId == null) {
|
if (doctorId == null) {
|
||||||
doctorId = com.core.common.utils.SecurityUtils.getLoginUser().getPractitionerId();
|
doctorId = com.core.common.utils.SecurityUtils.getLoginUser().getUserId();
|
||||||
}
|
}
|
||||||
return iDoctorStationEmrAppService.getPendingEmrCount(doctorId, patientName);
|
|
||||||
|
// 调用服务获取待写病历数量
|
||||||
|
return iDoctorStationEmrAppService.getPendingEmrCount(doctorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -198,10 +198,8 @@ public class AdviceBaseDto {
|
|||||||
/**
|
/**
|
||||||
* 所属科室
|
* 所属科室
|
||||||
*/
|
*/
|
||||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
private String orgId_dictText;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所在位置
|
* 所在位置
|
||||||
|
|||||||
@@ -8,10 +8,6 @@ import lombok.Data;
|
|||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
import com.fasterxml.jackson.annotation.Nulls;
|
import com.fasterxml.jackson.annotation.Nulls;
|
||||||
|
|
||||||
@@ -30,14 +26,6 @@ public class AdviceSaveDto {
|
|||||||
/** 医嘱类型 */
|
/** 医嘱类型 */
|
||||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||||
|
|
||||||
/**
|
|
||||||
* 医嘱开始时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求id
|
* 请求id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -63,18 +63,6 @@ public class PatientDetailsDto {
|
|||||||
*/
|
*/
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
/** 地址省 */
|
|
||||||
private String addressProvince;
|
|
||||||
|
|
||||||
/** 地址市 */
|
|
||||||
private String addressCity;
|
|
||||||
|
|
||||||
/** 地址区 */
|
|
||||||
private String addressDistrict;
|
|
||||||
|
|
||||||
/** 地址街道 */
|
|
||||||
private String addressStreet;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作单位
|
* 工作单位
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,12 +22,6 @@ public class RequestBaseDto {
|
|||||||
*/
|
*/
|
||||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||||
|
|
||||||
/**
|
|
||||||
* 医嘱开始时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 唯一标识
|
* 唯一标识
|
||||||
*/
|
*/
|
||||||
@@ -127,11 +121,6 @@ public class RequestBaseDto {
|
|||||||
* 请求状态
|
* 请求状态
|
||||||
*/
|
*/
|
||||||
private Integer statusEnum;
|
private Integer statusEnum;
|
||||||
/**
|
|
||||||
* 退回原因
|
|
||||||
*/
|
|
||||||
private String reasonText;
|
|
||||||
|
|
||||||
private String statusEnum_enumText;
|
private String statusEnum_enumText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -249,15 +238,4 @@ public class RequestBaseDto {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long patientId;
|
private Long patientId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 停嘱医生
|
|
||||||
*/
|
|
||||||
private String stopUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 停嘱时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date stopTime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ public class SurgeryItemDto {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
/** 所属科室名称 */
|
|
||||||
private String orgName;
|
|
||||||
|
|
||||||
/** 执行科室ID */
|
/** 执行科室ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long positionId;
|
private Long positionId;
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public interface DoctorStationAdviceAppMapper {
|
|||||||
* @param searchKey 模糊查询关键字(可选)
|
* @param searchKey 模糊查询关键字(可选)
|
||||||
* @return 手术项目分页数据
|
* @return 手术项目分页数据
|
||||||
*/
|
*/
|
||||||
IPage<SurgeryItemDto> getSurgeryPage(@Param("page") Page<SurgeryItemDto> page,
|
List<SurgeryItemDto> getSurgeryPage(@Param("page") Page<SurgeryItemDto> page,
|
||||||
@Param("statusEnum") Integer statusEnum,
|
@Param("statusEnum") Integer statusEnum,
|
||||||
@Param("organizationId") Long organizationId,
|
@Param("organizationId") Long organizationId,
|
||||||
@Param("searchKey") String searchKey);
|
@Param("searchKey") String searchKey);
|
||||||
@@ -203,7 +203,6 @@ public interface DoctorStationAdviceAppMapper {
|
|||||||
IPage<SurgeryItemDto> getExaminationPage(@Param("page") Page<SurgeryItemDto> page,
|
IPage<SurgeryItemDto> getExaminationPage(@Param("page") Page<SurgeryItemDto> page,
|
||||||
@Param("statusEnum") Integer statusEnum,
|
@Param("statusEnum") Integer statusEnum,
|
||||||
@Param("organizationId") Long organizationId,
|
@Param("organizationId") Long organizationId,
|
||||||
@Param("searchKey") String searchKey,
|
@Param("searchKey") String searchKey);
|
||||||
@Param("categoryCode") String categoryCode);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,11 @@
|
|||||||
package com.openhis.web.doctorstation.mapper;
|
package com.openhis.web.doctorstation.mapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医生站-电子病历 应用Mapper
|
* 医生站-电子病历 应用Mapper
|
||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface DoctorStationEmrAppMapper {
|
public interface DoctorStationEmrAppMapper {
|
||||||
|
|
||||||
List<Map<String, Object>> getPendingEmrList(@Param("doctorId") Long doctorId,
|
|
||||||
@Param("patientName") String patientName,
|
|
||||||
@Param("pageSize") Integer pageSize,
|
|
||||||
@Param("offset") Integer offset);
|
|
||||||
|
|
||||||
Long getPendingEmrCount(@Param("doctorId") Long doctorId,
|
|
||||||
@Param("patientName") String patientName);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,24 +178,11 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
inpatientAdviceParam.setEncounterIds(null);
|
inpatientAdviceParam.setEncounterIds(null);
|
||||||
Integer exeStatus = inpatientAdviceParam.getExeStatus();
|
Integer exeStatus = inpatientAdviceParam.getExeStatus();
|
||||||
inpatientAdviceParam.setExeStatus(null);
|
inpatientAdviceParam.setExeStatus(null);
|
||||||
// 提取requestStatus手动处理,支持COMPLETED(3)和CHECK_VERIFIED(10)同时查询
|
// requestStatus由前端tab传入,通过QueryWrapper自动添加到SQL外层WHERE过滤
|
||||||
Integer requestStatus = inpatientAdviceParam.getRequestStatus();
|
|
||||||
inpatientAdviceParam.setRequestStatus(null);
|
|
||||||
// 构建查询条件
|
// 构建查询条件
|
||||||
QueryWrapper<InpatientAdviceParam> queryWrapper
|
QueryWrapper<InpatientAdviceParam> queryWrapper
|
||||||
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||||
|
|
||||||
// 手动拼接requestStatus条件:COMPLETED(3)时同时包含CHECK_VERIFIED(10)
|
|
||||||
// UNION查询外层列名为request_status(T1.status_enum AS request_status),不是status_enum
|
|
||||||
if (requestStatus != null) {
|
|
||||||
if (RequestStatus.COMPLETED.getValue().equals(requestStatus)) {
|
|
||||||
queryWrapper.in("request_status",
|
|
||||||
RequestStatus.COMPLETED.getValue(), RequestStatus.CHECK_VERIFIED.getValue());
|
|
||||||
} else {
|
|
||||||
queryWrapper.eq("request_status", requestStatus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 手动拼接住院患者id条件
|
// 手动拼接住院患者id条件
|
||||||
if (encounterIds != null && !encounterIds.isEmpty()) {
|
if (encounterIds != null && !encounterIds.isEmpty()) {
|
||||||
List<Long> encounterIdList
|
List<Long> encounterIdList
|
||||||
@@ -328,29 +315,19 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||||
Date checkDate = new Date();
|
Date checkDate = new Date();
|
||||||
if (!serviceRequestList.isEmpty()) {
|
if (!serviceRequestList.isEmpty()) {
|
||||||
List<Long> serviceReqIds = serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList();
|
// 更新服务请求状态已完成
|
||||||
// 先查询服务请求,按 categoryEnum 分流:检查类(23)走 CHECK_VERIFIED,其余走 COMPLETED
|
serviceRequestService.updateCompleteRequestStatus(
|
||||||
List<ServiceRequest> allServiceRequests = serviceRequestService.listByIds(serviceReqIds);
|
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||||
List<Long> checkReqIds = allServiceRequests.stream()
|
List<ServiceRequest> serviceRequests = serviceRequestService
|
||||||
.filter(sr -> ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum()))
|
.listByIds(serviceRequestList.stream().map(PerformInfoDto::getRequestId).collect(Collectors.toList()));
|
||||||
.map(ServiceRequest::getId).toList();
|
for (ServiceRequest serviceRequest : serviceRequests) {
|
||||||
List<Long> otherReqIds = allServiceRequests.stream()
|
// 判断医嘱类型
|
||||||
.filter(sr -> !ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum()))
|
|
||||||
.map(ServiceRequest::getId).toList();
|
|
||||||
// 检查类 → 已校对(CHECK_VERIFIED=10)
|
|
||||||
if (!checkReqIds.isEmpty()) {
|
|
||||||
serviceRequestService.updateCheckVerifiedStatus(checkReqIds, practitionerId, checkDate);
|
|
||||||
}
|
|
||||||
// 其他类 → 已完成(COMPLETED=3)
|
|
||||||
if (!otherReqIds.isEmpty()) {
|
|
||||||
serviceRequestService.updateCompleteRequestStatus(otherReqIds, practitionerId, checkDate);
|
|
||||||
}
|
|
||||||
// 处理转科/出院等特殊医嘱
|
|
||||||
for (ServiceRequest serviceRequest : allServiceRequests) {
|
|
||||||
if (ActivityDefCategory.TRANSFER.getValue().equals(serviceRequest.getCategoryEnum())) {
|
if (ActivityDefCategory.TRANSFER.getValue().equals(serviceRequest.getCategoryEnum())) {
|
||||||
|
// 更新患者状态 待转科
|
||||||
encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
||||||
EncounterZyStatus.PENDING_TRANSFER.getValue());
|
EncounterZyStatus.PENDING_TRANSFER.getValue());
|
||||||
} else if (ActivityDefCategory.DISCHARGE.getValue().equals(serviceRequest.getCategoryEnum())) {
|
} else if (ActivityDefCategory.DISCHARGE.getValue().equals(serviceRequest.getCategoryEnum())) {
|
||||||
|
// 更新患者状态 待出院
|
||||||
encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
encounterService.updateEncounterStatus(serviceRequest.getEncounterId(),
|
||||||
EncounterZyStatus.AWAITING_DISCHARGE.getValue());
|
EncounterZyStatus.AWAITING_DISCHARGE.getValue());
|
||||||
}
|
}
|
||||||
@@ -382,24 +359,6 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
medRequestList.add(item);
|
medRequestList.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 校验医嘱是否已执行,已执行的医嘱需要先取消执行后才能退回
|
|
||||||
List<Long> allRequestIds = performInfoList.stream().map(PerformInfoDto::getRequestId).toList();
|
|
||||||
List<Procedure> allProcedures = procedureService.list(
|
|
||||||
new LambdaQueryWrapper<Procedure>()
|
|
||||||
.in(Procedure::getRequestId, allRequestIds)
|
|
||||||
.eq(Procedure::getDeleteFlag, "0"));
|
|
||||||
Set<Long> executedIds = allProcedures.stream()
|
|
||||||
.filter(p -> EventStatus.COMPLETED.getValue().equals(p.getStatusEnum()))
|
|
||||||
.map(Procedure::getId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
Set<Long> cancelledRefundIds = allProcedures.stream()
|
|
||||||
.filter(p -> EventStatus.CANCEL.getValue().equals(p.getStatusEnum()) && p.getRefundId() != null)
|
|
||||||
.map(Procedure::getRefundId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
executedIds.removeAll(cancelledRefundIds);
|
|
||||||
if (!executedIds.isEmpty()) {
|
|
||||||
return R.fail("该医嘱已执行,请先取消执行后再退回");
|
|
||||||
}
|
|
||||||
// 校验药品医嘱是否已发药,已发药的医嘱不允许退回
|
// 校验药品医嘱是否已发药,已发药的医嘱不允许退回
|
||||||
if (!medRequestList.isEmpty()) {
|
if (!medRequestList.isEmpty()) {
|
||||||
List<Long> medReqIds = medRequestList.stream().map(PerformInfoDto::getRequestId).toList();
|
List<Long> medReqIds = medRequestList.stream().map(PerformInfoDto::getRequestId).toList();
|
||||||
@@ -415,14 +374,13 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
Date checkDate = new Date();
|
Date checkDate = new Date();
|
||||||
if (!serviceRequestList.isEmpty()) {
|
if (!serviceRequestList.isEmpty()) {
|
||||||
// 更新服务请求状态待发送
|
// 更新服务请求状态待发送
|
||||||
String backReason = performInfoList.get(0).getBackReason();
|
|
||||||
serviceRequestService.updateDraftStatus(
|
serviceRequestService.updateDraftStatus(
|
||||||
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason);
|
serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||||
}
|
}
|
||||||
if (!medRequestList.isEmpty()) {
|
if (!medRequestList.isEmpty()) {
|
||||||
// 更新药品请求状态待发送
|
// 更新药品请求状态待发送
|
||||||
medicationRequestService.updateDraftStatusBatch(
|
medicationRequestService.updateDraftStatusBatch(
|
||||||
medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason);
|
medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate);
|
||||||
}
|
}
|
||||||
return R.ok(null, "退回成功");
|
return R.ok(null, "退回成功");
|
||||||
}
|
}
|
||||||
@@ -466,15 +424,6 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
List<ServiceRequestUseExe> actUseExeList = this.assemblyActivity(activityList);
|
List<ServiceRequestUseExe> actUseExeList = this.assemblyActivity(activityList);
|
||||||
// 处理诊疗执行
|
// 处理诊疗执行
|
||||||
this.exeActivity(actUseExeList, exeDate);
|
this.exeActivity(actUseExeList, exeDate);
|
||||||
// 检查类医嘱执行后,状态改为"待接收"(PENDING_RECEIVE=11)
|
|
||||||
List<Long> actReqIds = activityList.stream().map(AdviceExecuteDetailParam::getRequestId).toList();
|
|
||||||
List<ServiceRequest> executedReqs = serviceRequestService.listByIds(actReqIds);
|
|
||||||
List<Long> checkReqIds = executedReqs.stream()
|
|
||||||
.filter(sr -> ActivityDefCategory.TEST.getValue().equals(sr.getCategoryEnum()))
|
|
||||||
.map(ServiceRequest::getId).toList();
|
|
||||||
if (!checkReqIds.isEmpty()) {
|
|
||||||
serviceRequestService.updatePendingReceiveStatus(checkReqIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱执行"}));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱执行"}));
|
||||||
@@ -575,10 +524,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
// 处理长期已发放的药品
|
// 处理长期已发放的药品
|
||||||
if (!longMedDispensedList.isEmpty()) {
|
if (!longMedDispensedList.isEmpty()) {
|
||||||
// 生成退药单
|
// 生成退药单
|
||||||
this.creatRefundMedicationList(longMedDispensedList, procedureIdMap);
|
this.creatRefundMedicationList(tempMedDispensedList, procedureIdMap);
|
||||||
// 药品退药请求状态变更(待退药)
|
|
||||||
medicationRequestService.updateCancelledStatusBatch(
|
|
||||||
longMedDispensedList.stream().map(MedicationDispense::getMedReqId).toList(), null, null);
|
|
||||||
}
|
}
|
||||||
// 处理临时已发放药品
|
// 处理临时已发放药品
|
||||||
if (!tempMedDispensedList.isEmpty()) {
|
if (!tempMedDispensedList.isEmpty()) {
|
||||||
|
|||||||
@@ -78,10 +78,12 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
|||||||
.map(notPerformedReason -> new DispenseInitDto.NotPerformedReasonOption(notPerformedReason.getValue(),
|
.map(notPerformedReason -> new DispenseInitDto.NotPerformedReasonOption(notPerformedReason.getValue(),
|
||||||
notPerformedReason.getInfo()))
|
notPerformedReason.getInfo()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
// 发药状态(汇总单:待配药→已提交,已发放→已发药)
|
// 发药状态
|
||||||
List<DispenseStatusOption> dispenseStatusOptions = new ArrayList<>();
|
List<DispenseStatusOption> dispenseStatusOptions = new ArrayList<>();
|
||||||
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.PREPARATION.getValue(), "已提交"));
|
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.PREPARATION.getValue(),
|
||||||
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.COMPLETED.getValue(), "已发药"));
|
DispenseStatus.PREPARATION.getInfo()));
|
||||||
|
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.COMPLETED.getValue(),
|
||||||
|
DispenseStatus.COMPLETED.getInfo()));
|
||||||
|
|
||||||
initDto.setNotPerformedReasonOptions(notPerformedReasonOptions).setDispenseStatusOptions(dispenseStatusOptions);
|
initDto.setNotPerformedReasonOptions(notPerformedReasonOptions).setDispenseStatusOptions(dispenseStatusOptions);
|
||||||
return R.ok(initDto);
|
return R.ok(initDto);
|
||||||
@@ -159,8 +161,8 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
|||||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
|
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
|
||||||
DispenseStatus.PREPARATION.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
|
DispenseStatus.PREPARATION.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
|
||||||
medicineSummaryFormPage.getRecords().forEach(e -> {
|
medicineSummaryFormPage.getRecords().forEach(e -> {
|
||||||
// 发药状态(汇总单展示文案)
|
// 发药状态
|
||||||
e.setStatusEnum_enumText(getSummaryFormStatusText(e.getStatusEnum()));
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getStatusEnum()));
|
||||||
});
|
});
|
||||||
return R.ok(medicineSummaryFormPage);
|
return R.ok(medicineSummaryFormPage);
|
||||||
}
|
}
|
||||||
@@ -290,17 +292,4 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
|||||||
}
|
}
|
||||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"取消"}));
|
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"取消"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 汇总发药单状态展示文案(药品医嘱状态映射表:汇总申请→已提交,发药→已发药)
|
|
||||||
*/
|
|
||||||
private String getSummaryFormStatusText(Integer statusEnum) {
|
|
||||||
if (DispenseStatus.PREPARATION.getValue().equals(statusEnum)) {
|
|
||||||
return "已提交";
|
|
||||||
}
|
|
||||||
if (DispenseStatus.COMPLETED.getValue().equals(statusEnum)) {
|
|
||||||
return "已发药";
|
|
||||||
}
|
|
||||||
return EnumUtils.getInfoByValue(DispenseStatus.class, statusEnum);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -203,70 +202,62 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService
|
|||||||
@Override
|
@Override
|
||||||
public R<?> addOrEditBatchTransferReceipt(List<ProductTransferDto> productTransferDtoList, Boolean flag) {
|
public R<?> addOrEditBatchTransferReceipt(List<ProductTransferDto> productTransferDtoList, Boolean flag) {
|
||||||
|
|
||||||
|
// 校验调拨数量:必须 > 0 且不超过源库存数量(从数据库查实时库存)
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
Date now = DateUtils.getNowDate();
|
for (ProductTransferDto dto : productTransferDtoList) {
|
||||||
|
if (dto.getItemQuantity() == null || dto.getItemQuantity().compareTo(java.math.BigDecimal.ZERO) <= 0) {
|
||||||
|
return R.fail("调拨数量必须大于0");
|
||||||
|
}
|
||||||
|
// 查询该药品在源仓库的实时库存总量
|
||||||
|
List<InventoryItem> inventoryList = inventoryItemService.selectInventoryByItemId(
|
||||||
|
dto.getItemId(), dto.getLotNumber(), dto.getSourceLocationId(), tenantId);
|
||||||
|
java.math.BigDecimal actualStock = inventoryList.stream()
|
||||||
|
.map(InventoryItem::getQuantity)
|
||||||
|
.reduce(java.math.BigDecimal.ZERO, java.math.BigDecimal::add);
|
||||||
|
if (dto.getItemQuantity().compareTo(actualStock) > 0) {
|
||||||
|
return R.fail("调拨数量不可超出源库存数量(当前库存:" + actualStock + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<String> idList = new ArrayList<>();
|
List<String> idList = new ArrayList<>();
|
||||||
if (flag) {
|
if (flag) {
|
||||||
// 批量保存按钮
|
// 批量保存按钮
|
||||||
|
// 单据号取得
|
||||||
List<String> busNoList = productTransferDtoList.stream().map(ProductTransferDto::getBusNo).toList();
|
List<String> busNoList = productTransferDtoList.stream().map(ProductTransferDto::getBusNo).toList();
|
||||||
// 保存前:获取旧记录用于恢复预划扣库存
|
// 请求id取得
|
||||||
List<SupplyRequest> oldRequestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
List<SupplyRequest> requestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
||||||
if (!oldRequestList.isEmpty()) {
|
if (!requestList.isEmpty()) {
|
||||||
// 恢复旧记录已预划扣的库存
|
List<Long> requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||||
for (SupplyRequest oldReq : oldRequestList) {
|
// 单据信息删除
|
||||||
if (oldReq.getItemId() != null && oldReq.getLotNumber() != null
|
supplyRequestService.removeByIds(requestIdList);
|
||||||
&& oldReq.getSourceLocationId() != null && oldReq.getItemQuantity() != null) {
|
|
||||||
List<InventoryItem> invList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
oldReq.getItemId(), oldReq.getLotNumber(), oldReq.getSourceLocationId(), tenantId);
|
|
||||||
if (!invList.isEmpty()) {
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
invList.get(0).getId(),
|
|
||||||
invList.get(0).getQuantity().add(oldReq.getItemQuantity()), now);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<Long> oldIdList = oldRequestList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
|
||||||
supplyRequestService.removeByIds(oldIdList);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验 + 预划扣新记录
|
|
||||||
for (ProductTransferDto dto : productTransferDtoList) {
|
|
||||||
if (dto.getItemQuantity() == null || dto.getItemQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
|
||||||
return R.fail("调拨数量必须大于0");
|
|
||||||
}
|
|
||||||
List<InventoryItem> inventoryList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
dto.getItemId(), dto.getLotNumber(), dto.getSourceLocationId(), tenantId);
|
|
||||||
BigDecimal actualStock = inventoryList.stream()
|
|
||||||
.map(InventoryItem::getQuantity)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
if (dto.getItemQuantity().compareTo(actualStock) > 0) {
|
|
||||||
return R.fail("调拨数量不可超出源库存数量(当前库存:" + actualStock + ")");
|
|
||||||
}
|
|
||||||
// 预划扣源仓库库存
|
|
||||||
if (!inventoryList.isEmpty()) {
|
|
||||||
InventoryItem inv = inventoryList.get(0);
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
inv.getId(), inv.getQuantity().subtract(dto.getItemQuantity()), now);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成批量调拨单据
|
// 生成批量调拨单据
|
||||||
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
||||||
for (ProductTransferDto productTransferDto : productTransferDtoList) {
|
for (ProductTransferDto productTransferDto : productTransferDtoList) {
|
||||||
|
// 初始化单据信息
|
||||||
SupplyRequest supplyRequest = new SupplyRequest();
|
SupplyRequest supplyRequest = new SupplyRequest();
|
||||||
BeanUtils.copyProperties(productTransferDto, supplyRequest);
|
BeanUtils.copyProperties(productTransferDto, supplyRequest);
|
||||||
|
// 生成商品批量调拨单据
|
||||||
supplyRequest
|
supplyRequest
|
||||||
|
// id
|
||||||
.setId(null)
|
.setId(null)
|
||||||
|
// 单据分类:库存供应
|
||||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue())
|
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue())
|
||||||
|
// 单据类型:商品批量调拨
|
||||||
.setTypeEnum(SupplyType.PRODUCT_BATCH_TRANSFER.getValue())
|
.setTypeEnum(SupplyType.PRODUCT_BATCH_TRANSFER.getValue())
|
||||||
|
// 制单人
|
||||||
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||||
|
// 申请时间
|
||||||
.setApplyTime(DateUtils.getNowDate())
|
.setApplyTime(DateUtils.getNowDate())
|
||||||
|
// 源库存数量
|
||||||
.setTotalQuantity(productTransferDto.getTotalSourceQuantity());
|
.setTotalQuantity(productTransferDto.getTotalSourceQuantity());
|
||||||
supplyRequestList.add(supplyRequest);
|
supplyRequestList.add(supplyRequest);
|
||||||
}
|
}
|
||||||
supplyRequestService.saveOrUpdateBatch(supplyRequestList);
|
supplyRequestService.saveOrUpdateBatch(supplyRequestList);
|
||||||
|
// 请求id取得
|
||||||
List<SupplyRequest> supplyRequestIdList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
List<SupplyRequest> supplyRequestIdList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
||||||
|
// 返回请求id列表
|
||||||
List<Long> requestIdList = supplyRequestIdList.stream().map(SupplyRequest::getId).toList();
|
List<Long> requestIdList = supplyRequestIdList.stream().map(SupplyRequest::getId).toList();
|
||||||
for (Long list : requestIdList) {
|
for (Long list : requestIdList) {
|
||||||
idList.add(list.toString());
|
idList.add(list.toString());
|
||||||
@@ -274,58 +265,33 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService
|
|||||||
} else {
|
} else {
|
||||||
// 单独保存按钮
|
// 单独保存按钮
|
||||||
for (ProductTransferDto productTransferDto : productTransferDtoList) {
|
for (ProductTransferDto productTransferDto : productTransferDtoList) {
|
||||||
// 更新已有记录:先恢复旧预划扣,再扣新的
|
// 初始化单据信息
|
||||||
if (productTransferDto.getId() != null) {
|
|
||||||
SupplyRequest oldReq = supplyRequestService.getById(productTransferDto.getId());
|
|
||||||
if (oldReq != null && oldReq.getItemId() != null && oldReq.getLotNumber() != null
|
|
||||||
&& oldReq.getSourceLocationId() != null && oldReq.getItemQuantity() != null) {
|
|
||||||
List<InventoryItem> invList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
oldReq.getItemId(), oldReq.getLotNumber(), oldReq.getSourceLocationId(), tenantId);
|
|
||||||
if (!invList.isEmpty()) {
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
invList.get(0).getId(),
|
|
||||||
invList.get(0).getQuantity().add(oldReq.getItemQuantity()), now);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验 + 预划扣
|
|
||||||
if (productTransferDto.getItemQuantity() == null
|
|
||||||
|| productTransferDto.getItemQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
|
||||||
return R.fail("调拨数量必须大于0");
|
|
||||||
}
|
|
||||||
List<InventoryItem> inventoryList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
productTransferDto.getItemId(), productTransferDto.getLotNumber(),
|
|
||||||
productTransferDto.getSourceLocationId(), tenantId);
|
|
||||||
BigDecimal actualStock = inventoryList.stream()
|
|
||||||
.map(InventoryItem::getQuantity)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
if (productTransferDto.getItemQuantity().compareTo(actualStock) > 0) {
|
|
||||||
return R.fail("调拨数量不可超出源库存数量(当前库存:" + actualStock + ")");
|
|
||||||
}
|
|
||||||
if (!inventoryList.isEmpty()) {
|
|
||||||
InventoryItem inv = inventoryList.get(0);
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
inv.getId(), inv.getQuantity().subtract(productTransferDto.getItemQuantity()), now);
|
|
||||||
}
|
|
||||||
|
|
||||||
SupplyRequest supplyRequest = new SupplyRequest();
|
SupplyRequest supplyRequest = new SupplyRequest();
|
||||||
BeanUtils.copyProperties(productTransferDto, supplyRequest);
|
BeanUtils.copyProperties(productTransferDto, supplyRequest);
|
||||||
|
|
||||||
supplyRequest.setTotalQuantity(productTransferDto.getTotalSourceQuantity());
|
supplyRequest.setTotalQuantity(productTransferDto.getTotalSourceQuantity());
|
||||||
|
|
||||||
if (productTransferDto.getId() != null) {
|
if (productTransferDto.getId() != null) {
|
||||||
|
// 更新单据信息
|
||||||
supplyRequestService.updateById(supplyRequest);
|
supplyRequestService.updateById(supplyRequest);
|
||||||
} else {
|
} else {
|
||||||
|
// 生成商品批量调拨单据
|
||||||
supplyRequest
|
supplyRequest
|
||||||
|
// 单据分类:库存供应
|
||||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue())
|
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue())
|
||||||
|
// 单据类型:商品批量调拨
|
||||||
.setTypeEnum(SupplyType.PRODUCT_BATCH_TRANSFER.getValue())
|
.setTypeEnum(SupplyType.PRODUCT_BATCH_TRANSFER.getValue())
|
||||||
|
// 制单人
|
||||||
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||||
|
// 申请时间
|
||||||
.setApplyTime(DateUtils.getNowDate());
|
.setApplyTime(DateUtils.getNowDate());
|
||||||
supplyRequestService.save(supplyRequest);
|
supplyRequestService.save(supplyRequest);
|
||||||
}
|
}
|
||||||
|
// 返回单据id
|
||||||
return R.ok(supplyRequest.getId().toString(), null);
|
return R.ok(supplyRequest.getId().toString(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 返回单据id
|
||||||
return R.ok(idList, null);
|
return R.ok(idList, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,63 +332,33 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService
|
|||||||
@Override
|
@Override
|
||||||
public R<?> addOrEditTransferReceipt(List<ProductTransferDto> productTransferDtoList) {
|
public R<?> addOrEditTransferReceipt(List<ProductTransferDto> productTransferDtoList) {
|
||||||
|
|
||||||
|
// 校验调拨数量:必须 > 0 且不超过源库存数量(从数据库查实时库存)
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
Date now = DateUtils.getNowDate();
|
for (ProductTransferDto dto : productTransferDtoList) {
|
||||||
|
if (dto.getItemQuantity() == null || dto.getItemQuantity().compareTo(java.math.BigDecimal.ZERO) <= 0) {
|
||||||
|
return R.fail("调拨数量必须大于0");
|
||||||
|
}
|
||||||
|
List<InventoryItem> inventoryList = inventoryItemService.selectInventoryByItemId(
|
||||||
|
dto.getItemId(), dto.getLotNumber(), dto.getSourceLocationId(), tenantId);
|
||||||
|
java.math.BigDecimal actualStock = inventoryList.stream()
|
||||||
|
.map(InventoryItem::getQuantity)
|
||||||
|
.reduce(java.math.BigDecimal.ZERO, java.math.BigDecimal::add);
|
||||||
|
if (dto.getItemQuantity().compareTo(actualStock) > 0) {
|
||||||
|
return R.fail("调拨数量不可超出源库存数量(当前库存:" + actualStock + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<String> idList = new ArrayList<>();
|
List<String> idList = new ArrayList<>();
|
||||||
|
|
||||||
// 单据号取得
|
// 单据号取得
|
||||||
List<String> busNoList = productTransferDtoList.stream().map(ProductTransferDto::getBusNo).toList();
|
List<String> busNoList = productTransferDtoList.stream().map(ProductTransferDto::getBusNo).toList();
|
||||||
// 保存前:获取旧记录用于恢复预划扣库存
|
// 请求数据取得
|
||||||
List<SupplyRequest> oldRequestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
List<SupplyRequest> requestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
||||||
Map<String, BigDecimal> oldDeductionMap = new HashMap<>();
|
if (!requestList.isEmpty()) {
|
||||||
if (!oldRequestList.isEmpty()) {
|
// 请求id取得
|
||||||
for (SupplyRequest oldReq : oldRequestList) {
|
List<Long> requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||||
if (oldReq.getItemId() != null && oldReq.getLotNumber() != null && oldReq.getSourceLocationId() != null
|
// 单据信息删除
|
||||||
&& oldReq.getItemQuantity() != null) {
|
supplyRequestService.removeByIds(requestIdList);
|
||||||
String key = oldReq.getItemId() + "_" + oldReq.getLotNumber() + "_" + oldReq.getSourceLocationId();
|
|
||||||
oldDeductionMap.merge(key, oldReq.getItemQuantity(), BigDecimal::add);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 恢复旧记录已预划扣的库存
|
|
||||||
for (Map.Entry<String, BigDecimal> entry : oldDeductionMap.entrySet()) {
|
|
||||||
String[] parts = entry.getKey().split("_");
|
|
||||||
Long itemId = Long.parseLong(parts[0]);
|
|
||||||
String lotNumber = parts[1];
|
|
||||||
Long sourceLocationId = Long.parseLong(parts[2]);
|
|
||||||
BigDecimal restoreQty = entry.getValue();
|
|
||||||
List<InventoryItem> invList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
itemId, lotNumber, sourceLocationId, tenantId);
|
|
||||||
if (!invList.isEmpty()) {
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
invList.get(0).getId(), invList.get(0).getQuantity().add(restoreQty), now);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 删除旧记录
|
|
||||||
List<Long> oldIdList = oldRequestList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
|
||||||
supplyRequestService.removeByIds(oldIdList);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验 + 预划扣新记录
|
|
||||||
Map<String, BigDecimal> newDeductionMap = new HashMap<>();
|
|
||||||
for (ProductTransferDto dto : productTransferDtoList) {
|
|
||||||
if (dto.getItemQuantity() == null || dto.getItemQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
|
||||||
return R.fail("调拨数量必须大于0");
|
|
||||||
}
|
|
||||||
List<InventoryItem> inventoryList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
dto.getItemId(), dto.getLotNumber(), dto.getSourceLocationId(), tenantId);
|
|
||||||
BigDecimal actualStock = inventoryList.stream()
|
|
||||||
.map(InventoryItem::getQuantity)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
if (dto.getItemQuantity().compareTo(actualStock) > 0) {
|
|
||||||
return R.fail("调拨数量不可超出源库存数量(当前库存:" + actualStock + ")");
|
|
||||||
}
|
|
||||||
// 预划扣:扣减源仓库库存
|
|
||||||
if (!inventoryList.isEmpty()) {
|
|
||||||
InventoryItem inv = inventoryList.get(0);
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
inv.getId(), inv.getQuantity().subtract(dto.getItemQuantity()), now);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
||||||
@@ -469,22 +405,6 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> deleteReceipt(List<Long> supplyRequestIds) {
|
public R<?> deleteReceipt(List<Long> supplyRequestIds) {
|
||||||
// 删除前恢复预划扣的库存
|
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
|
||||||
Date now = DateUtils.getNowDate();
|
|
||||||
for (Long reqId : supplyRequestIds) {
|
|
||||||
SupplyRequest sr = supplyRequestService.getById(reqId);
|
|
||||||
if (sr != null && sr.getItemId() != null && sr.getSourceLocationId() != null
|
|
||||||
&& sr.getItemQuantity() != null && sr.getLotNumber() != null) {
|
|
||||||
List<InventoryItem> invList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
sr.getItemId(), sr.getLotNumber(), sr.getSourceLocationId(), tenantId);
|
|
||||||
if (!invList.isEmpty()) {
|
|
||||||
InventoryItem inv = invList.get(0);
|
|
||||||
inventoryItemService.updateInventoryQuantity(
|
|
||||||
inv.getId(), inv.getQuantity().add(sr.getItemQuantity()), now);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 删除单据
|
// 删除单据
|
||||||
boolean result = supplyRequestService.removeByIds(supplyRequestIds);
|
boolean result = supplyRequestService.removeByIds(supplyRequestIds);
|
||||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||||
|
|||||||
@@ -519,8 +519,58 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
|||||||
// 暂时先取出全部的库存,循环查库存同一会有问题,后续优化
|
// 暂时先取出全部的库存,循环查库存同一会有问题,后续优化
|
||||||
List<InventoryItem> inventoryItems = inventoryItemService.selectAllInventory();
|
List<InventoryItem> inventoryItems = inventoryItemService.selectAllInventory();
|
||||||
for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) {
|
for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) {
|
||||||
// 🔧 源仓库库存已在保存时预划扣,审批通过时不再重复扣减
|
// 根据项目id,产品批号,源仓库id 查询源仓库库存表信息
|
||||||
outList.add(supplyItemDetailDto);
|
// List<InventoryItem> inventoryItemSourceList = inventoryItemService.selectInventoryByItemId(
|
||||||
|
// supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(),
|
||||||
|
// supplyItemDetailDto.getSourceLocationId(), SecurityUtils.getLoginUser().getTenantId());
|
||||||
|
List<InventoryItem> filteredInventoryItems = inventoryItems.stream()
|
||||||
|
.filter(item -> item.getItemId().equals(supplyItemDetailDto.getItemId())
|
||||||
|
&& item.getLotNumber().equals(supplyItemDetailDto.getLotNumber())
|
||||||
|
&& item.getLocationId().equals(supplyItemDetailDto.getSourceLocationId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
InventoryItem inventoryItemSource = new InventoryItem();
|
||||||
|
if (!filteredInventoryItems.isEmpty()) {
|
||||||
|
inventoryItemSource = filteredInventoryItems.get(0);
|
||||||
|
// 最小数量(最小单位库存数量)
|
||||||
|
BigDecimal minQuantity = inventoryItemSource.getQuantity();
|
||||||
|
|
||||||
|
// // 计算调拨后库存数量,结果取小单位
|
||||||
|
// // 供应申请的物品计量单位与包装单位相同
|
||||||
|
// if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) {
|
||||||
|
// if
|
||||||
|
// (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity().multiply(supplyItemDetailDto.getPartPercent()))
|
||||||
|
// < 0) {
|
||||||
|
// // 库存数量不足
|
||||||
|
// throw new ServiceException("操作失败,库存数量不足");
|
||||||
|
// } else {
|
||||||
|
// // 源仓库库存-(调拨数量*拆零比)
|
||||||
|
// minQuantity = minQuantity.subtract(
|
||||||
|
// supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity()));
|
||||||
|
// }
|
||||||
|
// } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) {
|
||||||
|
// 直接扣减库存
|
||||||
|
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||||
|
// 库存数量不足
|
||||||
|
throw new ServiceException("操作失败,库存数量不足");
|
||||||
|
} else {
|
||||||
|
// 供应申请的物品计量单位与最小单位相同
|
||||||
|
// 源仓库库存-调拨数量
|
||||||
|
minQuantity = minQuantity.subtract(supplyItemDetailDto.getItemQuantity());
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
// 更新源仓库库存数量
|
||||||
|
Boolean aBoolean
|
||||||
|
= inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now);
|
||||||
|
if (!aBoolean) {
|
||||||
|
throw new ServiceException("系统异常,请稍后重试");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加到出库列表
|
||||||
|
outList.add(supplyItemDetailDto);
|
||||||
|
} else {
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
// 根据项目id,产品批号,目的仓库id 查询目的仓库库存表信息
|
// 根据项目id,产品批号,目的仓库id 查询目的仓库库存表信息
|
||||||
List<InventoryItem> inventoryItemPurposeList = inventoryItemService.selectInventoryByItemId(
|
List<InventoryItem> inventoryItemPurposeList = inventoryItemService.selectInventoryByItemId(
|
||||||
|
|||||||
@@ -86,12 +86,7 @@ public class OutpatientRecordServiceImpl implements IOutpatientRecordService {
|
|||||||
|
|
||||||
// 处理就诊对象状态筛选
|
// 处理就诊对象状态筛选
|
||||||
if (outpatientRecordSearchParam.getSubjectStatusEnum() != null) {
|
if (outpatientRecordSearchParam.getSubjectStatusEnum() != null) {
|
||||||
if (outpatientRecordSearchParam.getSubjectStatusEnum() == 0) {
|
queryWrapper.eq("enc.status_enum", outpatientRecordSearchParam.getSubjectStatusEnum());
|
||||||
// 前端选择"无状态"(0)时,过滤 status_enum IS NULL 的记录
|
|
||||||
queryWrapper.isNull("enc.status_enum");
|
|
||||||
} else {
|
|
||||||
queryWrapper.eq("enc.status_enum", outpatientRecordSearchParam.getSubjectStatusEnum());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理医生姓名查询(支持模糊查询)
|
// 处理医生姓名查询(支持模糊查询)
|
||||||
|
|||||||
@@ -133,13 +133,47 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
|||||||
@Override
|
@Override
|
||||||
public IPage<PatientBaseInfoDto> getPatientInfo(PatientBaseInfoDto patientBaseInfoDto, String searchKey,
|
public IPage<PatientBaseInfoDto> getPatientInfo(PatientBaseInfoDto patientBaseInfoDto, String searchKey,
|
||||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
// 构建基础查询条件
|
// 获取登录者信息
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
Long userId = loginUser.getUserId();
|
||||||
|
Integer tenantId = loginUser.getTenantId().intValue();
|
||||||
|
|
||||||
|
// 先构建基础查询条件
|
||||||
QueryWrapper<PatientBaseInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
QueryWrapper<PatientBaseInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||||
patientBaseInfoDto, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name,
|
patientBaseInfoDto, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name,
|
||||||
CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)),
|
CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)),
|
||||||
request);
|
request);
|
||||||
|
|
||||||
|
// 检查是否是精确ID查询(从门诊挂号页面跳转时使用)
|
||||||
|
boolean hasExactIdQuery = (patientBaseInfoDto.getId() != null);
|
||||||
|
|
||||||
|
// 只有非精确ID查询时,才添加医生患者过滤条件
|
||||||
|
if (!hasExactIdQuery) {
|
||||||
|
// 查询当前用户对应的医生信息
|
||||||
|
LambdaQueryWrapper<com.openhis.administration.domain.Practitioner> practitionerQuery = new LambdaQueryWrapper<>();
|
||||||
|
practitionerQuery.eq(com.openhis.administration.domain.Practitioner::getUserId, userId);
|
||||||
|
// 使用list()避免TooManyResultsException异常,然后取第一个记录
|
||||||
|
List<com.openhis.administration.domain.Practitioner> practitionerList = practitionerService.list(practitionerQuery);
|
||||||
|
com.openhis.administration.domain.Practitioner practitioner = practitionerList != null && !practitionerList.isEmpty() ? practitionerList.get(0) : null;
|
||||||
|
|
||||||
|
// 如果当前用户是医生,添加医生患者过滤条件
|
||||||
|
if (practitioner != null) {
|
||||||
|
// 查询该医生作为接诊医生(ADMITTER, code="1")和挂号医生(REGISTRATION_DOCTOR, code="12")的所有就诊记录的患者ID
|
||||||
|
List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId(
|
||||||
|
practitioner.getId(),
|
||||||
|
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()),
|
||||||
|
tenantId);
|
||||||
|
|
||||||
|
if (doctorPatientIds != null && !doctorPatientIds.isEmpty()) {
|
||||||
|
// 添加患者ID过滤条件 - 注意:这里使用列名而不是表别名
|
||||||
|
queryWrapper.in("id", doctorPatientIds);
|
||||||
|
} else {
|
||||||
|
// 如果没有相关患者,返回空结果
|
||||||
|
queryWrapper.eq("id", -1); // 设置一个不存在的ID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果不是医生,查询所有患者
|
||||||
|
}
|
||||||
|
|
||||||
IPage<PatientBaseInfoDto> patientInformationPage
|
IPage<PatientBaseInfoDto> patientInformationPage
|
||||||
= patientManageMapper.getPatientPage(new Page<>(pageNo, pageSize), queryWrapper);
|
= patientManageMapper.getPatientPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
@@ -235,7 +269,7 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
|||||||
// log.debug("添加病人信息,patientInfoDto:{}", patientBaseInfoDto);
|
// log.debug("添加病人信息,patientInfoDto:{}", patientBaseInfoDto);
|
||||||
// 如果患者没有输入身份证号则根据年龄自动生成
|
// 如果患者没有输入身份证号则根据年龄自动生成
|
||||||
String idCard = patientBaseInfoDto.getIdCard();
|
String idCard = patientBaseInfoDto.getIdCard();
|
||||||
if (idCard == null || idCard.length() < 6 || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||||
if (patientBaseInfoDto.getAge() != null) {
|
if (patientBaseInfoDto.getAge() != null) {
|
||||||
idCard = IdCardUtil.generateIdByAge(patientBaseInfoDto.getAge());
|
idCard = IdCardUtil.generateIdByAge(patientBaseInfoDto.getAge());
|
||||||
patientBaseInfoDto.setIdCard(idCard);
|
patientBaseInfoDto.setIdCard(idCard);
|
||||||
|
|||||||
@@ -69,12 +69,4 @@ public interface IAdviceManageAppService {
|
|||||||
*/
|
*/
|
||||||
R<?> stopRegAdvice(List<AdviceBatchOpParam> paramList);
|
R<?> stopRegAdvice(List<AdviceBatchOpParam> paramList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 住院医嘱取消停嘱(恢复)
|
|
||||||
*
|
|
||||||
* @param paramList 恢复参数
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
R<?> cancelStopRegAdvice(List<AdviceBatchOpParam> paramList);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import com.openhis.common.constant.PromptMsgConstant;
|
|||||||
import com.openhis.common.enums.*;
|
import com.openhis.common.enums.*;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.medication.domain.MedicationDispense;
|
|
||||||
import com.openhis.medication.domain.MedicationRequest;
|
import com.openhis.medication.domain.MedicationRequest;
|
||||||
import com.openhis.medication.service.IMedicationDispenseService;
|
import com.openhis.medication.service.IMedicationDispenseService;
|
||||||
import com.openhis.medication.service.IMedicationRequestService;
|
import com.openhis.medication.service.IMedicationRequestService;
|
||||||
@@ -37,8 +36,6 @@ import com.openhis.workflow.domain.ActivityDefinition;
|
|||||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||||
import com.openhis.workflow.service.IDeviceRequestService;
|
import com.openhis.workflow.service.IDeviceRequestService;
|
||||||
import com.openhis.workflow.service.IServiceRequestService;
|
import com.openhis.workflow.service.IServiceRequestService;
|
||||||
import com.openhis.document.domain.RequestForm;
|
|
||||||
import com.openhis.document.service.IRequestFormService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -88,9 +85,6 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
@Resource
|
@Resource
|
||||||
IDeviceDispenseService iDeviceDispenseService;
|
IDeviceDispenseService iDeviceDispenseService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
IRequestFormService iRequestFormService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询住院患者信息
|
* 查询住院患者信息
|
||||||
*
|
*
|
||||||
@@ -272,38 +266,6 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
|
|
||||||
log.info("开始处理删除操作,共 {} 条记录", deleteList.size());
|
log.info("开始处理删除操作,共 {} 条记录", deleteList.size());
|
||||||
|
|
||||||
// 🔧 手术申请单级联作废:删除手术医嘱(categoryEnum=24)时同步作废关联的手术申请单
|
|
||||||
Map<String, List<Long>> surgeryPrescriptionNoToRequestIds = new LinkedHashMap<>();
|
|
||||||
for (RegAdviceSaveDto adviceDto : deleteList) {
|
|
||||||
if (adviceDto.getRequestId() == null) continue;
|
|
||||||
ServiceRequest existing = iServiceRequestService.getById(adviceDto.getRequestId());
|
|
||||||
if (existing == null) continue;
|
|
||||||
if (existing.getCategoryEnum() != null
|
|
||||||
&& existing.getCategoryEnum() == 24
|
|
||||||
&& existing.getPrescriptionNo() != null && !existing.getPrescriptionNo().isEmpty()) {
|
|
||||||
surgeryPrescriptionNoToRequestIds.computeIfAbsent(existing.getPrescriptionNo(), k -> new ArrayList<>())
|
|
||||||
.add(adviceDto.getRequestId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Map.Entry<String, List<Long>> e : surgeryPrescriptionNoToRequestIds.entrySet()) {
|
|
||||||
String prescriptionNo = e.getKey();
|
|
||||||
try {
|
|
||||||
List<RequestForm> requestForms = iRequestFormService.list(
|
|
||||||
new LambdaQueryWrapper<RequestForm>()
|
|
||||||
.eq(RequestForm::getPrescriptionNo, prescriptionNo)
|
|
||||||
.eq(RequestForm::getTypeCode, ActivityDefCategory.PROCEDURE.getCode())
|
|
||||||
.and(w -> w.isNull(RequestForm::getDeleteFlag).or().eq(RequestForm::getDeleteFlag, "0")));
|
|
||||||
for (RequestForm requestForm : requestForms) {
|
|
||||||
iRequestFormService.removeById(requestForm.getId());
|
|
||||||
}
|
|
||||||
if (!requestForms.isEmpty()) {
|
|
||||||
log.info("级联作废手术申请单 prescriptionNo={}, 共{}条", prescriptionNo, requestForms.size());
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
log.warn("级联作废手术申请单失败 prescriptionNo={}", prescriptionNo, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (RegAdviceSaveDto adviceDto : deleteList) {
|
for (RegAdviceSaveDto adviceDto : deleteList) {
|
||||||
Integer adviceType = adviceDto.getAdviceType();
|
Integer adviceType = adviceDto.getAdviceType();
|
||||||
Long requestId = adviceDto.getRequestId();
|
Long requestId = adviceDto.getRequestId();
|
||||||
@@ -416,7 +378,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
// 保存时处理的字段属性
|
// 保存时处理的字段属性
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
longMedicationRequest.setEffectiveDoseStart(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
longMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||||
longMedicationRequest
|
longMedicationRequest
|
||||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||||
longMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
longMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
@@ -504,7 +466,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
// 保存时处理的字段属性
|
// 保存时处理的字段属性
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
tempMedicationRequest.setEffectiveDoseStart(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
tempMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||||
tempMedicationRequest
|
tempMedicationRequest
|
||||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||||
tempMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
tempMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
@@ -616,7 +578,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
// 保存时处理的字段属性
|
// 保存时处理的字段属性
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
longServiceRequest.setOccurrenceStartTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||||
longServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
longServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||||
longServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
longServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
longServiceRequest.setQuantity(new BigDecimal("1")); // 请求数量 | 诊疗的长期医嘱数量都是1
|
longServiceRequest.setQuantity(new BigDecimal("1")); // 请求数量 | 诊疗的长期医嘱数量都是1
|
||||||
@@ -667,7 +629,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
}
|
}
|
||||||
// 保存时处理的字段属性
|
// 保存时处理的字段属性
|
||||||
if (is_save) {
|
if (is_save) {
|
||||||
tempServiceRequest.setOccurrenceStartTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
tempServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||||
tempServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
tempServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||||
tempServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
tempServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
tempServiceRequest.setQuantity(regAdviceSaveDto.getQuantity()); // 请求数量
|
tempServiceRequest.setQuantity(regAdviceSaveDto.getQuantity()); // 请求数量
|
||||||
@@ -813,7 +775,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||||
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||||
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
||||||
deviceRequest.setReqAuthoredTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
deviceRequest.setReqAuthoredTime(startTime); // 医嘱开始时间
|
||||||
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
||||||
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||||
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
||||||
@@ -852,7 +814,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||||
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||||
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
||||||
deviceRequest.setReqAuthoredTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
deviceRequest.setReqAuthoredTime(startTime); // 医嘱开始时间
|
||||||
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
||||||
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||||
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
||||||
@@ -1044,14 +1006,8 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> stopRegAdvice(List<AdviceBatchOpParam> paramList) {
|
public R<?> stopRegAdvice(List<AdviceBatchOpParam> paramList) {
|
||||||
// 获取停嘱时间:优先从前端传入的 stopTime,否则用当前时间
|
// 当前时间
|
||||||
Date stopTime = paramList.stream()
|
Date date = new Date();
|
||||||
.map(AdviceBatchOpParam::getStopTime)
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.findFirst()
|
|
||||||
.orElse(new Date());
|
|
||||||
// 获取当前操作用户昵称作为停嘱医生
|
|
||||||
String stopUserName = SecurityUtils.getNickName();
|
|
||||||
// 药品
|
// 药品
|
||||||
List<AdviceBatchOpParam> medicineList = paramList.stream()
|
List<AdviceBatchOpParam> medicineList = paramList.stream()
|
||||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||||
@@ -1066,112 +1022,15 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
= activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
= activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||||
if (!medicineRequestIds.isEmpty()) {
|
if (!medicineRequestIds.isEmpty()) {
|
||||||
iMedicationRequestService.update(new LambdaUpdateWrapper<MedicationRequest>()
|
iMedicationRequestService.update(new LambdaUpdateWrapper<MedicationRequest>()
|
||||||
.in(MedicationRequest::getId, medicineRequestIds)
|
.in(MedicationRequest::getId, medicineRequestIds).set(MedicationRequest::getEffectiveDoseEnd, date)
|
||||||
.set(MedicationRequest::getEffectiveDoseEnd, stopTime)
|
.set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue()));
|
||||||
.set(MedicationRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
|
||||||
.set(MedicationRequest::getUpdateBy, stopUserName));
|
|
||||||
}
|
}
|
||||||
if (!activityRequestIds.isEmpty()) {
|
if (!activityRequestIds.isEmpty()) {
|
||||||
iServiceRequestService.update(new LambdaUpdateWrapper<ServiceRequest>()
|
iServiceRequestService.update(new LambdaUpdateWrapper<ServiceRequest>()
|
||||||
.in(ServiceRequest::getId, activityRequestIds)
|
.in(ServiceRequest::getId, activityRequestIds).set(ServiceRequest::getOccurrenceEndTime, date)
|
||||||
.set(ServiceRequest::getOccurrenceEndTime, stopTime)
|
.set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue()));
|
||||||
.set(ServiceRequest::getStatusEnum, RequestStatus.STOPPED.getValue())
|
|
||||||
.set(ServiceRequest::getUpdateBy, stopUserName));
|
|
||||||
}
|
}
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱停止"}));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱停止"}));
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 住院医嘱取消停嘱(恢复)
|
|
||||||
*
|
|
||||||
* 核心业务逻辑:
|
|
||||||
* 1. 护士站校验:护士站尚未对该医嘱的停止进行"停止核对/确认"(即 dispense 状态未进入已发药/完成状态)
|
|
||||||
* 2. 药房端校验:药房尚未对该停嘱单进行退药接收/退费入库确认
|
|
||||||
* 3. 若校验通过,将医嘱状态复原为"已签发";清空停嘱时间与停嘱医生字段;
|
|
||||||
* 同时自动作废已生成的待发药退回/退药申请
|
|
||||||
*
|
|
||||||
* @param paramList 恢复参数
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public R<?> cancelStopRegAdvice(List<AdviceBatchOpParam> paramList) {
|
|
||||||
// 药品
|
|
||||||
List<AdviceBatchOpParam> medicineList = paramList.stream()
|
|
||||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
|
||||||
List<Long> medicineRequestIds
|
|
||||||
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
|
||||||
// 诊疗(包含护理adviceType=26)
|
|
||||||
List<AdviceBatchOpParam> activityList = paramList.stream()
|
|
||||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|
|
||||||
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
List<Long> activityRequestIds
|
|
||||||
= activityList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
|
||||||
|
|
||||||
// ============ 前置校验 ============
|
|
||||||
// 1. 护士站校验:查询药品发放记录,确认护士站是否已执行停止核对(发药)
|
|
||||||
if (!medicineRequestIds.isEmpty()) {
|
|
||||||
List<MedicationDispense> dispenseList = iMedicationDispenseService.selectByRequestIdList(medicineRequestIds);
|
|
||||||
for (MedicationDispense dispense : dispenseList) {
|
|
||||||
// 如果发放状态 >= COMPLETED(4),说明护士站已发药/已确认停止
|
|
||||||
if (dispense.getStatusEnum() != null && dispense.getStatusEnum() >= DispenseStatus.COMPLETED.getValue()
|
|
||||||
&& !DispenseStatus.ON_HOLD.getValue().equals(dispense.getStatusEnum())
|
|
||||||
&& !DispenseStatus.STOPPED.getValue().equals(dispense.getStatusEnum())
|
|
||||||
&& !DispenseStatus.CANCELLED.getValue().equals(dispense.getStatusEnum())) {
|
|
||||||
throw new ServiceException("护士站已确认停止该医嘱,无法取消停嘱!");
|
|
||||||
}
|
|
||||||
// 2. 药房端校验:如果已有退药/退费记录,说明药房已处理
|
|
||||||
if (DispenseStatus.RETURNED.getValue().equals(dispense.getStatusEnum())
|
|
||||||
|| DispenseStatus.REFUNDED.getValue().equals(dispense.getStatusEnum())
|
|
||||||
|| DispenseStatus.PART_REFUND.getValue().equals(dispense.getStatusEnum())) {
|
|
||||||
throw new ServiceException("药房已完成退药处理,无法取消停嘱!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============ 执行恢复 ============
|
|
||||||
if (!medicineRequestIds.isEmpty()) {
|
|
||||||
// 恢复药品请求状态为"已发送"(ACTIVE=2),清空停嘱时间和更新人
|
|
||||||
iMedicationRequestService.update(new LambdaUpdateWrapper<MedicationRequest>()
|
|
||||||
.in(MedicationRequest::getId, medicineRequestIds)
|
|
||||||
.set(MedicationRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
|
||||||
.set(MedicationRequest::getEffectiveDoseEnd, null)
|
|
||||||
.set(MedicationRequest::getUpdateBy, null));
|
|
||||||
|
|
||||||
// 作废/删除与这些药品请求相关的待退药发放记录
|
|
||||||
List<MedicationDispense> relatedDispenseList = iMedicationDispenseService.selectByRequestIdList(medicineRequestIds);
|
|
||||||
for (MedicationDispense dispense : relatedDispenseList) {
|
|
||||||
if (DispenseStatus.PENDING_REFUND.getValue().equals(dispense.getStatusEnum())
|
|
||||||
|| DispenseStatus.CANCELLED.getValue().equals(dispense.getStatusEnum())
|
|
||||||
|| DispenseStatus.ON_HOLD.getValue().equals(dispense.getStatusEnum())) {
|
|
||||||
// 将待退药/暂停/撤回的记录标记为草稿,或删除
|
|
||||||
iMedicationDispenseService.update(new LambdaUpdateWrapper<MedicationDispense>()
|
|
||||||
.eq(MedicationDispense::getId, dispense.getId())
|
|
||||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.DRAFT.getValue())
|
|
||||||
.set(MedicationDispense::getStatusChangedTime, new Date()));
|
|
||||||
}
|
|
||||||
// 如果 dispense 已处于 STOPPED(6) 状态,也恢复为草稿以重新触发配药流程
|
|
||||||
if (DispenseStatus.STOPPED.getValue().equals(dispense.getStatusEnum())) {
|
|
||||||
iMedicationDispenseService.update(new LambdaUpdateWrapper<MedicationDispense>()
|
|
||||||
.eq(MedicationDispense::getId, dispense.getId())
|
|
||||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
|
||||||
.set(MedicationDispense::getStatusChangedTime, new Date()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!activityRequestIds.isEmpty()) {
|
|
||||||
// 恢复诊疗请求状态为"已发送"(ACTIVE=2),清空停嘱时间和更新人
|
|
||||||
iServiceRequestService.update(new LambdaUpdateWrapper<ServiceRequest>()
|
|
||||||
.in(ServiceRequest::getId, activityRequestIds)
|
|
||||||
.set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
|
||||||
.set(ServiceRequest::getOccurrenceEndTime, null)
|
|
||||||
.set(ServiceRequest::getUpdateBy, null));
|
|
||||||
}
|
|
||||||
|
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱恢复"}));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.core.common.enums.DelFlag;
|
|
||||||
import com.core.common.exception.ServiceException;
|
import com.core.common.exception.ServiceException;
|
||||||
import com.core.common.utils.AssignSeqUtil;
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
import com.core.common.utils.MessageUtils;
|
import com.core.common.utils.MessageUtils;
|
||||||
@@ -18,8 +17,6 @@ import com.openhis.common.constant.PromptMsgConstant;
|
|||||||
import com.openhis.common.enums.*;
|
import com.openhis.common.enums.*;
|
||||||
import com.openhis.document.domain.RequestForm;
|
import com.openhis.document.domain.RequestForm;
|
||||||
import com.openhis.document.service.IRequestFormService;
|
import com.openhis.document.service.IRequestFormService;
|
||||||
import com.openhis.lab.domain.Specimen;
|
|
||||||
import com.openhis.lab.service.ISpecimenService;
|
|
||||||
import com.openhis.web.doctorstation.dto.ActivityChildrenJsonParams;
|
import com.openhis.web.doctorstation.dto.ActivityChildrenJsonParams;
|
||||||
import com.openhis.web.doctorstation.utils.AdviceUtils;
|
import com.openhis.web.doctorstation.utils.AdviceUtils;
|
||||||
import com.openhis.web.regdoctorstation.appservice.IRequestFormManageAppService;
|
import com.openhis.web.regdoctorstation.appservice.IRequestFormManageAppService;
|
||||||
@@ -70,39 +67,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
@Resource
|
@Resource
|
||||||
IActivityDefinitionService iActivityDefinitionService;
|
IActivityDefinitionService iActivityDefinitionService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
ISpecimenService iSpecimenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验当前用户是否有权操作该申请单(申请者本人或管理员)
|
|
||||||
*/
|
|
||||||
private R<?> validateRequestFormPermission(RequestForm requestForm) {
|
|
||||||
if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Long currentPractitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
|
||||||
Long requesterId = requestForm.getRequesterId();
|
|
||||||
if (currentPractitionerId == null || requesterId == null
|
|
||||||
|| !currentPractitionerId.equals(requesterId)) {
|
|
||||||
return R.fail("无操作权限,仅申请开立者或管理员可操作");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验关联医嘱是否已采证(存在已采集/已接收标本则不可撤回)
|
|
||||||
*/
|
|
||||||
private boolean hasCollectedSpecimen(List<Long> serviceRequestIds) {
|
|
||||||
if (serviceRequestIds == null || serviceRequestIds.isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
long count = iSpecimenService.count(
|
|
||||||
new LambdaQueryWrapper<Specimen>()
|
|
||||||
.in(Specimen::getServiceId, serviceRequestIds)
|
|
||||||
.ge(Specimen::getCollectionStatusEnum, SpecCollectStatus.COLLECTED.getValue()));
|
|
||||||
return count > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存申请单
|
* 保存申请单
|
||||||
*
|
*
|
||||||
@@ -117,7 +81,16 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
Long requestFormId = requestFormSaveDto.getRequestFormId();
|
Long requestFormId = requestFormSaveDto.getRequestFormId();
|
||||||
boolean isEdit = requestFormId != null && requestFormId != 0L;
|
boolean isEdit = requestFormId != null && requestFormId != 0L;
|
||||||
|
|
||||||
// 🔧 手术/检查申请单:优先使用前端传入的positionId(用户手动选择的发往科室),跳过执行科室配置校验
|
// 诊疗执行科室配置校验(必须在任何数据库操作之前)
|
||||||
|
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
|
||||||
|
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
|
||||||
|
if (activityOrganizationConfig.isEmpty()) {
|
||||||
|
throw new ServiceException("请先配置当前时间段的执行科室");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 逐个校验activityList中的项目是否都配置了执行科室,并收集positionId供后续使用
|
||||||
|
// 必须在任何数据库操作之前完成全部校验,避免部分保存后异常导致脏数据
|
||||||
|
// 🔧 Bug #516: 优先使用前端传入的positionId(用户手动选择的发往科室),仅在未选择时使用配置的执行科室
|
||||||
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
||||||
// 缓存校验结果,避免主循环中重复查询和可能出现的数据不一致
|
// 缓存校验结果,避免主循环中重复查询和可能出现的数据不一致
|
||||||
java.util.Map<Long, Long> activityIdToPositionIdMap = new java.util.HashMap<>();
|
java.util.Map<Long, Long> activityIdToPositionIdMap = new java.util.HashMap<>();
|
||||||
@@ -129,15 +102,14 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), frontendPositionId);
|
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), frontendPositionId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 前端未传入时,查询配置的执行科室(暂不校验,仅用于兼容无前端传入的场景)
|
// 前端未传入时,使用配置的执行科室
|
||||||
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
|
|
||||||
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
|
|
||||||
Long configPositionId = activityOrganizationConfig.stream()
|
Long configPositionId = activityOrganizationConfig.stream()
|
||||||
.filter(dto -> activitySaveDto.getAdviceDefinitionId().equals(dto.getActivityDefinitionId()))
|
.filter(dto -> activitySaveDto.getAdviceDefinitionId().equals(dto.getActivityDefinitionId()))
|
||||||
.map(ActivityOrganizationConfigDto::getOrganizationId).findFirst().orElse(null);
|
.map(ActivityOrganizationConfigDto::getOrganizationId).findFirst().orElse(null);
|
||||||
if (configPositionId != null) {
|
if (configPositionId == null) {
|
||||||
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), configPositionId);
|
throw new ServiceException(activitySaveDto.getAdviceDefinitionName() + "未配置当前时间段的执行科室");
|
||||||
}
|
}
|
||||||
|
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), configPositionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,13 +127,10 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 根据申请单类型生成不同前缀的单号
|
// 检查申请单号:JC(检查)+ Z(住院标识)+ yyMMdd(日期)+ 5位顺序号
|
||||||
String dateStr = new java.text.SimpleDateFormat("yyMMdd").format(new Date());
|
String dateStr = new java.text.SimpleDateFormat("yyMMdd").format(new Date());
|
||||||
AssignSeqEnum seqEnum = ActivityDefCategory.PROCEDURE.getCode().equals(typeCode)
|
int seq = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.CHECK_APPLY_NO.getPrefix());
|
||||||
? AssignSeqEnum.SURGERY_APPLY_NO
|
prescriptionNo = "JCZ" + dateStr + String.format("%05d", seq);
|
||||||
: AssignSeqEnum.CHECK_APPLY_NO;
|
|
||||||
int seq = assignSeqUtil.getSeqNoByDay(seqEnum.getPrefix());
|
|
||||||
prescriptionNo = seqEnum.getPrefix() + dateStr + String.format("%05d", seq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前时间
|
// 当前时间
|
||||||
@@ -207,77 +176,73 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
ChargeItem chargeItem;
|
ChargeItem chargeItem;
|
||||||
log.info("保存申请单,typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId);
|
log.info("保存申请单,typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId);
|
||||||
|
|
||||||
// 🔧 手术申请单:跳过普通医嘱生成,只由 isProcedure 块生成手术医嘱,避免重复
|
for (ActivitySaveDto activitySaveDto : activityList) {
|
||||||
boolean isSurgeryRequest = ActivityDefCategory.PROCEDURE.getCode().equals(typeCode);
|
serviceRequest = new ServiceRequest();
|
||||||
if (!isSurgeryRequest) {
|
serviceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());
|
||||||
for (ActivitySaveDto activitySaveDto : activityList) {
|
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||||
serviceRequest = new ServiceRequest();
|
serviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
serviceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());
|
serviceRequest.setPrescriptionNo(prescriptionNo);
|
||||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
serviceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());// 治疗类型
|
||||||
serviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
serviceRequest.setQuantity(activitySaveDto.getQuantity()); // 请求数量
|
||||||
serviceRequest.setPrescriptionNo(prescriptionNo);
|
serviceRequest.setUnitCode(activitySaveDto.getUnitCode()); // 请求单位编码
|
||||||
serviceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());// 治疗类型
|
serviceRequest.setCategoryEnum(categoryEnum); // 请求类型
|
||||||
serviceRequest.setQuantity(activitySaveDto.getQuantity()); // 请求数量
|
serviceRequest.setActivityId(activitySaveDto.getAdviceDefinitionId());// 诊疗定义id
|
||||||
serviceRequest.setUnitCode(activitySaveDto.getUnitCode()); // 请求单位编码
|
serviceRequest.setPatientId(patientId); // 患者
|
||||||
serviceRequest.setCategoryEnum(categoryEnum); // 请求类型
|
serviceRequest.setRequesterId(practitionerId); // 开方医生
|
||||||
serviceRequest.setActivityId(activitySaveDto.getAdviceDefinitionId());// 诊疗定义id
|
serviceRequest.setEncounterId(encounterId); // 就诊id
|
||||||
serviceRequest.setPatientId(patientId); // 患者
|
serviceRequest.setAuthoredTime(curDate); // 请求签发时间
|
||||||
serviceRequest.setRequesterId(practitionerId); // 开方医生
|
|
||||||
serviceRequest.setEncounterId(encounterId); // 就诊id
|
|
||||||
serviceRequest.setAuthoredTime(curDate); // 请求签发时间
|
|
||||||
|
|
||||||
Long positionId = activityIdToPositionIdMap.get(activitySaveDto.getAdviceDefinitionId());
|
Long positionId = activityIdToPositionIdMap.get(activitySaveDto.getAdviceDefinitionId());
|
||||||
if (positionId == null) {
|
if (positionId == null) {
|
||||||
throw new ServiceException(activitySaveDto.getAdviceDefinitionName() + "未配置当前时间段的执行科室");
|
throw new ServiceException(activitySaveDto.getAdviceDefinitionName() + "未配置当前时间段的执行科室");
|
||||||
}
|
}
|
||||||
serviceRequest.setOrgId(positionId); // 执行科室
|
serviceRequest.setOrgId(positionId); // 执行科室
|
||||||
|
|
||||||
serviceRequest.setYbClassEnum(activitySaveDto.getYbClassEnum());// 类别医保编码
|
serviceRequest.setYbClassEnum(activitySaveDto.getYbClassEnum());// 类别医保编码
|
||||||
serviceRequest.setConditionId(activitySaveDto.getConditionId()); // 诊断id
|
serviceRequest.setConditionId(activitySaveDto.getConditionId()); // 诊断id
|
||||||
serviceRequest.setEncounterDiagnosisId(activitySaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
serviceRequest.setEncounterDiagnosisId(activitySaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||||
iServiceRequestService.save(serviceRequest);
|
iServiceRequestService.save(serviceRequest);
|
||||||
|
|
||||||
chargeItem = new ChargeItem();
|
chargeItem = new ChargeItem();
|
||||||
chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 收费状态
|
chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 收费状态
|
||||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo()));
|
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo()));
|
||||||
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
chargeItem.setPatientId(patientId); // 患者
|
chargeItem.setPatientId(patientId); // 患者
|
||||||
chargeItem.setContextEnum(activitySaveDto.getAdviceType()); // 类型
|
chargeItem.setContextEnum(activitySaveDto.getAdviceType()); // 类型
|
||||||
chargeItem.setEncounterId(encounterId); // 就诊id
|
chargeItem.setEncounterId(encounterId); // 就诊id
|
||||||
chargeItem.setDefinitionId(activitySaveDto.getDefinitionId()); // 费用定价ID
|
chargeItem.setDefinitionId(activitySaveDto.getDefinitionId()); // 费用定价ID
|
||||||
chargeItem.setDefDetailId(activitySaveDto.getDefinitionDetailId()); // 定价子表主键
|
chargeItem.setDefDetailId(activitySaveDto.getDefinitionDetailId()); // 定价子表主键
|
||||||
chargeItem.setEntererId(practitionerId);// 开立人ID
|
chargeItem.setEntererId(practitionerId);// 开立人ID
|
||||||
chargeItem.setEnteredDate(curDate); // 开立时间
|
chargeItem.setEnteredDate(curDate); // 开立时间
|
||||||
chargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);// 医疗服务类型
|
chargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);// 医疗服务类型
|
||||||
chargeItem.setServiceId(serviceRequest.getId()); // 医疗服务ID
|
chargeItem.setServiceId(serviceRequest.getId()); // 医疗服务ID
|
||||||
chargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);// 产品所在表
|
chargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);// 产品所在表
|
||||||
chargeItem.setProductId(activitySaveDto.getAdviceDefinitionId());// 收费项id
|
chargeItem.setProductId(activitySaveDto.getAdviceDefinitionId());// 收费项id
|
||||||
chargeItem.setAccountId(activitySaveDto.getAccountId());// 关联账户ID
|
chargeItem.setAccountId(activitySaveDto.getAccountId());// 关联账户ID
|
||||||
chargeItem.setRequestingOrgId(orgId); // 开立科室
|
chargeItem.setRequestingOrgId(orgId); // 开立科室
|
||||||
chargeItem.setConditionId(activitySaveDto.getConditionId()); // 诊断id
|
chargeItem.setConditionId(activitySaveDto.getConditionId()); // 诊断id
|
||||||
chargeItem.setEncounterDiagnosisId(activitySaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
chargeItem.setEncounterDiagnosisId(activitySaveDto.getEncounterDiagnosisId()); // 就诊诊断id
|
||||||
chargeItem.setQuantityValue(activitySaveDto.getQuantity()); // 数量
|
chargeItem.setQuantityValue(activitySaveDto.getQuantity()); // 数量
|
||||||
chargeItem.setQuantityUnit(activitySaveDto.getUnitCode()); // 单位
|
chargeItem.setQuantityUnit(activitySaveDto.getUnitCode()); // 单位
|
||||||
chargeItem.setUnitPrice(activitySaveDto.getUnitPrice()); // 单价
|
chargeItem.setUnitPrice(activitySaveDto.getUnitPrice()); // 单价
|
||||||
chargeItem.setTotalPrice(activitySaveDto.getTotalPrice()); // 总价
|
chargeItem.setTotalPrice(activitySaveDto.getTotalPrice()); // 总价
|
||||||
iChargeItemService.save(chargeItem);
|
iChargeItemService.save(chargeItem);
|
||||||
|
|
||||||
// 处理诊疗套餐的子项信息
|
// 处理诊疗套餐的子项信息
|
||||||
ActivityDefinition activityDefinition =
|
ActivityDefinition activityDefinition =
|
||||||
iActivityDefinitionService.getById(activitySaveDto.getAdviceDefinitionId());
|
iActivityDefinitionService.getById(activitySaveDto.getAdviceDefinitionId());
|
||||||
String childrenJson = activityDefinition.getChildrenJson();
|
String childrenJson = activityDefinition.getChildrenJson();
|
||||||
if (childrenJson != null) {
|
if (childrenJson != null) {
|
||||||
// 诊疗子项参数类
|
// 诊疗子项参数类
|
||||||
ActivityChildrenJsonParams activityChildrenJsonParams = new ActivityChildrenJsonParams();
|
ActivityChildrenJsonParams activityChildrenJsonParams = new ActivityChildrenJsonParams();
|
||||||
activityChildrenJsonParams.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue()); // 治疗类型
|
activityChildrenJsonParams.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue()); // 治疗类型
|
||||||
activityChildrenJsonParams.setPatientId(serviceRequest.getPatientId()); // 患者
|
activityChildrenJsonParams.setPatientId(serviceRequest.getPatientId()); // 患者
|
||||||
activityChildrenJsonParams.setEncounterId(serviceRequest.getEncounterId()); // 就诊id
|
activityChildrenJsonParams.setEncounterId(serviceRequest.getEncounterId()); // 就诊id
|
||||||
activityChildrenJsonParams.setAccountId(chargeItem.getAccountId()); // 账户id
|
activityChildrenJsonParams.setAccountId(chargeItem.getAccountId()); // 账户id
|
||||||
activityChildrenJsonParams.setChargeItemId(chargeItem.getId()); // 费用项id
|
activityChildrenJsonParams.setChargeItemId(chargeItem.getId()); // 费用项id
|
||||||
activityChildrenJsonParams.setParentId(serviceRequest.getId());// 子项诊疗的父id
|
activityChildrenJsonParams.setParentId(serviceRequest.getId());// 子项诊疗的父id
|
||||||
activityChildrenJsonParams.setEncounterDiagnosisId(serviceRequest.getEncounterDiagnosisId());
|
activityChildrenJsonParams.setEncounterDiagnosisId(serviceRequest.getEncounterDiagnosisId());
|
||||||
adviceUtils.handleActivityChild(childrenJson, organizationId, activityChildrenJsonParams);
|
adviceUtils.handleActivityChild(childrenJson, organizationId, activityChildrenJsonParams);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,13 +326,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
} else if (surgeryName != null && !surgeryName.isEmpty()) {
|
} else if (surgeryName != null && !surgeryName.isEmpty()) {
|
||||||
contentMap.put("surgeryName", surgeryName);
|
contentMap.put("surgeryName", surgeryName);
|
||||||
}
|
}
|
||||||
// 🔧 手术申请单级联删除:contentJson 中记录 requestFormId 和 prescriptionNo,删除医嘱时可定位并作废申请单
|
|
||||||
if (requestForm.getId() != null) {
|
|
||||||
contentMap.put("requestFormId", String.valueOf(requestForm.getId()));
|
|
||||||
}
|
|
||||||
if (prescriptionNo != null && !prescriptionNo.isEmpty()) {
|
|
||||||
contentMap.put("prescriptionNo", prescriptionNo);
|
|
||||||
}
|
|
||||||
if (surgeryCode != null && !surgeryCode.isEmpty()) {
|
if (surgeryCode != null && !surgeryCode.isEmpty()) {
|
||||||
contentMap.put("surgeryCode", surgeryCode);
|
contentMap.put("surgeryCode", surgeryCode);
|
||||||
}
|
}
|
||||||
@@ -410,10 +368,9 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
surgeryChargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);
|
surgeryChargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);
|
||||||
surgeryChargeItem.setServiceId(surgeryServiceRequest.getId());
|
surgeryChargeItem.setServiceId(surgeryServiceRequest.getId());
|
||||||
surgeryChargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
surgeryChargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
||||||
// 优先从 activityList 获取 productId 和 definitionId
|
// 优先从 activityList 获取 productId
|
||||||
if (activityList != null && !activityList.isEmpty()) {
|
if (activityList != null && !activityList.isEmpty()) {
|
||||||
surgeryChargeItem.setProductId(activityList.get(0).getAdviceDefinitionId());
|
surgeryChargeItem.setProductId(activityList.get(0).getAdviceDefinitionId());
|
||||||
surgeryChargeItem.setDefinitionId(activityList.get(0).getDefinitionId());
|
|
||||||
surgeryChargeItem.setAccountId(activityList.get(0).getAccountId());
|
surgeryChargeItem.setAccountId(activityList.get(0).getAccountId());
|
||||||
}
|
}
|
||||||
surgeryChargeItem.setRequestingOrgId(orgId);
|
surgeryChargeItem.setRequestingOrgId(orgId);
|
||||||
@@ -452,10 +409,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
anesthesiaChargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);
|
anesthesiaChargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);
|
||||||
anesthesiaChargeItem.setServiceId(surgeryServiceRequest.getId());
|
anesthesiaChargeItem.setServiceId(surgeryServiceRequest.getId());
|
||||||
anesthesiaChargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
anesthesiaChargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
||||||
// 从 activityList 获取 definitionId
|
|
||||||
if (activityList != null && !activityList.isEmpty()) {
|
|
||||||
anesthesiaChargeItem.setDefinitionId(activityList.get(0).getDefinitionId());
|
|
||||||
}
|
|
||||||
anesthesiaChargeItem.setRequestingOrgId(orgId);
|
anesthesiaChargeItem.setRequestingOrgId(orgId);
|
||||||
anesthesiaChargeItem.setQuantityValue(BigDecimal.valueOf(1));
|
anesthesiaChargeItem.setQuantityValue(BigDecimal.valueOf(1));
|
||||||
anesthesiaChargeItem.setQuantityUnit("次");
|
anesthesiaChargeItem.setQuantityUnit("次");
|
||||||
@@ -472,18 +425,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
log.error("生成手术医嘱过程中发生异常", e);
|
log.error("生成手术医嘱过程中发生异常", e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
// 将手术项目名称写入申请单name字段,确保医嘱删除后申请单仍保留正确名称
|
|
||||||
if (activityList != null && !activityList.isEmpty()) {
|
|
||||||
String surgeryDisplayName = activityList.stream()
|
|
||||||
.map(ActivitySaveDto::getAdviceDefinitionName)
|
|
||||||
.filter(name -> name != null && !name.isEmpty())
|
|
||||||
.distinct()
|
|
||||||
.collect(Collectors.joining("、"));
|
|
||||||
if (!surgeryDisplayName.isEmpty()) {
|
|
||||||
requestForm.setName(surgeryDisplayName);
|
|
||||||
iRequestFormService.updateById(requestForm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
log.info("不是手术申请单,跳过手术医嘱生成,typeCode={}", typeCode);
|
log.info("不是手术申请单,跳过手术医嘱生成,typeCode={}", typeCode);
|
||||||
}
|
}
|
||||||
@@ -567,17 +508,12 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
if (requestForm == null) {
|
if (requestForm == null) {
|
||||||
return R.fail("申请单不存在");
|
return R.fail("申请单不存在");
|
||||||
}
|
}
|
||||||
R<?> permissionResult = validateRequestFormPermission(requestForm);
|
|
||||||
if (permissionResult != null) {
|
|
||||||
return permissionResult;
|
|
||||||
}
|
|
||||||
String prescriptionNo = requestForm.getPrescriptionNo();
|
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||||
|
|
||||||
// 查询该申请单下所有 ServiceRequest(含子项)
|
// 查询该申请单下所有 ServiceRequest(含子项)
|
||||||
List<ServiceRequest> serviceRequests = iServiceRequestService.list(
|
List<ServiceRequest> serviceRequests = iServiceRequestService.list(
|
||||||
new LambdaQueryWrapper<ServiceRequest>()
|
new LambdaQueryWrapper<ServiceRequest>()
|
||||||
.eq(ServiceRequest::getPrescriptionNo, prescriptionNo)
|
.eq(ServiceRequest::getPrescriptionNo, prescriptionNo));
|
||||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
|
||||||
if (serviceRequests == null || serviceRequests.isEmpty()) {
|
if (serviceRequests == null || serviceRequests.isEmpty()) {
|
||||||
return R.fail("未找到关联的诊疗医嘱");
|
return R.fail("未找到关联的诊疗医嘱");
|
||||||
}
|
}
|
||||||
@@ -607,7 +543,7 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
// 4. 删除申请单
|
// 4. 删除申请单
|
||||||
iRequestFormService.removeById(requestFormId);
|
iRequestFormService.removeById(requestFormId);
|
||||||
|
|
||||||
log.info("检验申请单删除成功,requestFormId={}, prescriptionNo={}", requestFormId, prescriptionNo);
|
log.info("检查申请单删除成功,requestFormId={}, prescriptionNo={}", requestFormId, prescriptionNo);
|
||||||
return R.ok("删除成功");
|
return R.ok("删除成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,47 +556,32 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
if (requestForm == null) {
|
if (requestForm == null) {
|
||||||
return R.fail("申请单不存在");
|
return R.fail("申请单不存在");
|
||||||
}
|
}
|
||||||
R<?> permissionResult = validateRequestFormPermission(requestForm);
|
|
||||||
if (permissionResult != null) {
|
|
||||||
return permissionResult;
|
|
||||||
}
|
|
||||||
String prescriptionNo = requestForm.getPrescriptionNo();
|
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||||
|
|
||||||
// 查询该申请单下所有 ServiceRequest
|
// 查询该申请单下所有 ServiceRequest
|
||||||
List<ServiceRequest> serviceRequests = iServiceRequestService.list(
|
List<ServiceRequest> serviceRequests = iServiceRequestService.list(
|
||||||
new LambdaQueryWrapper<ServiceRequest>()
|
new LambdaQueryWrapper<ServiceRequest>()
|
||||||
.eq(ServiceRequest::getPrescriptionNo, prescriptionNo)
|
.eq(ServiceRequest::getPrescriptionNo, prescriptionNo));
|
||||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
|
||||||
if (serviceRequests == null || serviceRequests.isEmpty()) {
|
if (serviceRequests == null || serviceRequests.isEmpty()) {
|
||||||
return R.fail("未找到关联的诊疗医嘱");
|
return R.fail("未找到关联的诊疗医嘱");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验:只有已签发(status=2)的申请单可撤回
|
||||||
|
boolean allActive = serviceRequests.stream()
|
||||||
|
.allMatch(sr -> RequestStatus.ACTIVE.getValue().equals(sr.getStatusEnum()));
|
||||||
|
if (!allActive) {
|
||||||
|
return R.fail("只有已签发状态的申请单可撤回");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将所有 ServiceRequest 状态改回待签发(DRAFT=0)
|
||||||
List<Long> serviceRequestIds = serviceRequests.stream()
|
List<Long> serviceRequestIds = serviceRequests.stream()
|
||||||
.map(ServiceRequest::getId).collect(Collectors.toList());
|
.map(ServiceRequest::getId).collect(Collectors.toList());
|
||||||
|
iServiceRequestService.update(
|
||||||
// 校验:标本已采集则不可撤回
|
|
||||||
if (hasCollectedSpecimen(serviceRequestIds)) {
|
|
||||||
return R.fail("标本已采集,无法撤回");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验:任一ServiceRequest为ACTIVE(status=2)即可撤回,与SQL的EXISTS逻辑一致
|
|
||||||
boolean hasActive = serviceRequests.stream()
|
|
||||||
.anyMatch(sr -> RequestStatus.ACTIVE.getValue().equals(sr.getStatusEnum()));
|
|
||||||
if (!hasActive) {
|
|
||||||
return R.fail("只有已签发且未采证的申请单可撤回");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将所有已签发的 ServiceRequest 状态改回待签发,与申请单展示状态同步
|
|
||||||
boolean updated = iServiceRequestService.update(
|
|
||||||
new ServiceRequest().setStatusEnum(RequestStatus.DRAFT.getValue()),
|
new ServiceRequest().setStatusEnum(RequestStatus.DRAFT.getValue()),
|
||||||
new LambdaUpdateWrapper<ServiceRequest>()
|
new LambdaUpdateWrapper<ServiceRequest>()
|
||||||
.in(ServiceRequest::getId, serviceRequestIds)
|
.in(ServiceRequest::getId, serviceRequestIds));
|
||||||
.eq(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue()));
|
|
||||||
if (!updated) {
|
|
||||||
return R.fail("撤回失败,医嘱状态已变更,请刷新后重试");
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("检验申请单撤回成功,requestFormId={}, prescriptionNo={}", requestFormId, prescriptionNo);
|
log.info("检查申请单撤回成功,requestFormId={}, prescriptionNo={}", requestFormId, prescriptionNo);
|
||||||
return R.ok("撤回成功");
|
return R.ok("撤回成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import java.util.Arrays;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,7 +161,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
|||||||
adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id
|
adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id
|
||||||
// 对应的诊疗医嘱信息
|
// 对应的诊疗医嘱信息
|
||||||
activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, null,
|
activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, null,
|
||||||
null, null, 1, 1, null, List.of(3), null, null).getRecords().get(0);
|
null, null, 1, 1, Whether.NO.getValue(), List.of(3), null, null).getRecords().get(0);
|
||||||
// 逻辑1---------------------直接新增
|
// 逻辑1---------------------直接新增
|
||||||
longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
||||||
longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||||
@@ -209,7 +208,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
|||||||
adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id
|
adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id
|
||||||
// 对应的诊疗医嘱信息
|
// 对应的诊疗医嘱信息
|
||||||
activityAdviceBaseDto = iDoctorStationAdviceAppService
|
activityAdviceBaseDto = iDoctorStationAdviceAppService
|
||||||
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null)
|
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, Whether.NO.getValue(), List.of(3), null, null)
|
||||||
.getRecords().get(0);
|
.getRecords().get(0);
|
||||||
|
|
||||||
longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
||||||
@@ -349,7 +348,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
|||||||
adviceBaseDto.setAdviceDefinitionId(transferOrganizationDefinitionId); // 医嘱定义id
|
adviceBaseDto.setAdviceDefinitionId(transferOrganizationDefinitionId); // 医嘱定义id
|
||||||
// 转科的医嘱信息
|
// 转科的医嘱信息
|
||||||
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService
|
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService
|
||||||
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null)
|
.getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, Whether.NO.getValue(), List.of(3), null, null)
|
||||||
.getRecords().get(0);
|
.getRecords().get(0);
|
||||||
// 保存转科医嘱请求
|
// 保存转科医嘱请求
|
||||||
ServiceRequest serviceRequest = new ServiceRequest();
|
ServiceRequest serviceRequest = new ServiceRequest();
|
||||||
@@ -401,7 +400,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
|||||||
// 计划出院时间
|
// 计划出院时间
|
||||||
Date endTime = leaveHospitalParam.getEndTime();
|
Date endTime = leaveHospitalParam.getEndTime();
|
||||||
if (endTime == null) {
|
if (endTime == null) {
|
||||||
endTime = new Date();
|
endTime = endTime;
|
||||||
}
|
}
|
||||||
// 就诊id
|
// 就诊id
|
||||||
Long encounterId = leaveHospitalParam.getEncounterId();
|
Long encounterId = leaveHospitalParam.getEncounterId();
|
||||||
@@ -430,12 +429,9 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 出院的医嘱信息
|
// 出院的医嘱信息
|
||||||
List<AdviceBaseDto> adviceList = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null,
|
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null,
|
||||||
List.of(transferOrganizationDefinitionId), null, 1, 1, null, List.of(3), null, null).getRecords();
|
List.of(transferOrganizationDefinitionId), null, 1, 1, Whether.NO.getValue(), List.of(3), null, null).getRecords()
|
||||||
if (CollectionUtils.isEmpty(adviceList)) {
|
.get(0);
|
||||||
return R.fail("未找到出院医嘱定义数据,请确认诊疗目录中已配置出院医嘱");
|
|
||||||
}
|
|
||||||
AdviceBaseDto activityAdviceBaseDto = adviceList.get(0);
|
|
||||||
// 保存出院医嘱请求
|
// 保存出院医嘱请求
|
||||||
ServiceRequest serviceRequest = new ServiceRequest();
|
ServiceRequest serviceRequest = new ServiceRequest();
|
||||||
serviceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
serviceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态
|
||||||
|
|||||||
@@ -143,15 +143,4 @@ public class AdviceManageController {
|
|||||||
return iAdviceManageAppService.stopRegAdvice(paramList);
|
return iAdviceManageAppService.stopRegAdvice(paramList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 住院医嘱取消停嘱(恢复)
|
|
||||||
*
|
|
||||||
* @param paramList 恢复参数
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@PostMapping(value = "/cancel-stop-reg-advice")
|
|
||||||
public R<?> cancelStopRegAdvice(@RequestBody List<AdviceBatchOpParam> paramList) {
|
|
||||||
return iAdviceManageAppService.cancelStopRegAdvice(paramList);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,23 +143,14 @@ public class RequestFormManageController {
|
|||||||
* 查询手术申请单
|
* 查询手术申请单
|
||||||
*
|
*
|
||||||
* @param encounterId 就诊id
|
* @param encounterId 就诊id
|
||||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
|
||||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
|
||||||
* @param status 单据状态(可选)
|
|
||||||
* @param keyword 关键字(可选,申请单号/手术项目名称模糊匹配)
|
|
||||||
* @return 手术申请单
|
* @return 手术申请单
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/get-surgery")
|
@GetMapping(value = "/get-surgery")
|
||||||
public R<?> getSurgeryRequestForm(
|
public R<?> getSurgeryRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||||
@RequestParam(required = false) Long encounterId,
|
|
||||||
@RequestParam(required = false) String startDate,
|
|
||||||
@RequestParam(required = false) String endDate,
|
|
||||||
@RequestParam(required = false) String status,
|
|
||||||
@RequestParam(required = false) String keyword) {
|
|
||||||
if (encounterId == null) {
|
if (encounterId == null) {
|
||||||
return R.fail("就诊ID不能为空");
|
return R.fail("就诊ID不能为空");
|
||||||
}
|
}
|
||||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode(), startDate, endDate, status, keyword));
|
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode()));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗)
|
* 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗)
|
||||||
@@ -203,8 +194,8 @@ public class RequestFormManageController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public R<?> deleteRequestForm(@RequestBody Map<String, Object> data) {
|
public R<?> deleteRequestForm(@RequestBody Map<String, Long> data) {
|
||||||
return iRequestFormManageAppService.deleteRequestForm(parseLong(data.get("requestFormId")));
|
return iRequestFormManageAppService.deleteRequestForm(data.get("requestFormId"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -214,24 +205,7 @@ public class RequestFormManageController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/withdraw")
|
@PostMapping(value = "/withdraw")
|
||||||
public R<?> withdrawRequestForm(@RequestBody Map<String, Object> data) {
|
public R<?> withdrawRequestForm(@RequestBody Map<String, Long> data) {
|
||||||
return iRequestFormManageAppService.withdrawRequestForm(parseLong(data.get("requestFormId")));
|
return iRequestFormManageAppService.withdrawRequestForm(data.get("requestFormId"));
|
||||||
}
|
|
||||||
|
|
||||||
private Long parseLong(Object value) {
|
|
||||||
if (value == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (value instanceof Long) {
|
|
||||||
return (Long) value;
|
|
||||||
}
|
|
||||||
if (value instanceof Number) {
|
|
||||||
return ((Number) value).longValue();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return Long.parseLong(value.toString());
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
package com.openhis.web.regdoctorstation.dto;
|
package com.openhis.web.regdoctorstation.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医嘱批量操作参数类
|
* 医嘱批量操作参数类
|
||||||
*/
|
*/
|
||||||
@@ -24,10 +21,4 @@ public class AdviceBatchOpParam {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long requestId;
|
private Long requestId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 停嘱时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date stopTime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,6 @@ import java.math.BigDecimal;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class RequestFormDetailQueryDto {
|
public class RequestFormDetailQueryDto {
|
||||||
|
|
||||||
/**
|
|
||||||
* 诊疗活动定义ID(wor_service_request.activity_id,与开立检验时项目字典的 id / adviceDefinitionId 一致,用于编辑回显)
|
|
||||||
*/
|
|
||||||
private Long activityId;
|
|
||||||
|
|
||||||
/** 医嘱名称 */
|
/** 医嘱名称 */
|
||||||
private String adviceName;
|
private String adviceName;
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ public class HomeController {
|
|||||||
HomeStatisticsDto statisticsDto = homeStatisticsService.getHomeStatistics();
|
HomeStatisticsDto statisticsDto = homeStatisticsService.getHomeStatistics();
|
||||||
|
|
||||||
// 获取待写病历数量
|
// 获取待写病历数量
|
||||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||||
R<?> pendingEmrCount = doctorStationEmrAppService.getPendingEmrCount(practitionerId, null);
|
R<?> pendingEmrCount = doctorStationEmrAppService.getPendingEmrCount(userId);
|
||||||
|
|
||||||
// 将待写病历数量添加到统计数据中
|
// 将待写病历数量添加到统计数据中
|
||||||
statisticsDto.setPendingEmr((Integer) pendingEmrCount.getData());
|
statisticsDto.setPendingEmr((Integer) pendingEmrCount.getData());
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class TriageQueueAppServiceImpl implements TriageQueueAppService {
|
|||||||
.eq(TriageQueueItem::getTenantId, tenantId)
|
.eq(TriageQueueItem::getTenantId, tenantId)
|
||||||
.eq(TriageQueueItem::getQueueDate, qd)
|
.eq(TriageQueueItem::getQueueDate, qd)
|
||||||
.eq(TriageQueueItem::getDeleteFlag, "0")
|
.eq(TriageQueueItem::getDeleteFlag, "0")
|
||||||
|
.ne(TriageQueueItem::getStatus, TriageQueueStatus.COMPLETED.getValue())
|
||||||
.orderByAsc(TriageQueueItem::getQueueOrder);
|
.orderByAsc(TriageQueueItem::getQueueOrder);
|
||||||
|
|
||||||
// 如果指定了科室,按科室过滤;否则查询所有科室(全科模式)
|
// 如果指定了科室,按科室过滤;否则查询所有科室(全科模式)
|
||||||
@@ -91,6 +92,14 @@ public class TriageQueueAppServiceImpl implements TriageQueueAppService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 双重保险:再次过滤掉 COMPLETED 状态的患者(防止数据库中有异常数据)
|
||||||
|
if (list != null && !list.isEmpty()) {
|
||||||
|
int beforeSize = list.size();
|
||||||
|
list = list.stream()
|
||||||
|
.filter(item -> !TriageQueueStatus.COMPLETED.getValue().equals(item.getStatus()))
|
||||||
|
.collect(java.util.stream.Collectors.toList());
|
||||||
|
}
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
AND (t1.name ILIKE '%' || '${searchKey}' || '%' OR t1.py_str ILIKE '%' || '${searchKey}' || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="adviceDefinitionIdParamList != null and !adviceDefinitionIdParamList.isEmpty()">
|
<if test="adviceDefinitionIdParamList != null and !adviceDefinitionIdParamList.isEmpty()">
|
||||||
AND t1.id IN
|
AND t1.id IN
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
WHERE t1.delete_flag = '0'
|
WHERE t1.delete_flag = '0'
|
||||||
AND t1.status_enum = #{statusEnum}
|
AND t1.status_enum = #{statusEnum}
|
||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
AND (t1.name ILIKE '%' || '${searchKey}' || '%' OR t1.py_str ILIKE '%' || '${searchKey}' || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryCode != null and categoryCode != ''">
|
<if test="categoryCode != null and categoryCode != ''">
|
||||||
AND t1.category_code = #{categoryCode}
|
AND t1.category_code = #{categoryCode}
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
AND T1.category_code != '手术' AND T1.category_code != '24'
|
AND T1.category_code != '手术' AND T1.category_code != '24'
|
||||||
</if>
|
</if>
|
||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
AND (t1.name ILIKE '%' || '${searchKey}' || '%' OR t1.py_str ILIKE '%' || '${searchKey}' || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryCode != null and categoryCode != ''">
|
<if test="categoryCode != null and categoryCode != ''">
|
||||||
AND t1.category_code = #{categoryCode}
|
AND t1.category_code = #{categoryCode}
|
||||||
@@ -516,7 +516,6 @@
|
|||||||
T1.patient_id AS patient_id,
|
T1.patient_id AS patient_id,
|
||||||
'med_medication_definition' AS advice_table_name,
|
'med_medication_definition' AS advice_table_name,
|
||||||
T1.medication_id AS advice_definition_id
|
T1.medication_id AS advice_definition_id
|
||||||
, T1.back_reason AS reason_text
|
|
||||||
FROM med_medication_request AS T1
|
FROM med_medication_request AS T1
|
||||||
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
||||||
AND T2.delete_flag = '0'
|
AND T2.delete_flag = '0'
|
||||||
@@ -578,7 +577,6 @@
|
|||||||
T1.patient_id AS patient_id,
|
T1.patient_id AS patient_id,
|
||||||
'med_medication_definition' AS advice_table_name,
|
'med_medication_definition' AS advice_table_name,
|
||||||
T3.ID AS advice_definition_id
|
T3.ID AS advice_definition_id
|
||||||
, T2.back_reason AS reason_text
|
|
||||||
FROM adm_charge_item AS T1
|
FROM adm_charge_item AS T1
|
||||||
INNER JOIN med_medication_request AS T2 ON T2.ID = T1.service_id AND T2.delete_flag = '0'
|
INNER JOIN med_medication_request AS T2 ON T2.ID = T1.service_id AND T2.delete_flag = '0'
|
||||||
LEFT JOIN med_medication_definition AS T3 ON T3.ID = T2.medication_id AND T3.delete_flag = '0'
|
LEFT JOIN med_medication_definition AS T3 ON T3.ID = T2.medication_id AND T3.delete_flag = '0'
|
||||||
@@ -586,9 +584,6 @@
|
|||||||
WHERE T1.delete_flag = '0'
|
WHERE T1.delete_flag = '0'
|
||||||
AND T1.service_table = #{MED_MEDICATION_REQUEST}
|
AND T1.service_table = #{MED_MEDICATION_REQUEST}
|
||||||
<if test="historyFlag == '0'.toString()">
|
<if test="historyFlag == '0'.toString()">
|
||||||
<if test="generateSourceEnum != null">
|
|
||||||
AND (T2.generate_source_enum IS NULL OR T2.generate_source_enum = #{generateSourceEnum})
|
|
||||||
</if>
|
|
||||||
AND T1.encounter_id = #{encounterId}
|
AND T1.encounter_id = #{encounterId}
|
||||||
</if>
|
</if>
|
||||||
<if test="historyFlag == '1'.toString()">
|
<if test="historyFlag == '1'.toString()">
|
||||||
@@ -642,7 +637,6 @@
|
|||||||
CI.patient_id AS patient_id,
|
CI.patient_id AS patient_id,
|
||||||
'adm_device_definition' AS advice_table_name,
|
'adm_device_definition' AS advice_table_name,
|
||||||
CI.product_id AS advice_definition_id
|
CI.product_id AS advice_definition_id
|
||||||
, NULL AS reason_text
|
|
||||||
FROM adm_charge_item AS CI
|
FROM adm_charge_item AS CI
|
||||||
LEFT JOIN adm_charge_item_definition CID ON CID.id = CI.definition_id AND CID.delete_flag = '0'
|
LEFT JOIN adm_charge_item_definition CID ON CID.id = CI.definition_id AND CID.delete_flag = '0'
|
||||||
LEFT JOIN wor_device_request DR ON DR.id = CI.service_id AND DR.delete_flag = '0'
|
LEFT JOIN wor_device_request DR ON DR.id = CI.service_id AND DR.delete_flag = '0'
|
||||||
@@ -697,7 +691,6 @@
|
|||||||
T1.patient_id AS patient_id,
|
T1.patient_id AS patient_id,
|
||||||
'adm_device_definition' AS advice_table_name,
|
'adm_device_definition' AS advice_table_name,
|
||||||
T1.device_def_id AS advice_definition_id
|
T1.device_def_id AS advice_definition_id
|
||||||
, NULL AS reason_text
|
|
||||||
FROM wor_device_request AS T1
|
FROM wor_device_request AS T1
|
||||||
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
||||||
AND T2.delete_flag = '0'
|
AND T2.delete_flag = '0'
|
||||||
@@ -754,7 +747,6 @@
|
|||||||
T1.patient_id AS patient_id,
|
T1.patient_id AS patient_id,
|
||||||
'wor_activity_definition' AS advice_table_name,
|
'wor_activity_definition' AS advice_table_name,
|
||||||
T1.activity_id AS advice_definition_id
|
T1.activity_id AS advice_definition_id
|
||||||
, T1.reason_text AS reason_text
|
|
||||||
FROM wor_service_request AS T1
|
FROM wor_service_request AS T1
|
||||||
LEFT JOIN wor_activity_definition AS T2
|
LEFT JOIN wor_activity_definition AS T2
|
||||||
ON T2.ID = T1.activity_id
|
ON T2.ID = T1.activity_id
|
||||||
@@ -879,7 +871,6 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 手术项目专用分页查询:仅查手术 + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
<!-- 手术项目专用分页查询:仅查手术 + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||||
<!-- 使用 LIMIT/OFFSET 直接查询,避免 MyBatis Plus 分页插件的 COUNT 开销 -->
|
|
||||||
<select id="getSurgeryPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
<select id="getSurgeryPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||||
SELECT DISTINCT ON (t1.ID)
|
SELECT DISTINCT ON (t1.ID)
|
||||||
t1.ID AS advice_definition_id,
|
t1.ID AS advice_definition_id,
|
||||||
@@ -902,15 +893,15 @@
|
|||||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
||||||
|
LIMIT #{page.size} OFFSET ${(page.current - 1) * page.size}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 检查/检验项目专用分页查询:仅查指定 category_code + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
<!-- 检查项目专用分页查询:仅查检查(23) + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||||
<select id="getExaminationPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
<select id="getExaminationPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||||
SELECT DISTINCT ON (t1.ID)
|
SELECT DISTINCT ON (t1.ID)
|
||||||
t1.ID AS advice_definition_id,
|
t1.ID AS advice_definition_id,
|
||||||
t1.NAME AS advice_name,
|
t1.NAME AS advice_name,
|
||||||
t1.org_id AS org_id,
|
t1.org_id AS org_id,
|
||||||
t3.name AS org_name,
|
|
||||||
t1.org_id AS position_id,
|
t1.org_id AS position_id,
|
||||||
t2.ID AS charge_item_definition_id,
|
t2.ID AS charge_item_definition_id,
|
||||||
t2.price AS price,
|
t2.price AS price,
|
||||||
@@ -922,11 +913,8 @@
|
|||||||
AND t2.delete_flag = '0'
|
AND t2.delete_flag = '0'
|
||||||
AND t2.status_enum = #{statusEnum}
|
AND t2.status_enum = #{statusEnum}
|
||||||
AND t2.instance_table = 'wor_activity_definition'
|
AND t2.instance_table = 'wor_activity_definition'
|
||||||
LEFT JOIN adm_organization t3
|
|
||||||
ON t3.id = t1.org_id
|
|
||||||
AND t3.delete_flag = '0'
|
|
||||||
WHERE t1.delete_flag = '0'
|
WHERE t1.delete_flag = '0'
|
||||||
AND t1.category_code = #{categoryCode}
|
AND t1.category_code = '23'
|
||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -4,38 +4,4 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.openhis.web.doctorstation.mapper.DoctorStationEmrAppMapper">
|
<mapper namespace="com.openhis.web.doctorstation.mapper.DoctorStationEmrAppMapper">
|
||||||
|
|
||||||
<select id="getPendingEmrList" resultType="java.util.HashMap">
|
</mapper>
|
||||||
SELECT e.id AS "encounterId",
|
|
||||||
e.patient_id AS "patientId",
|
|
||||||
p.name AS "patientName",
|
|
||||||
p.gender_enum AS "gender",
|
|
||||||
p.birth_date AS "birthDate",
|
|
||||||
e.create_time AS "registerTime",
|
|
||||||
e.bus_no AS "busNo"
|
|
||||||
FROM adm_encounter e
|
|
||||||
INNER JOIN adm_encounter_participant ep ON e.id = ep.encounter_id AND ep.practitioner_id = #{doctorId}
|
|
||||||
LEFT JOIN adm_patient p ON e.patient_id = p.id
|
|
||||||
LEFT JOIN doc_emr emr ON e.id = emr.encounter_id
|
|
||||||
WHERE e.status_enum = 2
|
|
||||||
AND emr.id IS NULL
|
|
||||||
<if test="patientName != null and patientName != ''">
|
|
||||||
AND p.name LIKE CONCAT('%', #{patientName}, '%')
|
|
||||||
</if>
|
|
||||||
ORDER BY e.create_time DESC
|
|
||||||
LIMIT #{pageSize} OFFSET #{offset}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getPendingEmrCount" resultType="java.lang.Long">
|
|
||||||
SELECT COUNT(*)
|
|
||||||
FROM adm_encounter e
|
|
||||||
INNER JOIN adm_encounter_participant ep ON e.id = ep.encounter_id AND ep.practitioner_id = #{doctorId}
|
|
||||||
LEFT JOIN adm_patient p ON e.patient_id = p.id
|
|
||||||
LEFT JOIN doc_emr emr ON e.id = emr.encounter_id
|
|
||||||
WHERE e.status_enum = 2
|
|
||||||
AND emr.id IS NULL
|
|
||||||
<if test="patientName != null and patientName != ''">
|
|
||||||
AND p.name LIKE CONCAT('%', #{patientName}, '%')
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -11,10 +11,6 @@
|
|||||||
p.birth_date,
|
p.birth_date,
|
||||||
p.phone,
|
p.phone,
|
||||||
p.address,
|
p.address,
|
||||||
p.address_province,
|
|
||||||
p.address_city,
|
|
||||||
p.address_district,
|
|
||||||
p.address_street,
|
|
||||||
p.work_company,
|
p.work_company,
|
||||||
p.nationality_code,
|
p.nationality_code,
|
||||||
p.marital_status_enum,
|
p.marital_status_enum,
|
||||||
|
|||||||
@@ -214,13 +214,10 @@
|
|||||||
T1.dispense_per_duration AS dispense_per_duration,
|
T1.dispense_per_duration AS dispense_per_duration,
|
||||||
T2.part_percent AS part_percent,
|
T2.part_percent AS part_percent,
|
||||||
ccd.name AS condition_definition_name,
|
ccd.name AS condition_definition_name,
|
||||||
T1.effective_dose_start AS start_time,
|
|
||||||
T1.therapy_enum AS therapyEnum,
|
T1.therapy_enum AS therapyEnum,
|
||||||
T1.sort_number AS sort_number,
|
T1.sort_number AS sort_number,
|
||||||
T1.based_on_id AS based_on_id,
|
T1.based_on_id AS based_on_id,
|
||||||
T1.medication_id AS advice_definition_id
|
T1.medication_id AS advice_definition_id
|
||||||
T1.effective_dose_end AS stop_time,
|
|
||||||
T1.update_by AS stop_user_name
|
|
||||||
FROM med_medication_request AS T1
|
FROM med_medication_request AS T1
|
||||||
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
|
||||||
AND T2.delete_flag = '0'
|
AND T2.delete_flag = '0'
|
||||||
@@ -272,11 +269,8 @@
|
|||||||
'' AS condition_definition_name,
|
'' AS condition_definition_name,
|
||||||
2 AS therapyEnum,
|
2 AS therapyEnum,
|
||||||
99 AS sort_number,
|
99 AS sort_number,
|
||||||
T1.req_authored_time AS start_time,
|
|
||||||
T1.based_on_id AS based_on_id,
|
T1.based_on_id AS based_on_id,
|
||||||
T1.device_def_id AS advice_definition_id
|
T1.device_def_id AS advice_definition_id
|
||||||
NULL AS stop_time,
|
|
||||||
'' AS stop_user_name
|
|
||||||
FROM wor_device_request AS T1
|
FROM wor_device_request AS T1
|
||||||
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
|
||||||
AND T2.delete_flag = '0'
|
AND T2.delete_flag = '0'
|
||||||
@@ -325,11 +319,8 @@
|
|||||||
'' AS condition_definition_name,
|
'' AS condition_definition_name,
|
||||||
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
||||||
99 AS sort_number,
|
99 AS sort_number,
|
||||||
T1.occurrence_start_time AS start_time,
|
|
||||||
T1.based_on_id AS based_on_id,
|
T1.based_on_id AS based_on_id,
|
||||||
T1.activity_id AS advice_definition_id
|
T1.activity_id AS advice_definition_id
|
||||||
T1.occurrence_end_time AS stop_time,
|
|
||||||
T1.update_by AS stop_user_name
|
|
||||||
FROM wor_service_request AS T1
|
FROM wor_service_request AS T1
|
||||||
LEFT JOIN wor_activity_definition AS T2
|
LEFT JOIN wor_activity_definition AS T2
|
||||||
ON T2.ID = T1.activity_id
|
ON T2.ID = T1.activity_id
|
||||||
|
|||||||
@@ -35,36 +35,21 @@
|
|||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||||
AND ws.status_enum = 8
|
AND ws.status_enum = 8
|
||||||
) THEN 6
|
) THEN 6
|
||||||
WHEN EXISTS (
|
|
||||||
SELECT 1 FROM wor_service_request ws
|
|
||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
|
||||||
AND ws.status_enum = 5
|
|
||||||
) THEN 7
|
|
||||||
WHEN EXISTS (
|
WHEN EXISTS (
|
||||||
SELECT 1 FROM wor_service_request ws
|
SELECT 1 FROM wor_service_request ws
|
||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||||
AND ws.status_enum = 3
|
AND ws.status_enum = 3
|
||||||
) THEN 5
|
) THEN 5
|
||||||
WHEN EXISTS (
|
|
||||||
SELECT 1 FROM wor_service_request ws
|
|
||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
|
||||||
AND ws.status_enum = 12
|
|
||||||
) THEN 4
|
|
||||||
WHEN EXISTS (
|
|
||||||
SELECT 1 FROM wor_service_request ws
|
|
||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
|
||||||
AND ws.status_enum = 11
|
|
||||||
) THEN 3
|
|
||||||
WHEN EXISTS (
|
|
||||||
SELECT 1 FROM wor_service_request ws
|
|
||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
|
||||||
AND ws.status_enum = 10
|
|
||||||
) THEN 2
|
|
||||||
WHEN EXISTS (
|
WHEN EXISTS (
|
||||||
SELECT 1 FROM wor_service_request ws
|
SELECT 1 FROM wor_service_request ws
|
||||||
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||||
AND ws.status_enum = 2
|
AND ws.status_enum = 2
|
||||||
) THEN 1
|
) THEN 1
|
||||||
|
WHEN EXISTS (
|
||||||
|
SELECT 1 FROM wor_service_request ws
|
||||||
|
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
|
||||||
|
AND ws.status_enum = 5
|
||||||
|
) THEN 7
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END AS computed_status
|
END AS computed_status
|
||||||
FROM doc_request_form AS drf
|
FROM doc_request_form AS drf
|
||||||
@@ -72,6 +57,8 @@
|
|||||||
AND ae.delete_flag = '0'
|
AND ae.delete_flag = '0'
|
||||||
LEFT JOIN adm_patient AS ap ON ap.ID = ae.patient_id
|
LEFT JOIN adm_patient AS ap ON ap.ID = ae.patient_id
|
||||||
AND ap.delete_flag = '0'
|
AND ap.delete_flag = '0'
|
||||||
|
LEFT JOIN wor_service_request AS wsr ON wsr.prescription_no = drf.prescription_no
|
||||||
|
AND wsr.delete_flag = '0'
|
||||||
WHERE drf.delete_flag = '0'
|
WHERE drf.delete_flag = '0'
|
||||||
AND drf.encounter_id = #{encounterId}
|
AND drf.encounter_id = #{encounterId}
|
||||||
AND drf.type_code = #{typeCode}
|
AND drf.type_code = #{typeCode}
|
||||||
|
|||||||
@@ -768,4 +768,36 @@ public class CommonConstants {
|
|||||||
Integer ACCOUNT_DEVICE_TYPE = 6;
|
Integer ACCOUNT_DEVICE_TYPE = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源槽位状态 (adm_schedule_slot.status)
|
||||||
|
*/
|
||||||
|
public interface SlotStatus {
|
||||||
|
/** 可用 / 待预约 */
|
||||||
|
Integer AVAILABLE = 0;
|
||||||
|
/** 已预约 */
|
||||||
|
Integer BOOKED = 1;
|
||||||
|
/** 已取消 / 已停诊 */
|
||||||
|
Integer CANCELLED = 2;
|
||||||
|
/** 已签到 / 已取号 */
|
||||||
|
Integer CHECKED_IN = 3;
|
||||||
|
/** 已锁定 */
|
||||||
|
Integer LOCKED = 4;
|
||||||
|
/** 已退号 */
|
||||||
|
Integer RETURNED = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单状态 (order_main.status)
|
||||||
|
*/
|
||||||
|
public interface AppointmentOrderStatus {
|
||||||
|
/** 已预约 (待就诊) */
|
||||||
|
Integer BOOKED = 1;
|
||||||
|
/** 已取号 (已就诊) */
|
||||||
|
Integer CHECKED_IN = 2;
|
||||||
|
/** 已取消 */
|
||||||
|
Integer CANCELLED = 3;
|
||||||
|
/** 已退号 */
|
||||||
|
Integer RETURNED = 4;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,10 +274,6 @@ public enum AssignSeqEnum {
|
|||||||
* 检查申请单号(住院)
|
* 检查申请单号(住院)
|
||||||
*/
|
*/
|
||||||
CHECK_APPLY_NO("72", "检查申请单号", "JCZ"),
|
CHECK_APPLY_NO("72", "检查申请单号", "JCZ"),
|
||||||
/**
|
|
||||||
* 手术申请单号(住院)
|
|
||||||
*/
|
|
||||||
SURGERY_APPLY_NO("73", "手术申请单号", "SSZ"),
|
|
||||||
/**
|
/**
|
||||||
* b 病历文书
|
* b 病历文书
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -57,22 +57,7 @@ public enum RequestStatus implements HisEnumInterface {
|
|||||||
/**
|
/**
|
||||||
* 未知
|
* 未知
|
||||||
*/
|
*/
|
||||||
UNKNOWN(9, "unknown", "未知"),
|
UNKNOWN(9, "unknown", "未知");
|
||||||
|
|
||||||
/**
|
|
||||||
* 已校对(检查申请:护士校对通过)
|
|
||||||
*/
|
|
||||||
CHECK_VERIFIED(10, "check_verified", "已校对"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 待接收(检查申请:等待医技科室接单)
|
|
||||||
*/
|
|
||||||
PENDING_RECEIVE(11, "pending_receive", "待接收"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 已接收(检查申请:医技科室已接单)
|
|
||||||
*/
|
|
||||||
CHECK_RECEIVED(12, "check_received", "已接收");
|
|
||||||
|
|
||||||
@EnumValue
|
@EnumValue
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.openhis.common.enums;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 号源槽位状态 (adm_schedule_slot.status)
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* 状态流转:
|
|
||||||
* 预约 → 0→2 (锁定), locked_num+1
|
|
||||||
* 取消预约 → 2→0 (释放), locked_num-1
|
|
||||||
* 签到 → 2→1 (已约), locked_num-1, booked_num+1
|
|
||||||
* 退号 → 1→0 (释放), booked_num-1
|
|
||||||
* 停诊 → 任意→4 (已取消)
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author system
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum SlotStatus implements HisEnumInterface {
|
|
||||||
|
|
||||||
/** 可用 / 待预约 */
|
|
||||||
AVAILABLE(0, "available", "可用"),
|
|
||||||
|
|
||||||
/** 已预约 */
|
|
||||||
BOOKED(1, "booked", "已预约"),
|
|
||||||
|
|
||||||
/** 已锁定 (约而不付:预约后锁定号源) */
|
|
||||||
LOCKED(2, "locked", "已锁定"),
|
|
||||||
|
|
||||||
/** 已签到 / 已取号 */
|
|
||||||
CHECKED_IN(3, "checked_in", "已签到"),
|
|
||||||
|
|
||||||
/** 已取消 / 已停诊 */
|
|
||||||
CANCELLED(4, "cancelled", "已取消"),
|
|
||||||
|
|
||||||
/** 已退号 */
|
|
||||||
RETURNED(5, "returned", "已退号");
|
|
||||||
|
|
||||||
private final Integer value;
|
|
||||||
private final String code;
|
|
||||||
private final String info;
|
|
||||||
|
|
||||||
public static SlotStatus getByValue(Integer value) {
|
|
||||||
if (value == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
for (SlotStatus val : values()) {
|
|
||||||
if (val.getValue().equals(value)) {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -36,14 +36,6 @@ public interface IOrganizationLocationService extends IService<OrganizationLocat
|
|||||||
* @param activityDefinitionId 诊疗定义id
|
* @param activityDefinitionId 诊疗定义id
|
||||||
* @return 诊疗的执行科室列表
|
* @return 诊疗的执行科室列表
|
||||||
*/
|
*/
|
||||||
List<OrganizationLocation> getOrgLocListByOrgIdAndActivityDefinitionId(Long organizationId, Long activityDefinitionId);
|
List<OrganizationLocation> getOrgLocListByOrgIdAndActivityDefinitionId(Long activityDefinitionId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据诊疗定义id查询所有执行科室列表(跨科室)
|
|
||||||
*
|
|
||||||
* @param activityDefinitionId 诊疗定义id
|
|
||||||
* @return 执行科室列表
|
|
||||||
*/
|
|
||||||
List<OrganizationLocation> getOrgLocListByActivityDefinitionId(Long activityDefinitionId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -53,25 +53,11 @@ public class OrganizationLocationServiceImpl extends ServiceImpl<OrganizationLoc
|
|||||||
/**
|
/**
|
||||||
* 查询诊疗的执行科室列表
|
* 查询诊疗的执行科室列表
|
||||||
*
|
*
|
||||||
* @param organizationId 机构id
|
|
||||||
* @param activityDefinitionId 诊疗定义id
|
* @param activityDefinitionId 诊疗定义id
|
||||||
* @return 诊疗的执行科室列表
|
* @return 诊疗的执行科室列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OrganizationLocation> getOrgLocListByOrgIdAndActivityDefinitionId(Long organizationId, Long activityDefinitionId) {
|
public List<OrganizationLocation> getOrgLocListByOrgIdAndActivityDefinitionId(Long activityDefinitionId) {
|
||||||
return baseMapper.selectList(new LambdaQueryWrapper<OrganizationLocation>()
|
|
||||||
.eq(OrganizationLocation::getOrganizationId, organizationId)
|
|
||||||
.eq(OrganizationLocation::getActivityDefinitionId, activityDefinitionId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据诊疗定义id查询所有执行科室列表(跨科室)
|
|
||||||
*
|
|
||||||
* @param activityDefinitionId 诊疗定义id
|
|
||||||
* @return 执行科室列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<OrganizationLocation> getOrgLocListByActivityDefinitionId(Long activityDefinitionId) {
|
|
||||||
return baseMapper.selectList(new LambdaQueryWrapper<OrganizationLocation>()
|
return baseMapper.selectList(new LambdaQueryWrapper<OrganizationLocation>()
|
||||||
.eq(OrganizationLocation::getActivityDefinitionId, activityDefinitionId));
|
.eq(OrganizationLocation::getActivityDefinitionId, activityDefinitionId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,10 @@ import org.springframework.stereotype.Repository;
|
|||||||
public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
|
public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按号源池实时重算统计值。
|
* 按号源池实时重算统计值,避免并发场景下计数漂移。
|
||||||
*
|
*
|
||||||
* @param poolId 号源池ID
|
* 说明:available_num 在当前项目中可能为数据库生成列,因此这里仅维护
|
||||||
* @param bookedStatus 已约状态值,由 SlotStatus.BOOKED.getValue() 传入
|
* booked_num / locked_num,剩余号由数据库或查询逻辑计算。
|
||||||
* @param lockedStatus 锁定状态值,由 SlotStatus.LOCKED.getValue() 传入
|
|
||||||
*/
|
*/
|
||||||
@Update("""
|
@Update("""
|
||||||
UPDATE adm_schedule_pool p
|
UPDATE adm_schedule_pool p
|
||||||
@@ -24,22 +23,20 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
|
|||||||
FROM adm_schedule_slot s
|
FROM adm_schedule_slot s
|
||||||
WHERE s.pool_id = p.id
|
WHERE s.pool_id = p.id
|
||||||
AND s.delete_flag = '0'
|
AND s.delete_flag = '0'
|
||||||
AND s.status = #{bookedStatus}
|
AND s.status = 1
|
||||||
), 0),
|
), 0),
|
||||||
locked_num = COALESCE((
|
locked_num = COALESCE((
|
||||||
SELECT COUNT(1)
|
SELECT COUNT(1)
|
||||||
FROM adm_schedule_slot s
|
FROM adm_schedule_slot s
|
||||||
WHERE s.pool_id = p.id
|
WHERE s.pool_id = p.id
|
||||||
AND s.delete_flag = '0'
|
AND s.delete_flag = '0'
|
||||||
AND s.status = #{lockedStatus}
|
AND s.status = 3
|
||||||
), 0),
|
), 0),
|
||||||
update_time = now()
|
update_time = now()
|
||||||
WHERE p.id = #{poolId}
|
WHERE p.id = #{poolId}
|
||||||
AND p.delete_flag = '0'
|
AND p.delete_flag = '0'
|
||||||
""")
|
""")
|
||||||
int refreshPoolStats(@Param("poolId") Long poolId,
|
int refreshPoolStats(@Param("poolId") Long poolId);
|
||||||
@Param("bookedStatus") Integer bookedStatus,
|
|
||||||
@Param("lockedStatus") Integer lockedStatus);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签到时更新号源池统计:锁定数-1,已预约数+1
|
* 签到时更新号源池统计:锁定数-1,已预约数+1
|
||||||
|
|||||||
@@ -22,12 +22,9 @@ public interface ScheduleSlotMapper extends BaseMapper<ScheduleSlot> {
|
|||||||
TicketSlotDTO selectTicketSlotById(@Param("id") Long id);
|
TicketSlotDTO selectTicketSlotById(@Param("id") Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 原子抢占槽位:仅当当前状态=0(待约)时,更新为目标锁定状态。
|
* 原子抢占槽位:仅当当前状态=0(可用)时,更新为1(已预约)。
|
||||||
*
|
|
||||||
* @param slotId 槽位ID
|
|
||||||
* @param lockedStatus 锁定状态值,由 SlotStatus.LOCKED.getValue() 传入
|
|
||||||
*/
|
*/
|
||||||
int lockSlotForBooking(@Param("slotId") Long slotId, @Param("lockedStatus") Integer lockedStatus);
|
int lockSlotForBooking(@Param("slotId") Long slotId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按主键更新槽位状态。
|
* 按主键更新槽位状态。
|
||||||
@@ -37,16 +34,12 @@ public interface ScheduleSlotMapper extends BaseMapper<ScheduleSlot> {
|
|||||||
/**
|
/**
|
||||||
* 更新槽位状态并记录签到时间
|
* 更新槽位状态并记录签到时间
|
||||||
*
|
*
|
||||||
* @param slotId 槽位ID
|
* @param slotId 槽位ID
|
||||||
* @param status 目标状态,由 SlotStatus.BOOKED.getValue() 传入
|
* @param status 状态
|
||||||
* @param checkInTime 签到时间
|
* @param checkInTime 签到时间
|
||||||
* @param requiredStatus 前置状态,由 SlotStatus.LOCKED.getValue() 传入
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateSlotStatusAndCheckInTime(@Param("slotId") Long slotId,
|
int updateSlotStatusAndCheckInTime(@Param("slotId") Long slotId, @Param("status") Integer status, @Param("checkInTime") Date checkInTime);
|
||||||
@Param("status") Integer status,
|
|
||||||
@Param("checkInTime") Date checkInTime,
|
|
||||||
@Param("requiredStatus") Integer requiredStatus);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据槽位ID查询所属号源池ID。
|
* 根据槽位ID查询所属号源池ID。
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package com.openhis.clinical.service.impl;
|
package com.openhis.clinical.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.openhis.appointmentmanage.domain.AppointmentConfig;
|
import com.openhis.appointmentmanage.domain.AppointmentConfig;
|
||||||
import com.openhis.appointmentmanage.service.IAppointmentConfigService;
|
import com.openhis.appointmentmanage.service.IAppointmentConfigService;
|
||||||
import com.openhis.appointmentmanage.domain.TicketSlotDTO;
|
import com.openhis.appointmentmanage.domain.TicketSlotDTO;
|
||||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
|
||||||
import com.openhis.appointmentmanage.domain.ScheduleSlot;
|
import com.openhis.appointmentmanage.domain.ScheduleSlot;
|
||||||
import com.openhis.appointmentmanage.mapper.SchedulePoolMapper;
|
import com.openhis.appointmentmanage.mapper.SchedulePoolMapper;
|
||||||
import com.openhis.appointmentmanage.mapper.ScheduleSlotMapper;
|
import com.openhis.appointmentmanage.mapper.ScheduleSlotMapper;
|
||||||
@@ -15,7 +13,7 @@ import com.openhis.clinical.domain.Ticket;
|
|||||||
import com.openhis.clinical.mapper.TicketMapper;
|
import com.openhis.clinical.mapper.TicketMapper;
|
||||||
import com.openhis.clinical.service.IOrderService;
|
import com.openhis.clinical.service.IOrderService;
|
||||||
import com.openhis.clinical.service.ITicketService;
|
import com.openhis.clinical.service.ITicketService;
|
||||||
import com.openhis.common.enums.SlotStatus;
|
import com.openhis.common.constant.CommonConstants.SlotStatus;
|
||||||
import com.openhis.common.enums.OrderStatus;
|
import com.openhis.common.enums.OrderStatus;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -179,7 +177,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
logger.error("安全拦截:号源底库核对失败,slotId: {}", slotId);
|
logger.error("安全拦截:号源底库核对失败,slotId: {}", slotId);
|
||||||
throw new RuntimeException("号源数据不存在");
|
throw new RuntimeException("号源数据不存在");
|
||||||
}
|
}
|
||||||
if (slot.getSlotStatus() != null && SlotStatus.getByValue(slot.getSlotStatus()) != SlotStatus.AVAILABLE) {
|
if (slot.getSlotStatus() != null && !SlotStatus.AVAILABLE.equals(slot.getSlotStatus())) {
|
||||||
throw new RuntimeException("手慢了!该号源已刚刚被他人抢占");
|
throw new RuntimeException("手慢了!该号源已刚刚被他人抢占");
|
||||||
}
|
}
|
||||||
if (Boolean.TRUE.equals(slot.getIsStopped())) {
|
if (Boolean.TRUE.equals(slot.getIsStopped())) {
|
||||||
@@ -207,7 +205,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 原子抢占:避免并发下同一槽位被重复预约
|
// 原子抢占:避免并发下同一槽位被重复预约
|
||||||
int lockRows = scheduleSlotMapper.lockSlotForBooking(slotId, SlotStatus.LOCKED.getValue());
|
int lockRows = scheduleSlotMapper.lockSlotForBooking(slotId);
|
||||||
if (lockRows <= 0) {
|
if (lockRows <= 0) {
|
||||||
throw new RuntimeException("手慢了!该号源已刚刚被他人抢占");
|
throw new RuntimeException("手慢了!该号源已刚刚被他人抢占");
|
||||||
}
|
}
|
||||||
@@ -262,15 +260,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
throw new RuntimeException("预约成功但号源回填订单失败,请重试");
|
throw new RuntimeException("预约成功但号源回填订单失败,请重试");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. 预约成功后 locked_num+1(原子递增替代全量 recount,避免并发计数漂移)
|
refreshPoolStatsBySlotId(slotId);
|
||||||
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
|
|
||||||
if (poolId != null) {
|
|
||||||
schedulePoolMapper.update(null,
|
|
||||||
new LambdaUpdateWrapper<SchedulePool>()
|
|
||||||
.setSql("locked_num = locked_num + 1, version = version + 1")
|
|
||||||
.set(SchedulePool::getUpdateTime, new Date())
|
|
||||||
.eq(SchedulePool::getId, poolId));
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,8 +277,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
if (slot == null) {
|
if (slot == null) {
|
||||||
throw new RuntimeException("号源槽位不存在");
|
throw new RuntimeException("号源槽位不存在");
|
||||||
}
|
}
|
||||||
// 只有锁定态(2)的号源可以取消预约
|
if (slot.getSlotStatus() == null || !SlotStatus.BOOKED.equals(slot.getSlotStatus())) {
|
||||||
if (slot.getSlotStatus() == null || SlotStatus.getByValue(slot.getSlotStatus()) != SlotStatus.LOCKED) {
|
|
||||||
throw new RuntimeException("号源不可取消预约");
|
throw new RuntimeException("号源不可取消预约");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,7 +292,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
orderService.cancelAppointmentOrder(order.getId(), "患者取消预约");
|
orderService.cancelAppointmentOrder(order.getId(), "患者取消预约");
|
||||||
}
|
}
|
||||||
|
|
||||||
int updated = scheduleSlotMapper.updateSlotStatus(slotId, SlotStatus.AVAILABLE.getValue());
|
int updated = scheduleSlotMapper.updateSlotStatus(slotId, SlotStatus.AVAILABLE);
|
||||||
if (updated > 0) {
|
if (updated > 0) {
|
||||||
refreshPoolStatsBySlotId(slotId);
|
refreshPoolStatsBySlotId(slotId);
|
||||||
}
|
}
|
||||||
@@ -329,14 +318,11 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
orderService.updateOrderStatusById(latestOrder.getId(), OrderStatus.ACTIVE.getValue());
|
orderService.updateOrderStatusById(latestOrder.getId(), OrderStatus.ACTIVE.getValue());
|
||||||
orderMapper.updatePayStatus(latestOrder.getId(), 1, new Date());
|
orderMapper.updatePayStatus(latestOrder.getId(), 1, new Date());
|
||||||
|
|
||||||
// 2. 只有锁定态(2)的号源才能签到,签到时 2→1(LOCKED→BOOKED)
|
// 2. 查询号源槽位信息
|
||||||
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
|
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
|
||||||
if (slot == null || !SlotStatus.LOCKED.getValue().equals(slot.getStatus())) {
|
|
||||||
throw new RuntimeException("号源状态异常,无法签到");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 更新号源槽位状态 2→1(LOCKED→BOOKED,已预约=已签到)
|
// 3. 更新号源槽位状态为已签到,记录签到时间
|
||||||
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.BOOKED.getValue(), new Date(), SlotStatus.LOCKED.getValue());
|
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.CHECKED_IN, new Date());
|
||||||
|
|
||||||
// 4. 更新号源池统计:锁定数-1,已预约数+1
|
// 4. 更新号源池统计:锁定数-1,已预约数+1
|
||||||
if (slot != null && slot.getPoolId() != null) {
|
if (slot != null && slot.getPoolId() != null) {
|
||||||
@@ -365,7 +351,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
orderService.cancelAppointmentOrder(order.getId(), "医生停诊");
|
orderService.cancelAppointmentOrder(order.getId(), "医生停诊");
|
||||||
}
|
}
|
||||||
|
|
||||||
int updated = scheduleSlotMapper.updateSlotStatus(slotId, SlotStatus.CANCELLED.getValue());
|
int updated = scheduleSlotMapper.updateSlotStatus(slotId, SlotStatus.CANCELLED);
|
||||||
if (updated > 0) {
|
if (updated > 0) {
|
||||||
refreshPoolStatsBySlotId(slotId);
|
refreshPoolStatsBySlotId(slotId);
|
||||||
}
|
}
|
||||||
@@ -378,7 +364,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||||||
private void refreshPoolStatsBySlotId(Long slotId) {
|
private void refreshPoolStatsBySlotId(Long slotId) {
|
||||||
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
|
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
|
||||||
if (poolId != null) {
|
if (poolId != null) {
|
||||||
schedulePoolMapper.refreshPoolStats(poolId, SlotStatus.BOOKED.getValue(), SlotStatus.LOCKED.getValue());
|
schedulePoolMapper.refreshPoolStats(poolId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,9 +111,6 @@ public class MedicationRequest extends HisBaseEntity {
|
|||||||
/** 支持用药信息 */
|
/** 支持用药信息 */
|
||||||
private String supportInfo;
|
private String supportInfo;
|
||||||
|
|
||||||
/** 退回原因 */
|
|
||||||
private String backReason;
|
|
||||||
|
|
||||||
/** 请求开始时间 */
|
/** 请求开始时间 */
|
||||||
private Date reqAuthoredTime;
|
private Date reqAuthoredTime;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public interface IMedicationRequestService extends IService<MedicationRequest> {
|
|||||||
* @param practitionerId 校对人
|
* @param practitionerId 校对人
|
||||||
* @param checkDate 校对时间
|
* @param checkDate 校对时间
|
||||||
*/
|
*/
|
||||||
void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate, String backReason);
|
void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新请求状态:取消
|
* 更新请求状态:取消
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestM
|
|||||||
* @param checkDate 校对时间
|
* @param checkDate 校对时间
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate, String backReason) {
|
public void updateDraftStatusBatch(List<Long> requestIdList, Long practitionerId, Date checkDate) {
|
||||||
LambdaUpdateWrapper<MedicationRequest> updateWrapper =
|
LambdaUpdateWrapper<MedicationRequest> updateWrapper =
|
||||||
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList)
|
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, requestIdList)
|
||||||
.set(MedicationRequest::getStatusEnum, RequestStatus.DRAFT.getValue());
|
.set(MedicationRequest::getStatusEnum, RequestStatus.DRAFT.getValue());
|
||||||
@@ -54,9 +54,6 @@ public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestM
|
|||||||
if (checkDate != null) {
|
if (checkDate != null) {
|
||||||
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
||||||
}
|
}
|
||||||
if (backReason != null) {
|
|
||||||
updateWrapper.set(MedicationRequest::getBackReason, backReason);
|
|
||||||
}
|
|
||||||
baseMapper.update(null, updateWrapper);
|
baseMapper.update(null, updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,9 +75,6 @@ public class MedicationRequestServiceImpl extends ServiceImpl<MedicationRequestM
|
|||||||
if (checkDate != null) {
|
if (checkDate != null) {
|
||||||
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
updateWrapper.set(MedicationRequest::getCheckTime, checkDate);
|
||||||
}
|
}
|
||||||
if (backReason != null) {
|
|
||||||
updateWrapper.set(MedicationRequest::getBackReason, backReason);
|
|
||||||
}
|
|
||||||
baseMapper.update(null, updateWrapper);
|
baseMapper.update(null, updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,13 +79,11 @@ public class OpSchedule extends HisBaseEntity {
|
|||||||
private String surgerySite;
|
private String surgerySite;
|
||||||
|
|
||||||
/** 入院时间 */
|
/** 入院时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime admissionTime;
|
private LocalDateTime admissionTime;
|
||||||
|
|
||||||
/** 入手术室时间 */
|
/** 入手术室时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime entryTime;
|
private LocalDateTime entryTime;
|
||||||
|
|
||||||
/** 手术室编码 */
|
/** 手术室编码 */
|
||||||
@@ -144,23 +142,19 @@ public class OpSchedule extends HisBaseEntity {
|
|||||||
private String assistant3Code;
|
private String assistant3Code;
|
||||||
|
|
||||||
/** 手术开始时间 */
|
/** 手术开始时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
/** 手术结束时间 */
|
/** 手术结束时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
/** 麻醉开始时间 */
|
/** 麻醉开始时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime anesStart;
|
private LocalDateTime anesStart;
|
||||||
|
|
||||||
/** 麻醉结束时间 */
|
/** 麻醉结束时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime anesEnd;
|
private LocalDateTime anesEnd;
|
||||||
|
|
||||||
/** 手术状态 */
|
/** 手术状态 */
|
||||||
|
|||||||
@@ -39,22 +39,6 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
|||||||
*/
|
*/
|
||||||
void updateCompleteRequestStatus(List<Long> serReqIdList, Long practitionerId, Date checkDate);
|
void updateCompleteRequestStatus(List<Long> serReqIdList, Long practitionerId, Date checkDate);
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新检查申请状态:已校对(护士校对检查申请后状态为CHECK_VERIFIED,而非COMPLETED)
|
|
||||||
*
|
|
||||||
* @param serReqIdList 服务请求id列表
|
|
||||||
* @param practitionerId 校对人
|
|
||||||
* @param checkDate 校对时间
|
|
||||||
*/
|
|
||||||
void updateCheckVerifiedStatus(List<Long> serReqIdList, Long practitionerId, Date checkDate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新检查申请状态:待接收(护士执行检查申请后状态为PENDING_RECEIVE)
|
|
||||||
*
|
|
||||||
* @param serReqIdList 服务请求id列表
|
|
||||||
*/
|
|
||||||
void updatePendingReceiveStatus(List<Long> serReqIdList);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取执行过的诊疗数据
|
* 获取执行过的诊疗数据
|
||||||
*
|
*
|
||||||
@@ -109,7 +93,7 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
|
|||||||
* @param practitionerId 校对人
|
* @param practitionerId 校对人
|
||||||
* @param checkDate 校对时间
|
* @param checkDate 校对时间
|
||||||
*/
|
*/
|
||||||
void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate, String backReason);
|
void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新服务状态:待发送
|
* 更新服务状态:待发送
|
||||||
|
|||||||
@@ -66,31 +66,6 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
|||||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新检查申请状态:已校对(护士校对检查申请后状态为CHECK_VERIFIED,而非COMPLETED)
|
|
||||||
*
|
|
||||||
* @param serReqIdList 服务请求id列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void updateCheckVerifiedStatus(List<Long> serReqIdList, Long practitionerId, Date checkDate) {
|
|
||||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.CHECK_VERIFIED.getValue())
|
|
||||||
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId()).setCheckTime(DateUtils.getNowDate()),
|
|
||||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serReqIdList)
|
|
||||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新检查申请状态:待接收(护士执行检查申请后状态为PENDING_RECEIVE)
|
|
||||||
*
|
|
||||||
* @param serReqIdList 服务请求id列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void updatePendingReceiveStatus(List<Long> serReqIdList) {
|
|
||||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.PENDING_RECEIVE.getValue()),
|
|
||||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serReqIdList)
|
|
||||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取执行过的诊疗数据
|
* 获取执行过的诊疗数据
|
||||||
*
|
*
|
||||||
@@ -197,15 +172,9 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
|||||||
* @param checkDate 校对时间
|
* @param checkDate 校对时间
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate, String backReason) {
|
public void updateDraftStatus(List<Long> serviceRequestIdList, Long practitionerId, Date checkDate) {
|
||||||
ServiceRequest updateEntity = new ServiceRequest()
|
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.DRAFT.getValue())
|
||||||
.setStatusEnum(RequestStatus.DRAFT.getValue())
|
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId()).setCheckTime(DateUtils.getNowDate()),
|
||||||
.setPerformerCheckId(SecurityUtils.getLoginUser().getPractitionerId())
|
|
||||||
.setCheckTime(DateUtils.getNowDate());
|
|
||||||
if (backReason != null && !backReason.isEmpty()) {
|
|
||||||
updateEntity.setReasonText(backReason);
|
|
||||||
}
|
|
||||||
baseMapper.update(updateEntity,
|
|
||||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serviceRequestIdList)
|
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serviceRequestIdList)
|
||||||
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,14 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.openhis.appointmentmanage.mapper.ScheduleSlotMapper">
|
<mapper namespace="com.openhis.appointmentmanage.mapper.ScheduleSlotMapper">
|
||||||
|
|
||||||
<!--
|
<!-- 统一状态值(兼容数字/英文字符串存储),输出 Integer,避免 resultType 映射 NumberFormatException -->
|
||||||
统一状态值映射: DB 数值 → 规范化输出
|
|
||||||
0=待约 1=已约(签到后) 2=锁定(预约后) 3=已签到 4=已停诊 5=已退号
|
|
||||||
-->
|
|
||||||
<sql id="slotStatusNormExpr">
|
<sql id="slotStatusNormExpr">
|
||||||
CASE
|
CASE
|
||||||
WHEN LOWER(CONCAT('', s.status)) IN ('0', 'unbooked', 'available') THEN 0
|
WHEN LOWER(CONCAT('', s.status)) IN ('0', 'unbooked', 'available') THEN 0
|
||||||
WHEN LOWER(CONCAT('', s.status)) IN ('1', 'booked') THEN 1
|
WHEN LOWER(CONCAT('', s.status)) IN ('1', 'booked') THEN 1
|
||||||
WHEN LOWER(CONCAT('', s.status)) IN ('2', 'locked') THEN 2
|
WHEN LOWER(CONCAT('', s.status)) IN ('2', 'cancelled', 'canceled', 'stopped') THEN 2
|
||||||
WHEN LOWER(CONCAT('', s.status)) IN ('3', 'checked', 'checked_in', 'checkin') THEN 3
|
WHEN LOWER(CONCAT('', s.status)) IN ('3', 'checked', 'checked_in', 'checkin') THEN 3
|
||||||
WHEN LOWER(CONCAT('', s.status)) IN ('4', 'cancelled', 'canceled', 'stopped') THEN 4
|
WHEN LOWER(CONCAT('', s.status)) IN ('4', 'locked') THEN 4
|
||||||
WHEN LOWER(CONCAT('', s.status)) IN ('5', 'returned') THEN 5
|
WHEN LOWER(CONCAT('', s.status)) IN ('5', 'returned') THEN 5
|
||||||
ELSE NULL
|
ELSE NULL
|
||||||
END
|
END
|
||||||
@@ -34,9 +31,9 @@
|
|||||||
CASE
|
CASE
|
||||||
WHEN LOWER(CONCAT('', p.status)) IN ('0', 'unbooked', 'available') THEN 0
|
WHEN LOWER(CONCAT('', p.status)) IN ('0', 'unbooked', 'available') THEN 0
|
||||||
WHEN LOWER(CONCAT('', p.status)) IN ('1', 'booked') THEN 1
|
WHEN LOWER(CONCAT('', p.status)) IN ('1', 'booked') THEN 1
|
||||||
WHEN LOWER(CONCAT('', p.status)) IN ('2', 'locked') THEN 2
|
WHEN LOWER(CONCAT('', p.status)) IN ('2', 'cancelled', 'canceled', 'stopped') THEN 2
|
||||||
WHEN LOWER(CONCAT('', p.status)) IN ('3', 'checked', 'checked_in', 'checkin') THEN 3
|
WHEN LOWER(CONCAT('', p.status)) IN ('3', 'checked', 'checked_in', 'checkin') THEN 3
|
||||||
WHEN LOWER(CONCAT('', p.status)) IN ('4', 'cancelled', 'canceled', 'stopped') THEN 4
|
WHEN LOWER(CONCAT('', p.status)) IN ('4', 'locked') THEN 4
|
||||||
WHEN LOWER(CONCAT('', p.status)) IN ('5', 'returned') THEN 5
|
WHEN LOWER(CONCAT('', p.status)) IN ('5', 'returned') THEN 5
|
||||||
ELSE NULL
|
ELSE NULL
|
||||||
END
|
END
|
||||||
@@ -152,11 +149,10 @@
|
|||||||
s.id = #{id}
|
s.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 预约锁定: 0→#{lockedStatus} (AVAILABLE→LOCKED),由枚举传入 -->
|
|
||||||
<update id="lockSlotForBooking">
|
<update id="lockSlotForBooking">
|
||||||
UPDATE adm_schedule_slot
|
UPDATE adm_schedule_slot
|
||||||
SET
|
SET
|
||||||
status = #{lockedStatus},
|
status = 1,
|
||||||
update_time = now()
|
update_time = now()
|
||||||
WHERE
|
WHERE
|
||||||
id = #{slotId}
|
id = #{slotId}
|
||||||
@@ -178,7 +174,6 @@
|
|||||||
AND delete_flag = '0'
|
AND delete_flag = '0'
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 签到: #{requiredStatus}→#{status} (LOCKED→BOOKED),前置条件由枚举传入 -->
|
|
||||||
<update id="updateSlotStatusAndCheckInTime">
|
<update id="updateSlotStatusAndCheckInTime">
|
||||||
UPDATE adm_schedule_slot
|
UPDATE adm_schedule_slot
|
||||||
SET
|
SET
|
||||||
@@ -187,7 +182,6 @@
|
|||||||
update_time = NOW()
|
update_time = NOW()
|
||||||
WHERE
|
WHERE
|
||||||
id = #{slotId}
|
id = #{slotId}
|
||||||
AND status = #{requiredStatus}
|
|
||||||
AND delete_flag = '0'
|
AND delete_flag = '0'
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@@ -208,7 +202,7 @@
|
|||||||
update_time = now()
|
update_time = now()
|
||||||
WHERE
|
WHERE
|
||||||
id = #{slotId}
|
id = #{slotId}
|
||||||
AND status = 2
|
AND status = 1
|
||||||
AND delete_flag = '0'
|
AND delete_flag = '0'
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@@ -305,16 +299,15 @@
|
|||||||
<if test="query.phone != null and query.phone != ''">
|
<if test="query.phone != null and query.phone != ''">
|
||||||
AND o.phone LIKE CONCAT('%', #{query.phone}, '%')
|
AND o.phone LIKE CONCAT('%', #{query.phone}, '%')
|
||||||
</if>
|
</if>
|
||||||
<!-- 5. 时间过滤: 仅待约(0)受时间限制,已锁定(2)/已约(1)/已签到(3)/已退号(5)不受影响 -->
|
<!-- 5. 按系统时间过滤(Bug #398 #399 修复:仅未预约受时间过滤,已预约/已取号/已退号不受影响) -->
|
||||||
AND (
|
AND (
|
||||||
(<include refid="slotStatusNormExpr" /> = 0 AND (p.schedule_date > CURRENT_DATE OR (p.schedule_date = CURRENT_DATE AND (CAST(p.schedule_date AS TIMESTAMP) + CAST(s.expect_time AS TIME)) >= NOW())))
|
(<include refid="slotStatusNormExpr" /> = 0 AND (p.schedule_date > CURRENT_DATE OR (p.schedule_date = CURRENT_DATE AND (CAST(p.schedule_date AS TIMESTAMP) + CAST(s.expect_time AS TIME)) >= NOW())))
|
||||||
OR <include refid="slotStatusNormExpr" /> = 1
|
OR <include refid="slotStatusNormExpr" /> = 1
|
||||||
OR <include refid="slotStatusNormExpr" /> = 2
|
|
||||||
OR <include refid="slotStatusNormExpr" /> = 3
|
OR <include refid="slotStatusNormExpr" /> = 3
|
||||||
OR <include refid="slotStatusNormExpr" /> = 5
|
OR <include refid="slotStatusNormExpr" /> = 5
|
||||||
OR <include refid="orderStatusNormExpr" /> = 4
|
OR <include refid="orderStatusNormExpr" /> = 4
|
||||||
)
|
)
|
||||||
<!-- 6. 状态筛选: unbooked(0) locked(2) booked(2) checked(1) cancelled(4) returned(5) -->
|
<!-- 6. 状态过滤 -->
|
||||||
<if test="query.status != null and query.status != '' and query.status != 'all'">
|
<if test="query.status != null and query.status != '' and query.status != 'all'">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="'unbooked'.equals(query.status) or '未预约'.equals(query.status)">
|
<when test="'unbooked'.equals(query.status) or '未预约'.equals(query.status)">
|
||||||
@@ -325,15 +318,7 @@
|
|||||||
)
|
)
|
||||||
</when>
|
</when>
|
||||||
<when test="'booked'.equals(query.status) or '已预约'.equals(query.status)">
|
<when test="'booked'.equals(query.status) or '已预约'.equals(query.status)">
|
||||||
AND <include refid="slotStatusNormExpr" /> = 2
|
AND <include refid="slotStatusNormExpr" /> = 1
|
||||||
AND <include refid="orderStatusNormExpr" /> = 1
|
|
||||||
AND (
|
|
||||||
d.is_stopped IS NULL
|
|
||||||
OR d.is_stopped = FALSE
|
|
||||||
)
|
|
||||||
</when>
|
|
||||||
<when test="'locked'.equals(query.status) or '已锁定'.equals(query.status)">
|
|
||||||
AND <include refid="slotStatusNormExpr" /> = 2
|
|
||||||
AND <include refid="orderStatusNormExpr" /> = 1
|
AND <include refid="orderStatusNormExpr" /> = 1
|
||||||
AND (
|
AND (
|
||||||
d.is_stopped IS NULL
|
d.is_stopped IS NULL
|
||||||
@@ -341,7 +326,13 @@
|
|||||||
)
|
)
|
||||||
</when>
|
</when>
|
||||||
<when test="'checked'.equals(query.status) or '已取号'.equals(query.status)">
|
<when test="'checked'.equals(query.status) or '已取号'.equals(query.status)">
|
||||||
AND <include refid="slotStatusNormExpr" /> = 1
|
AND (
|
||||||
|
<include refid="slotStatusNormExpr" /> = 3
|
||||||
|
OR (
|
||||||
|
<include refid="slotStatusNormExpr" /> = 1
|
||||||
|
AND <include refid="orderStatusNormExpr" /> = 2
|
||||||
|
)
|
||||||
|
)
|
||||||
AND (
|
AND (
|
||||||
d.is_stopped IS NULL
|
d.is_stopped IS NULL
|
||||||
OR d.is_stopped = FALSE
|
OR d.is_stopped = FALSE
|
||||||
@@ -349,7 +340,7 @@
|
|||||||
</when>
|
</when>
|
||||||
<when test="'cancelled'.equals(query.status) or '已停诊'.equals(query.status) or '已取消'.equals(query.status)">
|
<when test="'cancelled'.equals(query.status) or '已停诊'.equals(query.status) or '已取消'.equals(query.status)">
|
||||||
AND (
|
AND (
|
||||||
<include refid="slotStatusNormExpr" /> = 4
|
<include refid="slotStatusNormExpr" /> = 2
|
||||||
OR d.is_stopped = TRUE
|
OR d.is_stopped = TRUE
|
||||||
)
|
)
|
||||||
</when>
|
</when>
|
||||||
|
|||||||
77
openhis-ui-vue3/package-lock.json
generated
77
openhis-ui-vue3/package-lock.json
generated
@@ -65,7 +65,7 @@
|
|||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"unplugin-auto-import": "0.17.1",
|
"unplugin-auto-import": "0.17.1",
|
||||||
"unplugin-vue-setup-extend-plus": "1.0.0",
|
"unplugin-vue-setup-extend-plus": "1.0.0",
|
||||||
"vite": "^5.0.4",
|
"vite": "5.0.4",
|
||||||
"vite-plugin-compression": "0.5.1",
|
"vite-plugin-compression": "0.5.1",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-plugin-vue-mcp": "^0.3.2",
|
"vite-plugin-vue-mcp": "^0.3.2",
|
||||||
@@ -3093,6 +3093,41 @@
|
|||||||
"url": "https://opencollective.com/vitest"
|
"url": "https://opencollective.com/vitest"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@vitest/mocker": {
|
||||||
|
"version": "4.1.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@vitest/mocker/-/mocker-4.1.2.tgz",
|
||||||
|
"integrity": "sha512-Ize4iQtEALHDttPRCmN+FKqOl2vxTiNUhzobQFFt/BM1lRUTG7zRCLOykG/6Vo4E4hnUdfVLo5/eqKPukcWW7Q==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@vitest/spy": "4.1.2",
|
||||||
|
"estree-walker": "^3.0.3",
|
||||||
|
"magic-string": "^0.30.21"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://opencollective.com/vitest"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"msw": "^2.4.9",
|
||||||
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"msw": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vite": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@vitest/mocker/node_modules/estree-walker": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/estree": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@vitest/pretty-format": {
|
"node_modules/@vitest/pretty-format": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmmirror.com/@vitest/pretty-format/-/pretty-format-4.1.2.tgz",
|
"resolved": "https://registry.npmmirror.com/@vitest/pretty-format/-/pretty-format-4.1.2.tgz",
|
||||||
@@ -12636,10 +12671,9 @@
|
|||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "5.0.4",
|
"version": "5.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.4.tgz",
|
"resolved": "https://registry.npmmirror.com/vite/-/vite-5.0.4.tgz",
|
||||||
"integrity": "sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg==",
|
"integrity": "sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.19.3",
|
"esbuild": "^0.19.3",
|
||||||
"postcss": "^8.4.31",
|
"postcss": "^8.4.31",
|
||||||
@@ -13302,33 +13336,6 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vitest/node_modules/@vitest/mocker": {
|
|
||||||
"version": "4.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.2.tgz",
|
|
||||||
"integrity": "sha512-Ize4iQtEALHDttPRCmN+FKqOl2vxTiNUhzobQFFt/BM1lRUTG7zRCLOykG/6Vo4E4hnUdfVLo5/eqKPukcWW7Q==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@vitest/spy": "4.1.2",
|
|
||||||
"estree-walker": "^3.0.3",
|
|
||||||
"magic-string": "^0.30.21"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://opencollective.com/vitest"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"msw": "^2.4.9",
|
|
||||||
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"msw": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"vite": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/vitest/node_modules/chokidar": {
|
"node_modules/vitest/node_modules/chokidar": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
||||||
@@ -13391,16 +13398,6 @@
|
|||||||
"@esbuild/win32-x64": "0.27.7"
|
"@esbuild/win32-x64": "0.27.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vitest/node_modules/estree-walker": {
|
|
||||||
"version": "3.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
|
||||||
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/estree": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/vitest/node_modules/fsevents": {
|
"node_modules/vitest/node_modules/fsevents": {
|
||||||
"version": "2.3.3",
|
"version": "2.3.3",
|
||||||
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
|
|||||||
@@ -83,11 +83,11 @@
|
|||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"unplugin-auto-import": "0.17.1",
|
"unplugin-auto-import": "0.17.1",
|
||||||
"unplugin-vue-setup-extend-plus": "1.0.0",
|
"unplugin-vue-setup-extend-plus": "1.0.0",
|
||||||
"vite": "^5.0.4",
|
"vite": "5.0.4",
|
||||||
"vite-plugin-compression": "0.5.1",
|
"vite-plugin-compression": "0.5.1",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-plugin-vue-mcp": "^0.3.2",
|
"vite-plugin-vue-mcp": "^0.3.2",
|
||||||
"vitest": "^4.0.18",
|
"vitest": "^4.0.18",
|
||||||
"vue-tsc": "^3.1.8"
|
"vue-tsc": "^3.1.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,24 +162,6 @@ export function getG(svg, viewConfig) {
|
|||||||
// 设置数据
|
// 设置数据
|
||||||
export function getData(allData) {
|
export function getData(allData) {
|
||||||
const rowsData = allData.rows; // allData, '【全部数据】'
|
const rowsData = allData.rows; // allData, '【全部数据】'
|
||||||
// 兼容旧数据:将旧 typeCode 映射到新 typeCode(心率 004→014,脉搏 005→002,呼吸 006→001)
|
|
||||||
const OLD_CODE_MAP = { '004': '014', '005': '002', '006': '001' };
|
|
||||||
rowsData.forEach(row => {
|
|
||||||
if (row.rowBOS) {
|
|
||||||
const prependItems = [];
|
|
||||||
row.rowBOS.forEach(item => {
|
|
||||||
const newCode = OLD_CODE_MAP[item.typeCode];
|
|
||||||
// 始终添加映射条目,用 unshift 插入数组头部
|
|
||||||
// 这样 getType 的 find() 优先匹配映射后的编码(如脉冲、呼吸)
|
|
||||||
// 即使存在同编码的旧条目(如血压舒张压用 002、收缩压用 001),
|
|
||||||
// 映射后的脉搏(002)和呼吸(001)条目排在前面,确保图表正确渲染
|
|
||||||
if (newCode) {
|
|
||||||
prependItems.push({ ...item, typeCode: newCode });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
row.rowBOS.unshift(...prependItems);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const infoData = allData.grParamBOS;
|
const infoData = allData.grParamBOS;
|
||||||
const typesData = getTypeDatas(allData.types, allData.grParamBOS.beginDate);
|
const typesData = getTypeDatas(allData.types, allData.grParamBOS.beginDate);
|
||||||
const selectOp = allData.selectOp;
|
const selectOp = allData.selectOp;
|
||||||
|
|||||||
@@ -10,27 +10,15 @@
|
|||||||
@click="clickAct"
|
@click="clickAct"
|
||||||
>
|
>
|
||||||
<div v-if="data.bedOperationalStatus==='U'">
|
<div v-if="data.bedOperationalStatus==='U'">
|
||||||
<img
|
<img :src="emptyBed" class="pf_card_emptyBed_img">
|
||||||
:src="emptyBed"
|
<div class="pf_card_emptyBed_text">{{ data.bedName }}</div>
|
||||||
class="pf_card_emptyBed_img"
|
|
||||||
>
|
|
||||||
<div class="pf_card_emptyBed_text">
|
|
||||||
{{ data.bedName }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div
|
<div v-if="data.isDischarge" class="pf_card_discharge">
|
||||||
v-if="data.isDischarge"
|
|
||||||
class="pf_card_discharge"
|
|
||||||
>
|
|
||||||
<span style="margin-left: 6px">离</span>
|
<span style="margin-left: 6px">离</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="pf_card_card">
|
<div class="pf_card_card">
|
||||||
<CardSign
|
<CardSign :color="getBedBackColor(data.triageLevel)" :title="data.bedName" :tail="getDisplay(data.triageLevel)" />
|
||||||
:color="getBedBackColor(data.triageLevel)"
|
|
||||||
:title="data.bedName"
|
|
||||||
:tail="getDisplay(data.triageLevel)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="pf_card_nameSexAndAge">
|
<div class="pf_card_nameSexAndAge">
|
||||||
<span class="pf_card_name">{{ data.patientName }}</span>
|
<span class="pf_card_name">{{ data.patientName }}</span>
|
||||||
@@ -40,48 +28,20 @@
|
|||||||
<span style="margin-right: 16px">入室时间</span>
|
<span style="margin-right: 16px">入室时间</span>
|
||||||
{{ moment(data.checkInWardTime).format('YYYY-MM-DD HH:mm') }}
|
{{ moment(data.checkInWardTime).format('YYYY-MM-DD HH:mm') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pf_card_noCode">
|
<div class="pf_card_noCode">{{ data.hisId }}</div>
|
||||||
{{ data.hisId }}
|
<div class="pf_card_rescueTimeText">{{ rescueTimeText() }}</div>
|
||||||
</div>
|
<div v-if="data.diag!==''" class="pf_card_diagnosis">
|
||||||
<div class="pf_card_rescueTimeText">
|
<div class="card-rectangle-text">{{ data.diag }}</div>
|
||||||
{{ rescueTimeText() }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="data.diag!==''"
|
|
||||||
class="pf_card_diagnosis"
|
|
||||||
>
|
|
||||||
<div class="card-rectangle-text">
|
|
||||||
{{ data.diag }}
|
|
||||||
</div>
|
|
||||||
<span style="margin-left: 4px">(诊断)</span>
|
<span style="margin-left: 4px">(诊断)</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="isNewSign()" class="card-rectangle">新</div>
|
||||||
v-if="isNewSign()"
|
<div v-if="is72HourSign()" class="card-rectangle2">超72H</div>
|
||||||
class="card-rectangle"
|
|
||||||
>
|
|
||||||
新
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="is72HourSign()"
|
|
||||||
class="card-rectangle2"
|
|
||||||
>
|
|
||||||
超72H
|
|
||||||
</div>
|
|
||||||
<hr class="pf_card_line">
|
<hr class="pf_card_line">
|
||||||
<div class="pf_card_nursingMeasuresString">
|
<div class="pf_card_nursingMeasuresString">{{ getStringByCode(data.nursingMeasures, nursingMeasures) }}</div>
|
||||||
{{ getStringByCode(data.nursingMeasures, nursingMeasures) }}
|
<div class="pf_card_specialArrangementString">{{ getStringByCode(data.specialArrangement, specialArrangementList) }}</div>
|
||||||
</div>
|
<div v-if="false" class="pf_card_btn" @click="moreClick">更多</div>
|
||||||
<div class="pf_card_specialArrangementString">
|
|
||||||
{{ getStringByCode(data.specialArrangement, specialArrangementList) }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="false"
|
|
||||||
class="pf_card_btn"
|
|
||||||
@click="moreClick"
|
|
||||||
>
|
|
||||||
更多
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
:data="item"
|
:data="item"
|
||||||
:bed-config="bedConfig"
|
:bed-config="bedConfig"
|
||||||
@click="clickAct"
|
@click="clickAct"
|
||||||
@more-click="moreClickAct"
|
@moreClick="moreClickAct"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,19 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="printCard">
|
<div class="printCard">
|
||||||
<div
|
<div ref="refQr" style="float: left; margin: 30px 15px">
|
||||||
ref="refQr"
|
<img :src="emptyBed" style="height: 120px" class="pf_card_emptyBed_img">
|
||||||
style="float: left; margin: 30px 15px"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:src="emptyBed"
|
|
||||||
style="height: 120px"
|
|
||||||
class="pf_card_emptyBed_img"
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="printView_content" style=" margin: 30px 0">
|
||||||
class="printView_content"
|
|
||||||
style=" margin: 30px 0"
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<span>床号:</span>
|
<span>床号:</span>
|
||||||
<span>{{ printData.bedName }}</span>
|
<span>{{ printData.bedName }}</span>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="recordBill">
|
<div class="recordBill">
|
||||||
<div
|
<div id="div1" class="printView_header">
|
||||||
id="div1"
|
|
||||||
class="printView_header"
|
|
||||||
>
|
|
||||||
<div style="text-align: center; height: 40px">
|
<div style="text-align: center; height: 40px">
|
||||||
护理交接班
|
护理交接班
|
||||||
</div>
|
</div>
|
||||||
@@ -21,83 +18,35 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div id="div2" class="printView_content">
|
||||||
id="div2"
|
<table border="1" cellSpacing="0" width="98%" cellPadding="1" style=" border-collapse:collapse; font-size: 14px" bordercolor="#333333">
|
||||||
class="printView_content"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
border="1"
|
|
||||||
cellSpacing="0"
|
|
||||||
width="98%"
|
|
||||||
cellPadding="1"
|
|
||||||
style=" border-collapse:collapse; font-size: 14px"
|
|
||||||
bordercolor="#333333"
|
|
||||||
>
|
|
||||||
<thead>
|
<thead>
|
||||||
<TR>
|
<TR>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 40px" align="center">类别</DIV>
|
||||||
style="width: 40px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
类别
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 50px" align="center">床号</DIV>
|
||||||
style="width: 50px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
床号
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 60px" align="center">姓名</DIV>
|
||||||
style="width: 60px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
姓名
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 90px" align="center">主诉</DIV>
|
||||||
style="width: 90px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
主诉
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 90px" align="center">既往史</DIV>
|
||||||
style="width: 90px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
既往史
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 90px" align="center">诊断</DIV>
|
||||||
style="width: 90px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
诊断
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 155px" align="center">交接信息</DIV>
|
||||||
style="width: 155px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
交接信息
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr v-for="item in printData.shiftRecordItems" :key="item.id">
|
||||||
v-for="item in printData.shiftRecordItems"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<td v-html="item.typeDisplay" />
|
<td v-html="item.typeDisplay" />
|
||||||
<td v-html="item.bedName" />
|
<td v-html="item.bedName" />
|
||||||
<td v-html="item.patientName" />
|
<td v-html="item.patientName" />
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="recordBill">
|
<div class="recordBill">
|
||||||
<div
|
<div :id="'exeSheetTitle' + printData.id" class="printView_header">
|
||||||
:id="'exeSheetTitle' + printData.id"
|
|
||||||
class="printView_header"
|
|
||||||
>
|
|
||||||
<div style="text-align: center; height: 60px">
|
<div style="text-align: center; height: 60px">
|
||||||
{{ userStore.hospitalName }}医嘱执行单
|
{{ userStore.hospitalName }}医嘱执行单
|
||||||
</div>
|
</div>
|
||||||
@@ -19,119 +16,51 @@
|
|||||||
<span style="display: inline-block; width: 140px">性别:{{!printData.patientInfo.gender? '':printData.patientInfo.gender.display}}</span>
|
<span style="display: inline-block; width: 140px">性别:{{!printData.patientInfo.gender? '':printData.patientInfo.gender.display}}</span>
|
||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div :id="'exeSheet' + printData.id" class="printView_content">
|
||||||
:id="'exeSheet' + printData.id"
|
<table border="1" cellSpacing="0" width="97%" cellPadding="1" style=" border-collapse:collapse; font-size: 13px" bordercolor="#333333">
|
||||||
class="printView_content"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
border="1"
|
|
||||||
cellSpacing="0"
|
|
||||||
width="97%"
|
|
||||||
cellPadding="1"
|
|
||||||
style=" border-collapse:collapse; font-size: 13px"
|
|
||||||
bordercolor="#333333"
|
|
||||||
>
|
|
||||||
<thead>
|
<thead>
|
||||||
<TR>
|
<TR>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV style="width: 65px;text-align: center">
|
<DIV style="width: 65px;text-align: center">医嘱日期</DIV>
|
||||||
医嘱日期
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
|
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 120px" align="center">医嘱</DIV>
|
||||||
style="width: 120px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
医嘱
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 10px" align="center" />
|
||||||
style="width: 10px"
|
|
||||||
align="center"
|
|
||||||
/>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 70px" align="center">嘱托</DIV>
|
||||||
style="width: 70px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
嘱托
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 60px" align="center">用量</DIV>
|
||||||
style="width: 60px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
用量
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 40px" align="center">用法</DIV>
|
||||||
style="width: 40px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
用法
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 40px" align="center">频次</DIV>
|
||||||
style="width: 40px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
频次
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 65px" align="center">开立医生</DIV>
|
||||||
style="width: 65px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
开立医生
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 65px" align="center">执行时间</DIV>
|
||||||
style="width: 65px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
执行时间
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 65px" align="center">执行护士</DIV>
|
||||||
style="width: 65px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
执行护士
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 55px" align="center">终止时间</DIV>
|
||||||
style="width: 55px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
终止时间
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 55px" align="center">终止人</DIV>
|
||||||
style="width: 55px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
终止人
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr v-for="item in printData.recordData" :key="item.id">
|
||||||
v-for="item in printData.recordData"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<td v-html="item.moTime" />
|
<td v-html="item.moTime" />
|
||||||
<td v-html="item.orderName" />
|
<td v-html="item.orderName" />
|
||||||
<td v-html="item.flag" />
|
<td v-html="item.flag" />
|
||||||
@@ -141,20 +70,12 @@
|
|||||||
<td v-html="item.frequency" />
|
<td v-html="item.frequency" />
|
||||||
<td :id="item.id">
|
<td :id="item.id">
|
||||||
<span v-if="(item.docSignImage === ''||item.docSignImage === null)">{{ item.moDocName }}</span>
|
<span v-if="(item.docSignImage === ''||item.docSignImage === null)">{{ item.moDocName }}</span>
|
||||||
<img
|
<img v-if="(item.docSignImage !== ''&&item.docSignImage !== null)" :src="'data:image/png;base64,'+ item.docSignImage" style="height: 100%; width: 100%;object-fit: cover;">
|
||||||
v-if="(item.docSignImage !== ''&&item.docSignImage !== null)"
|
|
||||||
:src="'data:image/png;base64,'+ item.docSignImage"
|
|
||||||
style="height: 100%; width: 100%;object-fit: cover;"
|
|
||||||
>
|
|
||||||
</td>
|
</td>
|
||||||
<td v-html="item.occurrence" />
|
<td v-html="item.occurrence" />
|
||||||
<td :id="item.id">
|
<td :id="item.id">
|
||||||
<span v-if="(item.perNurserSignImage === ''||item.perNurserSignImage === null)">{{ item.performName }}</span>
|
<span v-if="(item.perNurserSignImage === ''||item.perNurserSignImage === null)">{{ item.performName }}</span>
|
||||||
<img
|
<img v-if="(item.perNurserSignImage !== ''&&item.perNurserSignImage !== null)" :src="'data:image/png;base64,'+ item.perNurserSignImage" style="height: 100%; width: 100%;object-fit: cover;">
|
||||||
v-if="(item.perNurserSignImage !== ''&&item.perNurserSignImage !== null)"
|
|
||||||
:src="'data:image/png;base64,'+ item.perNurserSignImage"
|
|
||||||
style="height: 100%; width: 100%;object-fit: cover;"
|
|
||||||
>
|
|
||||||
</td>
|
</td>
|
||||||
<td />
|
<td />
|
||||||
<td />
|
<td />
|
||||||
@@ -170,6 +91,10 @@ import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
|||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
setup() {
|
||||||
|
const userStore = useUserStore();
|
||||||
|
return { userStore };
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
printData: {
|
printData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -178,10 +103,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup() {
|
|
||||||
const userStore = useUserStore();
|
|
||||||
return { userStore };
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,51 +12,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: block; width: 120px; height: 60px; float:left; ">
|
<div style="display: block; width: 120px; height: 60px; float:left; ">
|
||||||
<div
|
<div :id="getId(printData.id)" style="float: left; margin: 5px;" />
|
||||||
:id="getId(printData.id)"
|
|
||||||
style="float: left; margin: 5px;"
|
|
||||||
/>
|
|
||||||
<span style="float: left; margin: 5px">{{ printData.priority }}</span>
|
<span style="float: left; margin: 5px">{{ printData.priority }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div :id="printData.id + 'div2'">
|
<div :id="printData.id + 'div2'">
|
||||||
<table
|
<table border="1" cellSpacing="0" width="390px" cellPadding="1" style="margin-left: 8px; border-collapse:collapse; table-layout: fixed; font-size: 14px" bordercolor="#333333">
|
||||||
border="1"
|
|
||||||
cellSpacing="0"
|
|
||||||
width="390px"
|
|
||||||
cellPadding="1"
|
|
||||||
style="margin-left: 8px; border-collapse:collapse; table-layout: fixed; font-size: 14px"
|
|
||||||
bordercolor="#333333"
|
|
||||||
>
|
|
||||||
<thead>
|
<thead>
|
||||||
<TR>
|
<TR>
|
||||||
<Th
|
<Th style="width: 160px" v-html="'药品名称'" />
|
||||||
style="width: 160px"
|
<Th style="width: 75px" v-html="'用量'" />
|
||||||
v-html="'药品名称'"
|
<Th style="width: 10px" v-html="''" />
|
||||||
/>
|
<Th style="width: 50px" v-html="'频次'" />
|
||||||
<Th
|
<Th style="width: 75px" v-html="'用法'" />
|
||||||
style="width: 75px"
|
|
||||||
v-html="'用量'"
|
|
||||||
/>
|
|
||||||
<Th
|
|
||||||
style="width: 10px"
|
|
||||||
v-html="''"
|
|
||||||
/>
|
|
||||||
<Th
|
|
||||||
style="width: 50px"
|
|
||||||
v-html="'频次'"
|
|
||||||
/>
|
|
||||||
<Th
|
|
||||||
style="width: 75px"
|
|
||||||
v-html="'用法'"
|
|
||||||
/>
|
|
||||||
</TR>
|
</TR>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr v-for="item in printData.orderDetail" :key="item.id">
|
||||||
v-for="item in printData.orderDetail"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<td v-html="item.orderName" />
|
<td v-html="item.orderName" />
|
||||||
<td v-html="item.doseOnce + item.doseUnit" />
|
<td v-html="item.doseOnce + item.doseUnit" />
|
||||||
<td v-html="item.flag" />
|
<td v-html="item.flag" />
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="recordBill">
|
<div class="recordBill">
|
||||||
<div
|
<div id="div1" class="printView_header">
|
||||||
id="div1"
|
|
||||||
class="printView_header"
|
|
||||||
>
|
|
||||||
<div style="text-align: center; font-size: 20px; height: 40px">
|
<div style="text-align: center; font-size: 20px; height: 40px">
|
||||||
{{ userStore.hospitalName }}输液执行单
|
{{ userStore.hospitalName }}输液执行单
|
||||||
</div>
|
</div>
|
||||||
@@ -16,88 +13,38 @@
|
|||||||
<span style="margin-left: 18px">科室:{{ printData.patientInfo.deptName }}</span>
|
<span style="margin-left: 18px">科室:{{ printData.patientInfo.deptName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div id="div2" class="printView_content">
|
||||||
id="div2"
|
<table border="1" cellSpacing="0" cellPadding="1" style=" border-collapse:collapse; font-size: 14px" bordercolor="#333333">
|
||||||
class="printView_content"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
border="1"
|
|
||||||
cellSpacing="0"
|
|
||||||
cellPadding="1"
|
|
||||||
style=" border-collapse:collapse; font-size: 14px"
|
|
||||||
bordercolor="#333333"
|
|
||||||
>
|
|
||||||
<thead>
|
<thead>
|
||||||
<TR style="height: 30px">
|
<TR style="height: 30px">
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 35px" align="center">时间</DIV>
|
||||||
style="width: 35px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
时间
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 280px" align="center">药品名称</DIV>
|
||||||
style="width: 280px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
药品名称
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 10px" align="center" />
|
||||||
style="width: 10px"
|
|
||||||
align="center"
|
|
||||||
/>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 55px" align="center">剂量</DIV>
|
||||||
style="width: 55px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
剂量
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 30px" align="center">频次</DIV>
|
||||||
style="width: 30px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
频次
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD colspan="1">
|
<TD colspan="1">
|
||||||
<DIV
|
<DIV style="width: 55px" align="center">用法</DIV>
|
||||||
style="width: 55px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
用法
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 70px" align="center">执行时间</DIV>
|
||||||
style="width: 70px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
执行时间
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
<TD rowspan="1">
|
<TD rowspan="1">
|
||||||
<DIV
|
<DIV style="width: 55px" align="center">执行人</DIV>
|
||||||
style="width: 55px"
|
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
执行人
|
|
||||||
</DIV>
|
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody style=" border-collapse:collapse;">
|
<tbody style=" border-collapse:collapse;">
|
||||||
<tr
|
<tr v-for="item in printData.recordData" :key="item.id">
|
||||||
v-for="item in printData.recordData"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<td v-html="item.moTime.substring(0,16)" />
|
<td v-html="item.moTime.substring(0,16)" />
|
||||||
<td v-html="item.orderName" />
|
<td v-html="item.orderName" />
|
||||||
<td v-html="item.flag" />
|
<td v-html="item.flag" />
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div ref="print">
|
<div ref="print">
|
||||||
<div
|
<div v-for="item in printData" :key="item.id">
|
||||||
v-for="item in printData"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<div class="myccs2">
|
<div class="myccs2">
|
||||||
<injectLabel
|
<injectLabel :ref="item.id" :print-data="item" />
|
||||||
:ref="item.id"
|
|
||||||
:print-data="item"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,21 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div ref="print">
|
<div ref="print">
|
||||||
<div
|
<div v-for="item in printData" :key="item.id">
|
||||||
v-for="item in printData"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<div class="myccs2">
|
<div class="myccs2">
|
||||||
<orderSheet
|
<orderSheet v-if="!item.type" :ref="item.id" :print-data="item" />
|
||||||
v-if="!item.type"
|
<exeOrderSheet v-if="item.type" :ref="item.id" :print-data="item" />
|
||||||
:ref="item.id"
|
|
||||||
:print-data="item"
|
|
||||||
/>
|
|
||||||
<exeOrderSheet
|
|
||||||
v-if="item.type"
|
|
||||||
:ref="item.id"
|
|
||||||
:print-data="item"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Graphics
|
<Graphics v-if="graphicsDataDone" :value="resInfo" print @done="printPage" />
|
||||||
v-if="graphicsDataDone"
|
|
||||||
:value="resInfo"
|
|
||||||
print
|
|
||||||
@done="printPage"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -21,10 +21,7 @@
|
|||||||
<span>分诊时间:</span>
|
<span>分诊时间:</span>
|
||||||
<span>{{ printData.triageTime }}</span>
|
<span>{{ printData.triageTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img ref="refQr" style="position: absolute; top: 10px; left: 100px" />
|
||||||
ref="refQr"
|
|
||||||
style="position: absolute; top: 10px; left: 100px"
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -33,6 +30,10 @@ import useUserStore from '@/store/modules/user';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TriageTicket',
|
name: 'TriageTicket',
|
||||||
|
setup() {
|
||||||
|
const userStore = useUserStore();
|
||||||
|
return { userStore };
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
printData: {
|
printData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -47,10 +48,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
|
||||||
const userStore = useUserStore();
|
|
||||||
return { userStore };
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div ref="print">
|
<div ref="print">
|
||||||
<div class="myccs2">
|
<div class="myccs2">
|
||||||
<triageTicketNew
|
<triageTicketNew ref="printTriage" :print-data="printData" />
|
||||||
ref="printTriage"
|
|
||||||
:print-data="printData"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div v-for="item in printData" :key="item.id">-->
|
<!-- <div v-for="item in printData" :key="item.id">-->
|
||||||
<!-- <div class="myccs2">-->
|
<!-- <div class="myccs2">-->
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
<span style="font-weight: bolder; font-size: 18px; line-height: 36px">{{ printData.greenText }}</span>
|
<span style="font-weight: bolder; font-size: 18px; line-height: 36px">{{ printData.greenText }}</span>
|
||||||
<span style="font-weight: bolder; font-size: 18px; line-height: 36px">分诊单</span>
|
<span style="font-weight: bolder; font-size: 18px; line-height: 36px">分诊单</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position: absolute; top: 135px; text-align: center; width: 300px">
|
<div style="position: absolute; top: 135px; text-align: center; width: 300px">{{ printData.hisId }}</div>
|
||||||
{{ printData.hisId }}
|
|
||||||
</div>
|
|
||||||
<div style="position: absolute; top: 155px; text-align: center; width: 300px">
|
<div style="position: absolute; top: 155px; text-align: center; width: 300px">
|
||||||
{{ printData.triageLevel }}({{ printData.dept }})
|
{{ printData.triageLevel }}({{ printData.dept }})
|
||||||
</div>
|
</div>
|
||||||
@@ -109,18 +107,10 @@
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<div style="margin-left: 15px">
|
<div style="margin-left: 15px">
|
||||||
<div style="font-size: 14px; margin-top: 15px; font-weight: bolder">
|
<div style="font-size: 14px; margin-top: 15px; font-weight: bolder">请仔细核对个人信息后进行挂号</div>
|
||||||
请仔细核对个人信息后进行挂号
|
<div style="margin-top: 5px; font-size: 14px">为了您家人和其他患者的健康</div>
|
||||||
</div>
|
<div style="font-size: 14px">请您保持就诊秩序保持诊区安静</div>
|
||||||
<div style="margin-top: 5px; font-size: 14px">
|
<div style="font-size: 14px">祝您早日康复</div>
|
||||||
为了您家人和其他患者的健康
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 14px">
|
|
||||||
请您保持就诊秩序保持诊区安静
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 14px">
|
|
||||||
祝您早日康复
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="printWrist">
|
<div class="printWrist">
|
||||||
<div
|
<div id="div1" class="printView_content">
|
||||||
id="div1"
|
|
||||||
class="printView_content"
|
|
||||||
>
|
|
||||||
<div style="margin: 1px;font-size: 12px">
|
<div style="margin: 1px;font-size: 12px">
|
||||||
<span>姓名: </span>
|
<span>姓名: </span>
|
||||||
<span>{{ printData.patientName }}</span>
|
<span>{{ printData.patientName }}</span>
|
||||||
@@ -25,11 +22,7 @@
|
|||||||
<span style="position: absolute; left: 140px">{{ printData.triageLevel }}</span>
|
<span style="position: absolute; left: 140px">{{ printData.triageLevel }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div id="qrcode" ref="refQr" style="padding-top: 1px" />
|
||||||
id="qrcode"
|
|
||||||
ref="refQr"
|
|
||||||
style="padding-top: 1px"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -1,21 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-breadcrumb
|
<el-breadcrumb class="app-breadcrumb" separator="/">
|
||||||
class="app-breadcrumb"
|
|
||||||
separator="/"
|
|
||||||
>
|
|
||||||
<transition-group name="breadcrumb">
|
<transition-group name="breadcrumb">
|
||||||
<el-breadcrumb-item
|
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||||
v-for="(item,index) in levelList"
|
<span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title }}</span>
|
||||||
:key="item.path"
|
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
||||||
>
|
|
||||||
<span
|
|
||||||
v-if="item.redirect === 'noRedirect' || index == levelList.length - 1"
|
|
||||||
class="no-redirect"
|
|
||||||
>{{ item.meta.title }}</span>
|
|
||||||
<a
|
|
||||||
v-else
|
|
||||||
@click.prevent="handleLink(item)"
|
|
||||||
>{{ item.meta.title }}</a>
|
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
|||||||
@@ -1,107 +1,55 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="1">
|
||||||
v-model="radioValue"
|
日,允许的通配符[, - * ? / L W]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
日,允许的通配符[, - * ? / L W]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="2">
|
||||||
v-model="radioValue"
|
不指定
|
||||||
:label="2"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
不指定
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="3">
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="3"
|
<el-input-number v-model='cycle01' :min="1" :max="30" /> -
|
||||||
>
|
<el-input-number v-model='cycle02' :min="cycle01 + 1" :max="31" /> 日
|
||||||
周期从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="cycle01"
|
|
||||||
:min="1"
|
|
||||||
:max="30"
|
|
||||||
/> -
|
|
||||||
<el-input-number
|
|
||||||
v-model="cycle02"
|
|
||||||
:min="cycle01 + 1"
|
|
||||||
:max="31"
|
|
||||||
/> 日
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="4">
|
||||||
v-model="radioValue"
|
从
|
||||||
:label="4"
|
<el-input-number v-model='average01' :min="1" :max="30" /> 号开始,每
|
||||||
>
|
<el-input-number v-model='average02' :min="1" :max="31 - average01" /> 日执行一次
|
||||||
从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="average01"
|
|
||||||
:min="1"
|
|
||||||
:max="30"
|
|
||||||
/> 号开始,每
|
|
||||||
<el-input-number
|
|
||||||
v-model="average02"
|
|
||||||
:min="1"
|
|
||||||
:max="31 - average01"
|
|
||||||
/> 日执行一次
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="5">
|
||||||
v-model="radioValue"
|
每月
|
||||||
:label="5"
|
<el-input-number v-model='workday' :min="1" :max="31" /> 号最近的那个工作日
|
||||||
>
|
</el-radio>
|
||||||
每月
|
</el-form-item>
|
||||||
<el-input-number
|
|
||||||
v-model="workday"
|
|
||||||
:min="1"
|
|
||||||
:max="31"
|
|
||||||
/> 号最近的那个工作日
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="6">
|
||||||
v-model="radioValue"
|
本月最后一天
|
||||||
:label="6"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
本月最后一天
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="7">
|
||||||
v-model="radioValue"
|
指定
|
||||||
:label="7"
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="10">
|
||||||
>
|
<el-option v-for="item in 31" :key="item" :label="item" :value="item" />
|
||||||
指定
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="checkboxList"
|
</el-form-item>
|
||||||
clearable
|
</el-form>
|
||||||
placeholder="可多选"
|
|
||||||
multiple
|
|
||||||
:multiple-limit="10"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in 31"
|
|
||||||
:key="item"
|
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit = defineEmits(['update'])
|
const emit = defineEmits(['update'])
|
||||||
|
|||||||
@@ -1,75 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="1">
|
||||||
v-model="radioValue"
|
小时,允许的通配符[, - * /]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
小时,允许的通配符[, - * /]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="2">
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="2"
|
<el-input-number v-model='cycle01' :min="0" :max="22" /> -
|
||||||
>
|
<el-input-number v-model='cycle02' :min="cycle01 + 1" :max="23" /> 时
|
||||||
周期从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="cycle01"
|
|
||||||
:min="0"
|
|
||||||
:max="22"
|
|
||||||
/> -
|
|
||||||
<el-input-number
|
|
||||||
v-model="cycle02"
|
|
||||||
:min="cycle01 + 1"
|
|
||||||
:max="23"
|
|
||||||
/> 时
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="3">
|
||||||
v-model="radioValue"
|
从
|
||||||
:label="3"
|
<el-input-number v-model='average01' :min="0" :max="22" /> 时开始,每
|
||||||
>
|
<el-input-number v-model='average02' :min="1" :max="23 - average01" /> 小时执行一次
|
||||||
从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="average01"
|
|
||||||
:min="0"
|
|
||||||
:max="22"
|
|
||||||
/> 时开始,每
|
|
||||||
<el-input-number
|
|
||||||
v-model="average02"
|
|
||||||
:min="1"
|
|
||||||
:max="23 - average01"
|
|
||||||
/> 小时执行一次
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="4">
|
||||||
v-model="radioValue"
|
指定
|
||||||
:label="4"
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="10">
|
||||||
>
|
<el-option v-for="item in 24" :key="item" :label="item - 1" :value="item - 1" />
|
||||||
指定
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="checkboxList"
|
</el-form-item>
|
||||||
clearable
|
</el-form>
|
||||||
placeholder="可多选"
|
|
||||||
multiple
|
|
||||||
:multiple-limit="10"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in 24"
|
|
||||||
:key="item"
|
|
||||||
:label="item - 1"
|
|
||||||
:value="item - 1"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,211 +1,123 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane
|
<el-tab-pane label="秒" v-if="shouldHide('second')">
|
||||||
v-if="shouldHide('second')"
|
<CrontabSecond
|
||||||
label="秒"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabSecond
|
:cron="crontabValueObj"
|
||||||
ref="cronsecond"
|
ref="cronsecond"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane
|
<el-tab-pane label="分钟" v-if="shouldHide('min')">
|
||||||
v-if="shouldHide('min')"
|
<CrontabMin
|
||||||
label="分钟"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabMin
|
:cron="crontabValueObj"
|
||||||
ref="cronmin"
|
ref="cronmin"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane
|
<el-tab-pane label="小时" v-if="shouldHide('hour')">
|
||||||
v-if="shouldHide('hour')"
|
<CrontabHour
|
||||||
label="小时"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabHour
|
:cron="crontabValueObj"
|
||||||
ref="cronhour"
|
ref="cronhour"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane
|
<el-tab-pane label="日" v-if="shouldHide('day')">
|
||||||
v-if="shouldHide('day')"
|
<CrontabDay
|
||||||
label="日"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabDay
|
:cron="crontabValueObj"
|
||||||
ref="cronday"
|
ref="cronday"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane
|
<el-tab-pane label="月" v-if="shouldHide('month')">
|
||||||
v-if="shouldHide('month')"
|
<CrontabMonth
|
||||||
label="月"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabMonth
|
:cron="crontabValueObj"
|
||||||
ref="cronmonth"
|
ref="cronmonth"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane
|
<el-tab-pane label="周" v-if="shouldHide('week')">
|
||||||
v-if="shouldHide('week')"
|
<CrontabWeek
|
||||||
label="周"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabWeek
|
:cron="crontabValueObj"
|
||||||
ref="cronweek"
|
ref="cronweek"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane
|
<el-tab-pane label="年" v-if="shouldHide('year')">
|
||||||
v-if="shouldHide('year')"
|
<CrontabYear
|
||||||
label="年"
|
@update="updateCrontabValue"
|
||||||
>
|
:check="checkNumber"
|
||||||
<CrontabYear
|
:cron="crontabValueObj"
|
||||||
ref="cronyear"
|
ref="cronyear"
|
||||||
:check="checkNumber"
|
/>
|
||||||
:cron="crontabValueObj"
|
</el-tab-pane>
|
||||||
@update="updateCrontabValue"
|
</el-tabs>
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
|
|
||||||
<div class="popup-main">
|
<div class="popup-main">
|
||||||
<div class="popup-result">
|
<div class="popup-result">
|
||||||
<p class="title">
|
<p class="title">时间表达式</p>
|
||||||
时间表达式
|
<table>
|
||||||
</p>
|
<thead>
|
||||||
<table>
|
<th v-for="item of tabTitles" :key="item">{{item}}</th>
|
||||||
<thead>
|
<th>Cron 表达式</th>
|
||||||
<th
|
</thead>
|
||||||
v-for="item of tabTitles"
|
<tbody>
|
||||||
:key="item"
|
<td>
|
||||||
>
|
<span v-if="crontabValueObj.second.length < 10">{{crontabValueObj.second}}</span>
|
||||||
{{ item }}
|
<el-tooltip v-else :content="crontabValueObj.second" placement="top"><span>{{crontabValueObj.second}}</span></el-tooltip>
|
||||||
</th>
|
</td>
|
||||||
<th>Cron 表达式</th>
|
<td>
|
||||||
</thead>
|
<span v-if="crontabValueObj.min.length < 10">{{crontabValueObj.min}}</span>
|
||||||
<tbody>
|
<el-tooltip v-else :content="crontabValueObj.min" placement="top"><span>{{crontabValueObj.min}}</span></el-tooltip>
|
||||||
<td>
|
</td>
|
||||||
<span v-if="crontabValueObj.second.length < 10">{{ crontabValueObj.second }}</span>
|
<td>
|
||||||
<el-tooltip
|
<span v-if="crontabValueObj.hour.length < 10">{{crontabValueObj.hour}}</span>
|
||||||
v-else
|
<el-tooltip v-else :content="crontabValueObj.hour" placement="top"><span>{{crontabValueObj.hour}}</span></el-tooltip>
|
||||||
:content="crontabValueObj.second"
|
</td>
|
||||||
placement="top"
|
<td>
|
||||||
>
|
<span v-if="crontabValueObj.day.length < 10">{{crontabValueObj.day}}</span>
|
||||||
<span>{{ crontabValueObj.second }}</span>
|
<el-tooltip v-else :content="crontabValueObj.day" placement="top"><span>{{crontabValueObj.day}}</span></el-tooltip>
|
||||||
</el-tooltip>
|
</td>
|
||||||
</td>
|
<td>
|
||||||
<td>
|
<span v-if="crontabValueObj.month.length < 10">{{crontabValueObj.month}}</span>
|
||||||
<span v-if="crontabValueObj.min.length < 10">{{ crontabValueObj.min }}</span>
|
<el-tooltip v-else :content="crontabValueObj.month" placement="top"><span>{{crontabValueObj.month}}</span></el-tooltip>
|
||||||
<el-tooltip
|
</td>
|
||||||
v-else
|
<td>
|
||||||
:content="crontabValueObj.min"
|
<span v-if="crontabValueObj.week.length < 10">{{crontabValueObj.week}}</span>
|
||||||
placement="top"
|
<el-tooltip v-else :content="crontabValueObj.week" placement="top"><span>{{crontabValueObj.week}}</span></el-tooltip>
|
||||||
>
|
</td>
|
||||||
<span>{{ crontabValueObj.min }}</span>
|
<td>
|
||||||
</el-tooltip>
|
<span v-if="crontabValueObj.year.length < 10">{{crontabValueObj.year}}</span>
|
||||||
</td>
|
<el-tooltip v-else :content="crontabValueObj.year" placement="top"><span>{{crontabValueObj.year}}</span></el-tooltip>
|
||||||
<td>
|
</td>
|
||||||
<span v-if="crontabValueObj.hour.length < 10">{{ crontabValueObj.hour }}</span>
|
<td class="result">
|
||||||
<el-tooltip
|
<span v-if="crontabValueString.length < 90">{{crontabValueString}}</span>
|
||||||
v-else
|
<el-tooltip v-else :content="crontabValueString" placement="top"><span>{{crontabValueString}}</span></el-tooltip>
|
||||||
:content="crontabValueObj.hour"
|
</td>
|
||||||
placement="top"
|
</tbody>
|
||||||
>
|
</table>
|
||||||
<span>{{ crontabValueObj.hour }}</span>
|
</div>
|
||||||
</el-tooltip>
|
<CrontabResult :ex="crontabValueString"></CrontabResult>
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span v-if="crontabValueObj.day.length < 10">{{ crontabValueObj.day }}</span>
|
|
||||||
<el-tooltip
|
|
||||||
v-else
|
|
||||||
:content="crontabValueObj.day"
|
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<span>{{ crontabValueObj.day }}</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span v-if="crontabValueObj.month.length < 10">{{ crontabValueObj.month }}</span>
|
|
||||||
<el-tooltip
|
|
||||||
v-else
|
|
||||||
:content="crontabValueObj.month"
|
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<span>{{ crontabValueObj.month }}</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span v-if="crontabValueObj.week.length < 10">{{ crontabValueObj.week }}</span>
|
|
||||||
<el-tooltip
|
|
||||||
v-else
|
|
||||||
:content="crontabValueObj.week"
|
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<span>{{ crontabValueObj.week }}</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span v-if="crontabValueObj.year.length < 10">{{ crontabValueObj.year }}</span>
|
|
||||||
<el-tooltip
|
|
||||||
v-else
|
|
||||||
:content="crontabValueObj.year"
|
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<span>{{ crontabValueObj.year }}</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
|
||||||
<td class="result">
|
|
||||||
<span v-if="crontabValueString.length < 90">{{ crontabValueString }}</span>
|
|
||||||
<el-tooltip
|
|
||||||
v-else
|
|
||||||
:content="crontabValueString"
|
|
||||||
placement="top"
|
|
||||||
>
|
|
||||||
<span>{{ crontabValueString }}</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</td>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<CrontabResult :ex="crontabValueString" />
|
|
||||||
|
|
||||||
<div class="pop_btn">
|
<div class="pop_btn">
|
||||||
<el-button
|
<el-button type="primary" @click="submitFill">确定</el-button>
|
||||||
type="primary"
|
<el-button type="warning" @click="clearCron">重置</el-button>
|
||||||
@click="submitFill"
|
<el-button @click="hidePopup">取消</el-button>
|
||||||
>
|
</div>
|
||||||
确定
|
</div>
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
@click="clearCron"
|
|
||||||
>
|
|
||||||
重置
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="hidePopup">
|
|
||||||
取消
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,75 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="1">
|
||||||
v-model="radioValue"
|
分钟,允许的通配符[, - * /]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
分钟,允许的通配符[, - * /]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="2">
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="2"
|
<el-input-number v-model='cycle01' :min="0" :max="58" /> -
|
||||||
>
|
<el-input-number v-model='cycle02' :min="cycle01 + 1" :max="59" /> 分钟
|
||||||
周期从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="cycle01"
|
|
||||||
:min="0"
|
|
||||||
:max="58"
|
|
||||||
/> -
|
|
||||||
<el-input-number
|
|
||||||
v-model="cycle02"
|
|
||||||
:min="cycle01 + 1"
|
|
||||||
:max="59"
|
|
||||||
/> 分钟
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="3">
|
||||||
v-model="radioValue"
|
从
|
||||||
:label="3"
|
<el-input-number v-model='average01' :min="0" :max="58" /> 分钟开始, 每
|
||||||
>
|
<el-input-number v-model='average02' :min="1" :max="59 - average01" /> 分钟执行一次
|
||||||
从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="average01"
|
|
||||||
:min="0"
|
|
||||||
:max="58"
|
|
||||||
/> 分钟开始, 每
|
|
||||||
<el-input-number
|
|
||||||
v-model="average02"
|
|
||||||
:min="1"
|
|
||||||
:max="59 - average01"
|
|
||||||
/> 分钟执行一次
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="4">
|
||||||
v-model="radioValue"
|
指定
|
||||||
:label="4"
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="10">
|
||||||
>
|
<el-option v-for="item in 60" :key="item" :label="item - 1" :value="item - 1" />
|
||||||
指定
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="checkboxList"
|
</el-form-item>
|
||||||
clearable
|
</el-form>
|
||||||
placeholder="可多选"
|
|
||||||
multiple
|
|
||||||
:multiple-limit="10"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in 60"
|
|
||||||
:key="item"
|
|
||||||
:label="item - 1"
|
|
||||||
:value="item - 1"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit = defineEmits(['update'])
|
const emit = defineEmits(['update'])
|
||||||
|
|||||||
@@ -1,75 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="1">
|
||||||
v-model="radioValue"
|
月,允许的通配符[, - * /]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
月,允许的通配符[, - * /]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="2">
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="2"
|
<el-input-number v-model='cycle01' :min="1" :max="11" /> -
|
||||||
>
|
<el-input-number v-model='cycle02' :min="cycle01 + 1" :max="12" /> 月
|
||||||
周期从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="cycle01"
|
|
||||||
:min="1"
|
|
||||||
:max="11"
|
|
||||||
/> -
|
|
||||||
<el-input-number
|
|
||||||
v-model="cycle02"
|
|
||||||
:min="cycle01 + 1"
|
|
||||||
:max="12"
|
|
||||||
/> 月
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="3">
|
||||||
v-model="radioValue"
|
从
|
||||||
:label="3"
|
<el-input-number v-model='average01' :min="1" :max="11" /> 月开始,每
|
||||||
>
|
<el-input-number v-model='average02' :min="1" :max="12 - average01" /> 月月执行一次
|
||||||
从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="average01"
|
|
||||||
:min="1"
|
|
||||||
:max="11"
|
|
||||||
/> 月开始,每
|
|
||||||
<el-input-number
|
|
||||||
v-model="average02"
|
|
||||||
:min="1"
|
|
||||||
:max="12 - average01"
|
|
||||||
/> 月月执行一次
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="4">
|
||||||
v-model="radioValue"
|
指定
|
||||||
:label="4"
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="8">
|
||||||
>
|
<el-option v-for="item in monthList" :key="item.key" :label="item.value" :value="item.key" />
|
||||||
指定
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="checkboxList"
|
</el-form-item>
|
||||||
clearable
|
</el-form>
|
||||||
placeholder="可多选"
|
|
||||||
multiple
|
|
||||||
:multiple-limit="8"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in monthList"
|
|
||||||
:key="item.key"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="popup-result">
|
<div class="popup-result">
|
||||||
<p class="title">
|
<p class="title">最近5次运行时间</p>
|
||||||
最近5次运行时间
|
<ul class="popup-result-scroll">
|
||||||
</p>
|
<template v-if='isShow'>
|
||||||
<ul class="popup-result-scroll">
|
<li v-for='item in resultList' :key="item">{{item}}</li>
|
||||||
<template v-if="isShow">
|
</template>
|
||||||
<li
|
<li v-else>计算结果中...</li>
|
||||||
v-for="item in resultList"
|
</ul>
|
||||||
:key="item"
|
</div>
|
||||||
>
|
|
||||||
{{ item }}
|
|
||||||
</li>
|
|
||||||
</template>
|
|
||||||
<li v-else>
|
|
||||||
计算结果中...
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,75 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="1">
|
||||||
v-model="radioValue"
|
秒,允许的通配符[, - * /]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
秒,允许的通配符[, - * /]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="2">
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="2"
|
<el-input-number v-model='cycle01' :min="0" :max="58" /> -
|
||||||
>
|
<el-input-number v-model='cycle02' :min="cycle01 + 1" :max="59" /> 秒
|
||||||
周期从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="cycle01"
|
|
||||||
:min="0"
|
|
||||||
:max="58"
|
|
||||||
/> -
|
|
||||||
<el-input-number
|
|
||||||
v-model="cycle02"
|
|
||||||
:min="cycle01 + 1"
|
|
||||||
:max="59"
|
|
||||||
/> 秒
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="3">
|
||||||
v-model="radioValue"
|
从
|
||||||
:label="3"
|
<el-input-number v-model='average01' :min="0" :max="58" /> 秒开始,每
|
||||||
>
|
<el-input-number v-model='average02' :min="1" :max="59 - average01" /> 秒执行一次
|
||||||
从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="average01"
|
|
||||||
:min="0"
|
|
||||||
:max="58"
|
|
||||||
/> 秒开始,每
|
|
||||||
<el-input-number
|
|
||||||
v-model="average02"
|
|
||||||
:min="1"
|
|
||||||
:max="59 - average01"
|
|
||||||
/> 秒执行一次
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="4">
|
||||||
v-model="radioValue"
|
指定
|
||||||
:label="4"
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="10">
|
||||||
>
|
<el-option v-for="item in 60" :key="item" :label="item - 1" :value="item - 1" />
|
||||||
指定
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="checkboxList"
|
</el-form-item>
|
||||||
clearable
|
</el-form>
|
||||||
placeholder="可多选"
|
|
||||||
multiple
|
|
||||||
:multiple-limit="10"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in 60"
|
|
||||||
:key="item"
|
|
||||||
:label="item - 1"
|
|
||||||
:value="item - 1"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,130 +1,71 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="1">
|
||||||
v-model="radioValue"
|
周,允许的通配符[, - * ? / L #]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
周,允许的通配符[, - * ? / L #]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="2">
|
||||||
v-model="radioValue"
|
不指定
|
||||||
:label="2"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
不指定
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="3">
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="3"
|
<el-select clearable v-model="cycle01">
|
||||||
>
|
<el-option
|
||||||
周期从
|
v-for="(item,index) of weekList"
|
||||||
<el-select
|
:key="index"
|
||||||
v-model="cycle01"
|
:label="item.value"
|
||||||
clearable
|
:value="item.key"
|
||||||
>
|
:disabled="item.key === 7"
|
||||||
<el-option
|
>{{item.value}}</el-option>
|
||||||
v-for="(item,index) of weekList"
|
</el-select>
|
||||||
:key="index"
|
-
|
||||||
:label="item.value"
|
<el-select clearable v-model="cycle02">
|
||||||
:value="item.key"
|
<el-option
|
||||||
:disabled="item.key === 7"
|
v-for="(item,index) of weekList"
|
||||||
>
|
:key="index"
|
||||||
{{ item.value }}
|
:label="item.value"
|
||||||
</el-option>
|
:value="item.key"
|
||||||
</el-select>
|
:disabled="item.key <= cycle01"
|
||||||
-
|
>{{item.value}}</el-option>
|
||||||
<el-select
|
</el-select>
|
||||||
v-model="cycle02"
|
</el-radio>
|
||||||
clearable
|
</el-form-item>
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="(item,index) of weekList"
|
|
||||||
:key="index"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.key"
|
|
||||||
:disabled="item.key <= cycle01"
|
|
||||||
>
|
|
||||||
{{ item.value }}
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="4">
|
||||||
v-model="radioValue"
|
第
|
||||||
:label="4"
|
<el-input-number v-model='average01' :min="1" :max="4" /> 周的
|
||||||
>
|
<el-select clearable v-model="average02">
|
||||||
第
|
<el-option v-for="item in weekList" :key="item.key" :label="item.value" :value="item.key" />
|
||||||
<el-input-number
|
</el-select>
|
||||||
v-model="average01"
|
</el-radio>
|
||||||
:min="1"
|
</el-form-item>
|
||||||
:max="4"
|
|
||||||
/> 周的
|
|
||||||
<el-select
|
|
||||||
v-model="average02"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in weekList"
|
|
||||||
:key="item.key"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="5">
|
||||||
v-model="radioValue"
|
本月最后一个
|
||||||
:label="5"
|
<el-select clearable v-model="weekday">
|
||||||
>
|
<el-option v-for="item in weekList" :key="item.key" :label="item.value" :value="item.key" />
|
||||||
本月最后一个
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="weekday"
|
</el-form-item>
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in weekList"
|
|
||||||
:key="item.key"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio v-model='radioValue' :label="6">
|
||||||
v-model="radioValue"
|
指定
|
||||||
:label="6"
|
<el-select class="multiselect" clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="6">
|
||||||
>
|
<el-option v-for="item in weekList" :key="item.key" :label="item.value" :value="item.key" />
|
||||||
指定
|
</el-select>
|
||||||
<el-select
|
</el-radio>
|
||||||
v-model="checkboxList"
|
</el-form-item>
|
||||||
class="multiselect"
|
|
||||||
clearable
|
</el-form>
|
||||||
placeholder="可多选"
|
|
||||||
multiple
|
|
||||||
:multiple-limit="6"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in weekList"
|
|
||||||
:key="item.key"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -1,84 +1,43 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio :label="1" v-model='radioValue'>
|
||||||
v-model="radioValue"
|
不填,允许的通配符[, - * /]
|
||||||
:label="1"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
不填,允许的通配符[, - * /]
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio :label="2" v-model='radioValue'>
|
||||||
v-model="radioValue"
|
每年
|
||||||
:label="2"
|
</el-radio>
|
||||||
>
|
</el-form-item>
|
||||||
每年
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio :label="3" v-model='radioValue'>
|
||||||
v-model="radioValue"
|
周期从
|
||||||
:label="3"
|
<el-input-number v-model='cycle01' :min='fullYear' :max="2098"/> -
|
||||||
>
|
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : fullYear + 1" :max="2099"/>
|
||||||
周期从
|
</el-radio>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="cycle01"
|
|
||||||
:min="fullYear"
|
|
||||||
:max="2098"
|
|
||||||
/> -
|
|
||||||
<el-input-number
|
|
||||||
v-model="cycle02"
|
|
||||||
:min="cycle01 ? cycle01 + 1 : fullYear + 1"
|
|
||||||
:max="2099"
|
|
||||||
/>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio
|
<el-radio :label="4" v-model='radioValue'>
|
||||||
v-model="radioValue"
|
从
|
||||||
:label="4"
|
<el-input-number v-model='average01' :min='fullYear' :max="2098"/> 年开始,每
|
||||||
>
|
<el-input-number v-model='average02' :min="1" :max="2099 - average01 || fullYear"/> 年执行一次
|
||||||
从
|
</el-radio>
|
||||||
<el-input-number
|
|
||||||
v-model="average01"
|
|
||||||
:min="fullYear"
|
|
||||||
:max="2098"
|
|
||||||
/> 年开始,每
|
|
||||||
<el-input-number
|
|
||||||
v-model="average02"
|
|
||||||
:min="1"
|
|
||||||
:max="2099 - average01 || fullYear"
|
|
||||||
/> 年执行一次
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
</el-form-item>
|
||||||
<el-radio
|
|
||||||
v-model="radioValue"
|
<el-form-item>
|
||||||
:label="5"
|
<el-radio :label="5" v-model='radioValue'>
|
||||||
>
|
指定
|
||||||
指定
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple :multiple-limit="8">
|
||||||
<el-select
|
<el-option v-for="item in 9" :key="item" :value="item - 1 + fullYear" :label="item -1 + fullYear" />
|
||||||
v-model="checkboxList"
|
</el-select>
|
||||||
clearable
|
</el-radio>
|
||||||
placeholder="可多选"
|
</el-form-item>
|
||||||
multiple
|
</el-form>
|
||||||
:multiple-limit="8"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in 9"
|
|
||||||
:key="item"
|
|
||||||
:value="item - 1 + fullYear"
|
|
||||||
:label="item -1 + fullYear"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -10,14 +10,12 @@
|
|||||||
>{{ item.label + " " }}</span>
|
>{{ item.label + " " }}</span>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-else
|
v-else
|
||||||
:key="item.value + ''"
|
|
||||||
:disable-transitions="true"
|
:disable-transitions="true"
|
||||||
|
:key="item.value + ''"
|
||||||
:index="index"
|
:index="index"
|
||||||
:type="getValidTagType(item.elTagType)"
|
:type="getValidTagType(item.elTagType)"
|
||||||
:class="item.elTagClass"
|
:class="item.elTagClass"
|
||||||
>
|
>{{ item.label + " " }}</el-tag>
|
||||||
{{ item.label + " " }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="unmatch && showValue">
|
<template v-if="unmatch && showValue">
|
||||||
|
|||||||
@@ -1,33 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="editor-container">
|
<div class="editor-container">
|
||||||
<div>
|
<div>
|
||||||
<el-upload
|
<el-upload :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleUploadSuccess"
|
||||||
v-if="type == 'url'"
|
:on-error="handleUploadError" name="file" :show-file-list="false" :headers="headers" class="editor-img-uploader"
|
||||||
:action="uploadUrl"
|
v-if="type == 'url'">
|
||||||
:before-upload="handleBeforeUpload"
|
<i ref="uploadRef" class="editor-img-uploader"></i>
|
||||||
:on-success="handleUploadSuccess"
|
|
||||||
:on-error="handleUploadError"
|
|
||||||
name="file"
|
|
||||||
:show-file-list="false"
|
|
||||||
:headers="headers"
|
|
||||||
class="editor-img-uploader"
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
ref="uploadRef"
|
|
||||||
class="editor-img-uploader"
|
|
||||||
/>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
<div class="editor">
|
<div class="editor">
|
||||||
<quill-editor
|
<quill-editor ref="quillEditorRef" :content="content" @update:content="content = $event" contentType="html"
|
||||||
ref="quillEditorRef"
|
@textChange="(e) => $emit('update:modelValue', content)" :options="options" :style="styles" />
|
||||||
:content="content"
|
|
||||||
content-type="html"
|
|
||||||
:options="options"
|
|
||||||
:style="styles"
|
|
||||||
@update:content="content = $event"
|
|
||||||
@text-change="(e) => $emit('update:modelValue', content)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<div class="upload-file">
|
<div class="upload-file">
|
||||||
<el-upload
|
<el-upload
|
||||||
multiple
|
multiple
|
||||||
ref="fileUpload"
|
|
||||||
:action="uploadFileUrl"
|
:action="uploadFileUrl"
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
@@ -13,52 +12,26 @@
|
|||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
class="upload-file-uploader"
|
class="upload-file-uploader"
|
||||||
|
ref="fileUpload"
|
||||||
>
|
>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<el-button type="primary">
|
<el-button type="primary">选取文件</el-button>
|
||||||
选取文件
|
|
||||||
</el-button>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div
|
<div class="el-upload__tip" v-if="showTip">
|
||||||
v-if="showTip"
|
|
||||||
class="el-upload__tip"
|
|
||||||
>
|
|
||||||
请上传
|
请上传
|
||||||
<template v-if="fileSize">
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||||
</template>
|
|
||||||
<template v-if="fileType">
|
|
||||||
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
|
|
||||||
</template>
|
|
||||||
的文件
|
的文件
|
||||||
</div>
|
</div>
|
||||||
<!-- 文件列表 -->
|
<!-- 文件列表 -->
|
||||||
<transition-group
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||||
class="upload-file-list el-upload-list el-upload-list--text"
|
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
||||||
name="el-fade-in-linear"
|
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
||||||
tag="ul"
|
|
||||||
>
|
|
||||||
<li
|
|
||||||
v-for="(file, index) in fileList"
|
|
||||||
:key="file.uid"
|
|
||||||
class="el-upload-list__item ele-upload-list__item-content"
|
|
||||||
>
|
|
||||||
<el-link
|
|
||||||
:href="`${baseUrl}${file.url}`"
|
|
||||||
:underline="false"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
<div class="ele-upload-list__item-content-action">
|
<div class="ele-upload-list__item-content-action">
|
||||||
<el-link
|
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
||||||
:underline="false"
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(index)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-link>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div style="padding: 0 15px;" @click="toggleClick">
|
||||||
style="padding: 0 15px;"
|
|
||||||
@click="toggleClick"
|
|
||||||
>
|
|
||||||
<svg
|
<svg
|
||||||
:class="{'is-active':isActive}"
|
:class="{'is-active':isActive}"
|
||||||
class="hamburger"
|
class="hamburger"
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div :class="{ show: show }" class="header-search">
|
||||||
:class="{ show: show }"
|
<svg-icon class-name="search-icon" icon-class="search" @click.stop="click" v-if="!show" />
|
||||||
class="header-search"
|
|
||||||
>
|
|
||||||
<svg-icon
|
|
||||||
v-if="!show"
|
|
||||||
class-name="search-icon"
|
|
||||||
icon-class="search"
|
|
||||||
@click.stop="click"
|
|
||||||
/>
|
|
||||||
<el-select
|
<el-select
|
||||||
v-else
|
v-else
|
||||||
ref="headerSearchSelectRef"
|
ref="headerSearchSelectRef"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user