feat(closedArea): add currentUserCanAudit logic in query
parent
c3b0bc977c
commit
b1f1532c92
|
|
@ -49,6 +49,22 @@ public class ClosedAreaPersonApplyQueryExe {
|
||||||
Map<String, Object> params = PageQueryHelper.toHashMap(closedAreaPersonApplyPageQry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(closedAreaPersonApplyPageQry);
|
||||||
PageResponse<ClosedAreaPersonApplyDO> pageResponse = closedAreaPersonApplyRepository.listPage(params);
|
PageResponse<ClosedAreaPersonApplyDO> pageResponse = closedAreaPersonApplyRepository.listPage(params);
|
||||||
List<ClosedAreaPersonApplyCO> examCenterCOS = closedAreaPersonApplyCoConvertor.converDOsToCOs(pageResponse.getData());
|
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());
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue