fix: policy replaces floors (not intersection)

When tenant policy exists and enabled, allow_zone_ids REPLACES
the candidate floor list entirely. Phase 3 simplified.
Bump v2.0.20
This commit is contained in:
反编译工作区
2026-05-05 19:49:31 +08:00
parent f7da04caea
commit d52babe2c9
21 changed files with 1228 additions and 5 deletions
@@ -208,16 +208,15 @@ public class PersonRuleServiceImpl extends AbstractAcsPassService implements Per
this.logger.info("UC-01:调用方未指定楼层,取被访人默认楼层为 {}", candidate);
}
// === 阶段3ALWAYS 查询策略,有策略且生效则求交 ===
// === 阶段3ALWAYS 查询策略,有策略则以策略 allow 替代 ===
List<String> orgIds = personResult.getOrganizationIds();
this.logger.info("被访人所属组织 orgIds={}", orgIds);
TenantVisitorFloorPolicyDto policy = findPolicyByOrgIds(orgIds);
List<String> effective;
if (policy != null) {
this.logger.info("找到启用策略 policyId={} orgId={} allow={}", policy.getId(), policy.getOrgId(),
policy.getAllowZoneIds());
effective = resolveEffectiveFloors(candidate, candidate, policy, param.getPersonId());
this.logger.info("策略求交后最终楼层 effective={}", effective);
List<String> allow = parseAllowZoneIds(policy.getAllowZoneIds());
this.logger.info("找到启用策略 policyId={} orgId={} allow={}", policy.getId(), policy.getOrgId(), allow);
effective = allow;
} else {
this.logger.info("未找到启用策略,使用候选楼层原值 {}", candidate);
effective = candidate;