Fix Bug #443: 手术计费:点击"签发"耗材时异常报错

根因:签发耗材时 handDevice 方法会重复调用 saveOrUpdate 更新已有的 DeviceRequest 记录,
仅设置了部分字段(可能为 null),导致关键字段 performLocation(发放库房)被覆盖为空。
随后 handleDeviceDispense 创建 DeviceDispense 时 locationId 为 null,触发报错。

修复:签发操作(SIGN_ADVICE)跳过 handDevice 处理。因为耗材请求在保存时已创建完成,
签发只需更新状态(下方批量更新逻辑已处理),无需重新走 insert/update 流程。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
关羽
2026-05-14 18:15:34 +08:00
parent 571f254d0e
commit ffa709cf4e

View File

@@ -728,8 +728,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
/** /**
* 处理耗材请求 * 处理耗材请求
* 🔧 BugFix #443: 签发时跳过 handDevice避免重复创建 DeviceDispense 并覆盖关键字段(如 performLocation
* 签发时只需更新状态(下方 sign-advice 批量更新逻辑已处理)
*/ */
this.handDevice(deviceList, curDate, adviceOpType); if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
this.handDevice(deviceList, curDate, adviceOpType);
}
// 签发时,把草稿状态的账单更新为待收费 // 签发时,把草稿状态的账单更新为待收费
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) { if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {