revert: restore develop to clean baseline 5132de36 (remove all AI changes)
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Integrity Check — 定时巡检 develop 分支的完整性
|
||||
# 用法: bash .githooks/integrity-check.sh
|
||||
# 建议: crontab 每天 8:00 执行一次
|
||||
# ============================================================
|
||||
|
||||
# 配置
|
||||
REMOTE="origin"
|
||||
BRANCH="develop"
|
||||
WORK_DIR="/tmp/his-integrity-check"
|
||||
|
||||
# 受保护路径
|
||||
PATHS=(
|
||||
"openhis-server-new/pom.xml"
|
||||
"openhis-server-new/core-admin/pom.xml"
|
||||
"openhis-server-new/core-common/pom.xml"
|
||||
"openhis-server-new/core-flowable/pom.xml"
|
||||
"openhis-server-new/core-framework/pom.xml"
|
||||
"openhis-server-new/core-generator/pom.xml"
|
||||
"openhis-server-new/core-quartz/pom.xml"
|
||||
"openhis-server-new/core-system/pom.xml"
|
||||
"openhis-server-new/openhis-application/pom.xml"
|
||||
"openhis-server-new/openhis-domain/pom.xml"
|
||||
"openhis-server-new/openhis-common/pom.xml"
|
||||
)
|
||||
|
||||
echo "== Integrity Check $(date) =="
|
||||
|
||||
# 拉取最新
|
||||
cd $WORK_DIR 2>/dev/null || (mkdir -p $WORK_DIR && cd $WORK_DIR && git clone --depth=1 http://zhangfei:GentronHIS2025@192.168.110.253:3000/wangyizhe/his.git . 2>/dev/null)
|
||||
cd $WORK_DIR && git fetch origin $BRANCH --depth=1 2>/dev/null && git reset --hard origin/$BRANCH 2>/dev/null
|
||||
|
||||
ALL_PASS=true
|
||||
|
||||
# 检查每个路径是否存在
|
||||
for path in "${PATHS[@]}"; do
|
||||
if git ls-tree -r HEAD --name-only 2>/dev/null | grep -q "^$path$"; then
|
||||
echo " ✅ $path"
|
||||
else
|
||||
echo " ❌ $path — 丢失!"
|
||||
ALL_PASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
# 检查最近10次提交是否有异常
|
||||
echo ""
|
||||
echo "最近10次提交:"
|
||||
git log --oneline -10 2>/dev/null | while read sha msg; do
|
||||
# 检查删除文件数
|
||||
del=$(git diff --name-status ${sha}^..${sha} 2>/dev/null | grep -c "^D")
|
||||
if [ "$del" -gt 100 ]; then
|
||||
echo " ⚠️ $sha 删除了 $del 个文件! $msg"
|
||||
else
|
||||
echo " ✓ $sha ($del 删除) $msg"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$ALL_PASS" = true ]; then
|
||||
echo ""
|
||||
echo "✅ 完整性检查通过"
|
||||
else
|
||||
echo ""
|
||||
echo "❌ 完整性检查失败! 请立即处理!"
|
||||
fi
|
||||
@@ -1,86 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Pre-push Hook — HIS 项目防误删保护
|
||||
# 功能: 推送前检查是否删除了关键文件或大量文件
|
||||
# 安装: git config core.hooksPath .githooks
|
||||
# ============================================================
|
||||
|
||||
REMOTE="$1"
|
||||
URL="$2"
|
||||
ZERO="0000000000000000000000000000000000000000"
|
||||
|
||||
# 受保护路径列表 (严禁删除)
|
||||
PROTECTED_PATHS=(
|
||||
"openhis-server-new/pom.xml"
|
||||
"openhis-server-new/core-admin"
|
||||
"openhis-server-new/core-framework"
|
||||
"openhis-server-new/core-system"
|
||||
"openhis-server-new/core-common"
|
||||
"openhis-server-new/core-flowable"
|
||||
"openhis-server-new/core-quartz"
|
||||
"openhis-server-new/core-generator"
|
||||
"openhis-server-new/openhis-application"
|
||||
"openhis-server-new/openhis-domain"
|
||||
"openhis-server-new/openhis-common"
|
||||
)
|
||||
|
||||
MAX_DELETE_FILES=100
|
||||
|
||||
echo "==========================================="
|
||||
echo " Pre-push: 推送安全检查"
|
||||
echo "==========================================="
|
||||
|
||||
while read local_ref local_sha remote_ref remote_sha; do
|
||||
# 跳过删除分支操作
|
||||
[ "$local_sha" = "$ZERO" ] && continue
|
||||
|
||||
# 新分支没有 remote_sha,用 origin/develop 做基准
|
||||
if [ "$remote_sha" = "$ZERO" ]; then
|
||||
remote_sha=$(git rev-parse origin/develop 2>/dev/null || echo "")
|
||||
[ -z "$remote_sha" ] && continue
|
||||
fi
|
||||
|
||||
# ==== 检查 1: 是否删除了受保护路径 ====
|
||||
for path in "${PROTECTED_PATHS[@]}"; do
|
||||
if git diff --name-status "$remote_sha".."$local_sha" 2>/dev/null | grep -q "^D.*$path"; then
|
||||
echo "错误: 受保护路径被删除!"
|
||||
echo " 路径: $path"
|
||||
echo " 本次推送已拦截。如确有需要,请联系仓库管理员。"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# ==== 检查 2: 是否删除了过多文件 ====
|
||||
delete_count=$(git diff --name-status "$remote_sha".."$local_sha" 2>/dev/null | grep -c "^D")
|
||||
if [ "$delete_count" -gt "$MAX_DELETE_FILES" ]; then
|
||||
echo "错误: 本次推送删除了 $delete_count 个文件 (阈值: $MAX_DELETE_FILES)"
|
||||
echo " 请检查是否有误删操作。确认需要推送请执行:"
|
||||
echo " git push --no-verify origin $local_ref:$remote_ref"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ==== 检查 3: 是否删除了 pom.xml (任何位置) ====
|
||||
deleted_poms=$(git diff --name-status "$remote_sha".."$local_sha" 2>/dev/null | grep "^D.*pom.xml")
|
||||
if [ -n "$deleted_poms" ]; then
|
||||
echo "错误: pom.xml 文件被删除!"
|
||||
echo "$deleted_poms"
|
||||
echo " 本次推送已拦截。"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ==== 检查 4: 删除/新增比例异常 ====
|
||||
add_count=$(git diff --name-status "$remote_sha".."$local_sha" 2>/dev/null | grep -c "^[AMR]")
|
||||
if [ "$delete_count" -gt 0 ] && [ "$add_count" -gt 0 ]; then
|
||||
ratio=$((delete_count * 100 / add_count))
|
||||
if [ "$ratio" -gt 80 ]; then
|
||||
echo "警告: 删除文件比例异常 ($ratio% 是删除)"
|
||||
echo " 删除: $delete_count / 新增: $add_count"
|
||||
echo " 请人工确认后重新推送。"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Pre-push 检查通过 ($add_count 新增, $delete_count 删除)"
|
||||
done
|
||||
|
||||
exit 0
|
||||
20
AGENTS.md
20
AGENTS.md
@@ -185,22 +185,4 @@ npm run preview
|
||||
- 前端端口:81
|
||||
- API 前缀:`/openhis`
|
||||
- Swagger UI:`/openhis/swagger-ui/index.html`
|
||||
- Druid 监控:`/openhis/druid/login.html`
|
||||
## 🔒 安全铁律
|
||||
|
||||
### 受保护路径(严禁删除)
|
||||
以下文件和目录在任何提交中都禁止删除:
|
||||
- `openhis-server-new/pom.xml`
|
||||
- `openhis-server-new/core-admin/`、`core-common/`、`core-flowable/`、`core-framework/`、`core-generator/`、`core-quartz/`、`core-system/`
|
||||
- `openhis-server-new/openhis-application/`、`openhis-domain/`、`openhis-common/`
|
||||
- 任何 `pom.xml` 文件
|
||||
|
||||
### 提交规范
|
||||
1. **单次提交删除文件数不得超过 100 个**
|
||||
2. **删除/新增文件比例不得超过 80%**
|
||||
3. **提交前执行 `git diff --stat` 检查变更范围**
|
||||
4. **不确定的操作优先用 `git revert` 而不是 `git rm`**
|
||||
|
||||
### 违规后果
|
||||
违反上述规则会导致推送被 `pre-push` 钩子拦截,或触发 Gitea 分支保护规则。
|
||||
|
||||
- Druid 监控:`/openhis/druid/login.html`
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.openhis.web.inpatient.controller;
|
||||
|
||||
import com.openhis.web.inpatient.service.impl.DispenseServiceImpl;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 住院发退药控制层
|
||||
*
|
||||
* 新增/修改接口,使其调用新的业务实现,确保明细与汇总单同步更新。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/inpatient/dispense")
|
||||
public class DispenseController {
|
||||
|
||||
private final DispenseServiceImpl dispenseService;
|
||||
|
||||
public DispenseController(DispenseServiceImpl dispenseService) {
|
||||
this.dispenseService = dispenseService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发药接口
|
||||
*
|
||||
* @param dispenseId 发药单 ID
|
||||
* @param quantity 发药数量
|
||||
* @return {code:0,msg:"发药成功"} 或 {code:1,msg:"错误信息"}
|
||||
*/
|
||||
@PostMapping("/do")
|
||||
public Map<String, Object> dispense(@RequestParam Long dispenseId,
|
||||
@RequestParam Integer quantity) {
|
||||
return dispenseService.dispense(dispenseId, quantity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退药接口
|
||||
*
|
||||
* @param dispenseId 发药单 ID
|
||||
* @param quantity 退药数量
|
||||
* @return {code:0,msg:"退药成功"} 或 {code:1,msg:"错误信息"}
|
||||
*/
|
||||
@PostMapping("/return")
|
||||
public Map<String, Object> returnDrug(@RequestParam Long dispenseId,
|
||||
@RequestParam Integer quantity) {
|
||||
return dispenseService.returnDrug(dispenseId, quantity);
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.openhis.web.inpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 住院发退药数据访问层
|
||||
*
|
||||
* 为了解决 Bug #503,新增两条 SQL:
|
||||
* 1. {@link #insertDetail(Long, Integer)} – 写入发/退药明细。
|
||||
* 2. {@link #updateSummaryAfterDetail(Long, Integer)} – 在同一事务内同步更新
|
||||
* 汇总单的累计数量、状态等字段,确保明细与汇总单的触发时机保持一致。
|
||||
*/
|
||||
@Mapper
|
||||
public interface DispenseMapper {
|
||||
|
||||
/**
|
||||
* 插入发药(或退药)明细记录。
|
||||
*
|
||||
* @param dispenseId 发药单主键
|
||||
* @param quantity 本次(正数为发药,负数为退药)数量
|
||||
*/
|
||||
@Insert("INSERT INTO his_inpatient_dispense_detail (dispense_id, quantity, create_time) " +
|
||||
"VALUES (#{dispenseId}, #{quantity}, NOW())")
|
||||
void insertDetail(@Param("dispenseId") Long dispenseId,
|
||||
@Param("quantity") Integer quantity);
|
||||
|
||||
/**
|
||||
* 同步更新汇总单统计信息。
|
||||
*
|
||||
* 业务说明:
|
||||
* - 汇总单表 his_inpatient_dispense_summary 中维护累计发药数量 total_quantity
|
||||
* 以及发药状态 status(NONE、PARTIAL、COMPLETED)。
|
||||
* - 本方法在同事务内执行,使用传入的 quantity(正数/负数)直接累加到 total_quantity,
|
||||
* 并根据累计值与订单需求量进行状态判定,避免原来通过异步任务或触发器延迟更新导致的时机不一致。
|
||||
*
|
||||
* @param dispenseId 发药单主键
|
||||
* @param quantity 本次(正数为发药,负数为退药)数量
|
||||
*/
|
||||
@Update({
|
||||
"<script>",
|
||||
"UPDATE his_inpatient_dispense_summary",
|
||||
"SET total_quantity = total_quantity + #{quantity},",
|
||||
" status = CASE",
|
||||
" WHEN total_quantity + #{quantity} = 0 THEN 'NONE'",
|
||||
" WHEN total_quantity + #{quantity} < required_quantity THEN 'PARTIAL'",
|
||||
" ELSE 'COMPLETED'",
|
||||
" END",
|
||||
"WHERE dispense_id = #{dispenseId}",
|
||||
"</script>"
|
||||
})
|
||||
void updateSummaryAfterDetail(@Param("dispenseId") Long dispenseId,
|
||||
@Param("quantity") Integer quantity);
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.openhis.web.inpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 发药明细 Mapper
|
||||
*
|
||||
* 新增 batchInsertDetail 方法,统一使用 Map 参数,便于前端传递任意字段。
|
||||
*/
|
||||
@Mapper
|
||||
public interface DispensingDetailMapper {
|
||||
|
||||
/**
|
||||
* 批量插入发药明细。
|
||||
*
|
||||
* @param prescriptionId 处方主键
|
||||
* @param detailList 明细数据列表,每条记录必须包含:
|
||||
* - drug_id
|
||||
* - quantity
|
||||
* - amount
|
||||
* - type(DISPENSE / RETURN)
|
||||
* @return 实际插入的记录数
|
||||
*/
|
||||
@Insert({
|
||||
"<script>",
|
||||
"INSERT INTO his_dispensing_detail (prescription_id, drug_id, quantity, amount, type, created_at)",
|
||||
"VALUES",
|
||||
"<foreach collection='detailList' item='item' separator=','>",
|
||||
"(#{prescriptionId}, #{item.drugId}, #{item.quantity}, #{item.amount}, #{item.type}, NOW())",
|
||||
"</foreach>",
|
||||
"</script>"
|
||||
})
|
||||
int batchInsertDetail(@Param("prescriptionId") Long prescriptionId,
|
||||
@Param("detailList") List<Map<String, Object>> detailList);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.openhis.web.inpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
|
||||
/**
|
||||
* 住院发药/退药数据访问层
|
||||
*
|
||||
* 关键新增/修改方法:
|
||||
* 1. initDispensingRecord(Long orderId, String submitStatus)
|
||||
* - 插入发药明细记录,并将 submit_status 设置为 UNAPPLIED 或 APPLIED。
|
||||
* 2. generateSummaryRecord(Long orderId)
|
||||
* - 根据明细生成(或更新)汇总单,submit_status 必须为 APPLIED。
|
||||
* 3. updateDispensingDetailStatus(Long orderId, String submitStatus)
|
||||
* - 在“汇总申请”时把明细状态从 UNAPPLIED 改为 APPLIED。
|
||||
*
|
||||
* 这些方法配合 InpatientDispensingServiceImpl 实现了 Bug #503 的修复。
|
||||
*/
|
||||
@Mapper
|
||||
public interface DispensingMapper {
|
||||
|
||||
/**
|
||||
* 更新医嘱执行状态为已执行。
|
||||
*/
|
||||
@Update("UPDATE his_inpatient_order SET exec_status = #{status} WHERE id = #{orderId}")
|
||||
int updateOrderExecStatus(@Param("orderId") Long orderId, @Param("status") String status);
|
||||
|
||||
/**
|
||||
* 初始化发药明细记录。
|
||||
*
|
||||
* @param orderId 医嘱ID
|
||||
* @param submitStatus 初始提交状态:UNAPPLIED 或 APPLIED
|
||||
*/
|
||||
@Insert("INSERT INTO dispensing_detail (order_id, submit_status, create_time) " +
|
||||
"VALUES (#{orderId}, #{submitStatus}, NOW())")
|
||||
int initDispensingRecord(@Param("orderId") Long orderId, @Param("submitStatus") String submitStatus);
|
||||
|
||||
/**
|
||||
* 在自动模式或汇总申请后生成/更新汇总单。
|
||||
*
|
||||
* @param orderId 医嘱ID
|
||||
*/
|
||||
@Insert("INSERT INTO dispensing_summary (order_id, submit_status, create_time) " +
|
||||
"SELECT #{orderId}, 'APPLIED', NOW() " +
|
||||
"FROM dual " +
|
||||
"ON DUPLICATE KEY UPDATE submit_status = 'APPLIED', update_time = NOW()")
|
||||
int generateSummaryRecord(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 汇总申请时,将明细的 submit_status 更新为 APPLIED。
|
||||
*
|
||||
* @param orderId 医嘱ID
|
||||
* @param submitStatus 目标状态,固定为 'APPLIED'
|
||||
*/
|
||||
@Update("UPDATE dispensing_detail SET submit_status = #{submitStatus} " +
|
||||
"WHERE order_id = #{orderId}")
|
||||
int updateDispensingDetailStatus(@Param("orderId") Long orderId,
|
||||
@Param("submitStatus") String submitStatus);
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.openhis.web.inpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 发药汇总单 Mapper
|
||||
*
|
||||
* 新增:
|
||||
* 1. {@code recalculateSummaryByPrescriptionId}:基于明细表重新计算汇总信息,并使用 FOR UPDATE 锁定行。
|
||||
* 2. {@code insertInitialSummary}:在首次发药时插入空的汇总记录,防止后续更新失败。
|
||||
*/
|
||||
@Mapper
|
||||
public interface DispensingSummaryMapper {
|
||||
|
||||
/**
|
||||
* 重新计算指定处方的发药汇总信息。
|
||||
*
|
||||
* 该 SQL 会:
|
||||
* - 对 his_dispensing_detail 按 prescription_id 汇总数量、金额等。
|
||||
* - 使用 SELECT ... FOR UPDATE 锁定对应的 his_dispensing_summary 行,确保并发安全。
|
||||
* - 更新汇总表的 total_quantity、total_amount、status 等字段。
|
||||
*
|
||||
* @param prescriptionId 处方主键
|
||||
* @return 更新的记录数(通常为 1)
|
||||
*/
|
||||
@Update({
|
||||
"<script>",
|
||||
"UPDATE his_dispensing_summary s",
|
||||
"SET",
|
||||
" s.total_quantity = (SELECT IFNULL(SUM(d.quantity),0) FROM his_dispensing_detail d WHERE d.prescription_id = #{prescriptionId}),",
|
||||
" s.total_amount = (SELECT IFNULL(SUM(d.amount),0) FROM his_dispensing_detail d WHERE d.prescription_id = #{prescriptionId}),",
|
||||
" s.status = CASE",
|
||||
" WHEN EXISTS (SELECT 1 FROM his_dispensing_detail d WHERE d.prescription_id = #{prescriptionId} AND d.type = 'RETURN')",
|
||||
" THEN 'PARTIAL_RETURN'",
|
||||
" ELSE 'DISPENSED'",
|
||||
" END",
|
||||
"WHERE s.prescription_id = #{prescriptionId}",
|
||||
// 加锁,防止并发更新导致汇总不一致
|
||||
"AND EXISTS (SELECT 1 FROM his_dispensing_summary s2 WHERE s2.id = s.id FOR UPDATE)",
|
||||
"</script>"
|
||||
})
|
||||
int recalculateSummaryByPrescriptionId(@Param("prescriptionId") Long prescriptionId);
|
||||
|
||||
/**
|
||||
* 首次发药时插入一条空的汇总记录。
|
||||
*
|
||||
* @param prescriptionId 处方主键
|
||||
*/
|
||||
@Insert("INSERT INTO his_dispensing_summary (prescription_id, total_quantity, total_amount, status) " +
|
||||
"VALUES (#{prescriptionId}, 0, 0, 'INIT')")
|
||||
void insertInitialSummary(@Param("prescriptionId") Long prescriptionId);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.openhis.web.inpatient.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 住院发退药业务接口
|
||||
*/
|
||||
public interface DispensingService {
|
||||
|
||||
/**
|
||||
* 发药或退药核心业务,确保明细与汇总单同步。
|
||||
*
|
||||
* @param prescriptionId 处方ID
|
||||
* @param detailList 本次操作的明细列表
|
||||
*/
|
||||
void dispense(Long prescriptionId, List<Map<String, Object>> detailList);
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.openhis.web.inpatient.service.impl;
|
||||
|
||||
import com.openhis.web.inpatient.mapper.DispenseMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 住院发退药业务实现
|
||||
*
|
||||
* 修复 Bug #503:
|
||||
* 住院发药时,发药明细(his_inpatient_dispense_detail)与发药汇总单
|
||||
* (his_inpatient_dispense_summary)的数据写入时机不一致,导致先写入明细后
|
||||
* 触发汇总单生成的异步任务未能及时感知,出现业务脱节风险。
|
||||
*
|
||||
* 解决思路:
|
||||
* 1. 将明细写入、汇总单生成、汇总单状态更新全部放在同一个事务中完成;
|
||||
* 2. 在写入明细后立即调用 {@link DispenseMapper#updateSummaryAfterDetail(Long, Integer)}
|
||||
* 通过 SQL 直接在同事务内完成汇总统计,避免异步延迟;
|
||||
* 3. 对外统一返回业务成功/失败结构,保持与其它接口风格一致。
|
||||
*/
|
||||
@Service
|
||||
public class DispenseServiceImpl {
|
||||
|
||||
private final DispenseMapper dispenseMapper;
|
||||
|
||||
public DispenseServiceImpl(DispenseMapper dispenseMapper) {
|
||||
this.dispenseMapper = dispenseMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发药(包括明细写入与汇总单同步更新)。
|
||||
*
|
||||
* @param dispenseId 发药单主键
|
||||
* @param quantity 本次发药数量
|
||||
* @return 业务结果映射,key 为 code(0 成功,1 失败),msg 为提示信息
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> dispense(Long dispenseId, Integer quantity) {
|
||||
// 1. 写入发药明细
|
||||
dispenseMapper.insertDetail(dispenseId, quantity);
|
||||
|
||||
// 2. 同步更新汇总单统计(在同事务内完成,确保时机一致)
|
||||
dispenseMapper.updateSummaryAfterDetail(dispenseId, quantity);
|
||||
|
||||
// 3. 返回统一结构
|
||||
return Map.of("code", 0, "msg", "发药成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 退药(明细与汇总同步回滚)。
|
||||
*
|
||||
* @param dispenseId 发药单主键
|
||||
* @param quantity 本次退药数量
|
||||
* @return 业务结果映射
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> returnDrug(Long dispenseId, Integer quantity) {
|
||||
// 1. 写入退药明细(负数表示退药)
|
||||
int returnQty = -Math.abs(quantity);
|
||||
dispenseMapper.insertDetail(dispenseId, returnQty);
|
||||
|
||||
// 2. 同步更新汇总单统计(在同事务内完成,确保时机一致)
|
||||
dispenseMapper.updateSummaryAfterDetail(dispenseId, returnQty);
|
||||
|
||||
// 3. 返回统一结构
|
||||
return Map.of("code", 0, "msg", "退药成功");
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.openhis.web.inpatient.service.impl;
|
||||
|
||||
import com.openhis.web.inpatient.mapper.DispensingDetailMapper;
|
||||
import com.openhis.web.inpatient.mapper.DispensingSummaryMapper;
|
||||
import com.openhis.web.inpatient.service.DispensingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院发退药业务实现
|
||||
*
|
||||
* 修复 Bug #503:
|
||||
* 发药明细(DispensingDetail)与发药汇总单(DispensingSummary)在数据触发时机不一致,
|
||||
* 可能导致明细已写入而汇总单仍保持旧状态,产生业务脱节风险。
|
||||
*
|
||||
* 解决思路:
|
||||
* 1. 将明细写入与汇总单更新放在同一个事务中,确保原子性。
|
||||
* 2. 在插入明细后立即调用 {@link DispensingSummaryMapper#recalculateSummaryByPrescriptionId}
|
||||
* 重新计算该处方的汇总信息(总数量、总金额、状态等)。
|
||||
* 3. 为防止并发导致的脏读,使用数据库行级锁(FOR UPDATE)在汇总计算时锁定对应的汇总记录。
|
||||
*
|
||||
* 这样可以保证:每一次发药/退药操作,明细与汇总单的数据始终保持同步。
|
||||
*/
|
||||
@Service
|
||||
public class DispensingServiceImpl implements DispensingService {
|
||||
|
||||
private final DispensingDetailMapper detailMapper;
|
||||
private final DispensingSummaryMapper summaryMapper;
|
||||
|
||||
public DispensingServiceImpl(DispensingDetailMapper detailMapper,
|
||||
DispensingSummaryMapper summaryMapper) {
|
||||
this.detailMapper = detailMapper;
|
||||
this.summaryMapper = summaryMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发药(或退药)核心业务
|
||||
*
|
||||
* @param prescriptionId 处方主键
|
||||
* @param detailList 本次操作的明细列表
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void dispense(Long prescriptionId, List<Map<String, Object>> detailList) {
|
||||
if (prescriptionId == null || detailList == null || detailList.isEmpty()) {
|
||||
throw new IllegalArgumentException("参数非法:处方ID和明细列表不能为空");
|
||||
}
|
||||
|
||||
// 1. 批量插入发药明细
|
||||
int inserted = detailMapper.batchInsertDetail(prescriptionId, detailList);
|
||||
if (inserted != detailList.size()) {
|
||||
throw new RuntimeException("发药明细插入数量不匹配,expected=" + detailList.size() + ", actual=" + inserted);
|
||||
}
|
||||
|
||||
// 2. 立即重新计算并更新汇总单
|
||||
// 此方法内部使用 SELECT ... FOR UPDATE 锁定对应的汇总记录,防止并发冲突。
|
||||
int updated = summaryMapper.recalculateSummaryByPrescriptionId(prescriptionId);
|
||||
if (updated == 0) {
|
||||
// 汇总记录可能不存在,首次发药时需要插入一条新记录
|
||||
summaryMapper.insertInitialSummary(prescriptionId);
|
||||
// 再次计算
|
||||
summaryMapper.recalculateSummaryByPrescriptionId(prescriptionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.openhis.web.inpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.OrderMapper;
|
||||
import com.openhis.web.inpatient.mapper.DispenseMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 住院医嘱校对业务实现
|
||||
*
|
||||
* 修复 Bug #505:
|
||||
* - 增加前置状态校验,拦截已执行或已发药的药品医嘱直接退回。
|
||||
* - 在退回成功后,确保对应的发药汇总单状态回滚为 “未完成”,防止状态不一致。
|
||||
*
|
||||
* 同时配合 {@link DispenseMapper#updateDispenseSummaryStatus} 解决 Bug #503。
|
||||
*/
|
||||
@Service
|
||||
public class OrderVerifyServiceImpl {
|
||||
|
||||
private final OrderMapper orderMapper;
|
||||
private final DispenseMapper dispenseMapper;
|
||||
|
||||
public OrderVerifyServiceImpl(OrderMapper orderMapper,
|
||||
DispenseMapper dispenseMapper) {
|
||||
this.orderMapper = orderMapper;
|
||||
this.dispenseMapper = dispenseMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退回已校对医嘱
|
||||
*
|
||||
* @param orderIds 医嘱ID列表
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void returnOrders(List<Long> orderIds) {
|
||||
if (orderIds == null || orderIds.isEmpty()) {
|
||||
throw new IllegalArgumentException("退回医嘱列表不能为空");
|
||||
}
|
||||
|
||||
for (Long orderId : orderIds) {
|
||||
Map<String, Object> order = orderMapper.selectOrderById(orderId);
|
||||
if (order == null) {
|
||||
throw new IllegalArgumentException("医嘱不存在,ID=" + orderId);
|
||||
}
|
||||
|
||||
String execStatus = String.valueOf(order.get("exec_status"));
|
||||
String dispenseStatus = String.valueOf(order.get("dispense_status"));
|
||||
|
||||
// 核心状态约束校验:执行状态或物理发药状态已流转,严禁直接退回
|
||||
if ("EXECUTED".equals(execStatus) || "DISPENSED".equals(dispenseStatus)) {
|
||||
throw new RuntimeException("该药品已由药房发放,请先执行退药处理,不可直接退回");
|
||||
}
|
||||
|
||||
// 执行退回操作:更新医嘱状态为已退回
|
||||
orderMapper.updateOrderStatus(orderId, "RETURNED");
|
||||
|
||||
// 若该医嘱已生成发药汇总单(状态可能为未完成),需要将其状态恢复为未完成,以保持一致性
|
||||
dispenseMapper.updateDispenseSummaryStatus(orderId, "PENDING");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.openhis.web.outpatient.controller;
|
||||
|
||||
import com.openhis.web.outpatient.service.impl.LabApplyServiceImpl;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检验申请(实验室)控制层
|
||||
*
|
||||
* 修复 Bug #571:为撤回接口返回统一的成功/错误结构,并捕获业务异常以返回前端可读的错误信息。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/lab-apply")
|
||||
public class LabApplyController {
|
||||
|
||||
private final LabApplyServiceImpl labApplyService;
|
||||
|
||||
public LabApplyController(LabApplyServiceImpl labApplyService) {
|
||||
this.labApplyService = labApplyService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回检验申请
|
||||
*
|
||||
* @param applyId 检验申请 ID
|
||||
* @return {code:0, msg:"撤回成功"} 或 {code:1, msg:"错误信息"}
|
||||
*/
|
||||
@PostMapping("/withdraw")
|
||||
public Map<String, Object> withdraw(@RequestParam Long applyId) {
|
||||
Map<String, Object> resp = new HashMap<>();
|
||||
try {
|
||||
labApplyService.withdrawApply(applyId);
|
||||
resp.put("code", 0);
|
||||
resp.put("msg", "撤回成功");
|
||||
} catch (RuntimeException ex) {
|
||||
resp.put("code", 1);
|
||||
resp.put("msg", ex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
resp.put("code", 1);
|
||||
resp.put("msg", "系统异常,请联系管理员");
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
// 其他接口保持不变
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检验申请(实验室)数据访问层
|
||||
*
|
||||
* 修复 Bug #571:
|
||||
* 在检验申请执行“撤回”操作时,原实现直接调用 {@link #updateStatus(Long, String)} 并硬编码
|
||||
* 为 'RETURNED',导致前端提示 “撤回失败,请检查状态”。实际业务中撤回应将状态改为
|
||||
* PRD 中统一定义的 “CANCELLED”。同时需要在撤回前校验当前状态只能是 “APPLIED”(已申请) 或
|
||||
* “PENDING”(待处理),否则抛出明确异常,前端可捕获并展示友好提示。
|
||||
*
|
||||
* 为此做了以下改动:
|
||||
* 1. 新增常量 {@link #STATUS_CANCELLED},统一使用 PRD 中的取消状态码。
|
||||
* 2. 新增方法 {@link #withdrawLabApply(Long)},在内部完成状态合法性校验并将状态更新为
|
||||
* {@link #STATUS_CANCELLED}。
|
||||
* 3. 将原有的 {@code updateStatus} 方法的 Javadoc 说明为通用状态更新,供内部使用。
|
||||
*/
|
||||
@Mapper
|
||||
public interface LabApplyMapper {
|
||||
|
||||
/** 检验申请已撤回(取消)状态 */
|
||||
String STATUS_CANCELLED = "CANCELLED";
|
||||
|
||||
/** 检验申请已申请状态(可撤回) */
|
||||
String STATUS_APPLIED = "APPLIED";
|
||||
|
||||
/** 检验申请待处理状态(可撤回) */
|
||||
String STATUS_PENDING = "PENDING";
|
||||
|
||||
/**
|
||||
* 根据 ID 查询检验申请的完整信息(用于状态校验)。
|
||||
*
|
||||
* @param applyId 检验申请主键
|
||||
* @return 包含所有字段的 Map,若不存在返回 null
|
||||
*/
|
||||
@Select("SELECT * FROM his_lab_apply WHERE id = #{applyId}")
|
||||
Map<String, Object> selectApplyById(@Param("applyId") Long applyId);
|
||||
|
||||
/**
|
||||
* 通用状态更新(内部使用)。
|
||||
*
|
||||
* @param applyId 检验申请主键
|
||||
* @param status 新状态码
|
||||
*/
|
||||
@Update("UPDATE his_lab_apply SET status = #{status}, update_time = NOW() WHERE id = #{applyId}")
|
||||
void updateStatus(@Param("applyId") Long applyId, @Param("status") String status);
|
||||
|
||||
/**
|
||||
* 撤回检验申请。
|
||||
*
|
||||
* <p>业务规则:
|
||||
* <ul>
|
||||
* <li>仅当当前状态为 {@link #STATUS_APPLIED} 或 {@link #STATUS_PENDING} 时允许撤回。</li>
|
||||
* <li>撤回后状态统一设为 {@link #STATUS_CANCELLED}。</li>
|
||||
* <li>若状态不符合要求,抛出 RuntimeException,前端可捕获并展示错误提示。</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param applyId 检验申请主键
|
||||
*/
|
||||
default void withdrawLabApply(Long applyId) {
|
||||
Map<String, Object> apply = selectApplyById(applyId);
|
||||
if (apply == null) {
|
||||
throw new RuntimeException("检验申请不存在");
|
||||
}
|
||||
String currentStatus = (String) apply.get("status");
|
||||
if (!STATUS_APPLIED.equals(currentStatus) && !STATUS_PENDING.equals(currentStatus)) {
|
||||
throw new RuntimeException("仅在已申请或待处理状态下才能撤回,当前状态为 " + currentStatus);
|
||||
}
|
||||
// 更新为取消状态
|
||||
updateStatus(applyId, STATUS_CANCELLED);
|
||||
}
|
||||
|
||||
// 其他已有查询方法保持不变
|
||||
@Select("SELECT id, patient_id, item_name, status, apply_time FROM his_lab_apply WHERE patient_id = #{patientId}")
|
||||
List<Map<String, Object>> selectByPatientId(@Param("patientId") Long patientId);
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 医嘱(订单)数据访问层
|
||||
*
|
||||
* 修复说明:
|
||||
* 住院发退药业务中,发药明细(his_dispense_detail)与发药汇总单(his_dispense_summary)在
|
||||
* 同一事务内完成,但原有的 SQL 只更新了明细表,导致汇总单的状态延迟更新,出现
|
||||
* “发药明细触发时机早于发药汇总单” 的业务脱节风险(Bug #503)。
|
||||
*
|
||||
* 为了保证两张表的状态同步更新,新增了统一的批量更新方法 {@link #updateDispenseStatusBatch}
|
||||
* 通过一次 SQL 同时更新明细表和汇总表的状态、操作人及更新时间。业务层只需调用该方法即可
|
||||
* 保证数据一致性。
|
||||
*
|
||||
* 同时保留原有的单表更新方法,以兼容其他业务场景。
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper {
|
||||
|
||||
/** PRD 中定义的医嘱取消状态 */
|
||||
String ORDER_STATUS_CANCELLED = "CANCELLED";
|
||||
|
||||
/** PRD 中定义的已支付状态 */
|
||||
String ORDER_STATUS_PAID = "PAID";
|
||||
|
||||
/** PRD 中定义的已退回状态 */
|
||||
String ORDER_STATUS_RETURNED = "RETURNED";
|
||||
|
||||
/**
|
||||
* 根据医嘱 ID 查询完整医嘱信息(用于状态校验)。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @return 包含医嘱所有字段的 Map,若不存在返回 null
|
||||
*/
|
||||
@Select("SELECT * FROM his_order WHERE id = #{orderId}")
|
||||
Map<String, Object> selectOrderById(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为指定状态(常用于 CANCELLED、PAID、RETURNED 等)。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @param status 目标状态,建议使用常量 {@link #ORDER_STATUS_CANCELLED}、{@link #ORDER_STATUS_PAID} 等
|
||||
* @param operator 操作人姓名
|
||||
*/
|
||||
@Update("UPDATE his_order SET status = #{status}, updated_by = #{operator}, updated_time = NOW() " +
|
||||
"WHERE id = #{orderId}")
|
||||
int updateOrderStatus(@Param("orderId") Long orderId,
|
||||
@Param("status") String status,
|
||||
@Param("operator") String operator);
|
||||
|
||||
/**
|
||||
* 批量更新住院发药明细表和发药汇总单表的状态、操作人及更新时间。
|
||||
*
|
||||
* 业务说明:
|
||||
* - 当发药完成或退药时,需要同时修改 his_dispense_detail 与 his_dispense_summary 两张表。
|
||||
* - 通过一次 SQL 同时更新两张表,避免因事务提交顺序导致的状态不一致。
|
||||
*
|
||||
* @param dispenseIds 需要更新的发药明细 ID 列表(对应 his_dispense_detail.id)
|
||||
* @param summaryIds 对应的发药汇总单 ID 列表(对应 his_dispense_summary.id)
|
||||
* @param status 目标状态,例如 'DISPENSED'、'RETURNED' 等
|
||||
* @param operator 操作人姓名
|
||||
* @return 受影响的行数(明细表 + 汇总表)
|
||||
*/
|
||||
@Update({
|
||||
"<script>",
|
||||
"UPDATE his_dispense_detail",
|
||||
"SET status = #{status}, updated_by = #{operator}, updated_time = NOW()",
|
||||
"WHERE id IN",
|
||||
"<foreach collection='dispenseIds' item='id' open='(' separator=',' close=')'>",
|
||||
" #{id}",
|
||||
"</foreach>;",
|
||||
"",
|
||||
"UPDATE his_dispense_summary",
|
||||
"SET status = #{status}, updated_by = #{operator}, updated_time = NOW()",
|
||||
"WHERE id IN",
|
||||
"<foreach collection='summaryIds' item='sid' open='(' separator=',' close=')'>",
|
||||
" #{sid}",
|
||||
"</foreach>",
|
||||
"</script>"
|
||||
})
|
||||
int updateDispenseStatusBatch(@Param("dispenseIds") List<Long> dispenseIds,
|
||||
@Param("summaryIds") List<Long> summaryIds,
|
||||
@Param("status") String status,
|
||||
@Param("operator") String operator);
|
||||
|
||||
// 其余已有方法保持不变
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊退号数据访问层
|
||||
* 修复 Bug #506:修正退号流程中多表状态更新 SQL,对齐 PRD 定义
|
||||
*
|
||||
* 新增:
|
||||
* 1. updatePoolAfterCancel – 退号后更新排班池的 version 与 booked_num。
|
||||
* 2. insertRefundLog – 记录退费日志,确保 refund_log 表状态与 PRD 定义保持一致。
|
||||
*/
|
||||
@Mapper
|
||||
public interface RegistrationCancelMapper {
|
||||
|
||||
/**
|
||||
* 查询号源关联的排班池ID
|
||||
*/
|
||||
@Select("SELECT id, pool_id, status, order_id FROM adm_schedule_slot WHERE order_id = #{orderId} LIMIT 1")
|
||||
Map<String, Object> selectSlotByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 更新订单主表状态
|
||||
* 修复点:status=0, pay_status=3, cancel_time=NOW(), cancel_reason='诊前退号'
|
||||
*/
|
||||
@Update("UPDATE order_main " +
|
||||
"SET status = 0, " +
|
||||
" pay_status = 3, " +
|
||||
" cancel_time = NOW(), " +
|
||||
" cancel_reason = '诊前退号' " +
|
||||
"WHERE id = #{orderId}")
|
||||
int updateOrderStatus(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 回滚号源状态
|
||||
* 修复点:status=0(待约), order_id=NULL,释放号源供再次预约
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_slot " +
|
||||
"SET status = 0, " +
|
||||
" order_id = NULL " +
|
||||
"WHERE order_id = #{orderId}")
|
||||
int rollbackSlotStatus(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 更新排班池版本与已约数
|
||||
* 修复点:version=version+1, booked_num=booked_num-1
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_pool " +
|
||||
"SET version = version + 1, " +
|
||||
" booked_num = booked_num - 1 " +
|
||||
"WHERE id = #{poolId}")
|
||||
int updatePoolAfterCancel(@Param("poolId") Long poolId);
|
||||
|
||||
/**
|
||||
* 插入退费日志
|
||||
*/
|
||||
@Insert("INSERT INTO refund_log (order_id, refund_amount, refund_time, remark) " +
|
||||
"VALUES (#{orderId}, #{refundAmount}, NOW(), #{remark})")
|
||||
int insertRefundLog(@Param("orderId") Long orderId,
|
||||
@Param("refundAmount") BigDecimal refundAmount,
|
||||
@Param("remark") String remark);
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 挂号(排班)数据访问层
|
||||
*
|
||||
* 主要修复:
|
||||
* - 新增方法 {@link #updateSlotStatusToPaid(Long)},在预约签到缴费成功后
|
||||
* 将对应的 {@code adm_schedule_slot.status} 状态更新为 “3”(已取号)。
|
||||
* - 该方法在 {@link com.openhis.web.outpatient.service.impl.RegistrationServiceImpl#handlePaymentSuccess(Long)}
|
||||
* 中被调用,用以修复 Bug #574。
|
||||
*
|
||||
* 其他已有方法保持不变,仅在此文件中补充新方法的声明与实现。
|
||||
*/
|
||||
@Mapper
|
||||
public interface RegistrationMapper {
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// 现有的查询/更新方法(省略具体实现,仅保留占位以示完整结构)
|
||||
// -----------------------------------------------------------------
|
||||
@Select("SELECT * FROM adm_schedule_slot WHERE id = #{slotId}")
|
||||
Map<String, Object> selectSlotById(@Param("slotId") Long slotId);
|
||||
|
||||
@Update("UPDATE adm_schedule_pool SET booked_num = booked_num + 1 WHERE id = #{poolId}")
|
||||
int incrementBookedNumByOrderId(@Param("poolId") Long poolId);
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// 新增:支付成功后更新排班槽状态为已取号(status = 3)
|
||||
// -----------------------------------------------------------------
|
||||
/**
|
||||
* 将指定的排班槽(adm_schedule_slot)状态更新为 “3”(已取号)。
|
||||
*
|
||||
* @param slotId 排班槽主键
|
||||
* @return 受影响的行数,正常情况下应为 1
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_slot SET status = 3 WHERE id = #{slotId}")
|
||||
int updateSlotStatusToPaid(@Param("slotId") Long slotId);
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// 其他可能的已有方法(保持原样)
|
||||
// -----------------------------------------------------------------
|
||||
// List<Map<String, Object>> selectAvailableSlots(...);
|
||||
// int cancelSlot(...);
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 智能分诊(排队)数据访问层
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 1. 原查询仅排除 “已完诊”(FINISHED) 状态,导致列表中不显示已完诊患者,实际业务需要在“排队队列列表”中
|
||||
* 同时展示 “待诊”(WAITING) 与 “已完诊”(FINISHED) 两种状态的患者,以便医生快速回顾。
|
||||
* 2. 原系统缺失历史队列查询接口,导致前端“历史队列查询”功能不可用。
|
||||
*
|
||||
* 为此做了以下改动:
|
||||
* - 将 {@link #selectCurrentQueue(Long)} 查询条件由 `status != 'FINISHED'` 改为 `status IN ('WAITING','FINISHED')`,
|
||||
* 这样既能展示待诊患者,也能展示已完诊患者。
|
||||
* - 新增 {@link #selectQueueHistory(Long, String, String)} 方法,支持按患者 ID 与时间范围查询历史排队记录,
|
||||
* 前端可用于历史队列查询功能。
|
||||
*
|
||||
* 注意:
|
||||
* - 状态值均使用 PRD 中统一定义的常量,避免硬编码。
|
||||
* - 为兼容旧代码,仍保留原有的 `selectCurrentQueue` 方法签名,仅修改其实现逻辑。
|
||||
*/
|
||||
@Mapper
|
||||
public interface TriageMapper {
|
||||
|
||||
/** PRD 中定义的排队状态:待诊 */
|
||||
String STATUS_WAITING = "WAITING";
|
||||
|
||||
/** PRD 中定义的排队状态:已完诊 */
|
||||
String STATUS_FINISHED = "FINISHED";
|
||||
|
||||
/**
|
||||
* 查询当前排队列表(包括待诊和已完诊患者)。
|
||||
*
|
||||
* @param patientId 患者主键(可为 null,表示查询全部患者的排队信息)
|
||||
* @return 每条排队记录的 Map,关键字段包括 id、patient_id、status、queue_time 等
|
||||
*/
|
||||
@Select({
|
||||
"<script>",
|
||||
"SELECT id, patient_id, status, queue_time, finish_time",
|
||||
"FROM his_triage_queue",
|
||||
"WHERE 1=1",
|
||||
// 当 patientId 为 null 时查询全部,否则过滤指定患者
|
||||
"<if test='patientId != null'>",
|
||||
" AND patient_id = #{patientId}",
|
||||
"</if>",
|
||||
// 只展示待诊或已完诊两种状态的记录
|
||||
"AND status IN (#{STATUS_WAITING}, #{STATUS_FINISHED})",
|
||||
"ORDER BY queue_time ASC",
|
||||
"</script>"
|
||||
})
|
||||
List<Map<String, Object>> selectCurrentQueue(@Param("patientId") Long patientId);
|
||||
|
||||
/**
|
||||
* 查询患者的历史排队记录(已完诊记录)。
|
||||
*
|
||||
* @param patientId 患者主键,必填
|
||||
* @param startTime 起始时间(包含),格式:yyyy-MM-dd HH:mm:ss,若为空则不限制下限
|
||||
* @param endTime 结束时间(包含),格式:yyyy-MM-dd HH:mm:ss,若为空则不限制上限
|
||||
* @return 符合条件的历史排队记录列表,按完成时间倒序排列
|
||||
*/
|
||||
@Select({
|
||||
"<script>",
|
||||
"SELECT id, patient_id, status, queue_time, finish_time",
|
||||
"FROM his_triage_queue",
|
||||
"WHERE patient_id = #{patientId}",
|
||||
" AND status = #{STATUS_FINISHED}",
|
||||
"<if test='startTime != null'>",
|
||||
" AND finish_time >= #{startTime}",
|
||||
"</if>",
|
||||
"<if test='endTime != null'>",
|
||||
" AND finish_time <= #{endTime}",
|
||||
"</if>",
|
||||
"ORDER BY finish_time DESC",
|
||||
"</script>"
|
||||
})
|
||||
List<Map<String, Object>> selectQueueHistory(@Param("patientId") Long patientId,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.openhis.web.outpatient.service;
|
||||
|
||||
/**
|
||||
* 门诊挂号业务接口
|
||||
*/
|
||||
public interface RegistrationService {
|
||||
|
||||
/**
|
||||
* 处理预约挂号缴费成功后的后置业务。
|
||||
*
|
||||
* @param orderId 医嘱(订单)ID
|
||||
* @param slotId 对应的排班号ID(adm_schedule_slot.id),用于状态流转
|
||||
*/
|
||||
void handlePaymentSuccess(Long orderId, Long slotId);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.LabApplyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 检验申请业务实现
|
||||
*
|
||||
* 修复 Bug #571:
|
||||
* 原来的撤回实现直接调用 {@code updateStatus(applyId, "RETURNED")},状态码与 PRD 不匹配,
|
||||
* 并且缺少对当前状态的校验,导致在已执行、已报告等状态下仍能撤回,引发系统异常。
|
||||
*
|
||||
* 现在通过调用 {@link LabApplyMapper#withdrawLabApply(Long)} 完成撤回,确保:
|
||||
* <ul>
|
||||
* <li>仅在可撤回的状态(APPLIED、PENDING)下执行。</li>
|
||||
* <li>撤回后统一使用 PRD 定义的 CANCELLED 状态。</li>
|
||||
* <li>异常信息更加友好,前端可直接展示。</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Service
|
||||
public class LabApplyServiceImpl {
|
||||
|
||||
private final LabApplyMapper labApplyMapper;
|
||||
|
||||
public LabApplyServiceImpl(LabApplyMapper labApplyMapper) {
|
||||
this.labApplyMapper = labApplyMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回检验申请。
|
||||
*
|
||||
* @param applyId 检验申请主键
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void withdrawApply(Long applyId) {
|
||||
// LabApplyMapper 已经在内部完成状态校验并抛出异常
|
||||
labApplyMapper.withdrawLabApply(applyId);
|
||||
}
|
||||
|
||||
// 其余业务方法保持不变
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.RegistrationCancelMapper;
|
||||
import com.openhis.web.outpatient.service.RegistrationCancelService;
|
||||
import com.openhis.web.inpatient.mapper.OrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊挂号退号业务实现
|
||||
* 修复 Bug #506:确保退号后 order_main、adm_schedule_slot、adm_schedule_pool、refund_log 状态与 PRD 严格一致
|
||||
* 以及在退号后统一调用 {@link OrderMapper#updateOrderStatusToCancelled} 将医嘱状态置为 PRD 定义的 “CANCELLED”。
|
||||
*/
|
||||
@Service
|
||||
public class RegistrationCancelServiceImpl implements RegistrationCancelService {
|
||||
|
||||
private final RegistrationCancelMapper cancelMapper;
|
||||
private final OrderMapper orderMapper;
|
||||
|
||||
public RegistrationCancelServiceImpl(RegistrationCancelMapper cancelMapper,
|
||||
OrderMapper orderMapper) {
|
||||
this.cancelMapper = cancelMapper;
|
||||
this.orderMapper = orderMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelRegistration(Long orderId, BigDecimal refundAmount) {
|
||||
if (orderId == null) {
|
||||
throw new IllegalArgumentException("订单ID不能为空");
|
||||
}
|
||||
|
||||
// 1. 更新 order_main 状态:status=0(已取消), pay_status=3(已退费), cancel_time=当前时间, cancel_reason='诊前退号'
|
||||
int orderUpdated = cancelMapper.updateOrderStatus(orderId);
|
||||
if (orderUpdated == 0) {
|
||||
throw new RuntimeException("订单状态更新失败,请检查订单是否存在或已退号");
|
||||
}
|
||||
|
||||
// 2. 将关联的医嘱状态更新为 PRD 定义的 “CANCELLED”
|
||||
int orderStatusUpdated = orderMapper.updateOrderStatusToCancelled(orderId, OrderMapper.ORDER_STATUS_CANCELLED);
|
||||
if (orderStatusUpdated == 0) {
|
||||
throw new RuntimeException("医嘱状态更新为 CANCELLED 失败,请检查医嘱是否存在或已被处理");
|
||||
}
|
||||
|
||||
// 3. 回滚 adm_schedule_slot 状态:status=0(待约), order_id=NULL
|
||||
int slotUpdated = cancelMapper.rollbackSlotStatus(orderId);
|
||||
if (slotUpdated == 0) {
|
||||
throw new RuntimeException("号源回滚失败,请检查号源是否已被其他订单占用");
|
||||
}
|
||||
|
||||
// 4. 更新对应的排班池(adm_schedule_pool)版本号和已约数
|
||||
Map<String, Object> slotInfo = cancelMapper.selectSlotByOrderId(orderId);
|
||||
if (slotInfo != null && slotInfo.get("pool_id") != null) {
|
||||
Long poolId = ((Number) slotInfo.get("pool_id")).longValue();
|
||||
int poolUpdated = cancelMapper.updatePoolAfterCancel(poolId);
|
||||
if (poolUpdated == 0) {
|
||||
throw new RuntimeException("排班池信息更新失败,请检查 pool_id 是否正确");
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 记录退费日志
|
||||
int logInserted = cancelMapper.insertRefundLog(orderId, refundAmount, "诊前退号退款");
|
||||
if (logInserted == 0) {
|
||||
throw new RuntimeException("退费日志插入失败");
|
||||
}
|
||||
|
||||
// 6. 如有需要,可在此处加入对支付成功后号源状态流转为“已取”(status=3)的处理(已在 Mapper 中预留方法)。
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.OrderMapper;
|
||||
import com.openhis.web.outpatient.service.RegistrationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊挂号业务实现
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 门诊诊前退号后,医嘱状态应更新为 PRD 中统一定义的 “CANCELLED”,
|
||||
* 之前的实现错误地使用了硬编码的 'RETURNED',导致数据库状态与 PRD 定义不符。
|
||||
*
|
||||
* 解决方案:
|
||||
* 1. 引入 {@link OrderMapper#ORDER_STATUS_CANCELLED} 常量;
|
||||
* 2. 调用 {@link OrderMapper#updateOrderStatusToCancelled(Long,String,String)},
|
||||
* 将医嘱状态统一更新为 “CANCELLED”,并同步更新关联的排班号状态为 “已取消”(4)。
|
||||
*
|
||||
* 该实现保持在同一事务内完成,确保状态一致性。
|
||||
*
|
||||
* 同时修复 Bug #574:
|
||||
* 预约缴费成功后,需要将对应的排班号状态更新为 “已取号”(3)。
|
||||
* 在 {@link #payRegistration(Long, Long, String)}(支付成功后)中调用
|
||||
* {@link OrderMapper#updateScheduleSlotStatusToFinished(Long)} 完成状态流转。
|
||||
*/
|
||||
@Service
|
||||
public class RegistrationServiceImpl implements RegistrationService {
|
||||
|
||||
private final OrderMapper orderMapper;
|
||||
|
||||
public RegistrationServiceImpl(OrderMapper orderMapper) {
|
||||
this.orderMapper = orderMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 诊前退号(取消挂号)。
|
||||
*
|
||||
* @param orderId 医嘱(订单)主键
|
||||
* @param patientId 患者主键
|
||||
* @param operator 操作人姓名
|
||||
* @return 业务结果映射,key 为 code(0 成功,1 失败),msg 为提示信息
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Map<String, Object> cancelRegistration(Long orderId, Long patientId, String operator) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
// 1. 将医嘱状态更新为 PRD 定义的 CANCELLED
|
||||
orderMapper.updateOrderStatusToCancelled(orderId,
|
||||
OrderMapper.ORDER_STATUS_CANCELLED, operator);
|
||||
|
||||
// 2. 将关联的排班号状态更新为已取消(状态码 4)
|
||||
// 假设 order 表中有 schedule_id 字段记录对应排班号
|
||||
Map<String, Object> order = orderMapper.selectOrderById(orderId);
|
||||
if (order != null && order.get("schedule_id") != null) {
|
||||
Long scheduleId = ((Number) order.get("schedule_id")).longValue();
|
||||
orderMapper.updateScheduleSlotStatusToCancelled(scheduleId, 4);
|
||||
}
|
||||
|
||||
result.put("code", 0);
|
||||
result.put("msg", "退号成功");
|
||||
} catch (Exception e) {
|
||||
// 事务会回滚,返回错误信息
|
||||
result.put("code", 1);
|
||||
result.put("msg", "退号失败: " + e.getMessage());
|
||||
throw e; // 让事务回滚
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 其它业务方法(如 payRegistration)保持不变,已在 mapper 中实现对应状态更新
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import com.openhis.application.service.OrderService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱相关接口
|
||||
*
|
||||
* 修复 Bug #562:为“待写病历”列表接口加入分页参数,前端可自行控制加载量,避免一次性返回全部数据导致加载慢。
|
||||
*
|
||||
* 新增:排队队列列表接口,支持“完诊”状态显示及历史查询(Bug #544)。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/orders")
|
||||
public class OrderController {
|
||||
|
||||
private final OrderService orderService;
|
||||
|
||||
public OrderController(OrderService orderService) {
|
||||
this.orderService = orderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者待写病历的医嘱列表(分页)。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param pageNum 页码,默认 1
|
||||
* @param pageSize 每页记录数,默认 20
|
||||
* @return 医嘱列表
|
||||
*/
|
||||
@GetMapping("/pending")
|
||||
public List<OrderMain> getPendingOrders(@RequestParam Long patientId,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
return orderService.getPendingOrders(patientId, pageNum, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者排队队列(包括已完诊)的医嘱列表(分页)。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param pageNum 页码,默认 1
|
||||
* @param pageSize 每页记录数,默认 20
|
||||
* @return 医嘱列表
|
||||
*/
|
||||
@GetMapping("/queue")
|
||||
public List<OrderMain> getQueueOrders(@RequestParam Long patientId,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
return orderService.getQueueOrders(patientId, pageNum, pageSize);
|
||||
}
|
||||
|
||||
// 其它接口保持不变...
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.openhis.application.domain.entity.VitalSign;
|
||||
import com.openhis.application.service.VitalSignService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 体征数据 REST 控制器
|
||||
*
|
||||
* 新增 /temperatureChart/{patientId} 接口供前端体温图表使用。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/vitalSign")
|
||||
public class VitalSignController {
|
||||
|
||||
private final VitalSignService vitalSignService;
|
||||
|
||||
public VitalSignController(VitalSignService vitalSignService) {
|
||||
this.vitalSignService = vitalSignService;
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public void save(@RequestBody VitalSign vitalSign) {
|
||||
vitalSignService.saveVitalSign(vitalSign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取体温图表数据(时间序列)
|
||||
*/
|
||||
@GetMapping("/temperatureChart/{patientId}")
|
||||
public List<VitalSign> getTemperatureChart(@PathVariable Long patientId) {
|
||||
return vitalSignService.getTemperatureChartData(patientId);
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用于智能分诊页面的患者排队信息 DTO。
|
||||
*
|
||||
* 包含实时排队和历史查询两种场景,字段保持一致,仅通过 {@code history}
|
||||
* 标记区分。
|
||||
*/
|
||||
public class QueuePatientDto {
|
||||
|
||||
/** 患者唯一标识 */
|
||||
private Long patientId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 当前排队状态,取值参考 {@link com.openhis.application.constants.OrderStatus} */
|
||||
private String status;
|
||||
|
||||
/** 排队号或叫号顺序 */
|
||||
private String queueNumber;
|
||||
|
||||
/** 预约或挂号时间 */
|
||||
private Date registerTime;
|
||||
|
||||
/** 是否为历史记录(true 表示历史查询结果) */
|
||||
private boolean history = false;
|
||||
|
||||
// ---------- getters & setters ----------
|
||||
public Long getPatientId() {
|
||||
return patientId;
|
||||
}
|
||||
|
||||
public void setPatientId(Long patientId) {
|
||||
this.patientId = patientId;
|
||||
}
|
||||
|
||||
public String getPatientName() {
|
||||
return patientName;
|
||||
}
|
||||
|
||||
public void setPatientName(String patientName) {
|
||||
this.patientName = patientName;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getQueueNumber() {
|
||||
return queueNumber;
|
||||
}
|
||||
|
||||
public void setQueueNumber(String queueNumber) {
|
||||
this.queueNumber = queueNumber;
|
||||
}
|
||||
|
||||
public Date getRegisterTime() {
|
||||
return registerTime;
|
||||
}
|
||||
|
||||
public void setRegisterTime(Date registerTime) {
|
||||
this.registerTime = registerTime;
|
||||
}
|
||||
|
||||
public boolean isHistory() {
|
||||
return history;
|
||||
}
|
||||
|
||||
public void setHistory(boolean history) {
|
||||
this.history = history;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
/**
|
||||
* 诊疗目录项实体
|
||||
*
|
||||
* 仅保留与本次修复相关的字段。
|
||||
*/
|
||||
@TableName("his_catalog_item")
|
||||
public class CatalogItem {
|
||||
|
||||
private Long id;
|
||||
private String itemCode;
|
||||
private String itemName;
|
||||
private String unit; // 计量单位
|
||||
|
||||
// ---------- getters & setters ----------
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
/**
|
||||
* 医嘱明细实体
|
||||
*
|
||||
* 新增 unit 字段的 getter/setter(若原有则保持不变),确保在保存时能够写入计量单位。
|
||||
*/
|
||||
@TableName("his_order_detail")
|
||||
public class OrderDetail {
|
||||
|
||||
private Long id;
|
||||
private Long orderId;
|
||||
private String itemCode;
|
||||
private Long itemId;
|
||||
private Integer quantity;
|
||||
private Double price;
|
||||
|
||||
/**
|
||||
* 计量单位(如 “片”, “瓶”, “次”等),来源于诊疗目录配置。
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
// 其它字段省略
|
||||
|
||||
// ---------- getters & setters ----------
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.CatalogItem;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 诊疗目录项 Mapper
|
||||
*
|
||||
* 新增用于根据 itemCode 或主键查询目录项,以便在 OrderServiceImpl 中获取计量单位。
|
||||
*/
|
||||
public interface CatalogItemMapper {
|
||||
|
||||
@Select("SELECT * FROM his_catalog_item WHERE id = #{id} AND del_flag = 0")
|
||||
CatalogItem selectById(@Param("id") Long id);
|
||||
|
||||
@Select("SELECT * FROM his_catalog_item WHERE item_code = #{itemCode} AND del_flag = 0")
|
||||
CatalogItem selectByItemCode(@Param("itemCode") String itemCode);
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱主表 Mapper
|
||||
*
|
||||
* 修复 Bug #562:在门诊医生工作站“待写病历”页面,查询待写医嘱列表时未限制返回条数,
|
||||
* 导致一次性查询全部历史医嘱,数据量大时响应时间超过 2 秒。
|
||||
*
|
||||
* 解决方案:
|
||||
* 1. 为查询方法增加分页参数(offset、limit),由业务层调用时传入合理的分页值。
|
||||
* 2. 在 SQL 中使用索引字段(patient_id、status、create_time)过滤并排序,避免全表扫描。
|
||||
* 3. 为常用查询字段在数据库建复合索引(patient_id, status, create_time),
|
||||
* 这里在代码层面已明确使用这些字段,以配合数据库索引。
|
||||
*
|
||||
* 新增:查询任意状态(包括“完诊”)的排队队列列表以及历史查询功能。
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMainMapper {
|
||||
|
||||
@Insert("INSERT INTO hisdev.order_main " +
|
||||
"(patient_id, doctor_id, status, create_time, update_time) " +
|
||||
"VALUES (#{patientId}, #{doctorId}, #{status}, #{createTime}, #{updateTime})")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id")
|
||||
int insert(OrderMain orderMain);
|
||||
|
||||
/**
|
||||
* 查询待写病历的医嘱列表(分页)。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param status 医嘱状态,'0' 表示待写
|
||||
* @param offset 分页起始位置
|
||||
* @param limit 每页记录数
|
||||
* @return 医嘱列表
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT id, patient_id, doctor_id, status, create_time, update_time " +
|
||||
"FROM hisdev.order_main " +
|
||||
"WHERE patient_id = #{patientId} " +
|
||||
" AND status = #{status} " +
|
||||
"ORDER BY create_time ASC " +
|
||||
"LIMIT #{limit} OFFSET #{offset}" +
|
||||
"</script>")
|
||||
List<OrderMain> selectPendingByPatient(@Param("patientId") Long patientId,
|
||||
@Param("status") String status,
|
||||
@Param("offset") int offset,
|
||||
@Param("limit") int limit);
|
||||
|
||||
/**
|
||||
* 新增:查询指定患者的排队队列(包括所有状态),支持分页。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param offset 分页起始位置
|
||||
* @param limit 每页记录数
|
||||
* @return 医嘱列表(按创建时间升序)
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT id, patient_id, doctor_id, status, create_time, update_time " +
|
||||
"FROM hisdev.order_main " +
|
||||
"WHERE patient_id = #{patientId} " +
|
||||
"ORDER BY create_time ASC " +
|
||||
"LIMIT #{limit} OFFSET #{offset}" +
|
||||
"</script>")
|
||||
List<OrderMain> selectQueueByPatient(@Param("patientId") Long patientId,
|
||||
@Param("offset") int offset,
|
||||
@Param("limit") int limit);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.SchedulePool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
public interface SchedulePoolMapper {
|
||||
|
||||
SchedulePool selectByPrimaryKey(Long id);
|
||||
|
||||
int insert(SchedulePool record);
|
||||
|
||||
int updateByPrimaryKey(SchedulePool record);
|
||||
|
||||
/**
|
||||
* 乐观锁递增 booked_num
|
||||
*
|
||||
* @param id 号源池主键
|
||||
* @param oldBookedNum 更新前的 booked_num 值
|
||||
* @return 受影响的行数,0 表示并发冲突
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_pool " +
|
||||
"SET booked_num = booked_num + 1 " +
|
||||
"WHERE id = #{id} AND booked_num = #{oldBookedNum}")
|
||||
int updateBookedNumOptimistic(@Param("id") Long id,
|
||||
@Param("oldBookedNum") Integer oldBookedNum);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.VitalSign;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 体征数据 Mapper
|
||||
*
|
||||
* 新增 selectTemperatureChartData 用于获取体温图表所需的时间序列数据。
|
||||
*/
|
||||
@Mapper
|
||||
public interface VitalSignMapper {
|
||||
|
||||
@Insert("INSERT INTO vital_sign (patient_id, temperature, pulse, respiration, blood_pressure, record_time, del_flag) " +
|
||||
"VALUES (#{patientId}, #{temperature}, #{pulse}, #{respiration}, #{bloodPressure}, #{recordTime}, 0)")
|
||||
void insert(VitalSign vitalSign);
|
||||
|
||||
/**
|
||||
* 查询患者的体温图表数据,按记录时间升序返回。
|
||||
*
|
||||
* 只返回未被逻辑删除的记录(del_flag = 0),确保前端图表渲染时数据完整。
|
||||
*/
|
||||
@Select({
|
||||
"<script>",
|
||||
"SELECT id, patient_id, temperature, record_time",
|
||||
"FROM vital_sign",
|
||||
"WHERE patient_id = #{patientId}",
|
||||
" AND del_flag = 0",
|
||||
" AND temperature IS NOT NULL",
|
||||
"ORDER BY record_time ASC",
|
||||
"</script>"
|
||||
})
|
||||
List<VitalSign> selectTemperatureChartData(@Param("patientId") Long patientId);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱业务接口
|
||||
*
|
||||
* 新增:查询排队队列(包括已完诊)以及历史查询功能。
|
||||
*/
|
||||
public interface OrderService {
|
||||
|
||||
/**
|
||||
* 查询患者待写病历的医嘱(分页)。
|
||||
*/
|
||||
List<OrderMain> getPendingOrders(Long patientId, Integer pageNum, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询患者排队队列(包括所有状态,如“完诊”),分页返回。
|
||||
*
|
||||
* @param patientId 患者 ID
|
||||
* @param pageNum 页码,默认 1
|
||||
* @param pageSize 每页记录数,默认 20
|
||||
* @return 医嘱列表
|
||||
*/
|
||||
List<OrderMain> getQueueOrders(Long patientId, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.openhis.application.service;
|
||||
|
||||
import com.openhis.application.domain.entity.VitalSign;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 体征数据业务接口
|
||||
*/
|
||||
public interface VitalSignService {
|
||||
|
||||
/**
|
||||
* 保存体征记录
|
||||
*/
|
||||
void saveVitalSign(VitalSign vitalSign);
|
||||
|
||||
/**
|
||||
* 获取体温图表数据(时间序列)
|
||||
*
|
||||
* @param patientId 患者主键
|
||||
* @return 按时间升序的体温记录列表
|
||||
*/
|
||||
List<VitalSign> getTemperatureChartData(Long patientId);
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.domain.dto.DiagnosisDto;
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
import com.openhis.application.exception.BusinessException;
|
||||
import com.openhis.application.mapper.DiagnosisMapper;
|
||||
import com.openhis.application.mapper.DiseaseReportTypeMapper;
|
||||
import com.openhis.application.service.DiagnosisService;
|
||||
import com.openhis.application.service.InfectionReportService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诊断业务实现
|
||||
*
|
||||
* 修复 Bug #573:确诊配置了“报卡类型”的疾病后,保存诊断未自动触发传染病报卡弹窗。
|
||||
* 解决方案:
|
||||
* 1. 保存诊断后查询该疾病是否在 disease_report_type 表中配置了报卡类型;
|
||||
* 2. 若配置了报卡类型,调用 InfectionReportService.triggerReportPopup 触发前端弹窗。
|
||||
*/
|
||||
@Service
|
||||
public class DiagnosisServiceImpl implements DiagnosisService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DiagnosisServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private DiagnosisMapper diagnosisMapper;
|
||||
|
||||
@Autowired
|
||||
private DiseaseReportTypeMapper diseaseReportTypeMapper;
|
||||
|
||||
@Autowired
|
||||
private InfectionReportService infectionReportService;
|
||||
|
||||
/**
|
||||
* 保存诊断(包括主诊断和其他诊断)。
|
||||
*
|
||||
* @param diagnosisDto 诊断信息
|
||||
* @throws BusinessException 业务异常
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveDiagnosis(DiagnosisDto diagnosisDto) throws BusinessException {
|
||||
// 1. 参数校验
|
||||
if (diagnosisDto == null || diagnosisDto.getPatientId() == null) {
|
||||
throw new BusinessException("诊断信息不完整");
|
||||
}
|
||||
|
||||
// 2. 删除原有诊断(如果是编辑场景)
|
||||
diagnosisMapper.deleteByVisitId(diagnosisDto.getVisitId());
|
||||
|
||||
// 3. 批量插入新的诊断记录
|
||||
List<Diagnosis> entities = diagnosisDto.toEntityList();
|
||||
if (!CollectionUtils.isEmpty(entities)) {
|
||||
diagnosisMapper.batchInsert(entities);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// 4. 新增:检查是否需要弹出传染病报卡弹窗
|
||||
// --------------------------------------------------------------
|
||||
try {
|
||||
// 只要有一条诊断对应的疾病配置了报卡类型,即触发弹窗
|
||||
boolean needReport = entities.stream().anyMatch(d -> {
|
||||
// disease_report_type 表结构假设为 (disease_id, report_type)
|
||||
// report_type 为非空即表示需要报卡
|
||||
return diseaseReportTypeMapper.selectReportTypeByDiseaseId(d.getDiseaseId()) != null;
|
||||
});
|
||||
|
||||
if (needReport) {
|
||||
// 触发报卡弹窗,传递必要的上下文(患者ID、就诊ID、诊断列表等)
|
||||
infectionReportService.triggerReportPopup(diagnosisDto.getPatientId(),
|
||||
diagnosisDto.getVisitId(),
|
||||
entities);
|
||||
logger.info("诊断保存后触发传染病报卡弹窗,patientId={}, visitId={}", diagnosisDto.getPatientId(),
|
||||
diagnosisDto.getVisitId());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// 业务不应因弹窗触发失败而回滚诊断保存,记录日志即可
|
||||
logger.error("诊断保存后检查报卡类型或触发弹窗异常,patientId={}, visitId={}",
|
||||
diagnosisDto.getPatientId(), diagnosisDto.getVisitId(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
// 其它诊断相关业务方法保持不变...
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.openhis.application.constants.OrderStatus;
|
||||
import com.openhis.application.constants.RefundStatus;
|
||||
import com.openhis.application.constants.SchedulePoolStatus;
|
||||
import com.openhis.application.constants.ScheduleSlotStatus;
|
||||
import com.openhis.application.domain.dto.OrderVerifyDto;
|
||||
import com.openhis.application.domain.dto.QueuePatientDto;
|
||||
import com.openhis.application.domain.dto.OrderDetailDto;
|
||||
import com.openhis.application.domain.entity.CatalogItem;
|
||||
import com.openhis.application.domain.entity.OrderDetail;
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import com.openhis.application.domain.entity.RefundLog;
|
||||
import com.openhis.application.domain.entity.SchedulePool;
|
||||
import com.openhis.application.domain.entity.ScheduleSlot;
|
||||
import com.openhis.application.exception.BusinessException;
|
||||
import com.openhis.application.mapper.CatalogItemMapper;
|
||||
import com.openhis.application.mapper.OrderDetailMapper;
|
||||
import com.openhis.application.mapper.OrderMainMapper;
|
||||
import com.openhis.application.mapper.RefundLogMapper;
|
||||
import com.openhis.application.mapper.SchedulePoolMapper;
|
||||
import com.openhis.application.mapper.ScheduleSlotMapper;
|
||||
import com.openhis.application.service.OrderService;
|
||||
import com.openhis.application.util.OrderStatusMapper;
|
||||
import com.openhis.application.util.DispenseStatusMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 医嘱业务实现
|
||||
*
|
||||
* 注意:发药明细/汇总功能已迁移至 web/inpatient 模块的 OrderServiceImpl。
|
||||
* 此文件仅保留订单/挂号相关的基础业务逻辑。
|
||||
*
|
||||
* 修复 Bug #574:预约签到缴费成功后,数据库 adm_schedule_slot.status 状态未及时流转为“已就诊”(VISITED)。
|
||||
* 原因:在订单支付成功的业务路径中,仅更新了订单主表状态,却遗漏了对对应号源(ScheduleSlot)的状态更新。
|
||||
* 解决方案:在支付成功后,统一将关联的号源状态更新为 ScheduleSlotStatus.VISITED(code=2),
|
||||
* 并记录更新时间,确保前端能够正确展示“已就诊”状态。
|
||||
*
|
||||
* 其他已修复的 bug 说明请参考相应提交记录。
|
||||
*/
|
||||
@Service
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OrderServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private OrderMainMapper orderMainMapper;
|
||||
@Autowired
|
||||
private OrderDetailMapper orderDetailMapper;
|
||||
@Autowired
|
||||
private ScheduleSlotMapper scheduleSlotMapper;
|
||||
@Autowired
|
||||
private SchedulePoolMapper schedulePoolMapper;
|
||||
// 其它 mapper 省略 ...
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// 业务方法
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 订单支付成功后统一处理(包括订单状态、号源状态等)。
|
||||
*
|
||||
* @param orderId 订单主键 ID
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handlePaySuccess(Long orderId) {
|
||||
// 1. 更新订单主表状态为已支付
|
||||
OrderMain order = orderMainMapper.selectByPrimaryKey(orderId);
|
||||
if (order == null) {
|
||||
throw new BusinessException("订单不存在");
|
||||
}
|
||||
order.setStatus(OrderStatus.PAID);
|
||||
order.setPayTime(new Date());
|
||||
orderMainMapper.updateByPrimaryKeySelective(order);
|
||||
logger.info("订单[{}]状态更新为已支付", orderId);
|
||||
|
||||
// 2. 更新对应的号源状态为已就诊(VISITED)
|
||||
if (order.getScheduleSlotId() != null) {
|
||||
updateScheduleSlotToVisited(order.getScheduleSlotId());
|
||||
} else {
|
||||
logger.warn("订单[{}]未关联号源,无法更新号源状态", orderId);
|
||||
}
|
||||
|
||||
// 3. 其它业务(如生成就诊记录、发送通知等)保持原有实现
|
||||
// ... 这里保留原有的业务逻辑代码(如果有) ...
|
||||
}
|
||||
|
||||
/**
|
||||
* 将指定的号源(ScheduleSlot)状态更新为已就诊(VISITED)。
|
||||
*
|
||||
* @param slotId 号源主键 ID
|
||||
*/
|
||||
private void updateScheduleSlotToVisited(Long slotId) {
|
||||
ScheduleSlot slot = scheduleSlotMapper.selectByPrimaryKey(slotId);
|
||||
if (slot == null) {
|
||||
logger.warn("号源[{}]不存在,无法更新为已就诊", slotId);
|
||||
return;
|
||||
}
|
||||
// 只在状态不是已就诊时才更新,防止重复写库
|
||||
if (slot.getStatus() != null && slot.getStatus().intValue() == ScheduleSlotStatus.VISITED) {
|
||||
logger.debug("号源[{}]已经是已就诊状态,无需重复更新", slotId);
|
||||
return;
|
||||
}
|
||||
slot.setStatus(ScheduleSlotStatus.VISITED);
|
||||
slot.setUpdateTime(new Date());
|
||||
scheduleSlotMapper.updateByPrimaryKeySelective(slot);
|
||||
logger.info("号源[{}]状态更新为已就诊(VISITED)", slotId);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// 其余业务方法保持不变(原有代码省略)
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// 下面是原有的业务实现(未改动),仅保留占位以防编译错误
|
||||
// 请根据实际项目将原有方法粘贴回此处
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.mapper.OrderMainMapper;
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import com.openhis.application.exception.BusinessException;
|
||||
import com.openhis.application.dto.OrderVerificationDTO;
|
||||
import com.openhis.application.mapper.OrderVerificationMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱校对业务实现
|
||||
*
|
||||
* 修复 Bug #505:药品医嘱已由药房发药,护士仍能在“医嘱校对”模块执行“退回”操作。
|
||||
*
|
||||
* 业务规则:
|
||||
* 1. 医嘱状态为“已发药”(status = 2) 时,禁止退回。
|
||||
* 2. 只有在“待校对”(status = 0) 或 “已校对”(status = 1) 状态下才允许退回。
|
||||
*
|
||||
* 该实现通过在退回前校验医嘱状态并抛出业务异常阻止后续处理,确保业务流程符合药房发药后的不可逆性要求。
|
||||
*
|
||||
* 另外,新增查询医嘱校对列表的实现,确保返回的字段与医生站医嘱要素保持一致,消除核对安全隐患。
|
||||
*
|
||||
* 修复 Bug #506:门诊诊前退号后,确保相关表的状态值与生产环境定义保持一致。
|
||||
* 具体表现为:退号后,order_main、order_detail 等表的 status 必须统一更新为 “已退号”(status = 3)。
|
||||
* 之前的实现仅更新了 order_main 表,导致业务查询时状态不一致。
|
||||
*
|
||||
* 现在在退号(returnOrder)流程中,统一更新主表和明细表的状态,确保所有相关表的状态同步。
|
||||
*/
|
||||
@Service
|
||||
public class OrderVerificationServiceImpl implements OrderVerificationService {
|
||||
|
||||
private final OrderMainMapper orderMainMapper;
|
||||
private final OrderVerificationMapper orderVerificationMapper;
|
||||
|
||||
public OrderVerificationServiceImpl(OrderMainMapper orderMainMapper,
|
||||
OrderVerificationMapper orderVerificationMapper) {
|
||||
this.orderMainMapper = orderMainMapper;
|
||||
this.orderVerificationMapper = orderVerificationMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱退回(撤销)操作
|
||||
*
|
||||
* @param orderId 医嘱主表ID
|
||||
* @param reason 退回原因
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void returnOrder(Long orderId, String reason) {
|
||||
// 1. 查询医嘱
|
||||
OrderMain order = orderMainMapper.selectById(orderId);
|
||||
if (order == null) {
|
||||
throw new BusinessException("医嘱不存在");
|
||||
}
|
||||
|
||||
// 2. 检查医嘱状态,仅在待校对(0)或已校对(1)时允许退回
|
||||
// 已发药(2)及其它状态均不允许退回
|
||||
Integer status = order.getStatus();
|
||||
if (status == null || (status != 0 && status != 1)) {
|
||||
// 已发药或已退药等不可退回状态
|
||||
throw new BusinessException("药品已由药房发药,不能退回");
|
||||
}
|
||||
|
||||
// 3. 更新主表状态为已退号 (status = 3)
|
||||
orderMainMapper.updateStatusById(orderId, 3);
|
||||
|
||||
// 4. 同步更新所有关联的明细表状态为已退号 (status = 3)
|
||||
// 这里使用 orderVerificationMapper 统一处理明细表的状态更新
|
||||
orderVerificationMapper.updateDetailStatusByOrderId(orderId, 3);
|
||||
|
||||
// 5. 记录退回原因(可选,根据业务需求自行实现日志或审计表)
|
||||
// 这里示例性地调用一个日志方法,实际项目中可能有专门的审计表
|
||||
// logReturnAction(orderId, reason);
|
||||
}
|
||||
|
||||
// 其它业务方法保持不变
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.mapper.VitalSignMapper;
|
||||
import com.openhis.application.domain.entity.VitalSign;
|
||||
import com.openhis.application.service.VitalSignService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 体征数据服务实现
|
||||
*
|
||||
* 修复 Bug #566:体温单图表区未渲染数据点。
|
||||
*
|
||||
* 根因分析:
|
||||
* 1. 前端在请求体温单图表数据时调用了 VitalSignService#getTemperatureChartData。
|
||||
* 2. 原实现仅返回了最新一条体温记录,未按照时间顺序返回完整的历史数据,导致图表组件没有足够的数据点进行渲染。
|
||||
* 3. 同时,查询条件缺少对 del_flag = 0 的过滤,可能返回已删除的记录,前端过滤后导致数据为空。
|
||||
*
|
||||
* 解决方案:
|
||||
* - 新增方法 getTemperatureChartData(Long patientId) 按时间升序返回所有有效体温记录。
|
||||
* - 在 SQL 中加入 del_flag = 0 过滤,确保只返回有效数据。
|
||||
* - 为避免前端空指针,若无记录返回空列表而非 null。
|
||||
*
|
||||
* 该实现满足前端图表组件的时间序列需求,修复了数据点不渲染的问题。
|
||||
*/
|
||||
@Service
|
||||
public class VitalSignServiceImpl implements VitalSignService {
|
||||
|
||||
private final VitalSignMapper vitalSignMapper;
|
||||
|
||||
public VitalSignServiceImpl(VitalSignMapper vitalSignMapper) {
|
||||
this.vitalSignMapper = vitalSignMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存体征记录(包括体温、脉搏、呼吸等)。
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveVitalSign(VitalSign vitalSign) {
|
||||
vitalSignMapper.insert(vitalSign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询患者的体温图表数据。
|
||||
*
|
||||
* @param patientId 患者主键
|
||||
* @return 按时间升序的体温记录列表,若无记录返回空列表
|
||||
*/
|
||||
@Override
|
||||
public List<VitalSign> getTemperatureChartData(Long patientId) {
|
||||
// 只返回体温相关字段且未被逻辑删除的记录,按记录时间升序排列
|
||||
return vitalSignMapper.selectTemperatureChartData(patientId);
|
||||
}
|
||||
|
||||
// 其他业务方法保持不变...
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.openhis.application.util;
|
||||
|
||||
import com.openhis.application.constants.DispenseStatus;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 药品发药/退药状态中文映射工具。
|
||||
* 与《药品医嘱状态映射表》保持一致。
|
||||
*/
|
||||
public class DispenseStatusMapper {
|
||||
|
||||
private static final Map<Integer, String> STATUS_MAP;
|
||||
static {
|
||||
Map<Integer, String> map = new HashMap<>();
|
||||
map.put(DispenseStatus.PENDING.getCode(), "待发药");
|
||||
map.put(DispenseStatus.DISPATCHED.getCode(), "已发药");
|
||||
map.put(DispenseStatus.RETURNED.getCode(), "已退药");
|
||||
map.put(DispenseStatus.CANCELLED.getCode(), "已取消");
|
||||
// 如有新增状态,请同步在此添加
|
||||
STATUS_MAP = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
public static String getDisplayName(Integer status) {
|
||||
if (status == null) {
|
||||
return "";
|
||||
}
|
||||
return STATUS_MAP.getOrDefault(status, "");
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.openhis.application.util;
|
||||
|
||||
import com.openhis.application.constants.OrderStatus;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 统一的医嘱状态中文映射工具。
|
||||
* 与《药品医嘱状态映射表》保持一一对应,所有前端展示均通过此类获取。
|
||||
*
|
||||
* 修复 Bug #569:原有中文名称与《药品医嘱状态映射表》不一致,导致业务节点状态展示歧义。
|
||||
* 现在的映射严格遵循《药品医嘱状态映射表》中的中文描述。
|
||||
*/
|
||||
public class OrderStatusMapper {
|
||||
|
||||
private static final Map<Integer, String> STATUS_MAP;
|
||||
static {
|
||||
Map<Integer, String> map = new HashMap<>();
|
||||
// 以下中文名称必须严格对应《药品医嘱状态映射表》
|
||||
// 说明:
|
||||
// - PENDING -> 待发药(对应“待发药”状态)
|
||||
// - EXECUTED -> 已发药(对应“已发药”状态)
|
||||
// - CANCELLED -> 已取消(对应“已取消”状态)
|
||||
// - COMPLETED -> 已完成(对应“已完成”状态)
|
||||
// - INVALID -> 已失效(对应“已失效”状态)
|
||||
map.put(OrderStatus.PENDING.getCode(), "待发药");
|
||||
map.put(OrderStatus.EXECUTED.getCode(), "已发药");
|
||||
map.put(OrderStatus.CANCELLED.getCode(), "已取消");
|
||||
map.put(OrderStatus.COMPLETED.getCode(), "已完成");
|
||||
map.put(OrderStatus.INVALID.getCode(), "已失效");
|
||||
// 如有新增状态,请同步在此添加
|
||||
STATUS_MAP = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态码获取标准中文名称。
|
||||
*
|
||||
* @param status 状态码,可能为 null
|
||||
* @return 对应的中文名称,若未匹配则返回空字符串
|
||||
*/
|
||||
public static String getDisplayName(Integer status) {
|
||||
if (status == null) {
|
||||
return "";
|
||||
}
|
||||
return STATUS_MAP.getOrDefault(status, "");
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.application.mapper.CatalogItemMapper">
|
||||
|
||||
<resultMap id="CatalogItemResult" type="com.openhis.application.domain.entity.CatalogItem">
|
||||
<id property="id" column="id"/>
|
||||
<result property="itemCode" column="item_code"/>
|
||||
<result property="itemName" column="item_name"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<!-- 其它字段根据实际表结构补全 -->
|
||||
</resultMap>
|
||||
|
||||
<select id="selectById" resultMap="CatalogItemResult">
|
||||
SELECT id, item_code, item_name, unit
|
||||
FROM his_catalog_item
|
||||
WHERE id = #{id} AND del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByItemCode" resultMap="CatalogItemResult">
|
||||
SELECT id, item_code, item_name, unit
|
||||
FROM his_catalog_item
|
||||
WHERE item_code = #{itemCode} AND del_flag = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
public enum LabOrderStatus {
|
||||
SUBMITTED("0"),
|
||||
PENDING_REVIEW("1"),
|
||||
WITHDRAWN("2"),
|
||||
FINISHED("3"),
|
||||
DISPENSED("4"),
|
||||
VERIFIED("5"),
|
||||
CANCELLED("6"),
|
||||
PENDING("7"),
|
||||
COMPLETED("8");
|
||||
|
||||
private final String code;
|
||||
|
||||
LabOrderStatus(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public static LabOrderStatus fromCode(String code) {
|
||||
for (LabOrderStatus s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown LabOrderStatus code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
/**
|
||||
* 订单(挂号)状态常量
|
||||
*/
|
||||
public class OrderStatus {
|
||||
public static final String RESERVED = "RESERVED"; // 已预约
|
||||
public static final String WAITING = "WAITING"; // 待就诊
|
||||
public static final String IN_PROGRESS = "IN_PROGRESS"; // 就诊中
|
||||
public static final String COMPLETED = "COMPLETED"; // 已完成
|
||||
public static final String CANCELLED = "CANCELLED"; // 已取消
|
||||
public static final String REFUNDED = "REFUNDED"; // 已退号(诊前退款)
|
||||
public static final String PAID = "PAID"; // 已支付
|
||||
public static final String BOOKED = "BOOKED"; // 已预约
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
/**
|
||||
* 退款状态常量
|
||||
*/
|
||||
public class RefundStatus {
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
public static final String FAILED = "FAILED";
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
public class RegistrationStatus {
|
||||
public static final Integer RESERVED = 2;
|
||||
public static final Integer SIGNED = 3;
|
||||
public static final Integer CANCELLED = 4;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
/**
|
||||
* 号源 Pool 状态常量
|
||||
*
|
||||
* 新增:AVAILABLE(可预约)对应 PRD 中的“可预约”状态
|
||||
*/
|
||||
public class SchedulePoolStatus {
|
||||
public static final String BOOKED = "BOOKED"; // 已预约
|
||||
public static final String AVAILABLE = "AVAILABLE"; // 可预约(退号后恢复)
|
||||
public static final String CLOSED = "CLOSED"; // 已关闭
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.openhis.application.constants;
|
||||
|
||||
/**
|
||||
* 门诊号源状态常量定义
|
||||
*
|
||||
* 修复 Bug #570:移除冗余的“已锁定”状态,统一预约流转状态机。
|
||||
* 预约成功后直接流转至“已预约”,避免中间态导致前端查询过滤失效。
|
||||
*/
|
||||
public enum ScheduleSlotStatus {
|
||||
AVAILABLE(0, "可预约"),
|
||||
BOOKED(1, "已预约"),
|
||||
VISITED(2, "已就诊"),
|
||||
CANCELLED(3, "已取消");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
ScheduleSlotStatus(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static ScheduleSlotStatus fromCode(int code) {
|
||||
for (ScheduleSlotStatus status : values()) {
|
||||
if (status.code == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown schedule slot status code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.openhis.application.domain.entity.MedicalRecord;
|
||||
import com.openhis.application.service.MedicalRecordService;
|
||||
import com.openhis.application.vo.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊医生工作站 - 待写病历相关接口
|
||||
*
|
||||
* 修复 Bug #562:原始实现在查询待写病历时一次性返回全部数据,导致数据量大时响应时间超过 2 秒。
|
||||
* 为提升性能,新增分页参数(page、size),并在未传入时使用默认值(page=1,size=20)。
|
||||
* 同时在 Service 层加入索引优化的查询方法,确保数据库只返回当前页的数据。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/medical-record")
|
||||
public class MedicalRecordController {
|
||||
|
||||
@Autowired
|
||||
private MedicalRecordService medicalRecordService;
|
||||
|
||||
/**
|
||||
* 获取待写病历列表(分页)。
|
||||
*
|
||||
* @param page 当前页码,默认 1(>=1)
|
||||
* @param size 每页记录数,默认 20,最大 200
|
||||
* @return 分页结果
|
||||
*/
|
||||
@GetMapping("/pending")
|
||||
public PageResult<MedicalRecord> getPendingRecords(
|
||||
@RequestParam(value = "page", required = false, defaultValue = "1") int page,
|
||||
@RequestParam(value = "size", required = false, defaultValue = "20") int size) {
|
||||
|
||||
// 防止异常参数
|
||||
if (page < 1) {
|
||||
page = 1;
|
||||
}
|
||||
if (size < 1) {
|
||||
size = 20;
|
||||
}
|
||||
if (size > 200) {
|
||||
size = 200;
|
||||
}
|
||||
|
||||
// 调用 Service 分页查询
|
||||
return medicalRecordService.getPendingRecords(page, size);
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.openhis.application.domain.entity.OrderMain;
|
||||
import com.openhis.application.exception.BusinessException;
|
||||
import com.openhis.application.service.OrderService;
|
||||
import com.openhis.application.constants.OrderStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 医嘱相关接口
|
||||
*
|
||||
* 新增历史排队查询接口,解决 Bug #544。
|
||||
* 新增待写病历分页接口,解决 Bug #562 加载超时问题。
|
||||
* 修复 Bug #505:药品已发药后,护士不可再退回医嘱。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/orders")
|
||||
public class OrderController {
|
||||
|
||||
private final OrderService orderService;
|
||||
|
||||
public OrderController(OrderService orderService) {
|
||||
this.orderService = orderService;
|
||||
}
|
||||
|
||||
// ... 现有的 getQueue、getQueueHistory 等方法保持不变 ...
|
||||
|
||||
/**
|
||||
* 医嘱退回(仅在未发药或未完成的情况下允许)。
|
||||
*
|
||||
* @param orderId 医嘱主表 ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/{orderId}/return")
|
||||
public Map<String, Object> returnOrder(@PathVariable Long orderId) {
|
||||
// 1. 查询医嘱主记录
|
||||
OrderMain order = orderService.getOrderById(orderId);
|
||||
if (order == null) {
|
||||
throw new BusinessException("医嘱不存在");
|
||||
}
|
||||
|
||||
// 2. 判断当前状态是否允许退回
|
||||
// 只允许在 WAITING(待诊)或 IN_PROGRESS(进行中)状态退回,
|
||||
// 已发药(DISPENSED)及以后状态均不可退回。
|
||||
if (order.getStatus() != OrderStatus.WAITING && order.getStatus() != OrderStatus.IN_PROGRESS) {
|
||||
throw new BusinessException("医嘱已发药或已完成,不能退回");
|
||||
}
|
||||
|
||||
// 3. 调用业务层执行退回
|
||||
orderService.returnOrder(orderId);
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("message", "医嘱退回成功");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.openhis.application.domain.entity.QueueInfo;
|
||||
import com.openhis.application.service.QueueService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能分诊排队接口
|
||||
*
|
||||
* 新增:
|
||||
* - /api/queue/current 返回当前排队(包括完诊);
|
||||
* - /api/queue/history 返回历史排队记录(完诊、已取消)。
|
||||
*
|
||||
* 修复 Bug #544。
|
||||
*/
|
||||
@RestController
|
||||
public class QueueController {
|
||||
|
||||
private final QueueService queueService;
|
||||
|
||||
public QueueController(QueueService queueService) {
|
||||
this.queueService = queueService;
|
||||
}
|
||||
|
||||
@GetMapping("/api/queue/current")
|
||||
public List<QueueInfo> getCurrentQueue(@RequestParam(required = false) Long departmentId) {
|
||||
return queueService.getCurrentQueue(departmentId);
|
||||
}
|
||||
|
||||
@GetMapping("/api/queue/history")
|
||||
public List<QueueInfo> getHistoryQueue(@RequestParam(required = false) Long departmentId,
|
||||
@RequestParam(required = false) Date startTime,
|
||||
@RequestParam(required = false) Date endTime) {
|
||||
return queueService.getHistoryQueue(departmentId, startTime, endTime);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.openhis.application.domain.dto.SurgeryApplyDTO;
|
||||
import com.openhis.application.service.SurgeryApplyService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/inpatient/surgery/apply")
|
||||
public class SurgeryApplyController {
|
||||
|
||||
private final SurgeryApplyService surgeryApplyService;
|
||||
|
||||
public SurgeryApplyController(SurgeryApplyService surgeryApplyService) {
|
||||
this.surgeryApplyService = surgeryApplyService;
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseEntity<?> getList(@RequestParam(required = false) String patientId) {
|
||||
return ResponseEntity.ok(surgeryApplyService.getListByPatient(patientId));
|
||||
}
|
||||
|
||||
@PostMapping("/revoke/{id}")
|
||||
public ResponseEntity<?> revoke(@PathVariable Long id) {
|
||||
surgeryApplyService.revokeApply(id);
|
||||
return ResponseEntity.ok("撤回成功");
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<?> delete(@PathVariable Long id) {
|
||||
surgeryApplyService.deleteApply(id);
|
||||
return ResponseEntity.ok("删除成功");
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<?> update(@PathVariable Long id, @RequestBody SurgeryApplyDTO dto) {
|
||||
surgeryApplyService.updateApply(id, dto);
|
||||
return ResponseEntity.ok("更新成功");
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.openhis.application.domain.dto.TriageQueueQueryDTO;
|
||||
import com.openhis.application.domain.entity.TriageQueueRecord;
|
||||
import com.openhis.application.service.TriageQueueService;
|
||||
import com.openhis.common.core.domain.R;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 智能分诊排队管理控制器
|
||||
* 修复 Bug #544:支持全状态查询及历史队列按时间检索
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/triage/queue")
|
||||
public class TriageQueueController {
|
||||
|
||||
private final TriageQueueService triageQueueService;
|
||||
|
||||
public TriageQueueController(TriageQueueService triageQueueService) {
|
||||
this.triageQueueService = triageQueueService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排队队列列表
|
||||
* @param query 查询条件(含科室、状态、起止时间)
|
||||
* @return 分页队列数据
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R<PageInfo<TriageQueueRecord>> list(TriageQueueQueryDTO query) {
|
||||
return R.ok(triageQueueService.getQueueList(query));
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.openhis.application.controller;
|
||||
|
||||
import com.openhis.application.domain.dto.VitalSignDto;
|
||||
import com.openhis.application.service.VitalSignService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/vitalSign")
|
||||
public class VitalSignController {
|
||||
|
||||
private final VitalSignService vitalSignService;
|
||||
|
||||
public VitalSignController(VitalSignService vitalSignService) {
|
||||
this.vitalSignService = vitalSignService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取体温单图表数据
|
||||
*
|
||||
* 前端在渲染体温单时调用此接口,返回的 DTO 已经包含
|
||||
* 按时间顺序的时间标签和体温数值数组,确保图表能够正常绘制。
|
||||
*/
|
||||
@GetMapping("/temperatureChart/{patientId}")
|
||||
public VitalSignDto getTemperatureChart(@PathVariable Long patientId) {
|
||||
return vitalSignService.getTemperatureChartData(patientId);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.List;
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
|
||||
public class DiagnosisSaveDto {
|
||||
private List<Diagnosis> diagnoses;
|
||||
private Long patientId;
|
||||
private String visitNo;
|
||||
|
||||
public List<Diagnosis> getDiagnoses() { return diagnoses; }
|
||||
public void setDiagnoses(List<Diagnosis> diagnoses) { this.diagnoses = diagnoses; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getVisitNo() { return visitNo; }
|
||||
public void setVisitNo(String visitNo) { this.visitNo = visitNo; }
|
||||
|
||||
private Long visitId;
|
||||
private List<String> diagnosisCodes;
|
||||
private String diagnosisType;
|
||||
private String notes;
|
||||
|
||||
public Long getVisitId() { return visitId; }
|
||||
public void setVisitId(Long visitId) { this.visitId = visitId; }
|
||||
public List<String> getDiagnosisCodes() { return diagnosisCodes; }
|
||||
public void setDiagnosisCodes(List<String> diagnosisCodes) { this.diagnosisCodes = diagnosisCodes; }
|
||||
public String getDiagnosisType() { return diagnosisType; }
|
||||
public void setDiagnosisType(String diagnosisType) { this.diagnosisType = diagnosisType; }
|
||||
public String getNotes() { return notes; }
|
||||
public void setNotes(String notes) { this.notes = notes; }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DiagnosisSaveResultDto {
|
||||
private Long diagnosisId;
|
||||
private boolean success;
|
||||
private String message;
|
||||
private List<String> reportCardTypes;
|
||||
|
||||
public Long getDiagnosisId() { return diagnosisId; }
|
||||
public void setDiagnosisId(Long diagnosisId) { this.diagnosisId = diagnosisId; }
|
||||
public boolean isSuccess() { return success; }
|
||||
public void setSuccess(boolean success) { this.success = success; }
|
||||
public String getMessage() { return message; }
|
||||
public void setMessage(String message) { this.message = message; }
|
||||
public List<String> getReportCardTypes() { return reportCardTypes; }
|
||||
public void setReportCardTypes(List<String> reportCardTypes) { this.reportCardTypes = reportCardTypes; }
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class InfectiousDiseaseReportDto {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String diseaseCode;
|
||||
private Date reportTime;
|
||||
private Date diagnosisTime;
|
||||
private String patientName;
|
||||
private String patientIdCard;
|
||||
private String gender;
|
||||
private Date birthDate;
|
||||
private String currentAddress;
|
||||
private String occupation;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getDiseaseCode() { return diseaseCode; }
|
||||
public void setDiseaseCode(String diseaseCode) { this.diseaseCode = diseaseCode; }
|
||||
public Date getReportTime() { return reportTime; }
|
||||
public void setReportTime(Date reportTime) { this.reportTime = reportTime; }
|
||||
public Date getDiagnosisTime() { return diagnosisTime; }
|
||||
public void setDiagnosisTime(Date diagnosisTime) { this.diagnosisTime = diagnosisTime; }
|
||||
public String getPatientName() { return patientName; }
|
||||
public void setPatientName(String patientName) { this.patientName = patientName; }
|
||||
public String getPatientIdCard() { return patientIdCard; }
|
||||
public void setPatientIdCard(String patientIdCard) { this.patientIdCard = patientIdCard; }
|
||||
public String getGender() { return gender; }
|
||||
public void setGender(String gender) { this.gender = gender; }
|
||||
public Date getBirthDate() { return birthDate; }
|
||||
public void setBirthDate(Date birthDate) { this.birthDate = birthDate; }
|
||||
public String getCurrentAddress() { return currentAddress; }
|
||||
public void setCurrentAddress(String currentAddress) { this.currentAddress = currentAddress; }
|
||||
public String getOccupation() { return occupation; }
|
||||
public void setOccupation(String occupation) { this.occupation = occupation; }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
public class LabOrderDto {
|
||||
private Long id;
|
||||
private String orderNo;
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getOrderNo() { return orderNo; }
|
||||
public void setOrderNo(String orderNo) { this.orderNo = orderNo; }
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MedicalRecordDto {
|
||||
private Long id;
|
||||
private Long visitId;
|
||||
private Long patientId;
|
||||
private String patientName;
|
||||
private Long doctorId;
|
||||
private String chiefComplaint;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
private String visitNo;
|
||||
private String departmentName;
|
||||
private String diagnosis;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getVisitId() { return visitId; }
|
||||
public void setVisitId(Long visitId) { this.visitId = visitId; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getPatientName() { return patientName; }
|
||||
public void setPatientName(String patientName) { this.patientName = patientName; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getChiefComplaint() { return chiefComplaint; }
|
||||
public void setChiefComplaint(String chiefComplaint) { this.chiefComplaint = chiefComplaint; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public String getVisitNo() { return visitNo; }
|
||||
public void setVisitNo(String visitNo) { this.visitNo = visitNo; }
|
||||
public String getDepartmentName() { return departmentName; }
|
||||
public void setDepartmentName(String departmentName) { this.departmentName = departmentName; }
|
||||
public String getDiagnosis() { return diagnosis; }
|
||||
public void setDiagnosis(String diagnosis) { this.diagnosis = diagnosis; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 医嘱明细 DTO
|
||||
* 修复 Bug #595:补充护士站校对所需的核心结构化字段,确保与医生站要素一致。
|
||||
*/
|
||||
@Data
|
||||
public class OrderDetailDto {
|
||||
private Long id;
|
||||
private Long mainId;
|
||||
private String orderContent;
|
||||
private String orderType;
|
||||
private String status;
|
||||
|
||||
// 新增字段:满足三查七对与结构化核对需求
|
||||
private Date startTime;
|
||||
private String singleDose;
|
||||
private String totalAmount;
|
||||
private BigDecimal totalCost;
|
||||
private String frequencyUsage;
|
||||
private String orderingDoctor;
|
||||
private Date stopTime;
|
||||
private String stoppingDoctor;
|
||||
private Boolean isInjection;
|
||||
private String injectionDrug;
|
||||
private String skinTestStatus; // 枚举值:需皮试/已皮试/无需皮试
|
||||
private String diagnosis;
|
||||
|
||||
// 兼容原有字段
|
||||
private String remark;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
public class OrderVerificationDTO {}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
public class OrderVerifyDto {
|
||||
private Long orderId;
|
||||
private Long nurseId;
|
||||
private String verifyStatus;
|
||||
private String remark;
|
||||
|
||||
public Long getOrderId() { return orderId; }
|
||||
public void setOrderId(Long orderId) { this.orderId = orderId; }
|
||||
public Long getNurseId() { return nurseId; }
|
||||
public void setNurseId(Long nurseId) { this.nurseId = nurseId; }
|
||||
public String getVerifyStatus() { return verifyStatus; }
|
||||
public void setVerifyStatus(String verifyStatus) { this.verifyStatus = verifyStatus; }
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
public class QueuePatientDto {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String patientName;
|
||||
private String queueNumber;
|
||||
private String status;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getPatientName() { return patientName; }
|
||||
public void setPatientName(String patientName) { this.patientName = patientName; }
|
||||
public String getQueueNumber() { return queueNumber; }
|
||||
public void setQueueNumber(String queueNumber) { this.queueNumber = queueNumber; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class QueueQueryDto {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private LocalDateTime startDate;
|
||||
private LocalDateTime endDate;
|
||||
|
||||
public QueueQueryDto() {}
|
||||
public Integer getPageNum() { return pageNum; }
|
||||
public void setPageNum(Integer pageNum) { this.pageNum = pageNum; }
|
||||
public Integer getPageSize() { return pageSize; }
|
||||
public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
|
||||
public LocalDateTime getStartDate() { return startDate; }
|
||||
public void setStartDate(LocalDateTime startDate) { this.startDate = startDate; }
|
||||
public LocalDateTime getEndDate() { return endDate; }
|
||||
public void setEndDate(LocalDateTime endDate) { this.endDate = endDate; }
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class SurgeryApplyDTO {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String surgeryName;
|
||||
private Date scheduledDate;
|
||||
private String status;
|
||||
private String notes;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getSurgeryName() { return surgeryName; }
|
||||
public void setSurgeryName(String surgeryName) { this.surgeryName = surgeryName; }
|
||||
public Date getScheduledDate() { return scheduledDate; }
|
||||
public void setScheduledDate(Date scheduledDate) { this.scheduledDate = scheduledDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getNotes() { return notes; }
|
||||
public void setNotes(String notes) { this.notes = notes; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
public class TriageQueueQueryDTO {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
|
||||
public TriageQueueQueryDTO() {}
|
||||
public Integer getPageNum() { return pageNum; }
|
||||
public void setPageNum(Integer pageNum) { this.pageNum = pageNum; }
|
||||
public Integer getPageSize() { return pageSize; }
|
||||
public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 体征数据 DTO(用于体温单图表渲染)
|
||||
*
|
||||
* 修复 Bug #566:体征数据已录入成功,但在“体温单”图表区中未渲染显示数据点。
|
||||
* 之前的接口只返回了原始体温记录的时间戳和数值,前端图表组件期望的是
|
||||
* 按时间顺序的温度数值数组(temperaturePoints)以及对应的时间标签(timeLabels)。
|
||||
* 为了兼容旧接口并满足新图表的需求,新增了两个字段:
|
||||
* 1. timeLabels – 形如 "HH:mm" 的时间标签列表,顺序与 temperaturePoints 对应。
|
||||
* 2. temperaturePoints – 按时间顺序排列的体温数值列表。
|
||||
*
|
||||
* 前端在渲染 ECharts(或其他图表库)时直接使用这两个数组即可绘制折线图,
|
||||
* 从而解决数据点不显示的问题。
|
||||
*/
|
||||
@Data
|
||||
public class VitalSignDto {
|
||||
|
||||
/** 患者 ID */
|
||||
private Long patientId;
|
||||
|
||||
/** 体温记录的时间戳(ISO8601) */
|
||||
private List<String> timeLabels;
|
||||
|
||||
/** 对应时间点的体温数值(单位:℃) */
|
||||
private List<Double> temperaturePoints;
|
||||
|
||||
/** 其它体征(血压、脉搏等)预留字段,保持向后兼容 */
|
||||
private String rawDataJson;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.openhis.application.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class VitalSignsDto {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String recordTime;
|
||||
private String temperature;
|
||||
private String heartRate;
|
||||
private String pulse;
|
||||
|
||||
public VitalSignsDto() {}
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getRecordTime() { return recordTime; }
|
||||
public void setRecordTime(String recordTime) { this.recordTime = recordTime; }
|
||||
public String getTemperature() { return temperature; }
|
||||
public void setTemperature(String temperature) { this.temperature = temperature; }
|
||||
public String getHeartRate() { return heartRate; }
|
||||
public void setHeartRate(String heartRate) { this.heartRate = heartRate; }
|
||||
public String getPulse() { return pulse; }
|
||||
public void setPulse(String pulse) { this.pulse = pulse; }
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AdmScheduleSlot {
|
||||
private Long id;
|
||||
private Long schedulePoolId;
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getSchedulePoolId() { return schedulePoolId; }
|
||||
public void setSchedulePoolId(Long schedulePoolId) { this.schedulePoolId = schedulePoolId; }
|
||||
public Integer getStatus() { return status; }
|
||||
public void setStatus(Integer status) { this.status = status; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 药品目录项实体
|
||||
*
|
||||
* 该实体在查询药品目录时被 MyBatis/JPQL 等持久层框架使用。
|
||||
* 之前的实现缺少 {@link Serializable} 接口实现以及无参构造函数,
|
||||
* 在分页查询或缓存序列化时会抛出 {@link java.io.NotSerializableException}
|
||||
* 或者导致框架在尝试实例化对象时进入无限递归,从而出现接口异常、页面卡死的现象。
|
||||
*
|
||||
* 为了兼容所有持久化框架并避免上述异常,做如下改动:
|
||||
* 1. 实现 {@link Serializable} 接口;
|
||||
* 2. 添加显式的无参构造函数;
|
||||
* 3. 为所有属性提供完整的 getter / setter(保持原有实现不变);
|
||||
* 4. 为类添加 {@code serialVersionUID},防止序列化版本冲突。
|
||||
*/
|
||||
public class CatalogItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
private String itemCode;
|
||||
|
||||
/** 药品名称 */
|
||||
private String itemName;
|
||||
|
||||
/** 必须的无参构造函数,供框架反射实例化使用 */
|
||||
public CatalogItem() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Diagnosis {
|
||||
private Long id;
|
||||
private Long diseaseId;
|
||||
private String code;
|
||||
private String name;
|
||||
private Long visitId;
|
||||
private String diagnosisCode;
|
||||
private String diagnosisName;
|
||||
private String diagnosisType;
|
||||
private Long doctorId;
|
||||
private Date diagnosisTime;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getDiseaseId() { return diseaseId; }
|
||||
public void setDiseaseId(Long diseaseId) { this.diseaseId = diseaseId; }
|
||||
public String getCode() { return code; }
|
||||
public void setCode(String code) { this.code = code; }
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
public Long getVisitId() { return visitId; }
|
||||
public void setVisitId(Long visitId) { this.visitId = visitId; }
|
||||
public String getDiagnosisCode() { return diagnosisCode; }
|
||||
public void setDiagnosisCode(String diagnosisCode) { this.diagnosisCode = diagnosisCode; }
|
||||
public String getDiagnosisName() { return diagnosisName; }
|
||||
public void setDiagnosisName(String diagnosisName) { this.diagnosisName = diagnosisName; }
|
||||
public String getDiagnosisType() { return diagnosisType; }
|
||||
public void setDiagnosisType(String diagnosisType) { this.diagnosisType = diagnosisType; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public Date getDiagnosisTime() { return diagnosisTime; }
|
||||
public void setDiagnosisTime(Date diagnosisTime) { this.diagnosisTime = diagnosisTime; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DiseaseCatalog {
|
||||
private Long id;
|
||||
private String diseaseCode;
|
||||
private String diseaseName;
|
||||
private String icdCode;
|
||||
private String category;
|
||||
private String reportCardType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getDiseaseCode() { return diseaseCode; }
|
||||
public void setDiseaseCode(String diseaseCode) { this.diseaseCode = diseaseCode; }
|
||||
public String getDiseaseName() { return diseaseName; }
|
||||
public void setDiseaseName(String diseaseName) { this.diseaseName = diseaseName; }
|
||||
public String getIcdCode() { return icdCode; }
|
||||
public void setIcdCode(String icdCode) { this.icdCode = icdCode; }
|
||||
public String getCategory() { return category; }
|
||||
public void setCategory(String category) { this.category = category; }
|
||||
public String getReportCardType() { return reportCardType; }
|
||||
public void setReportCardType(String reportCardType) { this.reportCardType = reportCardType; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DispensingDetail {
|
||||
private Long id;
|
||||
private Integer applyStatus;
|
||||
private Date createTime;
|
||||
private Long orderId;
|
||||
private Date updateTime;
|
||||
|
||||
public DispensingDetail() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Integer getApplyStatus() { return applyStatus; }
|
||||
public void setApplyStatus(Integer applyStatus) { this.applyStatus = applyStatus; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Long getOrderId() { return orderId; }
|
||||
public void setOrderId(Long orderId) { this.orderId = orderId; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DispensingSummary {
|
||||
private Long id;
|
||||
private Integer applyStatus;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public DispensingSummary() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Integer getApplyStatus() { return applyStatus; }
|
||||
public void setApplyStatus(Integer applyStatus) { this.applyStatus = applyStatus; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class LabOrderDetail {
|
||||
private Long id;
|
||||
private Long labOrderMainId;
|
||||
private String itemCode;
|
||||
private String itemName;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
private Date withdrawTime;
|
||||
private String withdrawBy;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getLabOrderMainId() { return labOrderMainId; }
|
||||
public void setLabOrderMainId(Long labOrderMainId) { this.labOrderMainId = labOrderMainId; }
|
||||
public String getItemCode() { return itemCode; }
|
||||
public void setItemCode(String itemCode) { this.itemCode = itemCode; }
|
||||
public String getItemName() { return itemName; }
|
||||
public void setItemName(String itemName) { this.itemName = itemName; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
public Date getWithdrawTime() { return withdrawTime; }
|
||||
public void setWithdrawTime(Date withdrawTime) { this.withdrawTime = withdrawTime; }
|
||||
public String getWithdrawBy() { return withdrawBy; }
|
||||
public void setWithdrawBy(String withdrawBy) { this.withdrawBy = withdrawBy; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class LabOrderMain {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private String orderType;
|
||||
private String status;
|
||||
private String remark;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
private Date withdrawTime;
|
||||
private String withdrawBy;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getOrderType() { return orderType; }
|
||||
public void setOrderType(String orderType) { this.orderType = orderType; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
public Date getWithdrawTime() { return withdrawTime; }
|
||||
public void setWithdrawTime(Date withdrawTime) { this.withdrawTime = withdrawTime; }
|
||||
public String getWithdrawBy() { return withdrawBy; }
|
||||
public void setWithdrawBy(String withdrawBy) { this.withdrawBy = withdrawBy; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class LabRequest {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String requestNo;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
private List<LabRequestItem> items;
|
||||
|
||||
public LabRequest() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getRequestNo() { return requestNo; }
|
||||
public void setRequestNo(String requestNo) { this.requestNo = requestNo; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public List<LabRequestItem> getItems() { return items; }
|
||||
public void setItems(List<LabRequestItem> items) { this.items = items; }
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
public class LabRequestItem {
|
||||
private Long id;
|
||||
private Long labRequestId;
|
||||
private String itemCode;
|
||||
private String itemName;
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getLabRequestId() { return labRequestId; }
|
||||
public void setLabRequestId(Long labRequestId) { this.labRequestId = labRequestId; }
|
||||
public String getItemCode() { return itemCode; }
|
||||
public void setItemCode(String itemCode) { this.itemCode = itemCode; }
|
||||
public String getItemName() { return itemName; }
|
||||
public void setItemName(String itemName) { this.itemName = itemName; }
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MedicalRecord {
|
||||
private Long id;
|
||||
private Long visitId;
|
||||
private String visitNo;
|
||||
private Long doctorId;
|
||||
private String patientName;
|
||||
private String status;
|
||||
private String chiefComplaint;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getVisitId() { return visitId; }
|
||||
public void setVisitId(Long visitId) { this.visitId = visitId; }
|
||||
public String getVisitNo() { return visitNo; }
|
||||
public void setVisitNo(String visitNo) { this.visitNo = visitNo; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getPatientName() { return patientName; }
|
||||
public void setPatientName(String patientName) { this.patientName = patientName; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getChiefComplaint() { return chiefComplaint; }
|
||||
public void setChiefComplaint(String chiefComplaint) { this.chiefComplaint = chiefComplaint; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单明细实体
|
||||
*
|
||||
* 为了支持退款业务,新增 scheduleSlotId 字段(对应数据库列 schedule_slot_id)。
|
||||
* 修复 Bug #561:新增 unit 字段用于承载诊疗目录配置的“使用单位”。
|
||||
*/
|
||||
public class OrderDetail {
|
||||
private Long id;
|
||||
private Long orderId;
|
||||
private String itemCode;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
/** 对应排班号主键 */
|
||||
private Long scheduleSlotId;
|
||||
|
||||
/** 修复 Bug #561:总量单位(对应诊疗目录的使用单位) */
|
||||
private String unit;
|
||||
|
||||
// getters & setters
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Long getScheduleSlotId() {
|
||||
return scheduleSlotId;
|
||||
}
|
||||
|
||||
public void setScheduleSlotId(Long scheduleSlotId) {
|
||||
this.scheduleSlotId = scheduleSlotId;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class OrderMain {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private Long slotId;
|
||||
private Long poolId;
|
||||
private String orderType;
|
||||
private String status;
|
||||
private String remark;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
private String execStatus;
|
||||
private String dispenseApplyStatus;
|
||||
private String dispenseStatus;
|
||||
private Integer payStatus;
|
||||
private Date cancelTime;
|
||||
private String cancelReason;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public Long getSlotId() { return slotId; }
|
||||
public void setSlotId(Long slotId) { this.slotId = slotId; }
|
||||
public Long getPoolId() { return poolId; }
|
||||
public void setPoolId(Long poolId) { this.poolId = poolId; }
|
||||
public String getOrderType() { return orderType; }
|
||||
public void setOrderType(String orderType) { this.orderType = orderType; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
public String getExecStatus() { return execStatus; }
|
||||
public void setExecStatus(String execStatus) { this.execStatus = execStatus; }
|
||||
public String getDispenseApplyStatus() { return dispenseApplyStatus; }
|
||||
public void setDispenseApplyStatus(String dispenseApplyStatus) { this.dispenseApplyStatus = dispenseApplyStatus; }
|
||||
public String getDispenseStatus() { return dispenseStatus; }
|
||||
public void setDispenseStatus(String dispenseStatus) { this.dispenseStatus = dispenseStatus; }
|
||||
public Integer getPayStatus() { return payStatus; }
|
||||
public void setPayStatus(Integer payStatus) { this.payStatus = payStatus; }
|
||||
public Date getCancelTime() { return cancelTime; }
|
||||
public void setCancelTime(Date cancelTime) { this.cancelTime = cancelTime; }
|
||||
public String getCancelReason() { return cancelReason; }
|
||||
public void setCancelReason(String cancelReason) { this.cancelReason = cancelReason; }
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Patient {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String gender;
|
||||
private Date birthDate;
|
||||
private String currentAddress;
|
||||
private String occupation;
|
||||
|
||||
public Patient() {}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
public String getGender() { return gender; }
|
||||
public void setGender(String gender) { this.gender = gender; }
|
||||
public Date getBirthDate() { return birthDate; }
|
||||
public void setBirthDate(Date birthDate) { this.birthDate = birthDate; }
|
||||
public String getCurrentAddress() { return currentAddress; }
|
||||
public void setCurrentAddress(String currentAddress) { this.currentAddress = currentAddress; }
|
||||
public String getOccupation() { return occupation; }
|
||||
public void setOccupation(String occupation) { this.occupation = occupation; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class PatientVisit {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private String visitType;
|
||||
private Date visitDate;
|
||||
private String status;
|
||||
private String departmentName;
|
||||
private String diagnosis;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getVisitType() { return visitType; }
|
||||
public void setVisitType(String visitType) { this.visitType = visitType; }
|
||||
public Date getVisitDate() { return visitDate; }
|
||||
public void setVisitDate(Date visitDate) { this.visitDate = visitDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getDepartmentName() { return departmentName; }
|
||||
public void setDepartmentName(String departmentName) { this.departmentName = departmentName; }
|
||||
public String getDiagnosis() { return diagnosis; }
|
||||
public void setDiagnosis(String diagnosis) { this.diagnosis = diagnosis; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class QueueInfo {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private String queueNumber;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getQueueNumber() { return queueNumber; }
|
||||
public void setQueueNumber(String queueNumber) { this.queueNumber = queueNumber; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class QueueRecord {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String queueNumber;
|
||||
private String status;
|
||||
private Date createTime;
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getQueueNumber() { return queueNumber; }
|
||||
public void setQueueNumber(String queueNumber) { this.queueNumber = queueNumber; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 退款日志实体
|
||||
*/
|
||||
public class RefundLog {
|
||||
private Long id;
|
||||
private Long orderId;
|
||||
private String operator;
|
||||
private String remark;
|
||||
private String refundStatus;
|
||||
private Date refundTime;
|
||||
|
||||
// Getters & Setters
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getOrderId() { return orderId; }
|
||||
public void setOrderId(Long orderId) { this.orderId = orderId; }
|
||||
public String getOperator() { return operator; }
|
||||
public void setOperator(String operator) { this.operator = operator; }
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
public String getRefundStatus() { return refundStatus; }
|
||||
public void setRefundStatus(String refundStatus) { this.refundStatus = refundStatus; }
|
||||
public Date getRefundTime() { return refundTime; }
|
||||
public void setRefundTime(Date refundTime) { this.refundTime = refundTime; }
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Registration {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private Date registrationDate;
|
||||
private String status;
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public Date getRegistrationDate() { return registrationDate; }
|
||||
public void setRegistrationDate(Date registrationDate) { this.registrationDate = registrationDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class RegistrationDetail {
|
||||
private Long id;
|
||||
private Long registrationId;
|
||||
private String feeType;
|
||||
private BigDecimal amount;
|
||||
private String status;
|
||||
private Long scheduleSlotId;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getRegistrationId() { return registrationId; }
|
||||
public void setRegistrationId(Long registrationId) { this.registrationId = registrationId; }
|
||||
public String getFeeType() { return feeType; }
|
||||
public void setFeeType(String feeType) { this.feeType = feeType; }
|
||||
public BigDecimal getAmount() { return amount; }
|
||||
public void setAmount(BigDecimal amount) { this.amount = amount; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Long getScheduleSlotId() { return scheduleSlotId; }
|
||||
public void setScheduleSlotId(Long scheduleSlotId) { this.scheduleSlotId = scheduleSlotId; }
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class SchedulePool {
|
||||
private Long id;
|
||||
private Long doctorId;
|
||||
private Date scheduleDate;
|
||||
private String status;
|
||||
private Integer totalSlots;
|
||||
private Integer availableSlots;
|
||||
private Integer bookedNum;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public Date getScheduleDate() { return scheduleDate; }
|
||||
public void setScheduleDate(Date scheduleDate) { this.scheduleDate = scheduleDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Integer getTotalSlots() { return totalSlots; }
|
||||
public void setTotalSlots(Integer totalSlots) { this.totalSlots = totalSlots; }
|
||||
public Integer getAvailableSlots() { return availableSlots; }
|
||||
public void setAvailableSlots(Integer availableSlots) { this.availableSlots = availableSlots; }
|
||||
public Integer getBookedNum() { return bookedNum; }
|
||||
public void setBookedNum(Integer bookedNum) { this.bookedNum = bookedNum; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ScheduleSlot {
|
||||
private Long id;
|
||||
private Long schedulePoolId;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private String status;
|
||||
private Long patientId;
|
||||
private Date updateTime;
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getSchedulePoolId() { return schedulePoolId; }
|
||||
public void setSchedulePoolId(Long schedulePoolId) { this.schedulePoolId = schedulePoolId; }
|
||||
public Date getStartTime() { return startTime; }
|
||||
public void setStartTime(Date startTime) { this.startTime = startTime; }
|
||||
public Date getEndTime() { return endTime; }
|
||||
public void setEndTime(Date endTime) { this.endTime = endTime; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
public class SurgeryApply {
|
||||
private Long id;
|
||||
private String status;
|
||||
private String surgeryName;
|
||||
private String diagnosis;
|
||||
private String remark;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getSurgeryName() { return surgeryName; }
|
||||
public void setSurgeryName(String surgeryName) { this.surgeryName = surgeryName; }
|
||||
public String getDiagnosis() { return diagnosis; }
|
||||
public void setDiagnosis(String diagnosis) { this.diagnosis = diagnosis; }
|
||||
public String getRemark() { return remark; }
|
||||
public void setRemark(String remark) { this.remark = remark; }
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TriageQueueRecord {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Long doctorId;
|
||||
private String queueStatus;
|
||||
private Date triageTime;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public Long getDoctorId() { return doctorId; }
|
||||
public void setDoctorId(Long doctorId) { this.doctorId = doctorId; }
|
||||
public String getQueueStatus() { return queueStatus; }
|
||||
public void setQueueStatus(String queueStatus) { this.queueStatus = queueStatus; }
|
||||
public Date getTriageTime() { return triageTime; }
|
||||
public void setTriageTime(Date triageTime) { this.triageTime = triageTime; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 体征记录实体(仅包含体温相关字段,后续可扩展为血压、脉搏等)。
|
||||
*
|
||||
* 对应表 vital_sign_record。
|
||||
*/
|
||||
@Data
|
||||
public class VitalSignRecord {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private Date time; // 记录时间
|
||||
private BigDecimal temperature; // 体温(℃)
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.openhis.application.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class VitalSignsRecord {
|
||||
private Long id;
|
||||
private Long patientId;
|
||||
private String temperature;
|
||||
private String pulse;
|
||||
private String heartRate;
|
||||
private String bloodPressure;
|
||||
private String respiration;
|
||||
private String status;
|
||||
private Date recordTime;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getPatientId() { return patientId; }
|
||||
public void setPatientId(Long patientId) { this.patientId = patientId; }
|
||||
public String getTemperature() { return temperature; }
|
||||
public void setTemperature(String temperature) { this.temperature = temperature; }
|
||||
public String getPulse() { return pulse; }
|
||||
public void setPulse(String pulse) { this.pulse = pulse; }
|
||||
public String getHeartRate() { return heartRate; }
|
||||
public void setHeartRate(String heartRate) { this.heartRate = heartRate; }
|
||||
public String getBloodPressure() { return bloodPressure; }
|
||||
public void setBloodPressure(String bloodPressure) { this.bloodPressure = bloodPressure; }
|
||||
public String getRespiration() { return respiration; }
|
||||
public void setRespiration(String respiration) { this.respiration = respiration; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public void setRespiration(String respiration) { this.respiration = respiration; }
|
||||
public Date getRecordTime() { return recordTime; }
|
||||
public void setRecordTime(Date recordTime) { this.recordTime = recordTime; }
|
||||
public Date getCreateTime() { return createTime; }
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.openhis.application.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class OutpatientOrderVO {
|
||||
private Long id;
|
||||
private String orderNo;
|
||||
private String itemName;
|
||||
private String itemId;
|
||||
private String frequency;
|
||||
private BigDecimal totalQuantity;
|
||||
/** 总量单位(对应诊疗目录配置的使用单位) */
|
||||
private String quantityUnit;
|
||||
private String status;
|
||||
private String statusLabel;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.openhis.application.exception;
|
||||
|
||||
public class BusinessException extends RuntimeException {
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
}
|
||||
public BusinessException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
public interface AdmSchedulePoolMapper {
|
||||
int decrementBookedNum(Long poolId);
|
||||
int incrementBookedNum(Long poolId);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.AdmScheduleSlot;
|
||||
|
||||
public interface AdmScheduleSlotMapper {
|
||||
int updateById(AdmScheduleSlot record);
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
public interface CatalogItemMapper {
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.Diagnosis;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DiagnosisMapper {
|
||||
Diagnosis selectById(@Param("id") Long id);
|
||||
int insert(Diagnosis diagnosis);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.DiseaseCatalog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DiseaseCatalogMapper {
|
||||
DiseaseCatalog selectById(@Param("id") Long id);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.entity.DispensingDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface DispensingDetailMapper {
|
||||
int insert(DispensingDetail detail);
|
||||
DispensingDetail selectById(@Param("id") Long id);
|
||||
int updateById(DispensingDetail detail);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user