mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 00:40:30 +08:00
docs: add initialization flow analysis to policy design doc
- Add §7 initialization flow: /component/person/detail call chain from decompiled component-organization source - Document floorList assembly in ImgPersonServiceImpl (via elevatorFeignClient.listByImageId) - Analyze init vs submit consistency: gap when policy exists
This commit is contained in:
+11
-3
@@ -208,7 +208,7 @@ public class PersonRuleServiceImpl extends AbstractAcsPassService implements Per
|
||||
this.logger.info("UC-01:调用方未指定楼层,取被访人默认楼层为 {}", candidate);
|
||||
}
|
||||
|
||||
// === 阶段3:ALWAYS 查询策略,有策略则以策略 allow 替代 ===
|
||||
// === 阶段3:ALWAYS 查询策略,有策略且生效则候选与 allow 求交 ===
|
||||
List<String> orgIds = personResult.getOrganizationIds();
|
||||
this.logger.info("被访人所属组织 orgIds={}", orgIds);
|
||||
TenantVisitorFloorPolicyDto policy = findPolicyByOrgIds(orgIds);
|
||||
@@ -216,7 +216,14 @@ public class PersonRuleServiceImpl extends AbstractAcsPassService implements Per
|
||||
if (policy != null) {
|
||||
List<String> allow = parseAllowZoneIds(policy.getAllowZoneIds());
|
||||
this.logger.info("找到启用策略 policyId={} orgId={} allow={}", policy.getId(), policy.getOrgId(), allow);
|
||||
effective = allow;
|
||||
if (CollectionUtils.isEmpty(allow)) {
|
||||
this.logger.warn("策略 allow_zone_ids 为空,使用候选楼层原值 {}", candidate);
|
||||
effective = candidate;
|
||||
} else {
|
||||
Set<String> allowSet = new HashSet<>(allow);
|
||||
effective = candidate.stream().filter(c -> allowSet.contains(c)).collect(Collectors.toList());
|
||||
this.logger.info("候选楼层 vs 策略allow求交:candidate={} allow={} effective={}", candidate, allow, effective);
|
||||
}
|
||||
} else {
|
||||
this.logger.info("未找到启用策略,使用候选楼层原值 {}", candidate);
|
||||
effective = candidate;
|
||||
@@ -224,11 +231,12 @@ public class PersonRuleServiceImpl extends AbstractAcsPassService implements Per
|
||||
|
||||
// === 阶段4:空集校验 ===
|
||||
if (CollectionUtils.isEmpty(effective)) {
|
||||
this.logger.warn("无可用楼层 businessId={} personId={} visitorId={} callerProvided={} candidate={}",
|
||||
this.logger.warn("求交后无可用楼层 businessId={} personId={} visitorId={} callerProvided={} candidate={}",
|
||||
context.getCompany().getCompanyId(), param.getPersonId(), param.getVisitorId(),
|
||||
Boolean.valueOf(callerProvidedFloors), candidate);
|
||||
return CloudwalkResult.fail("76260531", getMessage("76260531"));
|
||||
}
|
||||
this.logger.info("最终生效楼层 effective={}", effective);
|
||||
param.setFloorIds(effective);
|
||||
ZoneQueryParam zoneQueryParam = new ZoneQueryParam();
|
||||
zoneQueryParam.setId(param.getFloorIds().get(0));
|
||||
|
||||
Reference in New Issue
Block a user