feat(mcp): 新增清机记录查询工具 hardware.cleanlog.list.query

对齐老系统 /hardwareCleanLog/listByPage,修正 5 处老接口坑(设计文档
doc/hardware-cleanlog-mcp-design.md §5):agentId 传了仍叠加行级 ACL、
富化/图片按页批量消除 N+1、时间过滤明确落 modify_time、status=1 硬过滤
口径保持、type!=0 时 beforeCleanPics 恒空保持。

- 实体/Mapper 从 publicbeanandmap 逐字段复制(25+13 列全核对)
- PermissionService 新增 applyHardwareCleanLogRowFilter(镜像
  applyHardwareRowFilter 同一 getByIsAgent 变体)
- 分页 selectCount+LIMIT 物理分页,rows 上限 100 截断+notice
- 图片 type=0 行内 picurl,type!=0 按页 IN 批量查 hardware_clean_pic
  按 order_no 拼 OSS URL
- 入参校验抛 ToolCallException(INVALID_ARGUMENT)
- seed-dev.sql 补 hardware/ops-query scope 绑定;reference 文档登记 #45

测试:新增 6 个单测,全量 482 tests 全绿
This commit is contained in:
my_local_kimi_dev2
2026-11-04 18:04:02 +08:00
parent fecbb2d95a
commit 4e27f8137d
11 changed files with 961 additions and 3 deletions
+3 -3
View File
@@ -27,10 +27,10 @@ INSERT INTO agent_scope (name, code, memo, status, create_id)
SELECT '出纸机', 'hardware', 'dev 种子:出纸机查询作用域', 1, 0
WHERE NOT EXISTS (SELECT 1 FROM agent_scope WHERE code = 'hardware');
-- 作用域-工具:hardware.list.query / hardware.detail.query
-- 作用域-工具:hardware.list.query / hardware.detail.query / hardware.cleanlog.list.query
INSERT INTO scope_tool (scope_id, tool_id, create_id)
SELECT s.id, t.id, 0 FROM agent_scope s JOIN tool t
WHERE s.code = 'hardware' AND t.name IN ('hardware.list.query', 'hardware.detail.query')
WHERE s.code = 'hardware' AND t.name IN ('hardware.list.query', 'hardware.detail.query', 'hardware.cleanlog.list.query')
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = s.id AND st.tool_id = t.id);
-- 作用域:sync(SYNC 增量同步;changes 工具由 REQ-20260911-0013 注册并绑定到本作用域)
@@ -56,7 +56,7 @@ WHERE NOT EXISTS (SELECT 1 FROM agent_scope WHERE code = 'ops-query');
INSERT INTO scope_tool (scope_id, tool_id, create_id)
SELECT s.id, t.id, 0 FROM agent_scope s JOIN tool t
WHERE s.code = 'ops-query' AND t.name IN ('sys.ping', 'integration.context.get', 'agent.count', 'agent.list.query', 'agent.detail.query', 'property.list.query', 'property.detail.query', 'district.list.query', 'district.detail.get', 'district.paper.statistics.query', 'district.paper.position.detail.query', 'hardware.list.query', 'hardware.detail.query', 'contract.list.query', 'contract.detail.query', 'mall.order.list.query', 'mall.order.detail.query', 'mall.order.logistics.query', 'install.order.list.query', 'install.order.detail.query', 'delivery.order.list.query', 'delivery.order.detail.query', 'pickup.order.list.query', 'pickup.order.detail.query', 'relocation.order.list.query', 'relocation.order.detail.query', 'withdraw.order.list.query', 'withdraw.order.detail.query', 'warehouse.in.list.query', 'warehouse.in.detail.query', 'warehouse.out.list.query', 'warehouse.out.detail.query', 'warehouse.stock.list.query')
WHERE s.code = 'ops-query' AND t.name IN ('sys.ping', 'integration.context.get', 'agent.count', 'agent.list.query', 'agent.detail.query', 'property.list.query', 'property.detail.query', 'district.list.query', 'district.detail.get', 'district.paper.statistics.query', 'district.paper.position.detail.query', 'hardware.list.query', 'hardware.detail.query', 'hardware.cleanlog.list.query', 'contract.list.query', 'contract.detail.query', 'mall.order.list.query', 'mall.order.detail.query', 'mall.order.logistics.query', 'install.order.list.query', 'install.order.detail.query', 'delivery.order.list.query', 'delivery.order.detail.query', 'pickup.order.list.query', 'pickup.order.detail.query', 'relocation.order.list.query', 'relocation.order.detail.query', 'withdraw.order.list.query', 'withdraw.order.detail.query', 'warehouse.in.list.query', 'warehouse.in.detail.query', 'warehouse.out.list.query', 'warehouse.out.detail.query', 'warehouse.stock.list.query')
AND NOT EXISTS (SELECT 1 FROM scope_tool st WHERE st.scope_id = s.id AND st.tool_id = t.id);
-- 人均用纸统计仅开放给用户委托 Token:绑定全部非服务身份作用域,不进入 sync/ops-query。