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:
@@ -1076,6 +1076,35 @@
|
||||
|
||||
---
|
||||
|
||||
## 45. hardware.cleanlog.list.query
|
||||
|
||||
清机记录分页查询(m0 `hardware_clean_log` 主表 + `hardware_clean_pic` 图片表,纯 MySQL),对应老 `/hardwareCleanLog/listByPage`。硬过滤 `soft_delete=0` 且 `status=1`(仅返回有效清机记录),固定 `id DESC`。
|
||||
|
||||
- 分类:hardware | 类型:读
|
||||
- 入参(全部可选):`districtId`/`propertyId`/`agentId`/`userId`(精确,正整数)、`snCode`(模糊)、
|
||||
`type`(0=大清洁 1=小清洁)、`userRoleType`(0=代理 1=物业 2=保洁)、
|
||||
`startTime`/`endTime`(yyyy-MM-dd HH:mm:ss,按 `modify_time` 即清机时间过滤,含边界,
|
||||
startTime 不得晚于 endTime)、`minCleanRfidCount`/`maxCleanRfidCount`(清理卷数范围,非负,min≤max);
|
||||
`page`/`rows` 默认 1/20 上限 100(超出截断 + notice)。
|
||||
- 返回 `total/page/rows/[notice]/records`,record 含 id/snCode/userId+userName/userRoleType+userRoleTypeText/
|
||||
type+typeText/cleanRfidCount/cleanRfidDays/memo/agentId+agentName/propertyId+propertyName/
|
||||
districtId+districtName/positions/workNo/assignmentId/maintenanceAgentId+maintenanceAgentName/
|
||||
maintenancePropertyId+maintenancePropertyName/poweredType+poweredTypeText(0=电源 1=电池)/
|
||||
createTime/modifyTime/beforeCleanPics/afterCleanPics。
|
||||
- 行级权限:与 hardware.list.query 同一 getByIsAgent 变体(落 `agent_id`/`property_id`);
|
||||
**传了 agentId 也仍叠加 ACL**(修正老接口 agentId 绕过行权限的 bug)。
|
||||
- 富化:agentName/propertyName/districtName 走 Redis `name:Agent:*`/`name:Properyt:*`(老拼写)/`name:District:*`
|
||||
multiGet 批量;userName 按页 `user_id IN` 批量查(修正老接口逐条 N+1)。
|
||||
- 图片:type=0 大清洁取行内 `before_clean_picurl`/`after_clean_picurl`;type≠0 按页
|
||||
`hardware_clean_id IN` 批量查 `hardware_clean_pic`(soft_delete=0 且 type=0 图片行),按 `order_no`
|
||||
排序拼 OSS URL `http://{bucket}.oss-cn-beijing.aliyuncs.com/{folder}{fileName}` 归入 afterCleanPics,
|
||||
beforeCleanPics 恒空(老系统如此,保持)。
|
||||
- 入参校验失败抛 `INVALID_ARGUMENT`(文案透出)。
|
||||
|
||||
详细设计见 [hardware-cleanlog-mcp-design](hardware-cleanlog-mcp-design.md)。
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
## 附录:在线查看工具清单
|
||||
|
||||
Reference in New Issue
Block a user