fix(#782): 请修复 Bug #782(重试)

根因:
- `HashSet` 没有单独导入,但代码中有 `import java.util.*;`(line 51),所以 `HashSet` 已被通配符导入。让我验证编译:

修复:
- 修改相关代码文件
This commit is contained in:
2026-06-19 19:57:16 +08:00
parent 6bed436c62
commit 0cd461e22c

View File

@@ -1154,14 +1154,17 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
.orElse(new Date());
// 获取当前操作用户昵称作为停嘱医生
String stopUserName = SecurityUtils.getNickName();
// 药品
// 药品包含出院带药adviceType=7与handleDeleteOperations保持一致
List<AdviceBatchOpParam> medicineList = paramList.stream()
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())
|| (e.getAdviceType() != null && e.getAdviceType() == 7))
.collect(Collectors.toList());
List<Long> medicineRequestIds
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
// 诊疗包含护理adviceType=26、文字医嘱adviceType=8
// 诊疗包含护理adviceType=26、手术adviceType=6、文字医嘱adviceType=8与saveRegAdvice保持一致
List<AdviceBatchOpParam> activityList = paramList.stream()
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|| ItemType.SURGERY.getValue().equals(e.getAdviceType())
|| ItemType.TEXT.getValue().equals(e.getAdviceType())
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
.collect(Collectors.toList());
@@ -1194,9 +1197,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
.set(DeviceRequest::getUpdateBy, stopUserName));
}
// 🔧 Bug #782 修复:兜底处理未被以上任何类型过滤器捕获的医嘱
// 当批量停嘱包含非标准 adviceType如 type=31、type=7 等)时,这些医嘱
// 不会被药品/诊疗/耗材任一组捕获,导致状态未更新为 PENDING_STOP造成状态不一致
// 🔧 Bug #782 兜底处理未被以上类型过滤器捕获的未知医嘱类型
// 将所有未匹配类型的医嘱统一按诊疗请求ServiceRequest处理
Set<Long> handledIds = new HashSet<>();
handledIds.addAll(medicineRequestIds);
@@ -1235,14 +1236,17 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
*/
@Override
public R<?> cancelStopRegAdvice(List<AdviceBatchOpParam> paramList) {
// 药品
// 药品包含出院带药adviceType=7与handleDeleteOperations保持一致
List<AdviceBatchOpParam> medicineList = paramList.stream()
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())
|| (e.getAdviceType() != null && e.getAdviceType() == 7))
.collect(Collectors.toList());
List<Long> medicineRequestIds
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
// 诊疗包含护理adviceType=26、文字医嘱adviceType=8
// 诊疗包含护理adviceType=26、手术adviceType=6、文字医嘱adviceType=8与saveRegAdvice保持一致
List<AdviceBatchOpParam> activityList = paramList.stream()
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|| ItemType.SURGERY.getValue().equals(e.getAdviceType())
|| ItemType.TEXT.getValue().equals(e.getAdviceType())
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
.collect(Collectors.toList());