69 lines
2.3 KiB
Markdown
69 lines
2.3 KiB
Markdown
|
|
# 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` 逻辑正确实现
|
|||
|
|
- [ ] 代码编译通过
|