“0826权限已修复”

This commit is contained in:
weizhong committed 2025-08-26 13:24:55 +08:00
1 parent 93711d76a3
commit 3dc8cf677a
10 files changed
+271 -10

No files matched your search

@@ -668,3 +668,144 @@
**📝 维护**: 物业报修管理 API 文档
**🔄 更新**: 2025-07-01
**�� 文件**: 物业报修管理 API.md
## 📊 统计分析接口
**详细信息参考**: `docs/业务模块/物业报修管理/统计分析功能.md`
---
## 🔧 培训申请待审批接口 (新增 2025-01-03)
### 查询待审批培训申请列表
**接口地址**: `GET /rs/training/application/pending/list`
**权限要求**: `rs:trainingapproval:process`
**接口说明**: 专门为审批人员提供的待审批培训申请列表接口,解决了rs-Approver角色权限问题
#### 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| pageNum | number | 否 | 页码,默认1 |
| pageSize | number | 否 | 每页数量,默认10 |
| courseName | string | 否 | 课程名称(模糊查询) |
| location | string | 否 | 培训地点(模糊查询) |
| status | string | 否 | 申请状态 |
| excludeStatus | string | 否 | 排除状态(默认排除已通过状态"1") |
#### 响应参数
```json
{
"code": 200,
"msg": "查询成功",
"rows": [
{
"applicationId": 1234567890123456789,
"courseId": 1,
"courseName": "Spring Boot开发培训",
"userId": 123,
"userName": "张三",
"department": "技术部",
"position": "开发工程师",
"reason": "提升技术能力",
"status": "0",
"applyTime": "2025-01-03 10:00:00",
"location": "培训中心A座",
"duration": 3,
"startTime": "2025-01-10 09:00:00",
"endTime": "2025-01-12 17:00:00"
}
],
"total": 15
}
```
#### 状态码说明
| 状态 | 含义 | 类型 |
|------|------|------|
| 0 | 待审核 | warning |
| 1 | 已通过 | success |
| 2 | 已拒绝 | danger |
| 3 | 已取消 | info |
| 4 | 已完成 | success |
#### 权限控制
- **接口权限**: `rs:trainingapproval:process`
- **角色支持**: rs-Approver, rs-admin
- **数据过滤**:
- rs-Approver角色:可查看所有待审批申请
- rs-admin角色:可查看所有申请
- 自动排除已通过状态的申请
#### 使用示例
**前端调用**:
```typescript
import { listPendingTrainingApplication } from '@/api/rs/training'
// 查询待审批列表
const getPendingList = async () => {
const params = {
pageNum: 1,
pageSize: 10,
excludeStatus: '1' // 排除已通过状态
}
const response = await listPendingTrainingApplication(params)
return response
}
```
**Curl示例**:
```bash
curl -X GET "http://localhost:8080/rs/training/application/pending/list?pageNum=1&pageSize=10" \
-H "Authorization: Bearer your-token" \
-H "clientid: e5cd7e4891bf95d1d19206ce24a7b32e" \
-H "referer: http://localhost"
```
#### 与原接口对比
| 项目 | 原接口 | 新接口 |
|------|--------|--------|
| 接口地址 | `/rs/training/application/list` | `/rs/training/application/pending/list` |
| 权限要求 | `rs:trainingapplication:list` | `rs:trainingapproval:process` |
| 角色支持 | rs-admin | rs-Approver, rs-admin |
| 设计目的 | 申请管理 | 审批处理 |
| 权限独立性 | ❌ 权限混合 | ✅ 权限分离 |
#### 技术实现
**后端Controller**:
```java
@SaCheckPermission("rs:trainingapproval:process")
@GetMapping("/pending/list")
public TableDataInfo<RsTrainingApplication> pendingList(
RsTrainingApplication application,
PageQuery pageQuery) {
// 设置租户ID和排除状态
application.setTenantId(LoginHelper.getTenantId());
application.setExcludeStatus("1"); // 排除已通过状态
return trainingApplicationService.selectPageRsTrainingApplicationList(
application, pageQuery);
}
```
**权限过滤逻辑**:
- Service层根据rs-Approver角色自动放开数据权限
- Mapper层支持excludeStatus参数过滤
- 前端调用专门的审批接口,权限控制更精确
---
**接口文档最后更新**: 2025-01-03
**维护责任人**: 系统架构师
**相关文档**:
- `docs/开发文档/培训申请权限一致性修复报告.md`
- `.cursor/cursorrules-backend.md` - 后端开发规范