diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java index d9ab38c8..e4d40048 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java @@ -158,8 +158,10 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation ? activityDefinitionMapper.selectById(activityDefinitionId) : null; String activityName = activityDef != null ? activityDef.getName() : ""; + // Only check for time conflicts within the same department List organizationLocationList = - organizationLocationService.getOrgLocListByActivityDefinitionId(orgLoc.getActivityDefinitionId()); + organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getOrganizationId(), + orgLoc.getActivityDefinitionId()); organizationLocationList = (orgLoc.getId() != null) ? organizationLocationList.stream().filter(item -> !orgLoc.getId().equals(item.getId())).toList() : organizationLocationList;