fix(#743): guanyu (文件合入)

This commit is contained in:
2026-06-14 06:11:03 +08:00
committed by 华佗
parent b063a2fb20
commit 226d3192f1
2 changed files with 13 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
# HealthLink-HIS 代码模块索引
> 供 LLM 快速定位代码。每个模块列出 Controller → Service → Mapper 关键文件。
> 最后更新: 2026-06-14 00:00 (298 个 Controller)
> 最后更新: 2026-06-14 06:00 (298 个 Controller)
## 关键词 → 模块速查

View File

@@ -165,6 +165,18 @@ public class EmergencyController {
@PostMapping("/rescue/add")
@Transactional(rollbackFor = Exception.class)
public R<?> addRescue(@RequestBody EmergencyRescue rescue) {
// Bug#743: 修复 patientId 为 null 时数据库 NOT NULL 约束冲突
// 如果传了 triageId 但没传 patientId从分诊记录自动关联患者
if (rescue.getPatientId() == null && rescue.getTriageId() != null) {
EmergencyTriage triage = triageService.getById(rescue.getTriageId());
if (triage != null) {
rescue.setPatientId(triage.getPatientId());
}
}
// 校验patientId 必须存在(数据库 NOT NULL 约束)
if (rescue.getPatientId() == null) {
return R.fail("患者ID不能为空请提供患者ID或分诊ID");
}
rescue.setRescueStart(new Date());
rescue.setCreateTime(new Date());
rescueService.save(rescue);