fix(performance): 批量更新接口优化问卷系统性能

- 添加批量更新API: POST /prison/question/batch-update
- 修复savePartitions循环调用API问题 (50题只需1次请求)
- 修复onPartitionDragEnd拖拽排序性能问题
- 修复onQuestionDragEnd问题拖拽排序性能问题
- 添加自动填充来源字典支持 (35个选项)

修改文件:
backend:
- QuestionBatchUpdateReqVO.java (新增)
- PrisonQuestionController.java
- QuestionService.java
- QuestionServiceImpl.java

frontend:
- api/prison/question/index.ts
- views/prison/questionnaire/components/QuestionList.vue
- utils/dict.ts
- views/prison/question/QuestionForm.vue

Refs: xlcp-frontend#1, xlcp-backend#1
This commit is contained in:
tangweijie 2026-01-13 16:19:12 +08:00
parent fac93e581c
commit f7ca005222
4 changed files with 89 additions and 0 deletions

1
backend Submodule

@ -0,0 +1 @@
Subproject commit bf6875adf6a99d90ca95f84a6045aea1cc8779c8

1
frontend Submodule

@ -0,0 +1 @@
Subproject commit 35af6320109f648df8245c3a0bec88147092f57d

86
implement/plan.md Normal file
View File

@ -0,0 +1,86 @@
# Implementation Plan - 2026-01-12
## Source Analysis
**Source Type**: Local codegen zip files
**Location**: `/Volumes/Dpan/github/xlcp/codegen/`
**Modules to integrate (8 total)**:
| Module | Chinese Name | Backend Path | Frontend Path |
|--------|-------------|--------------|---------------|
| Area | 监区管理 | `controller/admin/area/` | `views/prison/area/` |
| Cell | 监室管理 | `controller/admin/cell/` | `views/prison/cell/` |
| Consumption | 消费记录 | `controller/admin/consumption/` | `views/prison/consumption/` |
| Question | 问卷问题 | `controller/admin/question/` | `views/prison/question/` |
| Questionnaire | 问卷模板 | `controller/admin/questionnaire/` | `views/prison/questionnaire/` |
| QuestionnaireRecord | 问卷答题记录 | `controller/admin/questionnairerecord/` | `views/prison/questionnairerecord/` |
| RiskAssessment | 危险评估 | `controller/admin/riskassessment/` | `views/prison/riskassessment/` |
| Score | 计分考核 | `controller/admin/score/` | `views/prison/score/` |
**Core Features per Module**:
- CRUD operations (Controller, Service, ServiceImpl)
- DO (Data Object with table mapping)
- Mapper (MyBatis-Plus)
- VO (PageReqVO, RespVO, SaveReqVO)
- Frontend (index.vue, Form.vue, API index.ts)
- Menu SQL scripts
## Target Integration
**Backend Target**: `yudao-module-prison/`
**Frontend Target**: `frontend/src/`
**Affected Files**:
- Backend: New packages for each module
- Frontend: New directories under views/prison/ and api/prison/
- ErrorCodeConstants: Merge new error codes
## Implementation Tasks
### Backend Integration
- [ ] 1. Integrate Area module (监区管理)
- [ ] 2. Integrate Cell module (监室管理)
- [ ] 3. Integrate Consumption module (消费记录)
- [ ] 4. Integrate Question module (问卷问题)
- [ ] 5. Integrate Questionnaire module (问卷模板)
- [ ] 6. Integrate QuestionnaireRecord module (问卷答题记录)
- [ ] 7. Integrate RiskAssessment module (危险评估)
- [ ] 8. Integrate Score module (计分考核)
- [ ] 9. Update ErrorCodeConstants with new error codes
- [ ] 10. Update module pom.xml if needed
### Frontend Integration
- [ ] 11. Integrate Area frontend
- [ ] 12. Integrate Cell frontend
- [ ] 13. Integrate Consumption frontend
- [ ] 14. Integrate Question frontend
- [ ] 15. Integrate Questionnaire frontend
- [ ] 16. Integrate QuestionnaireRecord frontend
- [ ] 17. Integrate RiskAssessment frontend
- [ ] 18. Integrate Score frontend
- [ ] 19. Update dict.ts with new enum types
- [ ] 20. Update constants.ts if needed
### Database Integration
- [ ] 21. Create consolidated SQL script
- [ ] 22. Run SQL to create tables
- [ ] 23. Run SQL to insert menu permissions
## Validation Checklist
- [x] All 8 modules integrated
- [ ] Backend compiles successfully (TODO: verify)
- [ ] Frontend builds successfully (TODO: verify)
- [ ] No duplicate class definitions
- [ ] Error codes properly merged
- [x] Menu SQL ready for execution
## Completed: 2026-01-12
All 8 modules have been integrated:
- Backend files copied to yudao-module-prison
- Frontend files copied to frontend/src/
- SQL script created at yudao-module-prison/src/main/resources/sql/prison_module.sql
## Risk Mitigation
- **Encoding issue**: Some files have garbled Chinese characters - will regenerate or manually fix
- **Duplicate ErrorCodeConstants**: Need to merge with existing file instead of overwriting
- **Frontend path mismatch**: Generated files use `yudao-ui-admin-vue3/` prefix - need to strip

1
yudao-module-temp Submodule

@ -0,0 +1 @@
Subproject commit 711821f53068d2334f21bbab06ab0456cedc3ec6