From 74c1eda8be794ce5e1b4e941800f80dcfb323e9a Mon Sep 17 00:00:00 2001 From: dearLin <1261008090@qq.com> Date: Fri, 20 Mar 2026 11:24:54 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=B0=81=E9=97=AD=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E7=9A=84=E7=94=B3=E8=AF=B7=E4=B8=8E=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .sisyphus/boulder.json | 9 -- .sisyphus/plans/add-current-user-can-audit.md | 68 --------- .../plans/refactor-car-apply-listpage.md | 132 ------------------ 4 files changed, 2 insertions(+), 210 deletions(-) delete mode 100644 .sisyphus/boulder.json delete mode 100644 .sisyphus/plans/add-current-user-can-audit.md delete mode 100644 .sisyphus/plans/refactor-car-apply-listpage.md diff --git a/.gitignore b/.gitignore index 5ff6309..0ff1c94 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ target/ !**/src/test/**/target/ ### IntelliJ IDEA ### +.idea .idea/modules.xml .idea/jarRepositories.xml .idea/compiler.xml @@ -11,7 +12,7 @@ target/ *.iws *.iml *.ipr - +.sisyphus ### Eclipse ### .apt_generated .classpath diff --git a/.sisyphus/boulder.json b/.sisyphus/boulder.json deleted file mode 100644 index 17c3102..0000000 --- a/.sisyphus/boulder.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "active_plan": "E:\\proj\\zcloudGbsProj\\zcloud-gbs-primeport\\.sisyphus\\plans\\refactor-car-apply-listpage.md", - "started_at": "2026-03-20T02:50:18.824Z", - "session_ids": [ - "ses_2f70a72c8ffea8FCW0BWHlECqF" - ], - "plan_name": "refactor-car-apply-listpage", - "agent": "atlas" -} \ No newline at end of file diff --git a/.sisyphus/plans/add-current-user-can-audit.md b/.sisyphus/plans/add-current-user-can-audit.md deleted file mode 100644 index 96c9b45..0000000 --- a/.sisyphus/plans/add-current-user-can-audit.md +++ /dev/null @@ -1,68 +0,0 @@ -# Add currentUserCanAudit Field Logic - -## TL;DR - -在 `ClosedAreaPersonApplyQueryExe.execute()` 方法中添加逻辑,为每条查询结果设置 `currentUserCanAudit` 字段,标识当前登录用户是否能审核该申请。 - -**Deliverables**: -- 修改 `ClosedAreaPersonApplyQueryExe.java` - -**Estimated Effort**: Quick (1 file, <20 lines) - ---- - -## Context - -### Target File -`web-app/src/main/java/com/zcloud/primeport/command/query/ClosedAreaPersonApplyQueryExe.java` - -### Business Logic -- `currentUserCanAudit = 1`:当前用户能审核(审核中状态且当前用户是审批人) -- `currentUserCanAudit = 2`:当前用户不能审核 - -### Implementation Requirements -1. 获取当前登录用户ID:`AuthContext.getUserId()` -2. 遍历查询结果,对每个 `ClosedAreaPersonApplyCO` 设置字段: - - 如果 `auditFlag == 1`(审核中)且 `auditPersonUserId == currentUserId` → `currentUserCanAudit = 1` - - 否则 → `currentUserCanAudit = 2` - ---- - -## TODOs - -- [x] Add currentUserCanAudit logic in ClosedAreaPersonApplyQueryExe.execute() - - **What to do**: - 1. 在 `execute` 方法中获取当前登录用户ID - 2. 在转换DO到CO后,遍历CO列表设置 `currentUserCanAudit` 字段 - 3. 判断逻辑:审核中(1)且当前用户是审批人 → 能审核(1),否则不能审核(2) - - **References**: - - `web-app/src/main/java/com/zcloud/primeport/command/query/ClosedAreaPersonApplyQueryExe.java:48-53` - execute method to modify - - `web-client/src/main/java/com/zcloud/primeport/dto/clientobject/ClosedAreaPersonApplyCO.java:124-125` - currentUserCanAudit field already exists - - `web-app/src/main/java/com/zcloud/primeport/command/ClosedAreaPersonApplyAddExe.java` - AuthContext.getUserId() usage example - - **Acceptance Criteria**: - - [ ] `execute` 方法中获取 `AuthContext.getUserId()` - - [ ] 对每条记录正确设置 `currentUserCanAudit` 字段 - - [ ] 代码编译通过 - - [ ] 使用 `import com.jjb.saas.framework.auth.utils.AuthContext;` - ---- - -## Commit Strategy - -- **1**: `feat(closedArea): add currentUserCanAudit logic in query` — ClosedAreaPersonApplyQueryExe.java - ---- - -## Success Criteria - -### Verification Commands -```bash -mvn compile -pl web-app -``` - -### Final Checklist -- [ ] `currentUserCanAudit` 逻辑正确实现 -- [ ] 代码编译通过 diff --git a/.sisyphus/plans/refactor-car-apply-listpage.md b/.sisyphus/plans/refactor-car-apply-listpage.md deleted file mode 100644 index 7136fd7..0000000 --- a/.sisyphus/plans/refactor-car-apply-listpage.md +++ /dev/null @@ -1,132 +0,0 @@ -# Refactor ClosedAreaCarApplyRepositoryImpl listPage Method - -## TL;DR - -按照 `ClosedAreaPersonApplyRepositoryImpl.listPage()` 的实现方式重写 `ClosedAreaCarApplyRepositoryImpl.listPage()` 方法,添加 `menuPerms` 参数处理逻辑。 - -**Deliverables**: -- 修改 `ClosedAreaCarApplyMapper.java` - 添加 listPage 方法 -- 修改 `ClosedAreaCarApplyMapper.xml` - 添加 SQL 查询 -- 修改 `ClosedAreaCarApplyRepositoryImpl.java` - 重写 listPage 方法 - -**Estimated Effort**: Quick (3 files) - ---- - -## Context - -### Reference Implementation -`ClosedAreaPersonApplyRepositoryImpl.listPage()` 的实现模式: -1. 使用 `Page>` 创建分页对象 -2. 获取 `menuPerms` 参数:通过 `MenuEnum.getMenuKeyByPath()` 转换 -3. 调用 Mapper 的自定义 `listPage` 方法 -4. 返回 `PageHelper.pageToResponse()` 结果 - -### Business Logic -```java -String menuPerms = ""; -if (!org.springframework.util.ObjectUtils.isEmpty(params.get("menuPath"))) { - menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString()); -} -``` - ---- - -## TODOs - -- [ ] 1. Add listPage method to ClosedAreaCarApplyMapper.java - - **What to do**: - 添加 `listPage` 方法签名,参考 ClosedAreaPersonApplyMapper - - **File**: `web-infrastructure/src/main/java/com/zcloud/primeport/persistence/mapper/ClosedAreaCarApplyMapper.java` - - **Code**: - ```java - IPage listPage(Page> page, Map params, String menuPerms); - ``` - - **Imports to add**: - ```java - import com.baomidou.mybatisplus.core.metadata.IPage; - import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - import java.util.Map; - ``` - -- [ ] 2. Add listPage SQL to ClosedAreaCarApplyMapper.xml - - **What to do**: - 添加分页查询 SQL,参考 ClosedAreaPersonApplyMapper.xml - - **File**: `web-infrastructure/src/main/resources/mapper/ClosedAreaCarApplyMapper.xml` - - **Code**: - ```xml - - ``` - -- [ ] 3. Rewrite listPage in ClosedAreaCarApplyRepositoryImpl.java - - **What to do**: - 按照 ClosedAreaPersonApplyRepositoryImpl 的模式重写 listPage 方法 - - **File**: `web-infrastructure/src/main/java/com/zcloud/primeport/persistence/repository/impl/ClosedAreaCarApplyRepositoryImpl.java` - - **Code**: - ```java - @Override - public PageResponse listPage(Map params) { - Page> page = new Page<>(Integer.parseInt(params.get("pageIndex").toString()), - Integer.parseInt(params.get("pageSize").toString())); - String menuPerms = ""; - if (!org.springframework.util.ObjectUtils.isEmpty(params.get("menuPath"))) { - menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString()); - } - IPage result = closedAreaCarApplyMapper.listPage(page, params, menuPerms); - return PageHelper.pageToResponse(result, result.getRecords()); - } - ``` - - **Imports to add**: - ```java - import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - import com.zcloud.primeport.domain.enums.MenuEnum; - ``` - ---- - -## Commit Strategy - -- **1**: `feat(closedArea): refactor ClosedAreaCarApplyRepositoryImpl listPage with menuPerms` — 3 files - ---- - -## Success Criteria - -### Verification Commands -```bash -mvn compile -pl web-infrastructure -``` - -### Final Checklist -- [ ] Mapper 接口添加 listPage 方法 -- [ ] XML 添加对应 SQL -- [ ] Repository 实现重写完成 -- [ ] 编译通过 \ No newline at end of file