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:
反编译工作区
2026-05-05 19:57:01 +08:00
parent d52babe2c9
commit 1cac12d940
572 changed files with 64161 additions and 61 deletions
@@ -208,7 +208,7 @@ public class PersonRuleServiceImpl extends AbstractAcsPassService implements Per
this.logger.info("UC-01:调用方未指定楼层,取被访人默认楼层为 {}", candidate);
}
// === 阶段3ALWAYS 查询策略,有策略则以策略 allow 替代 ===
// === 阶段3ALWAYS 查询策略,有策略且生效则候选与 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));
@@ -1,10 +1,10 @@
artifact=cw-elevator-application-V1.0.0.20211103.jar
bundle_dir_name=cw-elevator-application-V2.0.19.20260505
directory=/media/zebra/9e8fa357-7db6-4d70-88ed-d5de5a059a663/星河湾星中星/源码/maven-cw-elevator-application/releases/cw-elevator-application-V2.0.19.20260505
built_at=2026-05-05T19:41:14+08:00
built_at=2026-05-05T19:54:11+08:00
java_home=/usr/lib/jvm/java-8-openjdk-amd64
java_version_line=openjdk version "1.8.0_482"
java_version_line=OpenJDK Runtime Environment (build 1.8.0_482-8u482-ga~us1-0ubuntu1~22.04-b08)
java_version_line=OpenJDK 64-Bit Server VM (build 25.482-b08, mixed mode)
git_rev=c5febc99055822f83061ee58d78d3cfdc66dff51
git_rev=d52babe2c96d02afd9feee0e9f86642f473a0489
git_branch=release/cw-elevator-v1-lib-min-risk