Fix Bug #547: 执行科室配置保存时,冲突检测应跳过已被软删除科室的孤脏记录 — 根因:时间冲突校验未排除科室已删除的 OrganizationLocation 记录,导致已不存在的科室仍会阻断新配置保存

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 15:06:22 +08:00
parent 206a0f4083
commit 85e95420b7

View File

@@ -169,9 +169,11 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
orgLoc.getStartTime(), orgLoc.getEndTime())) {
Organization org = organizationService.getById(organizationLocation.getOrganizationId());
String organizationName = org != null ? org.getName() : "已删除科室(ID:" + organizationLocation.getOrganizationId() + ")";
if (org == null) {
continue;
}
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "" + organizationName + "时间冲突");
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "" + org.getName() + "时间冲突");
}
if (orgLocQueryDto.getId() != null) {