docs: add policy redesign doc with sequence diagrams

- Full business logic redesign with UC-01/UC-02 sequence diagrams
- Policy ALWAYS evaluated, intersect candidate with allow
- Scenario matrix covering all combinations
- v2.0.19 implementation with intersection fix
This commit is contained in:
反编译工作区
2026-05-05 20:05:37 +08:00
parent 2310d3f059
commit 9749e7531e
10 changed files with 61 additions and 11 deletions
@@ -1,4 +1,16 @@
package cn.cloudwalk.client.organization.personimg.result;
/**
* 人员图库基础结果
*
* 关键字段:
* - floorList: List<String> — 被访人在电梯中已授权的楼层 zoneId 列表
* 由 ImgPersonServiceImpl 通过 elevatorFeignClient.listByImageId() 填充
* - floorName/floorNames: 楼层名称(用于展示)
* - organizationIds: 所属组织 ID 列表(用于策略查询)
*
* 来源:cwos-component-organization-interface-v2.9.2_xinghewan(反编译整理)
*/
import java.util.List;
@@ -115,7 +115,7 @@ extends AbstractJob {
queryZoneForm.setBusinessId(context.getBatchImport().getBusinessId());
CloudwalkResult<List<ZoneResult>> zoneDetail = this.zoneFeignClient.findZonelist(queryZoneForm);
logger.info("\u5f53\u524d\u697c\u5c42\u4fe1\u606fTask{}", (Object)JSON.toJSONString(zoneDetail));
if (Objects.equals(zoneDetail.getCode(), "00000000")) {
if ("00000000".equals(zoneDetail.getCode())) {
List data = (List)zoneDetail.getData();
context.setZoneMap(data);
}
@@ -1,5 +1,23 @@
package cn.cloudwalk.service.organization.service;
/**
* 人员图库服务实现类(组织组件核心业务)
*
* 职责:
* 1. 人员详情查询(detail)— 返回 floorList(被访人授权楼层)
* floorList 通过 ElevatorFeignClient.listByImageId() 从电梯 image_rule_ref 获取
* 2. 人员图库绑定/解绑/同步
* 3. 人员注册审核
*
* 调用链路:
* PersonController.detail()
* → this.imgStorePersonService.detail()
* → ImgPersonServiceImpl.detail()
* → elevatorFeignClient.listByImageId() ← 获取人员在电梯中的授权区域
* → result.setFloorList(floorList)
*
* 来源:cwos-component-organization-service-v2.9.2_xinghewan(反编译整理)
*/
import cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum;
import cn.cloudwalk.client.aggregate.group.param.AgFeatureExtractParam;
import cn.cloudwalk.client.aggregate.group.result.AgFeatureExtractResult;
@@ -303,7 +321,7 @@ implements ImgStorePersonService {
acsPassRuleImageForm.setIncludeLabels(imgStorePersonResult.getLabelIds());
acsPassRuleImageForm.setBusinessId(businessId);
CloudwalkResult<List<AcsPassRuleImageResultDto>> images = this.elevatorFeignClient.listByImageId(acsPassRuleImageForm);
if (Objects.equals(images.getCode(), "00000000")) {
if ("00000000".equals(images.getCode())) {
imgStorePersonResult.setFloorInfoList((List)images.getData());
}
imgStorePersonResult.setDefaultChooseFloor(imgStorePersonResult.getDefaultFloor());
@@ -517,7 +535,7 @@ implements ImgStorePersonService {
queryZoneForm.setIds(ids);
CloudwalkResult<List<ZoneResult>> zoneDetail = this.zoneFeignClient.findZonelist(queryZoneForm);
this.logger.debug("\u5f53\u524d\u697c\u5c42\u4fe1\u606f{}", (Object)JSON.toJSONString(zoneDetail));
if (Objects.equals(zoneDetail.getCode(), "00000000")) {
if ("00000000".equals(zoneDetail.getCode())) {
String zoneName = "";
List data = (List)zoneDetail.getData();
for (int i = 0; i < data.size(); ++i) {
@@ -529,7 +547,7 @@ implements ImgStorePersonService {
AddVehiclePersonForm form = new AddVehiclePersonForm();
form.setPersonId(param.getId());
CloudwalkResult<List<String>> vehcleResult = this.vehicleFeignClient.getVehicleIds(form);
if (Objects.equals(vehcleResult.getCode(), "00000000")) {
if ("00000000".equals(vehcleResult.getCode())) {
personList.setVehicleList((List)vehcleResult.getData());
}
List<ImgStorePersonGetResult> imgStorePersonResults = this.getImgStorePersonResults(Arrays.asList(personList), businessId);
@@ -540,7 +558,7 @@ implements ImgStorePersonService {
acsPassRuleImageForm.setIncludeLabels(result.getLabelIds());
acsPassRuleImageForm.setBusinessId(businessId);
CloudwalkResult<List<AcsPassRuleImageResultDto>> images = this.elevatorFeignClient.listByImageId(acsPassRuleImageForm);
if (Objects.equals(images.getCode(), "00000000")) {
if ("00000000".equals(images.getCode())) {
ArrayList<String> floorList = new ArrayList<String>();
String zoneNames = "";
List acsPassRuleImageResultDtoList = (List)images.getData();
@@ -661,7 +679,7 @@ implements ImgStorePersonService {
acsPassRuleImageForm.setIncludeLabels(personResult.getLabelIds());
acsPassRuleImageForm.setBusinessId(businessId);
CloudwalkResult<List<AcsPassRuleImageResultDto>> images = this.elevatorFeignClient.listByImageId(acsPassRuleImageForm);
if (!Objects.equals(images.getCode(), "00000000")) continue;
if (!"00000000".equals(images.getCode())) continue;
ArrayList<String> floorList = new ArrayList<String>();
String zoneNames = "";
List acsPassRuleImageResultDtoList = (List)images.getData();
@@ -308,7 +308,7 @@ implements LabelService {
acsPassRuleImageForm.setLabelId(pageLabelResult.getId());
acsPassRuleImageForm.setBusinessId(businessId);
CloudwalkResult<List<AcsDeviceRestructureResult>> images = this.elevatorFeignClient.listCondition(acsPassRuleImageForm);
if (!Objects.equals(images.getCode(), "00000000")) continue;
if (!"00000000".equals(images.getCode())) continue;
ArrayList<String> floorList = new ArrayList<String>();
String zoneNames = "";
List acsPassRuleImageResultDtoList = (List)images.getData();
@@ -747,7 +747,7 @@ implements OrganizationService {
acsPassRuleImageForm.setOrgId(orgResult.getId());
acsPassRuleImageForm.setBusinessId(businessId);
CloudwalkResult<List<AcsDeviceRestructureResult>> images = this.elevatorFeignClient.listCondition(acsPassRuleImageForm);
if (!Objects.equals(images.getCode(), "00000000")) continue;
if (!"00000000".equals(images.getCode())) continue;
ArrayList<String> floorList = new ArrayList<String>();
String zoneNames = "";
List acsPassRuleImageResultDtoList = (List)images.getData();
@@ -818,7 +818,7 @@ implements OrganizationService {
queryZoneUnitParam.setUnitIds(Collections.singletonList(organization.getId()));
CloudwalkResult<List<ZoneUnitResultDTO>> zoneDetail = this.zoneFeignClient.findZoneDetailByUnitIds(queryZoneUnitParam);
List<Object> zoneIds = new ArrayList();
if (Objects.equals(zoneDetail.getCode(), "00000000")) {
if ("00000000".equals(zoneDetail.getCode())) {
List data = (List)zoneDetail.getData();
zoneIds = data.stream().map(ZoneUnitResultDTO::getZoneId).collect(Collectors.toList());
}
@@ -94,7 +94,7 @@ implements OrganizationService {
queryZoneUnitParam.setUnitIds(ids);
CloudwalkResult<List<ZoneUnitResultDTO>> zoneDetail = this.zoneFeignClient.findZoneDetailByUnitIds(queryZoneUnitParam);
HashMap<String, String> unitZoneMap = new HashMap<String, String>();
if (Objects.equals(zoneDetail.getCode(), "00000000")) {
if ("00000000".equals(zoneDetail.getCode())) {
List data = (List)zoneDetail.getData();
for (ZoneUnitResultDTO datum : data) {
String unitId = datum.getUnitId();
@@ -110,7 +110,7 @@ implements OrganizationService {
AddVehiclePersonForm addVehiclePersonForm = new AddVehiclePersonForm();
CloudwalkResult<List<VehicleCountCompany>> companyCountDate = this.vehicleFeignClient.getVehicleIdsCountByCompany(addVehiclePersonForm);
HashMap<String, Integer> companyCountMap = new HashMap<String, Integer>();
if (Objects.equals(companyCountDate.getCode(), "00000000")) {
if ("00000000".equals(companyCountDate.getCode())) {
List data = (List)companyCountDate.getData();
for (VehicleCountCompany datum : data) {
String companyId = datum.getCompanyId();
@@ -1,4 +1,6 @@
package cn.cloudwalk.service.organization.service.feign;
/** CrkAccessFeignClient — 组织组件调用外部服务的 Feign 接口 */
import cn.cloudwalk.client.organization.param.AcsDeviceRestructureConditionForm;
import cn.cloudwalk.client.organization.result.AcsDeviceNewResult;
@@ -1,4 +1,6 @@
package cn.cloudwalk.service.organization.service.feign;
/** ElevatorAppFeignClient — 组织组件调用外部服务的 Feign 接口 */
import cn.cloudwalk.client.organization.service.store.param.BatchPassRuleParam;
import cn.cloudwalk.client.organization.service.store.param.PassRuleParam;
@@ -1,4 +1,6 @@
package cn.cloudwalk.service.organization.service.feign;
/** ElevatorFeignClient — 组织组件调用外部服务的 Feign 接口 */
import cn.cloudwalk.client.organization.param.AcsPassRuleImageForm;
import cn.cloudwalk.client.organization.param.AcsRestructureQueryForm;
@@ -1,4 +1,18 @@
package cn.cloudwalk.web.organization.controller;
/**
* 人员管理控制器(组织组件)
*
* 核心接口:
* - POST /component/person/detail — 人员详情查询,返回 floorList 授权楼层
* - POST /component/person/page — 人员分页查询
* - POST /component/person/add/edit/delete — 人员增删改
*
* floorList 数据来源:通过 ImgPersonServiceImpl 调用 elevatorFeignClient.listByImageId()
* 从电梯 image_rule_ref 表获取被访人已授权的区域 ID 列表。
*
* 来源:cwos-component-organization-web-v2.9.2_xinghewan(反编译整理)
*/
import cn.cloudwalk.client.organization.personimg.param.AddImgPersonParam;
import cn.cloudwalk.client.organization.personimg.param.BatchImportParam;