Fix Bug #501: 【住院护士站-医嘱执行】医嘱执行页面点击"取消执行"报错

修复 adviceCancel 方法中两处复制粘贴错误:
1. 长期已发放药品处理中误用 tempMedDispensedList 替代 longMedDispensedList
2. 长期未发放药品处理中误用 tempMedUndispenseList 替代 longMedUndispenseList

导致取消执行时数据处理混乱,引发 SQL 异常

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
赵云
2026-05-11 11:18:16 +08:00
parent 58d4ee969a
commit f17f0e8816

View File

@@ -523,7 +523,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
// 处理长期已发放的药品 // 处理长期已发放的药品
if (!longMedDispensedList.isEmpty()) { if (!longMedDispensedList.isEmpty()) {
// 生成退药单 // 生成退药单
this.creatRefundMedicationList(tempMedDispensedList, procedureIdMap); this.creatRefundMedicationList(longMedDispensedList, procedureIdMap);
} }
// 处理临时已发放药品 // 处理临时已发放药品
if (!tempMedDispensedList.isEmpty()) { if (!tempMedDispensedList.isEmpty()) {
@@ -653,7 +653,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
if (!longMedUndispenseList.isEmpty()) { if (!longMedUndispenseList.isEmpty()) {
// 排除已汇总的药品 // 排除已汇总的药品
List<MedicationDispense> medicationDispenseList List<MedicationDispense> medicationDispenseList
= tempMedUndispenseList.stream().filter(x -> x.getSummaryNo() == null).toList(); = longMedUndispenseList.stream().filter(x -> x.getSummaryNo() == null).toList();
medicationDispenseService medicationDispenseService
.removeByIds(medicationDispenseList.stream().map(MedicationDispense::getId).toList()); .removeByIds(medicationDispenseList.stream().map(MedicationDispense::getId).toList());
} }