property.list.query 移除 enterprise_type=2 物业用户限制:物业用户不查此列表,与老 /property/listByPage 语义一致(PermissionService 保留 isPropertyUser 通用方法);同步设计文档 §9.1 与 README,回归 total 141/73 不变
This commit is contained in:
@@ -62,7 +62,7 @@ xiaoqu-agent-service/
|
||||
| `isAgentAuthority(authorityId)` | `AuthorityServiceImpl.checkAuthorityIsagent` | 权限组 isagent=1 → 代理商视角 |
|
||||
| `visibleAgentIds(user)` | `getByIsAgent` 主重载 | isagent!=1 返回 null(不过滤);否则 自己 + 直属下级(supervisor_id 一层)+ m2 warehouse_agent_auth 代管 manager_agent_id |
|
||||
| `isSalesNonLeader(user)` | saleFlag 逻辑(:382-427) | Redis db5 `Dictionary` hash 的 authDeptId 命中 ",deptId," 且 authDeptPostId 不含 "postId,";字典缺失按不限制处理并告警 |
|
||||
| `isPropertyUser(user)` | enterprise_type=2 规则 | 物业用户(后续 property 查询再限 property_id=自己) |
|
||||
| `isPropertyUser(user)` | enterprise_type=2 规则(§3.3 通用规则,保留备用) | 物业用户;**property.list.query 不使用本规则**(物业用户不查此列表,与老 /property/listByPage 一致,2026-09-03 决策) |
|
||||
|
||||
`agent.list.query` 的行权限照搬老系统 `AgentController.listByPage`:isagent=1 → `supervisor_id = 用户agentId`(只查直属下级);isagent=0 → 不过滤;入参传 `id` → 精确查询(可查到自身,不加 supervisor 限制)。
|
||||
|
||||
@@ -73,7 +73,7 @@ xiaoqu-agent-service/
|
||||
| `sys.ping` | system | read | 服务自检:服务名、版本、当前时间、Redis PING |
|
||||
| `agent.count` | system | read | 查 m0 库 `agent` 表 `soft_delete=0` 总数 |
|
||||
| `agent.list.query` | customer | read | 代理商分页查询。入参 id/name/level/channelNo/province/city/serialnumber/page/rows;出参 id/name/level/channelNo/serialnumber/supervisorName/province/city/countyseat/contact/phone/agencyarea/memo/createTime。行权限:isagent=1 只查直属下级,id 精确查可看自身。supervisorName 批量 IN 富化 |
|
||||
| `property.list.query` | customer | read | 物业(客户)分页查询(m0 properyt 表)。入参 name/agentId/serialnumber/province/city/contact/phone/page/rows;出参 id/name/serialnumber/agentName/createName/province/city/countyseat/address/contact/phone/createTime。行权限走 PermissionService 完整版 getByIsAgent 语义。agentName/createName 批量 IN 富化 |
|
||||
| `property.list.query` | customer | read | 物业(客户)分页查询(m0 properyt 表)。入参 name/agentId/serialnumber/province/city/contact/phone/page/rows;出参 id/name/serialnumber/agentName/createName/province/city/countyseat/address/contact/phone/createTime。行权限走 PermissionService 完整版 getByIsAgent 语义(不含 enterprise_type=2 限制,与老 /property/listByPage 一致)。agentName/createName 批量 IN 富化 |
|
||||
|
||||
分页统一规范:page 从 1 开始,rows 默认 20、上限 100,超出截断为 100 并在返回 `notice` 字段提示。
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PropertyTools implements ToolObject {
|
||||
@Tool(name = "property.list.query", description = "查询物业(客户)列表(分页),数据来源 m0 库 properyt 表。"
|
||||
+ "行级权限:代理商身份的用户(权限组 isagent=1)只能看到 自己+直属下级代理+被授权代管代理 名下的物业,"
|
||||
+ "以及被授权代管的物业(agent_manage_district_auth);总部身份(isagent=0)可看全部;"
|
||||
+ "物业账号(enterprise_type=2)只能看自己物业;销售部门非负责人只能看自己创建的物业。"
|
||||
+ "销售部门非负责人只能看自己创建的物业。"
|
||||
+ "分页:page 从 1 开始,rows 默认 20、上限 100,超出自动截断为 100 并在返回的 notice 字段提示。"
|
||||
+ "返回 total(符合条件的总数)、records(本页记录)。")
|
||||
public Map<String, Object> propertyListQuery(
|
||||
|
||||
@@ -106,7 +106,12 @@ public class PermissionService {
|
||||
&& !authDeptPostId.toString().contains(user.getPostId() + ",");
|
||||
}
|
||||
|
||||
/** 物业用户(enterprise_type=2):老系统语义为再限 property_id=自己 */
|
||||
/**
|
||||
* 物业用户(enterprise_type=2):设计文档 §3.3 通用规则为再限 property_id=自己。
|
||||
* 注意:property.list.query 不使用本规则——物业用户不查此列表,
|
||||
* 与老系统 /property/listByPage(PropertyController.java:95)语义保持一致。
|
||||
* 本方法保留供其他需要该通用规则的场景使用。
|
||||
*/
|
||||
public boolean isPropertyUser(User user) {
|
||||
return user.getEnterpriseType() != null && user.getEnterpriseType() == 2;
|
||||
}
|
||||
@@ -134,12 +139,12 @@ public class PermissionService {
|
||||
* <li>isagent=1:agent_id IN (自己+下级+warehouse_agent_auth 代管),
|
||||
* 若存在代管物业则 OR id IN (agent_manage_district_auth 代管物业 id 集合);</li>
|
||||
* <li>isagent!=1(总部):不加 agent/id 过滤;</li>
|
||||
* <li>enterprise_type=2(物业用户):再 AND id = 用户 propertyId
|
||||
* (注:老 PropertyController 未挂此限制,来自设计文档 §3.3 通用规则);</li>
|
||||
* <li>销售部门非负责人:再 AND create_id = 自己
|
||||
* (注:老代码 saleFlag 分支是 id IN (自建 ∪ 代管 agent 的物业),
|
||||
* 此处按设计文档 §3.3"只看 create_id=自己"收窄)。</li>
|
||||
* </ol>
|
||||
* 不含 enterprise_type=2(物业用户)限制:物业用户不查此列表,与老接口语义一致
|
||||
* (2026-09-03 用户决策;§3.3 通用规则保留于 {@link #isPropertyUser})。
|
||||
*/
|
||||
public void applyPropertyRowFilter(LambdaQueryWrapper<Properyt> wrapper, User user) {
|
||||
List<Long> agentIds = visibleAgentIds(user);
|
||||
@@ -151,9 +156,6 @@ public class PermissionService {
|
||||
wrapper.in(Properyt::getAgentId, agentIds);
|
||||
}
|
||||
}
|
||||
if (isPropertyUser(user)) {
|
||||
wrapper.eq(Properyt::getId, user.getPropertyId());
|
||||
}
|
||||
if (isSalesNonLeader(user)) {
|
||||
wrapper.eq(Properyt::getCreateId, user.getId());
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ xiaoqu-agent-service/
|
||||
|
||||
**`property.list.query`**(分类 customer,读)
|
||||
|
||||
- 语义照搬:完整版 `getByIsAgent`(下级代理 + warehouse_agent_auth 代管 + agent_manage_district_auth 代管物业 + 销售非负责人限 create_id)。
|
||||
- 语义照搬:完整版 `getByIsAgent`(下级代理 + warehouse_agent_auth 代管 + agent_manage_district_auth 代管物业 + 销售非负责人限 create_id)。**不含** enterprise_type=2(物业用户限自己物业)限制——物业用户不查此列表,与老接口 `/property/listByPage`(PropertyController.java:95)语义一致(2026-09-03 决策;§3.3 通用规则表保留该条,仅此处不适用)。
|
||||
- 入参:`name`(模糊)、`agentId`、`serialnumber`、`province`、`city`、`contact`、`phone`、`page`、`rows`。
|
||||
- 出参:id、name、serialnumber、agentName、createName(销售)、province/city/countyseat、address、contact、phone、createTime。
|
||||
- 已裁剪:开票信息、银行账户。
|
||||
|
||||
Reference in New Issue
Block a user