feat(closedArea): add currentUserCanAudit logic in query

koumen
dearLin 2026-03-20 10:06:07 +08:00
parent c3b0bc977c
commit b1f1532c92
1 changed files with 16 additions and 0 deletions

View File

@ -49,6 +49,22 @@ public class ClosedAreaPersonApplyQueryExe {
Map<String, Object> params = PageQueryHelper.toHashMap(closedAreaPersonApplyPageQry);
PageResponse<ClosedAreaPersonApplyDO> pageResponse = closedAreaPersonApplyRepository.listPage(params);
List<ClosedAreaPersonApplyCO> examCenterCOS = closedAreaPersonApplyCoConvertor.converDOsToCOs(pageResponse.getData());
// 获取当前登录用户ID
Long currentUserId = AuthContext.getUserId();
// 设置当前用户是否能审核
for (ClosedAreaPersonApplyCO co : examCenterCOS) {
// 审核中(1)且当前用户是审批人 → 能审核(1),否则不能审核(2)
if (co.getAuditFlag() != null && co.getAuditFlag() == 1
&& co.getAuditPersonUserId() != null
&& co.getAuditPersonUserId().equals(currentUserId)) {
co.setCurrentUserCanAudit(1);
} else {
co.setCurrentUserCanAudit(2);
}
}
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
}