增加AI出题
parent
5257bcc5c8
commit
3b8419583f
37
README.md
37
README.md
|
|
@ -9,6 +9,7 @@
|
||||||
- 考试管理
|
- 考试管理
|
||||||
- 题库管理
|
- 题库管理
|
||||||
- 成绩统计
|
- 成绩统计
|
||||||
|
- AI题目生成
|
||||||
|
|
||||||
## 微信扫码登录配置
|
## 微信扫码登录配置
|
||||||
|
|
||||||
|
|
@ -39,6 +40,42 @@ wechat:
|
||||||
4. 在微信中确认登录
|
4. 在微信中确认登录
|
||||||
5. 系统将自动跳转到主页
|
5. 系统将自动跳转到主页
|
||||||
|
|
||||||
|
## AI题目生成功能
|
||||||
|
|
||||||
|
系统集成了AI题目生成功能,可以通过调用AI大模型API来自动生成各种类型的题目。
|
||||||
|
|
||||||
|
### 配置步骤
|
||||||
|
|
||||||
|
1. 在`exam-online-api/ruoyi-admin/src/main/resources/application.yml`中配置AI API参数:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
ai:
|
||||||
|
# DeepSeek API配置
|
||||||
|
api-url: https://api.deepseek.com/v1/chat/completions
|
||||||
|
model-name: deepseek-chat
|
||||||
|
api-key: your_deepseek_api_key
|
||||||
|
connect-timeout: 30
|
||||||
|
read-timeout: 60
|
||||||
|
write-timeout: 30
|
||||||
|
|
||||||
|
# OpenRouter API配置
|
||||||
|
openrouter:
|
||||||
|
api-url: https://openrouter.ai/api/v1/chat/completions
|
||||||
|
model-name: deepseek/deepseek-v3-0324-free
|
||||||
|
api-key: your_openrouter_api_key
|
||||||
|
enabled: false
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 执行数据库脚本`doc/ai_question_permissions.sql`添加相关权限
|
||||||
|
|
||||||
|
### 使用说明
|
||||||
|
|
||||||
|
1. 进入"题库管理"模块
|
||||||
|
2. 选择一个题库或创建新题库
|
||||||
|
3. 点击"AI生成题目"按钮
|
||||||
|
4. 配置生成参数并生成题目
|
||||||
|
5. 点击"保存到题库"将题目保存到当前题库中
|
||||||
|
|
||||||
## 技术栈
|
## 技术栈
|
||||||
|
|
||||||
- 后端:Spring Boot + MyBatis + Spring Security
|
- 后端:Spring Boot + MyBatis + Spring Security
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,219 @@
|
||||||
|
# AI题目生成功能使用指南
|
||||||
|
|
||||||
|
## 功能概述
|
||||||
|
|
||||||
|
AI题目生成功能是yzexam在线考试系统的一个扩展功能,通过调用AI大模型API(如DeepSeek、OpenRouter等)来自动生成各种类型的题目,包括选择题、简答题和论述题等,以提高教师出题效率,丰富题库内容。
|
||||||
|
|
||||||
|
## 功能特性
|
||||||
|
|
||||||
|
- 支持生成多种题型:单选题、多选题、简答题、论述题
|
||||||
|
- 支持"全部题型"选项,一次性生成多种类型的题目
|
||||||
|
- 支持设置题目数量(1-20题)
|
||||||
|
- 支持设置题目难度等级:简单、中等、困难
|
||||||
|
- 支持指定知识点范围生成题目
|
||||||
|
- 支持指定关键词生成题目(多个关键词用逗号分隔)
|
||||||
|
- 支持指定题目方向生成题目(理解、应用、分析、综合、评价)
|
||||||
|
- 支持指定适合学段生成题目(初中、高中、大学、研究生)
|
||||||
|
- 生成的题目可直接保存到题库中
|
||||||
|
|
||||||
|
## 技术架构
|
||||||
|
|
||||||
|
### 后端技术栈
|
||||||
|
- Java + Spring Boot
|
||||||
|
- OkHttp(用于调用AI API)
|
||||||
|
- FastJSON(用于JSON处理)
|
||||||
|
- MyBatis(用于数据库操作)
|
||||||
|
|
||||||
|
### 前端技术栈
|
||||||
|
- Vue.js 2.x
|
||||||
|
- Element UI
|
||||||
|
- Axios
|
||||||
|
|
||||||
|
## 部署配置
|
||||||
|
|
||||||
|
### 1. 配置AI API密钥
|
||||||
|
|
||||||
|
在[application.yml](file:///Volumes/macData/code/yzexam/examapi/ruoyi-admin/src/main/resources/application.yml)中配置AI API相关信息:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# AI题目生成配置
|
||||||
|
ai:
|
||||||
|
# DeepSeek API配置
|
||||||
|
api-url: https://api.deepseek.com/v1/chat/completions
|
||||||
|
model-name: deepseek-chat
|
||||||
|
api-key: ${AI_API_KEY:}
|
||||||
|
connect-timeout: 30
|
||||||
|
read-timeout: 60
|
||||||
|
write-timeout: 30
|
||||||
|
|
||||||
|
# OpenRouter API配置
|
||||||
|
openrouter:
|
||||||
|
api-url: https://openrouter.ai/api/v1/chat/completions
|
||||||
|
model-name: deepseek/deepseek-v3-0324-free
|
||||||
|
api-key: ${OPENROUTER_API_KEY:}
|
||||||
|
enabled: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 设置环境变量
|
||||||
|
|
||||||
|
可以选择使用DeepSeek API或OpenRouter API:
|
||||||
|
|
||||||
|
使用DeepSeek API:
|
||||||
|
```bash
|
||||||
|
export AI_API_KEY="your_deepseek_api_key_here"
|
||||||
|
```
|
||||||
|
|
||||||
|
使用OpenRouter API:
|
||||||
|
```bash
|
||||||
|
export OPENROUTER_API_KEY="your_openrouter_api_key_here"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 数据库权限配置
|
||||||
|
|
||||||
|
运行[ai_question_permissions.sql](file:///Volumes/macData/code/yzexam/doc/ai_question_permissions.sql)脚本,为系统添加AI题目生成功能所需的菜单和权限。
|
||||||
|
|
||||||
|
## 使用说明
|
||||||
|
|
||||||
|
### 1. 访问AI题目生成功能
|
||||||
|
|
||||||
|
1. 登录系统后,进入"题库管理"模块
|
||||||
|
2. 选择一个题库或创建新题库
|
||||||
|
3. 点击"AI生成题目"按钮
|
||||||
|
4. 系统将跳转到AI题目生成页面
|
||||||
|
|
||||||
|
### 2. 配置生成参数
|
||||||
|
|
||||||
|
在AI题目生成页面中,配置以下参数:
|
||||||
|
|
||||||
|
- **题目类型**:选择要生成的题目类型(单选题、多选题、简答题、论述题或全部题型)
|
||||||
|
- **题目数量**:输入要生成的题目数量(1-20题)
|
||||||
|
- **知识点范围**:输入题目涉及的知识点范围
|
||||||
|
- **关键词**:输入与题目相关的关键词(多个关键词用逗号分隔)
|
||||||
|
- **难易程度**:选择题目的难度等级(简单、中等、困难)
|
||||||
|
- **题目方向**:选择题目的考查方向(理解、应用、分析、综合、评价)
|
||||||
|
- **适合学段**:选择题目适合的学段(初中、高中、大学、研究生)
|
||||||
|
|
||||||
|
### 3. 生成题目
|
||||||
|
|
||||||
|
点击"生成题目"按钮,系统将调用AI API生成指定类型的题目,并在页面中显示生成结果。
|
||||||
|
|
||||||
|
### 4. 保存题目
|
||||||
|
|
||||||
|
生成题目后,可以点击"保存到题库"按钮将题目保存到当前题库中。
|
||||||
|
|
||||||
|
## API接口说明
|
||||||
|
|
||||||
|
### 1. 生成选择题
|
||||||
|
```
|
||||||
|
POST /ai/questions/choice
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"knowledgePoint": "马克思主义基本原理",
|
||||||
|
"keywords": "唯物主义,辩证法,实践",
|
||||||
|
"difficulty": "medium",
|
||||||
|
"direction": "comprehension",
|
||||||
|
"gradeLevel": "college",
|
||||||
|
"multiple": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 生成简答题
|
||||||
|
```
|
||||||
|
POST /ai/questions/short-answer
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"knowledgePoint": "社会主义核心价值观",
|
||||||
|
"keywords": "爱国,敬业,诚信,友善",
|
||||||
|
"difficulty": "medium",
|
||||||
|
"direction": "application",
|
||||||
|
"gradeLevel": "college"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 生成论述题
|
||||||
|
```
|
||||||
|
POST /ai/questions/essay
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"knowledgePoint": "新时代党的建设",
|
||||||
|
"keywords": "全面从严治党,反腐倡康,制度建设",
|
||||||
|
"difficulty": "hard",
|
||||||
|
"direction": "evaluation",
|
||||||
|
"gradeLevel": "postgraduate"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. 批量生成题目
|
||||||
|
```
|
||||||
|
POST /ai/questions/batch
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"questionType": "choice",
|
||||||
|
"count": 5,
|
||||||
|
"knowledgePoint": "马克思主义基本原理",
|
||||||
|
"keywords": "唯物主义,辩证法,实践",
|
||||||
|
"difficulty": "medium",
|
||||||
|
"direction": "comprehension",
|
||||||
|
"gradeLevel": "college",
|
||||||
|
"multiple": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. 保存AI生成的题目
|
||||||
|
```
|
||||||
|
POST /ai/questions/save
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"questions": [...], // AI生成的题目列表
|
||||||
|
"bankCode": "题库代码"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安全注意事项
|
||||||
|
|
||||||
|
1. API密钥应妥善保管,不要硬编码在代码中
|
||||||
|
2. 建议通过环境变量或配置中心管理API密钥
|
||||||
|
3. 实际部署时应添加身份验证和权限控制
|
||||||
|
4. 添加API调用频率限制,防止滥用
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
### 1. 生成题目失败
|
||||||
|
|
||||||
|
可能原因:
|
||||||
|
- API密钥配置错误
|
||||||
|
- 网络连接问题
|
||||||
|
- AI API服务不可用
|
||||||
|
|
||||||
|
解决方案:
|
||||||
|
- 检查API密钥是否正确配置
|
||||||
|
- 检查网络连接是否正常
|
||||||
|
- 确认AI API服务是否可用
|
||||||
|
|
||||||
|
### 2. 保存题目失败
|
||||||
|
|
||||||
|
可能原因:
|
||||||
|
- 题库代码不正确
|
||||||
|
- 数据库连接问题
|
||||||
|
- 权限不足
|
||||||
|
|
||||||
|
解决方案:
|
||||||
|
- 检查题库代码是否正确
|
||||||
|
- 检查数据库连接是否正常
|
||||||
|
- 确认用户是否有保存题目的权限
|
||||||
|
|
||||||
|
## 扩展建议
|
||||||
|
|
||||||
|
1. 添加题目质量评估功能
|
||||||
|
2. 实现题目去重机制
|
||||||
|
3. 添加题目版本管理
|
||||||
|
4. 支持批量生成题目
|
||||||
|
5. 添加题目审核流程
|
||||||
|
6. 实现题目分类管理
|
||||||
|
7. 添加题目搜索功能
|
||||||
|
8. 支持题目导出为不同格式
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
-- 添加AI题目生成功能的权限
|
||||||
|
-- 菜单权限
|
||||||
|
INSERT INTO `sys_menu` (`menu_name`, `parent_id`, `order_num`, `path`, `component`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||||
|
VALUES ('AI题目生成', 2000, 1, 'ai/generator', 'questions/ai/AIQuestionGenerator', 1, 0, 'C', '0', '0', 'ai:questions:generate', 'magic', 'admin', sysdate(), '', null, 'AI题目生成菜单');
|
||||||
|
|
||||||
|
-- 按钮权限
|
||||||
|
INSERT INTO `sys_menu` (`menu_name`, `parent_id`, `order_num`, `path`, `component`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||||
|
VALUES ('生成题目', 2001, 1, '#', '', 1, 0, 'F', '0', '0', 'ai:questions:generate', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_name`, `parent_id`, `order_num`, `path`, `component`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||||
|
VALUES ('保存题目', 2001, 2, '#', '', 1, 0, 'F', '0', '0', 'ai:questions:save', '#', 'admin', sysdate(), '', null, '');
|
||||||
|
|
||||||
|
-- 获取新插入菜单的ID
|
||||||
|
SET @menu_id = LAST_INSERT_ID();
|
||||||
|
|
||||||
|
-- 角色权限关联(给管理员角色分配权限)
|
||||||
|
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 2001);
|
||||||
|
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 2002);
|
||||||
|
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 2003);
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
######################################################################
|
|
||||||
# Build Tools
|
|
||||||
|
|
||||||
.gradle
|
|
||||||
/build/
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
target/
|
|
||||||
!.mvn/wrapper/maven-wrapper.jar
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# IDE
|
|
||||||
|
|
||||||
### STS ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
nbproject/private/
|
|
||||||
build/*
|
|
||||||
nbbuild/
|
|
||||||
dist/
|
|
||||||
nbdist/
|
|
||||||
.nb-gradle/
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# Others
|
|
||||||
*.log
|
|
||||||
*.xml.versionsBackup
|
|
||||||
*.swp
|
|
||||||
|
|
||||||
!*/build/*.java
|
|
||||||
!*/build/*.html
|
|
||||||
!*/build/*.xml
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2018 RuoYi
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
## 平台简介
|
|
||||||
|
|
||||||
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
|
|
||||||
|
|
||||||
* 前端采用Vue、Element UI。
|
|
||||||
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
|
|
||||||
* 权限认证使用Jwt,支持多终端认证系统。
|
|
||||||
* 支持加载动态权限菜单,多方式轻松权限控制。
|
|
||||||
* 高效率开发,使用代码生成器可以一键生成前后端代码。
|
|
||||||
* 提供了单应用版本[RuoYi-Vue-fast](https://github.com/yangzongzhuan/RuoYi-Vue-fast),Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
|
|
||||||
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
|
|
||||||
* 特别鸣谢:[element](https://github.com/ElemeFE/element),[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin),[eladmin-web](https://github.com/elunez/eladmin-web)。
|
|
||||||
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)
|
|
||||||
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)
|
|
||||||
|
|
||||||
## 内置功能
|
|
||||||
|
|
||||||
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
|
|
||||||
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
|
|
||||||
3. 岗位管理:配置系统用户所属担任职务。
|
|
||||||
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
|
|
||||||
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
|
|
||||||
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
|
|
||||||
7. 参数管理:对系统动态配置常用参数。
|
|
||||||
8. 通知公告:系统通知公告信息发布维护。
|
|
||||||
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
|
|
||||||
10. 登录日志:系统登录日志记录查询包含登录异常。
|
|
||||||
11. 在线用户:当前系统中活跃用户状态监控。
|
|
||||||
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
|
|
||||||
13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
|
|
||||||
14. 系统接口:根据业务代码自动生成相关的api接口文档。
|
|
||||||
15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
|
|
||||||
16. 缓存监控:对系统的缓存信息查询,命令统计等。
|
|
||||||
17. 在线构建器:拖动表单元素生成相应的HTML代码。
|
|
||||||
18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
|
|
||||||
|
|
||||||
## 在线体验
|
|
||||||
|
|
||||||
- admin/admin123
|
|
||||||
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
|
|
||||||
|
|
||||||
演示地址:http://vue.ruoyi.vip
|
|
||||||
文档地址:http://doc.ruoyi.vip
|
|
||||||
|
|
||||||
## 演示图
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
|
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
## 若依前后端分离交流群
|
|
||||||
|
|
||||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5bVB1og) [](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [](https://jq.qq.com/?_wv=1027&k=51G72yr) [](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [](https://jq.qq.com/?_wv=1027&k=5vYAqA05) 点击按钮入群。
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
mvn clean
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
@echo off
|
|
||||||
echo.
|
|
||||||
echo [信息] 清理生成路径。
|
|
||||||
echo.
|
|
||||||
|
|
||||||
%~d0
|
|
||||||
cd %~dp0
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
call mvn clean
|
|
||||||
|
|
||||||
pause
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
mvn clean package -Dmaven.test.skip=true
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
@echo off
|
|
||||||
echo.
|
|
||||||
echo [信息] 打包Web工程,生成war/jar包文件。
|
|
||||||
echo.
|
|
||||||
|
|
||||||
%~d0
|
|
||||||
cd %~dp0
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
call mvn clean package -Dmaven.test.skip=true
|
|
||||||
|
|
||||||
pause
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
java -Dfile.encoding=utf-8 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar ruoyi-admin/target/examapi.jar
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
@echo off
|
|
||||||
echo.
|
|
||||||
echo [信息] 运行Web工程。
|
|
||||||
echo.
|
|
||||||
|
|
||||||
cd %~dp0
|
|
||||||
cd ../ruoyi-admin/target
|
|
||||||
|
|
||||||
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
|
||||||
|
|
||||||
java -jar %JAVA_OPTS% ruoyi-admin.jar
|
|
||||||
|
|
||||||
cd bin
|
|
||||||
pause
|
|
||||||
Binary file not shown.
|
|
@ -1,198 +0,0 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi</artifactId>
|
|
||||||
<version>3.8.6</version>
|
|
||||||
</parent>
|
|
||||||
<!-- <groupId>com.hig</groupId> -->
|
|
||||||
<artifactId>hig-application</artifactId>
|
|
||||||
<name>hig-application</name>
|
|
||||||
<description>应用扩展包</description>
|
|
||||||
<properties>
|
|
||||||
<java.version>1.8</java.version>
|
|
||||||
<fastjson.version>1.2.83</fastjson.version>
|
|
||||||
<lombok.version>1.18.30</lombok.version>
|
|
||||||
<oracle.version>12.2.0.1.0</oracle.version>
|
|
||||||
<druid.version>1.2.20</druid.version>
|
|
||||||
<mybatis.version>2.3.2</mybatis.version>
|
|
||||||
<gson.version>2.10.1</gson.version>
|
|
||||||
<jasypt.version>3.0.5</jasypt.version>
|
|
||||||
<quartz.version>2.3.2</quartz.version>
|
|
||||||
<httpclient.version>4.5.14</httpclient.version>
|
|
||||||
<httpmime.version>4.5.14</httpmime.version>
|
|
||||||
<httpcore.version>4.4.16</httpcore.version>
|
|
||||||
<commons-codec.version>1.15</commons-codec.version>
|
|
||||||
<commons-logging.version>1.2</commons-logging.version>
|
|
||||||
<commons-io.version>2.11.0</commons-io.version>
|
|
||||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
|
||||||
<commons-lang.version>3.12.0</commons-lang.version>
|
|
||||||
<weixin-java-cp.version>4.5.0</weixin-java-cp.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- 发war包的时侯排除tomcat -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>fastjson</artifactId>
|
|
||||||
<version>${fastjson.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>${lombok.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
<version>${gson.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.hutool</groupId>
|
|
||||||
<artifactId>hutool-all</artifactId>
|
|
||||||
<version>5.8.25</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.ulisesbocchio</groupId>
|
|
||||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
|
||||||
<version>${jasypt.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- 添加Scheduled坐标 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-context-support</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Sprng tx 坐标 这个是控制事务的-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-tx</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!--oracle驱动-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>com.oracle</groupId>-->
|
|
||||||
<!-- <artifactId>ojdbc8</artifactId>-->
|
|
||||||
<!-- <version>${oracle.version}</version>-->
|
|
||||||
<!-- </dependency> -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
|
||||||
<version>${druid.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
|
||||||
<version>${mybatis.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Quartz坐标 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
|
||||||
<artifactId>quartz</artifactId>
|
|
||||||
<version>${quartz.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
<version>${httpclient.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpmime</artifactId>
|
|
||||||
<version>${httpmime.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpcore</artifactId>
|
|
||||||
<version>${httpcore.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.thoughtworks.xstream</groupId>
|
|
||||||
<artifactId>xstream</artifactId>
|
|
||||||
<version>1.4.20</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>${commons-io.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
<version>${commons-codec.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<version>${commons-logging.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>${commons-lang3.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-cp</artifactId>
|
|
||||||
<version>${weixin-java-cp.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20231013</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-framework</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-system</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>hig-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package com.hig.cms.utils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FilenameUtils;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
public class FileUpload {
|
|
||||||
/**
|
|
||||||
* 文件上传处理
|
|
||||||
*
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String writeUploadFile(MultipartFile file,String path) {
|
|
||||||
String filename = file.getOriginalFilename();
|
|
||||||
System.out.println("原始文件名:" + filename);
|
|
||||||
File fileDir = new File(path);
|
|
||||||
if (!fileDir.exists())
|
|
||||||
fileDir.mkdirs();
|
|
||||||
|
|
||||||
String extname = FilenameUtils.getExtension(filename);
|
|
||||||
String allowImgFormat = "gif,jpg,jpeg,png";
|
|
||||||
if (!allowImgFormat.contains(extname.toLowerCase())) {
|
|
||||||
return "NOT_IMAGE";
|
|
||||||
}
|
|
||||||
|
|
||||||
filename = Math.abs(file.getOriginalFilename().hashCode()) + RandomUtils.createRandomString( 4 ) + "." + extname;
|
|
||||||
InputStream input = null;
|
|
||||||
FileOutputStream fos = null;
|
|
||||||
try {
|
|
||||||
input = file.getInputStream();
|
|
||||||
fos = new FileOutputStream(path + "/" + filename);
|
|
||||||
IOUtils.copy(input, fos);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
} finally {
|
|
||||||
if (input != null) {
|
|
||||||
try {
|
|
||||||
input.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fos != null) {
|
|
||||||
try {
|
|
||||||
fos.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
package com.hig.cms.utils;
|
|
||||||
|
|
||||||
public class RandomUtils {
|
|
||||||
private static final String charlist = "0123456789";
|
|
||||||
|
|
||||||
public static String createRandomString(int len) {
|
|
||||||
String str = new String();
|
|
||||||
for (int i = 0; i < len; i++) {
|
|
||||||
str += charlist.charAt(getRandom(charlist.length()));
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getRandom(int mod) {
|
|
||||||
if (mod < 1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int ret = getInt() % mod;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int getInt() {
|
|
||||||
int ret = Math.abs(Long.valueOf(getRandomNumString()).intValue());
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String getRandomNumString() {
|
|
||||||
double d = Math.random();
|
|
||||||
String dStr = String.valueOf(d).replaceAll("[^\\d]", "");
|
|
||||||
if (dStr.length() > 1) {
|
|
||||||
dStr = dStr.substring(0, dStr.length() - 1);
|
|
||||||
}
|
|
||||||
return dStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
package com.hig.exam.controller;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.hig.exam.domain.ExamTaskData;
|
|
||||||
import com.hig.exam.service.IExamTaskDataService;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/examtask")
|
|
||||||
public class ExamTaskDataController extends BaseController{
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskDataService examTaskDataService;
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/save")
|
|
||||||
public AjaxResult save(@RequestBody ExamTaskData examTaskData)
|
|
||||||
{
|
|
||||||
// 数据判断
|
|
||||||
if (examTaskData == null) {
|
|
||||||
return AjaxResult.error(-1, "传入数据为空!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (examTaskData.getExamTaskManager() == null) {
|
|
||||||
return AjaxResult.error(-1, "传入任务属性信息为空!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (examTaskData.getTaskQuestionsList() == null || examTaskData.getTaskQuestionsList().size() == 0) {
|
|
||||||
return AjaxResult.error(-1, "传入题库信息为空!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (examTaskData.getTaskGroupList() == null || examTaskData.getTaskGroupList().size() == 0) {
|
|
||||||
return AjaxResult.error(-1, "传入人员分组信息为空!");
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
examTaskDataService.saveData(examTaskData);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
return AjaxResult.error(-1, e.getMessage());
|
|
||||||
}
|
|
||||||
return AjaxResult.success("保存成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
package com.hig.exam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.exam.domain.ExamTaskGroup;
|
|
||||||
import com.hig.exam.service.IExamTaskGroupService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务分组Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/taskgroup")
|
|
||||||
public class ExamTaskGroupController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskGroupService examTaskGroupService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务分组列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamTaskGroup> list = examTaskGroupService.selectExamTaskGroupList(examTaskGroup);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出任务分组列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
List<ExamTaskGroup> list = examTaskGroupService.selectExamTaskGroupList(examTaskGroup);
|
|
||||||
ExcelUtil<ExamTaskGroup> util = new ExcelUtil<ExamTaskGroup>(ExamTaskGroup.class);
|
|
||||||
return util.exportExcel(list, "任务分组数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取任务分组详细信息
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examTaskGroupService.selectExamTaskGroupById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务分组
|
|
||||||
*/
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskGroupService.insertExamTaskGroup(examTaskGroup));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务分组
|
|
||||||
*/
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskGroupService.updateExamTaskGroup(examTaskGroup));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/batchupdate")
|
|
||||||
public AjaxResult batchUpdate(@RequestBody List<ExamTaskGroup> examTaskGroupList)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
examTaskGroupService.batchUpdateExamTaskGroup(examTaskGroupList);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除任务分组
|
|
||||||
*/
|
|
||||||
@GetMapping("/delete/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskGroupService.deleteExamTaskGroupByIds(examCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,172 +0,0 @@
|
||||||
package com.hig.exam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.cms.utils.FileUpload;
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.exam.domain.ExamTaskPicture;
|
|
||||||
import com.hig.exam.service.IExamTaskManagerService;
|
|
||||||
import com.hig.exam.service.IExamTaskPictureService;
|
|
||||||
import com.hig.questions.domain.ExamBankPicture;
|
|
||||||
import com.hig.utils.DateUtils;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建考试Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/examtask")
|
|
||||||
public class ExamTaskManagerController extends BaseController
|
|
||||||
{
|
|
||||||
@Value("${cms.exam.photo-path:/photo/exam}")
|
|
||||||
private String photopath;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskManagerService examTaskManagerService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPictureService examTaskPictureService;
|
|
||||||
/**
|
|
||||||
* 查询创建考试列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:examtask:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (examTaskManager.getStartTime() != null) {
|
|
||||||
examTaskManager.setStartDateText(DateUtils.toShortDateString(examTaskManager.getStartTime()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (examTaskManager.getEndTime() != null) {
|
|
||||||
examTaskManager.setEndDateText(DateUtils.toShortDateString(examTaskManager.getEndTime()));
|
|
||||||
}
|
|
||||||
|
|
||||||
startPage();
|
|
||||||
List<ExamTaskManager> list = examTaskManagerService.selectExamTaskManagerList(examTaskManager);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出创建考试列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:examtask:export')")
|
|
||||||
@Log(title = "创建考试", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
List<ExamTaskManager> list = examTaskManagerService.selectExamTaskManagerList(examTaskManager);
|
|
||||||
ExcelUtil<ExamTaskManager> util = new ExcelUtil<ExamTaskManager>(ExamTaskManager.class);
|
|
||||||
return util.exportExcel(list, "创建考试数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取创建考试详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:examtask:query')")
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examTaskManagerService.selectExamTaskManagerById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增创建考试
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:examtask:add')")
|
|
||||||
@Log(title = "创建考试", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/add")
|
|
||||||
public AjaxResult add(@RequestBody ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskManagerService.insertExamTaskManager(examTaskManager));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改创建考试
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:examtask:edit')")
|
|
||||||
@Log(title = "创建考试", businessType = BusinessType.UPDATE)
|
|
||||||
// @PutMapping
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskManagerService.updateExamTaskManager(examTaskManager));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除创建考试
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:examtask:remove')")
|
|
||||||
@Log(title = "创建考试", businessType = BusinessType.DELETE)
|
|
||||||
@GetMapping("/delete/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskManagerService.deleteExamTaskManagerByIds(examCodes));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增参数配置
|
|
||||||
*/
|
|
||||||
@PostMapping("/uploadphoto/{examCodes}")
|
|
||||||
public AjaxResult uploadPhoto(@PathVariable String examCodes,
|
|
||||||
@RequestParam("file") MultipartFile file)
|
|
||||||
{
|
|
||||||
// 取得原始文件名
|
|
||||||
String originalfile = file.getOriginalFilename();
|
|
||||||
|
|
||||||
// 拼接路径
|
|
||||||
String path = RuoYiConfig.getProfile() + photopath;
|
|
||||||
String filename = FileUpload.writeUploadFile(file,path);
|
|
||||||
String fileurl = photopath + "/" + filename;
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
|
|
||||||
ExamTaskPicture examTaskPicture = new ExamTaskPicture(examCodes,path,fileurl,filename,originalfile,loginUser.getUser().getUserName());
|
|
||||||
System.out.println("examTaskPicture:" + examTaskPicture.toString());
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
examTaskPictureService.deleteExamTaskPictureById(examCodes);
|
|
||||||
count = examTaskPictureService.insertExamTaskPicture(examTaskPicture);
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return AjaxResult.success(examTaskPicture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,111 +0,0 @@
|
||||||
package com.hig.exam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.exam.domain.ExamTaskPerson;
|
|
||||||
import com.hig.exam.service.IExamTaskPersonService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试人员Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/taskperson")
|
|
||||||
public class ExamTaskPersonController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPersonService examTaskPersonService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:taskperson:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamTaskPerson> list = examTaskPersonService.selectExamTaskPersonList(examTaskPerson);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试人员列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:taskperson:export')")
|
|
||||||
@Log(title = "考试人员", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
List<ExamTaskPerson> list = examTaskPersonService.selectExamTaskPersonList(examTaskPerson);
|
|
||||||
ExcelUtil<ExamTaskPerson> util = new ExcelUtil<ExamTaskPerson>(ExamTaskPerson.class);
|
|
||||||
return util.exportExcel(list, "考试人员数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试人员详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:taskperson:query')")
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examTaskPersonService.selectExamTaskPersonById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试人员
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:taskperson:add')")
|
|
||||||
@Log(title = "考试人员", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/add")
|
|
||||||
public AjaxResult add(@RequestBody ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPersonService.insertExamTaskPerson(examTaskPerson));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试人员
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:taskperson:edit')")
|
|
||||||
@Log(title = "考试人员", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPersonService.updateExamTaskPerson(examTaskPerson));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新考试开始时间
|
|
||||||
*/
|
|
||||||
@PostMapping("/starttime")
|
|
||||||
public AjaxResult updateStartTime(@RequestBody ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPersonService.updateStartTime(examTaskPerson));
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除考试人员
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:taskperson:remove')")
|
|
||||||
@Log(title = "考试人员", businessType = BusinessType.DELETE)
|
|
||||||
@GetMapping("/delete/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPersonService.deleteExamTaskPersonByIds(examCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
package com.hig.exam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.exam.domain.ExamTaskPicture;
|
|
||||||
import com.hig.exam.service.IExamTaskPictureService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试任务图片管理Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-18
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/exampicture")
|
|
||||||
public class ExamTaskPictureController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPictureService examTaskPictureService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:exampicture:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamTaskPicture> list = examTaskPictureService.selectExamTaskPictureList(examTaskPicture);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试任务图片管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:exampicture:export')")
|
|
||||||
@Log(title = "考试任务图片管理", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
List<ExamTaskPicture> list = examTaskPictureService.selectExamTaskPictureList(examTaskPicture);
|
|
||||||
ExcelUtil<ExamTaskPicture> util = new ExcelUtil<ExamTaskPicture>(ExamTaskPicture.class);
|
|
||||||
return util.exportExcel(list, "考试任务图片管理数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试任务图片管理详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:exampicture:query')")
|
|
||||||
@GetMapping(value = "/{photoCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("photoCode") String photoCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examTaskPictureService.selectExamTaskPictureById(photoCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试任务图片管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:exampicture:add')")
|
|
||||||
@Log(title = "考试任务图片管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPictureService.insertExamTaskPicture(examTaskPicture));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试任务图片管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:exampicture:edit')")
|
|
||||||
@Log(title = "考试任务图片管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPictureService.updateExamTaskPicture(examTaskPicture));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试任务图片管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('exam:exampicture:remove')")
|
|
||||||
@Log(title = "考试任务图片管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{photoCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] photoCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskPictureService.deleteExamTaskPictureByIds(photoCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
package com.hig.exam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.exam.domain.ExamTaskQuestions;
|
|
||||||
import com.hig.exam.service.IExamTaskQuestionsService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务题目Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/taskquestions")
|
|
||||||
public class ExamTaskQuestionsController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskQuestionsService examTaskQuestionsService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务题目列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamTaskQuestions examTaskQuestions)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamTaskQuestions> list = examTaskQuestionsService.selectExamTaskQuestionsList(examTaskQuestions);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出任务题目列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamTaskQuestions examTaskQuestions)
|
|
||||||
{
|
|
||||||
List<ExamTaskQuestions> list = examTaskQuestionsService.selectExamTaskQuestionsList(examTaskQuestions);
|
|
||||||
ExcelUtil<ExamTaskQuestions> util = new ExcelUtil<ExamTaskQuestions>(ExamTaskQuestions.class);
|
|
||||||
return util.exportExcel(list, "任务题目数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取任务题目详细信息
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examTaskQuestionsService.selectExamTaskQuestionsById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/batchupdate")
|
|
||||||
public AjaxResult batchUpdate(@RequestBody List<ExamTaskQuestions> examTaskQuestionsList)
|
|
||||||
{
|
|
||||||
int count = -1;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = examTaskQuestionsService.batchUpdateExamTaskQuestions(examTaskQuestionsList);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
return AjaxResult.success("更新成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务题目
|
|
||||||
*/
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamTaskQuestions examTaskQuestions)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskQuestionsService.updateExamTaskQuestions(examTaskQuestions));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务题目
|
|
||||||
*/
|
|
||||||
@GetMapping("/delete/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskQuestionsService.deleteExamTaskQuestionsByIds(examCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package com.hig.exam.domain;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ExamTaskData {
|
|
||||||
private ExamTaskManager examTaskManager;
|
|
||||||
private List<ExamTaskGroup> taskGroupList;
|
|
||||||
private List<ExamTaskQuestions> taskQuestionsList;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
package com.hig.exam.domain;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务分组对象 exam_task_group
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
public class ExamTaskGroup extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
@Excel(name = "考试代码")
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 分组代码 */
|
|
||||||
@Excel(name = "分组代码")
|
|
||||||
private String groupCode;
|
|
||||||
|
|
||||||
/** 排序编号 */
|
|
||||||
@Excel(name = "排序编号")
|
|
||||||
private Long orderId;
|
|
||||||
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setGroupCode(String groupCode)
|
|
||||||
{
|
|
||||||
this.groupCode = groupCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGroupCode()
|
|
||||||
{
|
|
||||||
return groupCode;
|
|
||||||
}
|
|
||||||
public void setOrderId(Long orderId)
|
|
||||||
{
|
|
||||||
this.orderId = orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getOrderId()
|
|
||||||
{
|
|
||||||
return orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("groupCode", getGroupCode())
|
|
||||||
.append("orderId", getOrderId())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,270 +0,0 @@
|
||||||
package com.hig.exam.domain;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建考试对象 exam_task_manager
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
public class ExamTaskManager extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试序号 */
|
|
||||||
@Excel(name = "考试序号")
|
|
||||||
private Long examId;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
@Excel(name = "考试代码")
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 考试名称 */
|
|
||||||
@Excel(name = "考试名称")
|
|
||||||
private String examName;
|
|
||||||
|
|
||||||
/** 考试说明 */
|
|
||||||
@Excel(name = "考试说明")
|
|
||||||
private String examDescribe;
|
|
||||||
|
|
||||||
/** 组卷方式 */
|
|
||||||
@Excel(name = "组卷方式")
|
|
||||||
private String buildType;
|
|
||||||
|
|
||||||
/** 强制抽卷 */
|
|
||||||
@Excel(name = "强制抽卷")
|
|
||||||
private String forceDone;
|
|
||||||
|
|
||||||
/** 考试题库 */
|
|
||||||
@Excel(name = "考试题库")
|
|
||||||
private String examBank;
|
|
||||||
|
|
||||||
/** 考试题库文字 */
|
|
||||||
@Excel(name = "考试题库文字")
|
|
||||||
private String examBankText;
|
|
||||||
|
|
||||||
@Excel(name = "考试类型1 固定时间考试 2固定时间段考试")
|
|
||||||
private Integer examType;
|
|
||||||
|
|
||||||
public Integer getExamType() {
|
|
||||||
return examType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExamType(Integer examType) {
|
|
||||||
this.examType = examType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExamTimes() {
|
|
||||||
return examTimes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExamTimes(Integer examTimes) {
|
|
||||||
this.examTimes = examTimes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Excel(name = "考试次数")
|
|
||||||
private Integer examTimes;
|
|
||||||
|
|
||||||
/** 图片链接 */
|
|
||||||
@Excel(name = "图片链接")
|
|
||||||
private String pictureUrl;
|
|
||||||
|
|
||||||
/** 开始时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
/** 结束时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date endTime;
|
|
||||||
|
|
||||||
|
|
||||||
/** 考试时长 */
|
|
||||||
@Excel(name = "考试时长")
|
|
||||||
private String examDuration;
|
|
||||||
|
|
||||||
/** 状态 */
|
|
||||||
@Excel(name = "状态")
|
|
||||||
private Long status;
|
|
||||||
|
|
||||||
private String startDateText;
|
|
||||||
|
|
||||||
public String getStartDateText() {
|
|
||||||
return startDateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStartDateText(String startDateText) {
|
|
||||||
this.startDateText = startDateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private String endDateText;
|
|
||||||
|
|
||||||
public String getEndDateText() {
|
|
||||||
return endDateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEndDateText(String endDateText) {
|
|
||||||
this.endDateText = endDateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 创建部门 */
|
|
||||||
private Long createDept;
|
|
||||||
|
|
||||||
public void setExamId(Long examId)
|
|
||||||
{
|
|
||||||
this.examId = examId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getExamId()
|
|
||||||
{
|
|
||||||
return examId;
|
|
||||||
}
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setExamName(String examName)
|
|
||||||
{
|
|
||||||
this.examName = examName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamName()
|
|
||||||
{
|
|
||||||
return examName;
|
|
||||||
}
|
|
||||||
public void setExamDescribe(String examDescribe)
|
|
||||||
{
|
|
||||||
this.examDescribe = examDescribe;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamDescribe()
|
|
||||||
{
|
|
||||||
return examDescribe;
|
|
||||||
}
|
|
||||||
public void setBuildType(String buildType)
|
|
||||||
{
|
|
||||||
this.buildType = buildType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBuildType()
|
|
||||||
{
|
|
||||||
return buildType;
|
|
||||||
}
|
|
||||||
public void setForceDone(String forceDone)
|
|
||||||
{
|
|
||||||
this.forceDone = forceDone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getForceDone()
|
|
||||||
{
|
|
||||||
return forceDone;
|
|
||||||
}
|
|
||||||
public void setExamBank(String examBank)
|
|
||||||
{
|
|
||||||
this.examBank = examBank;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamBank()
|
|
||||||
{
|
|
||||||
return examBank;
|
|
||||||
}
|
|
||||||
public void setPictureUrl(String pictureUrl)
|
|
||||||
{
|
|
||||||
this.pictureUrl = pictureUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExamBankText(String examBankText)
|
|
||||||
{
|
|
||||||
this.examBankText = examBankText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamBankText()
|
|
||||||
{
|
|
||||||
return examBankText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPictureUrl()
|
|
||||||
{
|
|
||||||
return pictureUrl;
|
|
||||||
}
|
|
||||||
public void setStartTime(Date startTime)
|
|
||||||
{
|
|
||||||
this.startTime = startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getStartTime()
|
|
||||||
{
|
|
||||||
return startTime;
|
|
||||||
}
|
|
||||||
public void setEndTime(Date endTime)
|
|
||||||
{
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getEndTime()
|
|
||||||
{
|
|
||||||
return endTime;
|
|
||||||
}
|
|
||||||
public void setExamDuration(String examDuration)
|
|
||||||
{
|
|
||||||
this.examDuration = examDuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamDuration()
|
|
||||||
{
|
|
||||||
return examDuration;
|
|
||||||
}
|
|
||||||
public void setStatus(Long status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
public void setCreateDept(Long createDept)
|
|
||||||
{
|
|
||||||
this.createDept = createDept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCreateDept()
|
|
||||||
{
|
|
||||||
return createDept;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examId", getExamId())
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("examName", getExamName())
|
|
||||||
.append("examDescribe", getExamDescribe())
|
|
||||||
.append("buildType", getBuildType())
|
|
||||||
.append("forceDone", getForceDone())
|
|
||||||
.append("examBank", getExamBank())
|
|
||||||
.append("examBankText", getExamBankText())
|
|
||||||
.append("pictureUrl", getPictureUrl())
|
|
||||||
.append("startTime", getStartTime())
|
|
||||||
.append("endTime", getEndTime())
|
|
||||||
.append("examDuration", getExamDuration())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createDept", getCreateDept())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,111 +0,0 @@
|
||||||
package com.hig.exam.domain;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试人员对象 exam_task_person
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-14
|
|
||||||
*/
|
|
||||||
public class ExamTaskPerson extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
@Excel(name = "考试代码")
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 考试人员 */
|
|
||||||
@Excel(name = "考试人员")
|
|
||||||
private String userCode;
|
|
||||||
|
|
||||||
/** 个人任务码 */
|
|
||||||
private String taskCode;
|
|
||||||
|
|
||||||
/** 开始时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
/** 结束时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date endTime;
|
|
||||||
|
|
||||||
/** 状态 */
|
|
||||||
@Excel(name = "状态")
|
|
||||||
private Long status;
|
|
||||||
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setuserCode(String userCode)
|
|
||||||
{
|
|
||||||
this.userCode = userCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getuserCode()
|
|
||||||
{
|
|
||||||
return userCode;
|
|
||||||
}
|
|
||||||
public void setTaskCode(String taskCode)
|
|
||||||
{
|
|
||||||
this.taskCode = taskCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTaskCode()
|
|
||||||
{
|
|
||||||
return taskCode;
|
|
||||||
}
|
|
||||||
public void setStartTime(Date startTime)
|
|
||||||
{
|
|
||||||
this.startTime = startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getStartTime()
|
|
||||||
{
|
|
||||||
return startTime;
|
|
||||||
}
|
|
||||||
public void setEndTime(Date endTime)
|
|
||||||
{
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getEndTime()
|
|
||||||
{
|
|
||||||
return endTime;
|
|
||||||
}
|
|
||||||
public void setStatus(Long status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("userCode", getuserCode())
|
|
||||||
.append("taskCode", getTaskCode())
|
|
||||||
.append("startTime", getStartTime())
|
|
||||||
.append("endTime", getEndTime())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,145 +0,0 @@
|
||||||
package com.hig.exam.domain;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试任务图片管理对象 exam_task_picture
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-18
|
|
||||||
*/
|
|
||||||
public class ExamTaskPicture extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 图片序号 */
|
|
||||||
private Long photoId;
|
|
||||||
|
|
||||||
/** 图片代码 */
|
|
||||||
private String photoCode;
|
|
||||||
|
|
||||||
/** 文档代码 */
|
|
||||||
@Excel(name = "文档代码")
|
|
||||||
private String photoPath;
|
|
||||||
|
|
||||||
/** 图片链接 */
|
|
||||||
@Excel(name = "图片链接")
|
|
||||||
private String photoUrl;
|
|
||||||
|
|
||||||
/** 文件名称 */
|
|
||||||
@Excel(name = "文件名称")
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
/** 原始名称 */
|
|
||||||
@Excel(name = "原始名称")
|
|
||||||
private String originalName;
|
|
||||||
|
|
||||||
private String createBy;
|
|
||||||
public String getCreateBy() {
|
|
||||||
return createBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateBy(String createBy) {
|
|
||||||
this.createBy = createBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 状态 */
|
|
||||||
@Excel(name = "状态")
|
|
||||||
private Long status;
|
|
||||||
|
|
||||||
public void setPhotoId(Long photoId)
|
|
||||||
{
|
|
||||||
this.photoId = photoId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getPhotoId()
|
|
||||||
{
|
|
||||||
return photoId;
|
|
||||||
}
|
|
||||||
public void setPhotoCode(String photoCode)
|
|
||||||
{
|
|
||||||
this.photoCode = photoCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPhotoCode()
|
|
||||||
{
|
|
||||||
return photoCode;
|
|
||||||
}
|
|
||||||
public void setPhotoPath(String photoPath)
|
|
||||||
{
|
|
||||||
this.photoPath = photoPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPhotoPath()
|
|
||||||
{
|
|
||||||
return photoPath;
|
|
||||||
}
|
|
||||||
public void setPhotoUrl(String photoUrl)
|
|
||||||
{
|
|
||||||
this.photoUrl = photoUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPhotoUrl()
|
|
||||||
{
|
|
||||||
return photoUrl;
|
|
||||||
}
|
|
||||||
public void setFileName(String fileName)
|
|
||||||
{
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileName()
|
|
||||||
{
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
public void setOriginalName(String originalName)
|
|
||||||
{
|
|
||||||
this.originalName = originalName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOriginalName()
|
|
||||||
{
|
|
||||||
return originalName;
|
|
||||||
}
|
|
||||||
public void setStatus(Long status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ExamTaskPicture(String photoCode, String photoPath, String photoUrl, String fileName, String originalName,
|
|
||||||
String createBy) {
|
|
||||||
super();
|
|
||||||
this.photoCode = photoCode;
|
|
||||||
this.photoPath = photoPath;
|
|
||||||
this.photoUrl = photoUrl;
|
|
||||||
this.fileName = fileName;
|
|
||||||
this.originalName = originalName;
|
|
||||||
this.createBy = createBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("photoId", getPhotoId())
|
|
||||||
.append("photoCode", getPhotoCode())
|
|
||||||
.append("photoPath", getPhotoPath())
|
|
||||||
.append("photoUrl", getPhotoUrl())
|
|
||||||
.append("fileName", getFileName())
|
|
||||||
.append("originalName", getOriginalName())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
package com.hig.exam.domain;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务题目对象 exam_task_questions
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-15
|
|
||||||
*/
|
|
||||||
public class ExamTaskQuestions extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
@Excel(name = "考试代码")
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 题目代码 */
|
|
||||||
@Excel(name = "题目代码")
|
|
||||||
private String questionsCode;
|
|
||||||
|
|
||||||
/** 题号 */
|
|
||||||
@Excel(name = "题号")
|
|
||||||
private int questionsNumber;
|
|
||||||
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setQuestionsCode(String questionsCode)
|
|
||||||
{
|
|
||||||
this.questionsCode = questionsCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuestionsCode()
|
|
||||||
{
|
|
||||||
return questionsCode;
|
|
||||||
}
|
|
||||||
public void setQuestionsNumber(int questionsNumber)
|
|
||||||
{
|
|
||||||
this.questionsNumber = questionsNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getQuestionsNumber()
|
|
||||||
{
|
|
||||||
return questionsNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("questionsCode", getQuestionsCode())
|
|
||||||
.append("questionsNumber", getQuestionsNumber())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.exam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskGroup;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务分组Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
public interface ExamTaskGroupMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询任务分组
|
|
||||||
*
|
|
||||||
* @param examCode 任务分组ID
|
|
||||||
* @return 任务分组
|
|
||||||
*/
|
|
||||||
public ExamTaskGroup selectExamTaskGroupById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务分组列表
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 任务分组集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskGroup> selectExamTaskGroupList(ExamTaskGroup examTaskGroup);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskGroup(ExamTaskGroup examTaskGroup);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskGroup(ExamTaskGroup examTaskGroup);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务分组
|
|
||||||
*
|
|
||||||
* @param examCode 任务分组ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskGroupById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务分组
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskGroupByIds(String[] examCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
package com.hig.exam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建考试Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
public interface ExamTaskManagerMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询创建考试
|
|
||||||
*
|
|
||||||
* @param examCode 创建考试ID
|
|
||||||
* @return 创建考试
|
|
||||||
*/
|
|
||||||
public ExamTaskManager selectExamTaskManagerById(String examCode);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询创建考试列表
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 创建考试集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskManager> selectExamTaskManagerList(ExamTaskManager examTaskManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增创建考试
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskManager(ExamTaskManager examTaskManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改创建考试
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskManager(ExamTaskManager examTaskManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除创建考试
|
|
||||||
*
|
|
||||||
* @param examCode 创建考试ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskManagerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除创建考试
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskManagerByIds(String[] examCodes);
|
|
||||||
|
|
||||||
public List<ExamTaskManager> selectCurrentExam(@Param("userCode") String userCode);
|
|
||||||
|
|
||||||
public List<ExamTaskManager> countExamScore(@Param("examCodeList") List<String> examCodeList);
|
|
||||||
|
|
||||||
public List<ExamTaskManager> groupExamTypeCount(@Param("examCodeList") List<String> examCodeList);
|
|
||||||
}
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
package com.hig.exam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskPerson;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试人员Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
public interface ExamTaskPersonMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试人员
|
|
||||||
*
|
|
||||||
* @param examCode 考试人员ID
|
|
||||||
* @return 考试人员
|
|
||||||
*/
|
|
||||||
public ExamTaskPerson selectExamTaskPersonById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 考试人员
|
|
||||||
*/
|
|
||||||
public ExamTaskPerson selectExamTaskPerson(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员列表
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 考试人员集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskPerson> selectExamTaskPersonList(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskPerson(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量拷贝考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int batchInsertPerson(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskPerson(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新考试开始时间
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateStartTime(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新完成状态
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDoneStatus(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试人员
|
|
||||||
*
|
|
||||||
* @param examCode 考试人员ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPersonById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试人员
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPersonByIds(String[] examCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.exam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskPicture;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试任务图片管理Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-18
|
|
||||||
*/
|
|
||||||
public interface ExamTaskPictureMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCode 考试任务图片管理ID
|
|
||||||
* @return 考试任务图片管理
|
|
||||||
*/
|
|
||||||
public ExamTaskPicture selectExamTaskPictureById(String photoCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理列表
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 考试任务图片管理集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskPicture> selectExamTaskPictureList(ExamTaskPicture examTaskPicture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskPicture(ExamTaskPicture examTaskPicture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskPicture(ExamTaskPicture examTaskPicture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCode 考试任务图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPictureById(String photoCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPictureByIds(String[] photoCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.exam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskQuestions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务题目Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
public interface ExamTaskQuestionsMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询任务题目
|
|
||||||
*
|
|
||||||
* @param examCode 任务题目ID
|
|
||||||
* @return 任务题目
|
|
||||||
*/
|
|
||||||
public ExamTaskQuestions selectExamTaskQuestionsById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务题目列表
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 任务题目集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskQuestions> selectExamTaskQuestionsList(ExamTaskQuestions examTaskQuestions);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务题目
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskQuestions(ExamTaskQuestions examTaskQuestions);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务题目
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskQuestions(ExamTaskQuestions examTaskQuestions);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务题目
|
|
||||||
*
|
|
||||||
* @param examCode 任务题目ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskQuestionsById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务题目
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskQuestionsByIds(String[] examCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package com.hig.exam.service;
|
|
||||||
|
|
||||||
import com.hig.exam.domain.ExamTaskData;
|
|
||||||
|
|
||||||
public interface IExamTaskDataService {
|
|
||||||
public int saveData(ExamTaskData examTaskData) throws Exception;
|
|
||||||
}
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.hig.exam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskGroup;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务分组Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
public interface IExamTaskGroupService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询任务分组
|
|
||||||
*
|
|
||||||
* @param examCode 任务分组ID
|
|
||||||
* @return 任务分组
|
|
||||||
*/
|
|
||||||
public ExamTaskGroup selectExamTaskGroupById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务分组列表
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 任务分组集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskGroup> selectExamTaskGroupList(ExamTaskGroup examTaskGroup);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskGroup(ExamTaskGroup examTaskGroup);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskGroup(ExamTaskGroup examTaskGroup);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public int batchUpdateExamTaskGroup(List<ExamTaskGroup> examTaskGroupList) throws Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务分组
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的任务分组ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskGroupByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务分组信息
|
|
||||||
*
|
|
||||||
* @param examCode 任务分组ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskGroupById(String examCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
package com.hig.exam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamTitleData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建考试Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
public interface IExamTaskManagerService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询创建考试
|
|
||||||
*
|
|
||||||
* @param examCode 创建考试ID
|
|
||||||
* @return 创建考试
|
|
||||||
*/
|
|
||||||
public ExamTaskManager selectExamTaskManagerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询创建考试列表
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 创建考试集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskManager> selectExamTaskManagerList(ExamTaskManager examTaskManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增创建考试
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskManager(ExamTaskManager examTaskManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改创建考试
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskManager(ExamTaskManager examTaskManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除创建考试
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的创建考试ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskManagerByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除创建考试信息
|
|
||||||
*
|
|
||||||
* @param examCode 创建考试ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskManagerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前用户可以参加的考试
|
|
||||||
* @param userCode
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<ExamTitleData> selectCurrentExam(String userCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
package com.hig.exam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.exam.domain.ExamTaskPerson;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试人员Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
public interface IExamTaskPersonService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试人员
|
|
||||||
*
|
|
||||||
* @param examCode 考试人员ID
|
|
||||||
* @return 考试人员
|
|
||||||
*/
|
|
||||||
public ExamTaskPerson selectExamTaskPersonById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 考试人员
|
|
||||||
*/
|
|
||||||
public ExamTaskPerson selectExamTaskPerson(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员列表
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 考试人员集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskPerson> selectExamTaskPersonList(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskPerson(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量拷贝考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int batchInsertPerson(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskPerson(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新考试开始时间
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateStartTime(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新完成状态
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateDoneStatus(ExamTaskPerson examTaskPerson);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试人员
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试人员ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPersonByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试人员信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试人员ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPersonById(String examCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.exam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskPicture;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试任务图片管理Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-18
|
|
||||||
*/
|
|
||||||
public interface IExamTaskPictureService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCode 考试任务图片管理ID
|
|
||||||
* @return 考试任务图片管理
|
|
||||||
*/
|
|
||||||
public ExamTaskPicture selectExamTaskPictureById(String photoCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理列表
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 考试任务图片管理集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskPicture> selectExamTaskPictureList(ExamTaskPicture examTaskPicture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskPicture(ExamTaskPicture examTaskPicture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskPicture(ExamTaskPicture examTaskPicture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCodes 需要删除的考试任务图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPictureByIds(String[] photoCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试任务图片管理信息
|
|
||||||
*
|
|
||||||
* @param photoCode 考试任务图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskPictureById(String photoCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package com.hig.exam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.exam.domain.ExamTaskQuestions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务题目Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
public interface IExamTaskQuestionsService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询任务题目
|
|
||||||
*
|
|
||||||
* @param examCode 任务题目ID
|
|
||||||
* @return 任务题目
|
|
||||||
*/
|
|
||||||
public ExamTaskQuestions selectExamTaskQuestionsById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务题目列表
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 任务题目集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskQuestions> selectExamTaskQuestionsList(ExamTaskQuestions examTaskQuestions);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务题目
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskQuestions(ExamTaskQuestions examTaskQuestions);
|
|
||||||
|
|
||||||
public int batchUpdateExamTaskQuestions(List<ExamTaskQuestions> examTaskQuestionsList) throws Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务题目
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskQuestions(ExamTaskQuestions examTaskQuestions);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务题目
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的任务题目ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskQuestionsByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务题目信息
|
|
||||||
*
|
|
||||||
* @param examCode 任务题目ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskQuestionsById(String examCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
package com.hig.exam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.hig.exam.domain.ExamTaskData;
|
|
||||||
import com.hig.exam.domain.ExamTaskGroup;
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.exam.domain.ExamTaskQuestions;
|
|
||||||
import com.hig.exam.service.IExamTaskDataService;
|
|
||||||
import com.hig.exam.service.IExamTaskGroupService;
|
|
||||||
import com.hig.exam.service.IExamTaskManagerService;
|
|
||||||
import com.hig.exam.service.IExamTaskPersonService;
|
|
||||||
import com.hig.exam.service.IExamTaskQuestionsService;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ExamTaskDataServiceImpl implements IExamTaskDataService {
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskGroupService examTaskGroupService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskManagerService examTaskManagerService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskQuestionsService examTaskQuestionsService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPersonService examTaskPersonService;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int saveData(ExamTaskData examTaskData) throws Exception {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ExamTaskManager examTaskManager = examTaskData.getExamTaskManager();
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 安全删除
|
|
||||||
examTaskManagerService.deleteExamTaskManagerById(examTaskManager.getExamCode());
|
|
||||||
|
|
||||||
// 保存数据
|
|
||||||
count = examTaskManagerService.insertExamTaskManager(examTaskManager);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存属性出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ExamTaskQuestions> questionsList = examTaskData.getTaskQuestionsList();
|
|
||||||
|
|
||||||
// 安全删除
|
|
||||||
examTaskQuestionsService.deleteExamTaskQuestionsById(examTaskManager.getExamCode());
|
|
||||||
|
|
||||||
for(ExamTaskQuestions examTaskQuestions: questionsList) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = examTaskQuestionsService.insertExamTaskQuestions(examTaskQuestions);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存题目信息出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ExamTaskGroup> groupList = examTaskData.getTaskGroupList();
|
|
||||||
|
|
||||||
// 安全删除
|
|
||||||
examTaskGroupService.deleteExamTaskGroupById(examTaskManager.getExamCode());
|
|
||||||
|
|
||||||
for (ExamTaskGroup examTaskGroup: groupList) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = examTaskGroupService.insertExamTaskGroup(examTaskGroup);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存分组信息出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 安全删除
|
|
||||||
examTaskPersonService.deleteExamTaskPersonById(examTaskManager.getExamCode());
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = examTaskPersonService.batchInsertPerson(examTaskManager.getExamCode());
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存考试人员信息出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
package com.hig.exam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.exam.mapper.ExamTaskGroupMapper;
|
|
||||||
import com.hig.exam.domain.ExamTaskGroup;
|
|
||||||
import com.hig.exam.service.IExamTaskGroupService;
|
|
||||||
import com.hig.exam.service.IExamTaskPersonService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务分组Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamTaskGroupServiceImpl implements IExamTaskGroupService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamTaskGroupMapper examTaskGroupMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPersonService examTaskPersonService;
|
|
||||||
/**
|
|
||||||
* 查询任务分组
|
|
||||||
*
|
|
||||||
* @param examCode 任务分组ID
|
|
||||||
* @return 任务分组
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamTaskGroup selectExamTaskGroupById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskGroupMapper.selectExamTaskGroupById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务分组列表
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 任务分组
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTaskGroup> selectExamTaskGroupList(ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
return examTaskGroupMapper.selectExamTaskGroupList(examTaskGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamTaskGroup(ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
return examTaskGroupMapper.insertExamTaskGroup(examTaskGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务分组
|
|
||||||
*
|
|
||||||
* @param examTaskGroup 任务分组
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamTaskGroup(ExamTaskGroup examTaskGroup)
|
|
||||||
{
|
|
||||||
return examTaskGroupMapper.updateExamTaskGroup(examTaskGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务分组
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的任务分组ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskGroupByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
return examTaskGroupMapper.deleteExamTaskGroupByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务分组信息
|
|
||||||
*
|
|
||||||
* @param examCode 任务分组ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskGroupById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskGroupMapper.deleteExamTaskGroupById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int batchUpdateExamTaskGroup(List<ExamTaskGroup> examTaskGroupList) throws Exception {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// 安全删除
|
|
||||||
int count = 0;
|
|
||||||
String examCode = examTaskGroupList.get(0).getExamCode();
|
|
||||||
examTaskGroupMapper.deleteExamTaskGroupById(examCode);
|
|
||||||
|
|
||||||
for (ExamTaskGroup examTaskGroup: examTaskGroupList) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = examTaskGroupMapper.insertExamTaskGroup(examTaskGroup);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存分组信息出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 安全删除
|
|
||||||
examTaskPersonService.deleteExamTaskPersonById(examCode);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = examTaskPersonService.batchInsertPerson(examCode);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存考试人员信息出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
||||||
package com.hig.exam.service.impl;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateField;
|
|
||||||
import cn.hutool.core.date.DateTime;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamTitleData;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.exam.mapper.ExamTaskManagerMapper;
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.exam.service.IExamTaskGroupService;
|
|
||||||
import com.hig.exam.service.IExamTaskManagerService;
|
|
||||||
import com.hig.exam.service.IExamTaskPersonService;
|
|
||||||
import com.hig.exam.service.IExamTaskQuestionsService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建考试Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamTaskManagerServiceImpl implements IExamTaskManagerService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamTaskManagerMapper examTaskManagerMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskGroupService examTaskGroupService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskQuestionsService examTaskQuestionsService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPersonService examTaskPersonService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询创建考试
|
|
||||||
*
|
|
||||||
* @param examCode 创建考试ID
|
|
||||||
* @return 创建考试
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamTaskManager selectExamTaskManagerById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskManagerMapper.selectExamTaskManagerById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询创建考试列表
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 创建考试
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTaskManager> selectExamTaskManagerList(ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
return examTaskManagerMapper.selectExamTaskManagerList(examTaskManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增创建考试
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamTaskManager(ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
examTaskManager.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return examTaskManagerMapper.insertExamTaskManager(examTaskManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改创建考试
|
|
||||||
*
|
|
||||||
* @param examTaskManager 创建考试
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamTaskManager(ExamTaskManager examTaskManager)
|
|
||||||
{
|
|
||||||
return examTaskManagerMapper.updateExamTaskManager(examTaskManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除创建考试
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的创建考试ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskManagerByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
// 删除题目
|
|
||||||
examTaskQuestionsService.deleteExamTaskQuestionsByIds(examCodes);
|
|
||||||
// 删除人员分组
|
|
||||||
examTaskGroupService.deleteExamTaskGroupByIds(examCodes);
|
|
||||||
// 删除人员
|
|
||||||
examTaskPersonService.deleteExamTaskPersonByIds(examCodes);
|
|
||||||
|
|
||||||
return examTaskManagerMapper.deleteExamTaskManagerByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除创建考试信息
|
|
||||||
*
|
|
||||||
* @param examCode 创建考试ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskManagerById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskManagerMapper.deleteExamTaskManagerById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前用户可以参加的考试
|
|
||||||
* @param userCode
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTitleData> selectCurrentExam(String userCode) {
|
|
||||||
//先根据当前时间和startDate和endDate过滤一下
|
|
||||||
List<ExamTaskManager> list=examTaskManagerMapper.selectCurrentExam(userCode);
|
|
||||||
List<ExamTitleData> retList=new ArrayList<>();
|
|
||||||
List<String> examCodeList=new ArrayList<>();
|
|
||||||
for(ExamTaskManager examTaskManager:list){
|
|
||||||
if(examTaskManager.getExamType()==1){
|
|
||||||
if(!checkCanRun(examTaskManager)){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
|
|
||||||
}
|
|
||||||
ExamTitleData ed=new ExamTitleData();
|
|
||||||
examCodeList.add(examTaskManager.getExamCode());
|
|
||||||
// 使用 Hutool 的 BeanUtil.copyProperties 方法复制属性
|
|
||||||
BeanUtil.copyProperties(examTaskManager, ed);
|
|
||||||
retList.add(ed);
|
|
||||||
}
|
|
||||||
List<ExamTaskManager> listScore=examTaskManagerMapper.countExamScore(examCodeList);
|
|
||||||
List<ExamTaskManager> listTypeCount=examTaskManagerMapper.groupExamTypeCount(examCodeList);
|
|
||||||
for(ExamTitleData item :retList){
|
|
||||||
List<ExamTaskManager> tmp= listScore.stream().filter(d->d.getExamCode().equals(item.getExamCode())).collect(Collectors.toList());
|
|
||||||
if(tmp.size()>0){
|
|
||||||
item.setQuestionsScore(tmp.get(0).getExamType());
|
|
||||||
}
|
|
||||||
tmp=listTypeCount.stream().filter(d->d.getExamCode().equals(item.getExamCode()) && d.getExamId()==1).collect(Collectors.toList());
|
|
||||||
if(tmp.size()>0){
|
|
||||||
item.setJudgeNumber(tmp.get(0).getExamType());
|
|
||||||
}
|
|
||||||
tmp=listTypeCount.stream().filter(d->d.getExamCode().equals(item.getExamCode()) && d.getExamId()==2).collect(Collectors.toList());
|
|
||||||
if(tmp.size()>0){
|
|
||||||
item.setRadioNumber(tmp.get(0).getExamType());
|
|
||||||
}
|
|
||||||
tmp=listTypeCount.stream().filter(d->d.getExamCode().equals(item.getExamCode()) && d.getExamId()==3).collect(Collectors.toList());
|
|
||||||
if(tmp.size()>0){
|
|
||||||
item.setChoiceNumber(tmp.get(0).getExamType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean checkCanRun(ExamTaskManager examTaskManager) {
|
|
||||||
//开始时间+考试时长 小于当前时间表示考试已发结束,大于表示还可能继续考试
|
|
||||||
DateTime dtStart=new DateTime( examTaskManager.getStartTime());
|
|
||||||
String sp=examTaskManager.getExamDuration();
|
|
||||||
String[] timeParts = sp.split(":");
|
|
||||||
int hours = Integer.parseInt(timeParts[0]);
|
|
||||||
int minutes = Integer.parseInt(timeParts[1]);
|
|
||||||
// 计算结束时间
|
|
||||||
DateTime endDateTime = dtStart.offset(DateField.HOUR_OF_DAY, hours)
|
|
||||||
.offset(DateField.MINUTE, minutes);
|
|
||||||
return endDateTime.isAfter(DateUtils.getNowDate());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,125 +0,0 @@
|
||||||
package com.hig.exam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.exam.mapper.ExamTaskPersonMapper;
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.exam.domain.ExamTaskPerson;
|
|
||||||
import com.hig.exam.service.IExamTaskPersonService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试人员Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-06
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamTaskPersonServiceImpl implements IExamTaskPersonService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamTaskPersonMapper examTaskPersonMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员
|
|
||||||
*
|
|
||||||
* @param examCode 考试人员ID
|
|
||||||
* @return 考试人员
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamTaskPerson selectExamTaskPersonById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskPersonMapper.selectExamTaskPersonById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试人员列表
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 考试人员
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTaskPerson> selectExamTaskPersonList(ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
return examTaskPersonMapper.selectExamTaskPersonList(examTaskPerson);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamTaskPerson(ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
return examTaskPersonMapper.insertExamTaskPerson(examTaskPerson);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试人员
|
|
||||||
*
|
|
||||||
* @param examTaskPerson 考试人员
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamTaskPerson(ExamTaskPerson examTaskPerson)
|
|
||||||
{
|
|
||||||
return examTaskPersonMapper.updateExamTaskPerson(examTaskPerson);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试人员
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试人员ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskPersonByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
return examTaskPersonMapper.deleteExamTaskPersonByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试人员信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试人员ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskPersonById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskPersonMapper.deleteExamTaskPersonById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int batchInsertPerson(String examCode) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examTaskPersonMapper.batchInsertPerson(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateStartTime(ExamTaskPerson examTaskPerson) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
ExamTaskPerson taskPerson = examTaskPersonMapper.selectExamTaskPerson(examTaskPerson);
|
|
||||||
|
|
||||||
if (taskPerson != null && taskPerson.getStartTime() == null) {
|
|
||||||
examTaskPersonMapper.updateStartTime(examTaskPerson);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ExamTaskPerson selectExamTaskPerson(ExamTaskPerson examTaskPerson) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examTaskPersonMapper.selectExamTaskPerson(examTaskPerson);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateDoneStatus(ExamTaskPerson examTaskPerson) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examTaskPersonMapper.updateDoneStatus(examTaskPerson);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
package com.hig.exam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.exam.mapper.ExamTaskPictureMapper;
|
|
||||||
import com.hig.exam.domain.ExamTaskPicture;
|
|
||||||
import com.hig.exam.service.IExamTaskPictureService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试任务图片管理Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-01-18
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamTaskPictureServiceImpl implements IExamTaskPictureService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamTaskPictureMapper examTaskPictureMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCode 考试任务图片管理ID
|
|
||||||
* @return 考试任务图片管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamTaskPicture selectExamTaskPictureById(String photoCode)
|
|
||||||
{
|
|
||||||
return examTaskPictureMapper.selectExamTaskPictureById(photoCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试任务图片管理列表
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 考试任务图片管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTaskPicture> selectExamTaskPictureList(ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
return examTaskPictureMapper.selectExamTaskPictureList(examTaskPicture);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamTaskPicture(ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
examTaskPicture.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return examTaskPictureMapper.insertExamTaskPicture(examTaskPicture);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param examTaskPicture 考试任务图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamTaskPicture(ExamTaskPicture examTaskPicture)
|
|
||||||
{
|
|
||||||
return examTaskPictureMapper.updateExamTaskPicture(examTaskPicture);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试任务图片管理
|
|
||||||
*
|
|
||||||
* @param photoCodes 需要删除的考试任务图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskPictureByIds(String[] photoCodes)
|
|
||||||
{
|
|
||||||
return examTaskPictureMapper.deleteExamTaskPictureByIds(photoCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试任务图片管理信息
|
|
||||||
*
|
|
||||||
* @param photoCode 考试任务图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskPictureById(String photoCode)
|
|
||||||
{
|
|
||||||
return examTaskPictureMapper.deleteExamTaskPictureById(photoCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
package com.hig.exam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.exam.mapper.ExamTaskQuestionsMapper;
|
|
||||||
import com.hig.exam.domain.ExamTaskQuestions;
|
|
||||||
import com.hig.exam.service.IExamTaskQuestionsService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务题目Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-10
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamTaskQuestionsServiceImpl implements IExamTaskQuestionsService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamTaskQuestionsMapper examTaskQuestionsMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务题目
|
|
||||||
*
|
|
||||||
* @param examCode 任务题目ID
|
|
||||||
* @return 任务题目
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamTaskQuestions selectExamTaskQuestionsById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskQuestionsMapper.selectExamTaskQuestionsById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务题目列表
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 任务题目
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTaskQuestions> selectExamTaskQuestionsList(ExamTaskQuestions examTaskQuestions)
|
|
||||||
{
|
|
||||||
return examTaskQuestionsMapper.selectExamTaskQuestionsList(examTaskQuestions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增任务题目
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamTaskQuestions(ExamTaskQuestions examTaskQuestions)
|
|
||||||
{
|
|
||||||
return examTaskQuestionsMapper.insertExamTaskQuestions(examTaskQuestions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务题目
|
|
||||||
*
|
|
||||||
* @param examTaskQuestions 任务题目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamTaskQuestions(ExamTaskQuestions examTaskQuestions)
|
|
||||||
{
|
|
||||||
return examTaskQuestionsMapper.updateExamTaskQuestions(examTaskQuestions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务题目
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的任务题目ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskQuestionsByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
return examTaskQuestionsMapper.deleteExamTaskQuestionsByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务题目信息
|
|
||||||
*
|
|
||||||
* @param examCode 任务题目ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskQuestionsById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskQuestionsMapper.deleteExamTaskQuestionsById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int batchUpdateExamTaskQuestions(List<ExamTaskQuestions> examTaskQuestionsList) throws Exception {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// 安全删除
|
|
||||||
|
|
||||||
examTaskQuestionsMapper.deleteExamTaskQuestionsById(examTaskQuestionsList.get(0).getExamCode());
|
|
||||||
|
|
||||||
for(ExamTaskQuestions examTaskQuestions: examTaskQuestionsList) {
|
|
||||||
try
|
|
||||||
{
|
|
||||||
examTaskQuestionsMapper.insertExamTaskQuestions(examTaskQuestions);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
throw new Exception("保存题目信息出错,信息:" + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package com.hig.fms.common;
|
|
||||||
|
|
||||||
public class NotSameFileExpection extends Exception {
|
|
||||||
public NotSameFileExpection() {
|
|
||||||
super("File MD5 Different");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,196 +0,0 @@
|
||||||
package com.hig.fms.controller;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.cms.utils.FileUpload;
|
|
||||||
import com.hig.fms.common.NotSameFileExpection;
|
|
||||||
import com.hig.fms.domain.FmsFiles;
|
|
||||||
import com.hig.fms.domain.MultipartFileParam;
|
|
||||||
import com.hig.fms.domain.dto.StdOut;
|
|
||||||
import com.hig.fms.service.ChunkService;
|
|
||||||
import com.hig.fms.service.IFmsFilesService;
|
|
||||||
import com.hig.utils.DateUtils;
|
|
||||||
import com.hig.utils.UUIDGenerator;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件管理Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-17
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/fms/files")
|
|
||||||
public class FmsFilesController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IFmsFilesService fmsFilesService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ChunkService chunkService;
|
|
||||||
|
|
||||||
@Value("${cms.files.photo-path}")
|
|
||||||
private String filespath;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文件管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:files:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<FmsFiles> list = fmsFilesService.selectFmsFilesList(fmsFiles);
|
|
||||||
// System.out.println("文件列表:" + list.toString());
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出文件管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:files:export')")
|
|
||||||
@Log(title = "文件管理", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
List<FmsFiles> list = fmsFilesService.selectFmsFilesList(fmsFiles);
|
|
||||||
ExcelUtil<FmsFiles> util = new ExcelUtil<FmsFiles>(FmsFiles.class);
|
|
||||||
return util.exportExcel(list, "文件管理数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件管理详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:files:query')")
|
|
||||||
@GetMapping(value = "/{fileId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("fileId") Long fileId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(fmsFilesService.selectFmsFilesById(fileId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增文件管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:files:add')")
|
|
||||||
@Log(title = "文件管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
return toAjax(fmsFilesService.insertFmsFiles(fmsFiles));
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping("/chunkupload/{guid}/{username}")
|
|
||||||
// @PostMapping(value = "/chunkupload")
|
|
||||||
public StdOut chunkUpload(@PathVariable String guid,@PathVariable String username,MultipartFileParam param, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
StdOut out = new StdOut();
|
|
||||||
|
|
||||||
// 在此更换路径
|
|
||||||
// File file = new File("D:\\chunk_test");//存储路径
|
|
||||||
// 拼接路径
|
|
||||||
String fileurl = filespath + "/" + DateUtils.toDateString() + "/" + guid ;
|
|
||||||
// System.out.println("拼接地址为:" + fileurl);
|
|
||||||
String filepath = RuoYiConfig.getProfile() + fileurl;
|
|
||||||
// System.out.println("拼接路径为:" + filepath);
|
|
||||||
File file = new File(filepath);//存储路径
|
|
||||||
|
|
||||||
|
|
||||||
String path = file.getAbsolutePath();
|
|
||||||
response.setContentType("text/html;charset=UTF-8");
|
|
||||||
|
|
||||||
try {
|
|
||||||
//判断前端Form表单格式是否支持文件上传
|
|
||||||
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
|
||||||
if (!isMultipart) {
|
|
||||||
out.setCode(StdOut.PARAMETER_NULL);
|
|
||||||
out.setMessage("表单格式错误");
|
|
||||||
return out;
|
|
||||||
} else {
|
|
||||||
param.setTaskId(param.getIdentifier());
|
|
||||||
out.setModel(chunkService.chunkUploadByMappedByteBuffer(param, path));
|
|
||||||
// System.out.println("保存后:" + out.toString());
|
|
||||||
if (out.getModel() != null) {
|
|
||||||
// System.out.println("文件名:" + out.getModel().toString());
|
|
||||||
// 保存文件信息
|
|
||||||
// 取得文件名
|
|
||||||
String filename = out.getModel().toString();
|
|
||||||
// 取文件类型
|
|
||||||
String suffix = getSuffix(filename);
|
|
||||||
|
|
||||||
// 开始保存
|
|
||||||
// String fileTitle, String fileDescribe, String fileName, String filePath, String fileUrl,
|
|
||||||
// String fileSuffix, String originalName, String uploadName
|
|
||||||
FmsFiles fmsFiles = new FmsFiles(null, null, filename, filepath, fileurl, suffix, filename, username);
|
|
||||||
System.out.println(fmsFiles.toString());
|
|
||||||
int count = fmsFilesService.insertFmsFiles(fmsFiles);
|
|
||||||
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
} catch (NotSameFileExpection e) {
|
|
||||||
out.setCode(StdOut.FAIL);
|
|
||||||
out.setMessage("MD5校验失败");
|
|
||||||
return out;
|
|
||||||
} catch (Exception e) {
|
|
||||||
out.setCode(StdOut.FAIL);
|
|
||||||
out.setMessage("上传失败");
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getSuffix(String filename) {
|
|
||||||
String suffix = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
suffix = filename.substring(filename.lastIndexOf(".") + 1);
|
|
||||||
}
|
|
||||||
catch(Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return suffix;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 修改文件管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:files:edit')")
|
|
||||||
@Log(title = "文件管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
System.out.println("fmsFiles:" + fmsFiles.toString());
|
|
||||||
return toAjax(fmsFilesService.updateFmsFiles(fmsFiles));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文件管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:files:remove')")
|
|
||||||
@Log(title = "文件管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{fileIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] fileIds)
|
|
||||||
{
|
|
||||||
return toAjax(fmsFilesService.deleteFmsFilesByIds(fileIds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,179 +0,0 @@
|
||||||
package com.hig.fms.controller;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.cms.utils.FileUpload;
|
|
||||||
import com.hig.fms.domain.FmsPhoto;
|
|
||||||
import com.hig.fms.service.IFmsPhotoService;
|
|
||||||
import com.hig.utils.DateUtils;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片管理Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-14
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/fms/photo")
|
|
||||||
public class FmsPhotoController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IFmsPhotoService fmsPhotoService;
|
|
||||||
|
|
||||||
@Value("${cms.fms.photo-path}")
|
|
||||||
private String fmspath;
|
|
||||||
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询图片管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:photo:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(FmsPhoto fmsPhoto)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<FmsPhoto> list = fmsPhotoService.selectFmsPhotoList(fmsPhoto);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出图片管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:photo:export')")
|
|
||||||
@Log(title = "图片管理", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(FmsPhoto fmsPhoto)
|
|
||||||
{
|
|
||||||
List<FmsPhoto> list = fmsPhotoService.selectFmsPhotoList(fmsPhoto);
|
|
||||||
ExcelUtil<FmsPhoto> util = new ExcelUtil<FmsPhoto>(FmsPhoto.class);
|
|
||||||
return util.exportExcel(list, "图片管理数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取图片管理详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:photo:query')")
|
|
||||||
@GetMapping(value = "/{photoId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("photoId") Long photoId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(fmsPhotoService.selectFmsPhotoById(photoId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增图片管理
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasPermi('fms:photo:add')")
|
|
||||||
// @Log(title = "图片管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping(value = "/add/{username}")
|
|
||||||
public AjaxResult add(@PathVariable String username,@RequestParam("file") MultipartFile file)
|
|
||||||
{
|
|
||||||
if (username == null || username.trim().equals("")) {
|
|
||||||
return AjaxResult.error("用户名不能为空");
|
|
||||||
}
|
|
||||||
System.out.println("当前日期:" + DateUtils.toDateString());
|
|
||||||
// 取得原始文件名
|
|
||||||
String originalfile = file.getOriginalFilename();
|
|
||||||
|
|
||||||
// 拼接路径
|
|
||||||
String path = RuoYiConfig.getProfile() + fmspath + "/" + DateUtils.toDateString();
|
|
||||||
System.out.println("拼接路径为:" + path);
|
|
||||||
String filename = FileUpload.writeUploadFile(file,path);
|
|
||||||
String fileurl = fmspath + "/" + DateUtils.toDateString() + "/" + filename;
|
|
||||||
System.out.println(fileurl);
|
|
||||||
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
// System.out.println("photoid:" + swipperid);
|
|
||||||
|
|
||||||
System.out.println("RuoYiConfig.getProfile()" + RuoYiConfig.getProfile());
|
|
||||||
|
|
||||||
/*LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
SysUser user = loginUser.getUser();
|
|
||||||
|
|
||||||
System.out.println("取得用户信息:" + user.toString());*/
|
|
||||||
|
|
||||||
// String fileName, String photoPath, String photoUrl, String originalName, String uploadName,String uploadDept, Long status
|
|
||||||
FmsPhoto fmsPhoto = new FmsPhoto(filename, path, fileurl, originalfile, username, "", (long) 0);
|
|
||||||
|
|
||||||
// System.out.println("fmsPhoto:" + fmsPhoto.toString());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return toAjax(fmsPhotoService.insertFmsPhoto(fmsPhoto));
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
// select photo_id,file_name,photo_path,photo_url,original_name,upload_name,upload_dept,upload_time,status from fms_photo;
|
|
||||||
|
|
||||||
// 相应赋值
|
|
||||||
//int photoId, int swipperId, String photoPath, String photoUrl, String fileName,String originalName
|
|
||||||
|
|
||||||
/*SysSwipper sysSwipper = new SysSwipper(Integer.parseInt(swipperid), path, fileurl, filename, originalfile);
|
|
||||||
|
|
||||||
System.out.println("sysSwipper:" + sysSwipper.toString());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
count = swipperService.insertSwipper(sysSwipper);
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// FmsPhoto fmsPhoto
|
|
||||||
|
|
||||||
// return AjaxResult.success(sysSwipper);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改图片管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:photo:edit')")
|
|
||||||
@Log(title = "图片管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody FmsPhoto fmsPhoto)
|
|
||||||
{
|
|
||||||
return toAjax(fmsPhotoService.updateFmsPhoto(fmsPhoto));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除图片管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('fms:photo:remove')")
|
|
||||||
@Log(title = "图片管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{photoIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] photoIds)
|
|
||||||
{
|
|
||||||
return toAjax(fmsPhotoService.deleteFmsPhotoByIds(photoIds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
package com.hig.fms.domain;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class FmsFiles {
|
|
||||||
/** 文件序号 */
|
|
||||||
private int fileId;
|
|
||||||
|
|
||||||
/** 文件标题 */
|
|
||||||
@Excel(name = "文件标题")
|
|
||||||
private String fileTitle;
|
|
||||||
|
|
||||||
/** 文件描述 */
|
|
||||||
@Excel(name = "文件描述")
|
|
||||||
private String fileDescribe;
|
|
||||||
|
|
||||||
/** 文件名称 */
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
/** 文件路径 */
|
|
||||||
private String filePath;
|
|
||||||
|
|
||||||
/** 文件链接 */
|
|
||||||
private String fileUrl;
|
|
||||||
|
|
||||||
/** 文件类型 */
|
|
||||||
private String fileSuffix;
|
|
||||||
|
|
||||||
/** 原始名称 */
|
|
||||||
private String originalName;
|
|
||||||
|
|
||||||
/** 上传者 */
|
|
||||||
@Excel(name = "上传者")
|
|
||||||
private String uploadName;
|
|
||||||
|
|
||||||
/** 上传部门 */
|
|
||||||
private String uploadDept;
|
|
||||||
|
|
||||||
/** 上传时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date uploadTime;
|
|
||||||
|
|
||||||
/** 状态 */
|
|
||||||
private int status;
|
|
||||||
|
|
||||||
public FmsFiles() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public FmsFiles(String fileTitle, String fileDescribe, String fileName, String filePath, String fileUrl,
|
|
||||||
String fileSuffix, String originalName, String uploadName) {
|
|
||||||
super();
|
|
||||||
this.fileTitle = fileTitle;
|
|
||||||
this.fileDescribe = fileDescribe;
|
|
||||||
this.fileName = fileName;
|
|
||||||
this.filePath = filePath;
|
|
||||||
this.fileUrl = fileUrl;
|
|
||||||
this.fileSuffix = fileSuffix;
|
|
||||||
this.originalName = originalName;
|
|
||||||
this.uploadName = uploadName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this)
|
|
||||||
.append("fileId", getFileId())
|
|
||||||
.append("fileTitle", getFileTitle())
|
|
||||||
.append("fileDescribe", getFileDescribe())
|
|
||||||
.append("fileName", getFileName())
|
|
||||||
.append("filePath", getFilePath())
|
|
||||||
.append("fileUrl", getFileUrl())
|
|
||||||
.append("fileSuffix", getFileSuffix())
|
|
||||||
.append("originalName", getOriginalName())
|
|
||||||
.append("uploadName", getUploadName())
|
|
||||||
.append("uploadDept", getUploadDept())
|
|
||||||
.append("uploadTime", getUploadTime())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,166 +0,0 @@
|
||||||
package com.hig.fms.domain;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片管理对象 fms_photo
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-14
|
|
||||||
*/
|
|
||||||
public class FmsPhoto extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 图片序号 */
|
|
||||||
@Excel(name = "图片序号")
|
|
||||||
private Long photoId;
|
|
||||||
|
|
||||||
/** 文件名称 */
|
|
||||||
@Excel(name = "文件名称")
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
/** 图片路径 */
|
|
||||||
@Excel(name = "图片路径")
|
|
||||||
private String photoPath;
|
|
||||||
|
|
||||||
/** 图片链接 */
|
|
||||||
@Excel(name = "图片链接")
|
|
||||||
private String photoUrl;
|
|
||||||
|
|
||||||
/** 原始名称 */
|
|
||||||
@Excel(name = "原始名称")
|
|
||||||
private String originalName;
|
|
||||||
|
|
||||||
/** 上传者 */
|
|
||||||
@Excel(name = "上传者")
|
|
||||||
private String uploadName;
|
|
||||||
|
|
||||||
/** 上传部门 */
|
|
||||||
@Excel(name = "上传部门")
|
|
||||||
private String uploadDept;
|
|
||||||
|
|
||||||
/** 上传时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date uploadTime;
|
|
||||||
|
|
||||||
/** 状态 */
|
|
||||||
@Excel(name = "状态")
|
|
||||||
private Long status;
|
|
||||||
|
|
||||||
public void setPhotoId(Long photoId)
|
|
||||||
{
|
|
||||||
this.photoId = photoId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getPhotoId()
|
|
||||||
{
|
|
||||||
return photoId;
|
|
||||||
}
|
|
||||||
public void setFileName(String fileName)
|
|
||||||
{
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileName()
|
|
||||||
{
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
public void setPhotoPath(String photoPath)
|
|
||||||
{
|
|
||||||
this.photoPath = photoPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPhotoPath()
|
|
||||||
{
|
|
||||||
return photoPath;
|
|
||||||
}
|
|
||||||
public void setPhotoUrl(String photoUrl)
|
|
||||||
{
|
|
||||||
this.photoUrl = photoUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPhotoUrl()
|
|
||||||
{
|
|
||||||
return photoUrl;
|
|
||||||
}
|
|
||||||
public void setOriginalName(String originalName)
|
|
||||||
{
|
|
||||||
this.originalName = originalName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOriginalName()
|
|
||||||
{
|
|
||||||
return originalName;
|
|
||||||
}
|
|
||||||
public void setUploadName(String uploadName)
|
|
||||||
{
|
|
||||||
this.uploadName = uploadName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUploadName()
|
|
||||||
{
|
|
||||||
return uploadName;
|
|
||||||
}
|
|
||||||
public void setUploadDept(String uploadDept)
|
|
||||||
{
|
|
||||||
this.uploadDept = uploadDept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUploadDept()
|
|
||||||
{
|
|
||||||
return uploadDept;
|
|
||||||
}
|
|
||||||
public void setUploadTime(Date uploadTime)
|
|
||||||
{
|
|
||||||
this.uploadTime = uploadTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getUploadTime()
|
|
||||||
{
|
|
||||||
return uploadTime;
|
|
||||||
}
|
|
||||||
public void setStatus(Long status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public FmsPhoto(String fileName, String photoPath, String photoUrl, String originalName, String uploadName,
|
|
||||||
String uploadDept, Long status) {
|
|
||||||
super();
|
|
||||||
this.fileName = fileName;
|
|
||||||
this.photoPath = photoPath;
|
|
||||||
this.photoUrl = photoUrl;
|
|
||||||
this.originalName = originalName;
|
|
||||||
this.uploadName = uploadName;
|
|
||||||
this.uploadDept = uploadDept;
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("photoId", getPhotoId())
|
|
||||||
.append("fileName", getFileName())
|
|
||||||
.append("photoPath", getPhotoPath())
|
|
||||||
.append("photoUrl", getPhotoUrl())
|
|
||||||
.append("originalName", getOriginalName())
|
|
||||||
.append("uploadName", getUploadName())
|
|
||||||
.append("uploadDept", getUploadDept())
|
|
||||||
.append("uploadTime", getUploadTime())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.fms.domain;
|
|
||||||
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
public class MultipartFileParam {
|
|
||||||
private String taskId;
|
|
||||||
private int chunkNumber;
|
|
||||||
private long chunkSize;
|
|
||||||
private int totalChunks;
|
|
||||||
private String identifier;
|
|
||||||
private MultipartFile file;
|
|
||||||
|
|
||||||
public String getTaskId() {
|
|
||||||
return taskId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaskId(String taskId) {
|
|
||||||
this.taskId = taskId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getChunkNumber() {
|
|
||||||
return chunkNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChunkNumber(int chunkNumber) {
|
|
||||||
this.chunkNumber = chunkNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getChunkSize() {
|
|
||||||
return chunkSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChunkSize(long chunkSize) {
|
|
||||||
this.chunkSize = chunkSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTotalChunks() {
|
|
||||||
return totalChunks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalChunks(int totalChunks) {
|
|
||||||
this.totalChunks = totalChunks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIdentifier() {
|
|
||||||
return identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIdentifier(String identifier) {
|
|
||||||
this.identifier = identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MultipartFile getFile() {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFile(MultipartFile file) {
|
|
||||||
this.file = file;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
package com.hig.fms.domain.dto;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
|
|
||||||
public class StdOut {
|
|
||||||
public static final int SUCCESS = 200;
|
|
||||||
public static final int FAIL = 400;
|
|
||||||
public static final int PARAMETER_NULL = 500;
|
|
||||||
public static final int NO_LOGIN = 600;
|
|
||||||
private int code = 200;
|
|
||||||
private Object model = null;
|
|
||||||
private String message = null;
|
|
||||||
|
|
||||||
public StdOut() {
|
|
||||||
this.setCode(200);
|
|
||||||
this.setModel((Object)null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StdOut(int code) {
|
|
||||||
this.setCode(code);
|
|
||||||
this.setModel((Object)null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StdOut(List<Map<String, Object>> model) {
|
|
||||||
this.setCode(200);
|
|
||||||
this.setModel(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StdOut(int code, List<Map<String, Object>> model) {
|
|
||||||
this.setCode(code);
|
|
||||||
this.setModel(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCode() {
|
|
||||||
return this.code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCode(int code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return JSON.toJSONString(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getModel() {
|
|
||||||
return this.model;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModel(Object model) {
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return this.message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.fms.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.fms.domain.FmsFiles;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件管理Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-17
|
|
||||||
*/
|
|
||||||
public interface FmsFilesMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询文件管理
|
|
||||||
*
|
|
||||||
* @param fileId 文件管理ID
|
|
||||||
* @return 文件管理
|
|
||||||
*/
|
|
||||||
public FmsFiles selectFmsFilesById(Long fileId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文件管理列表
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 文件管理集合
|
|
||||||
*/
|
|
||||||
public List<FmsFiles> selectFmsFilesList(FmsFiles fmsFiles);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增文件管理
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertFmsFiles(FmsFiles fmsFiles);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文件管理
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateFmsFiles(FmsFiles fmsFiles);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文件管理
|
|
||||||
*
|
|
||||||
* @param fileId 文件管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsFilesById(Long fileId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文件管理
|
|
||||||
*
|
|
||||||
* @param fileIds 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsFilesByIds(Long[] fileIds);
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.fms.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.fms.domain.FmsPhoto;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片管理Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-14
|
|
||||||
*/
|
|
||||||
public interface FmsPhotoMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询图片管理
|
|
||||||
*
|
|
||||||
* @param photoId 图片管理ID
|
|
||||||
* @return 图片管理
|
|
||||||
*/
|
|
||||||
public FmsPhoto selectFmsPhotoById(Long photoId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询图片管理列表
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 图片管理集合
|
|
||||||
*/
|
|
||||||
public List<FmsPhoto> selectFmsPhotoList(FmsPhoto fmsPhoto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增图片管理
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertFmsPhoto(FmsPhoto fmsPhoto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改图片管理
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateFmsPhoto(FmsPhoto fmsPhoto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除图片管理
|
|
||||||
*
|
|
||||||
* @param photoId 图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsPhotoById(Long photoId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除图片管理
|
|
||||||
*
|
|
||||||
* @param photoIds 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsPhotoByIds(Long[] photoIds);
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
package com.hig.fms.service;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import com.hig.fms.common.NotSameFileExpection;
|
|
||||||
import com.hig.fms.domain.MultipartFileParam;
|
|
||||||
|
|
||||||
|
|
||||||
public interface ChunkService {
|
|
||||||
public String chunkUploadByMappedByteBuffer(MultipartFileParam param, String filePath) throws IOException, NotSameFileExpection;
|
|
||||||
|
|
||||||
public void renameFile(File toBeRenamed, String toFileNewName);
|
|
||||||
|
|
||||||
public boolean checkUploadStatus(MultipartFileParam param, String fileName, String filePath) throws IOException;
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.fms.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.fms.domain.FmsFiles;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件管理Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-17
|
|
||||||
*/
|
|
||||||
public interface IFmsFilesService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询文件管理
|
|
||||||
*
|
|
||||||
* @param fileId 文件管理ID
|
|
||||||
* @return 文件管理
|
|
||||||
*/
|
|
||||||
public FmsFiles selectFmsFilesById(Long fileId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文件管理列表
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 文件管理集合
|
|
||||||
*/
|
|
||||||
public List<FmsFiles> selectFmsFilesList(FmsFiles fmsFiles);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增文件管理
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertFmsFiles(FmsFiles fmsFiles);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文件管理
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateFmsFiles(FmsFiles fmsFiles);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文件管理
|
|
||||||
*
|
|
||||||
* @param fileIds 需要删除的文件管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsFilesByIds(Long[] fileIds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文件管理信息
|
|
||||||
*
|
|
||||||
* @param fileId 文件管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsFilesById(Long fileId);
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
package com.hig.fms.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.fms.domain.FmsPhoto;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片管理Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-14
|
|
||||||
*/
|
|
||||||
public interface IFmsPhotoService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询图片管理
|
|
||||||
*
|
|
||||||
* @param photoId 图片管理ID
|
|
||||||
* @return 图片管理
|
|
||||||
*/
|
|
||||||
public FmsPhoto selectFmsPhotoById(Long photoId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询图片管理列表
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 图片管理集合
|
|
||||||
*/
|
|
||||||
public List<FmsPhoto> selectFmsPhotoList(FmsPhoto fmsPhoto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增图片管理
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertFmsPhoto(FmsPhoto fmsPhoto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改图片管理
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateFmsPhoto(FmsPhoto fmsPhoto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除图片管理
|
|
||||||
*
|
|
||||||
* @param photoIds 需要删除的图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsPhotoByIds(Long[] photoIds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除图片管理信息
|
|
||||||
*
|
|
||||||
* @param photoId 图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteFmsPhotoById(Long photoId);
|
|
||||||
}
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
package com.hig.fms.service.impl;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.RandomAccessFile;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.channels.FileChannel;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.hig.fms.common.NotSameFileExpection;
|
|
||||||
import com.hig.fms.domain.MultipartFileParam;
|
|
||||||
import com.hig.fms.service.ChunkService;
|
|
||||||
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ChunkServiceImpl implements ChunkService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String chunkUploadByMappedByteBuffer(MultipartFileParam param, String filePath) throws IOException, NotSameFileExpection {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (param.getTaskId() == null || "".equals(param.getTaskId())) {
|
|
||||||
param.setTaskId(UUID.randomUUID().toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
String fileName = param.getFile().getOriginalFilename();
|
|
||||||
String tempFileName = param.getTaskId() + fileName.substring(fileName.lastIndexOf(".")) + "_tmp";
|
|
||||||
File fileDir = new File(filePath);
|
|
||||||
if (!fileDir.exists()) {
|
|
||||||
fileDir.mkdirs();
|
|
||||||
}
|
|
||||||
File tempFile = new File(filePath, tempFileName);
|
|
||||||
//第一步 打开将要写入的文件
|
|
||||||
RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
|
|
||||||
//第二步 打开通道
|
|
||||||
FileChannel fileChannel = raf.getChannel();
|
|
||||||
//第三步 计算偏移量
|
|
||||||
long position = (param.getChunkNumber() - 1) * param.getChunkSize();
|
|
||||||
//第四步 获取分片数据
|
|
||||||
byte[] fileData = param.getFile().getBytes();
|
|
||||||
//第五步 写入数据
|
|
||||||
fileChannel.position(position);
|
|
||||||
fileChannel.write(ByteBuffer.wrap(fileData));
|
|
||||||
fileChannel.force(true);
|
|
||||||
fileChannel.close();
|
|
||||||
raf.close();
|
|
||||||
//判断是否完成文件的传输并进行校验与重命名
|
|
||||||
boolean isComplete = checkUploadStatus(param, fileName, filePath);
|
|
||||||
if (isComplete) {
|
|
||||||
FileInputStream fileInputStream = new FileInputStream(tempFile.getPath());
|
|
||||||
String md5 = DigestUtils.md5Hex(fileInputStream);
|
|
||||||
fileInputStream.close();
|
|
||||||
if (StringUtils.isNotBlank(md5) && !md5.equals(param.getIdentifier())) {
|
|
||||||
throw new NotSameFileExpection();
|
|
||||||
}
|
|
||||||
renameFile(tempFile, fileName);
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renameFile(File toBeRenamed, String toFileNewName) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
if (!toBeRenamed.exists() || toBeRenamed.isDirectory()) {
|
|
||||||
System.err.println("文件不存在");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String p = toBeRenamed.getParent();
|
|
||||||
File newFile = new File(p + File.separatorChar + toFileNewName);
|
|
||||||
toBeRenamed.renameTo(newFile);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkUploadStatus(MultipartFileParam param, String fileName, String filePath) throws IOException {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
File confFile = new File(filePath, fileName + ".conf");
|
|
||||||
RandomAccessFile confAccessFile = new RandomAccessFile(confFile, "rw");
|
|
||||||
//设置文件长度
|
|
||||||
confAccessFile.setLength(param.getTotalChunks());
|
|
||||||
//设置起始偏移量
|
|
||||||
confAccessFile.seek(param.getChunkNumber() - 1);
|
|
||||||
//将指定的一个字节写入文件中 127,
|
|
||||||
confAccessFile.write(Byte.MAX_VALUE);
|
|
||||||
byte[] completeStatusList = FileUtils.readFileToByteArray(confFile);
|
|
||||||
confAccessFile.close();//不关闭会造成无法占用
|
|
||||||
//创建conf文件文件长度为总分片数,每上传一个分块即向conf文件中写入一个127,那么没上传的位置就是默认的0,已上传的就是127
|
|
||||||
for (int i = 0; i < completeStatusList.length; i++) {
|
|
||||||
if (completeStatusList[i] != Byte.MAX_VALUE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
confFile.delete();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
package com.hig.fms.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.fms.mapper.FmsFilesMapper;
|
|
||||||
import com.hig.fms.domain.FmsFiles;
|
|
||||||
import com.hig.fms.service.IFmsFilesService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件管理Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-17
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class FmsFilesServiceImpl implements IFmsFilesService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private FmsFilesMapper fmsFilesMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文件管理
|
|
||||||
*
|
|
||||||
* @param fileId 文件管理ID
|
|
||||||
* @return 文件管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public FmsFiles selectFmsFilesById(Long fileId)
|
|
||||||
{
|
|
||||||
return fmsFilesMapper.selectFmsFilesById(fileId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文件管理列表
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 文件管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<FmsFiles> selectFmsFilesList(FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
return fmsFilesMapper.selectFmsFilesList(fmsFiles);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增文件管理
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertFmsFiles(FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
return fmsFilesMapper.insertFmsFiles(fmsFiles);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文件管理
|
|
||||||
*
|
|
||||||
* @param fmsFiles 文件管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateFmsFiles(FmsFiles fmsFiles)
|
|
||||||
{
|
|
||||||
return fmsFilesMapper.updateFmsFiles(fmsFiles);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文件管理
|
|
||||||
*
|
|
||||||
* @param fileIds 需要删除的文件管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteFmsFilesByIds(Long[] fileIds)
|
|
||||||
{
|
|
||||||
return fmsFilesMapper.deleteFmsFilesByIds(fileIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文件管理信息
|
|
||||||
*
|
|
||||||
* @param fileId 文件管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteFmsFilesById(Long fileId)
|
|
||||||
{
|
|
||||||
return fmsFilesMapper.deleteFmsFilesById(fileId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
package com.hig.fms.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.fms.mapper.FmsPhotoMapper;
|
|
||||||
import com.hig.fms.domain.FmsPhoto;
|
|
||||||
import com.hig.fms.service.IFmsPhotoService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片管理Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2021-12-14
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class FmsPhotoServiceImpl implements IFmsPhotoService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private FmsPhotoMapper fmsPhotoMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询图片管理
|
|
||||||
*
|
|
||||||
* @param photoId 图片管理ID
|
|
||||||
* @return 图片管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public FmsPhoto selectFmsPhotoById(Long photoId)
|
|
||||||
{
|
|
||||||
return fmsPhotoMapper.selectFmsPhotoById(photoId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询图片管理列表
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 图片管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<FmsPhoto> selectFmsPhotoList(FmsPhoto fmsPhoto)
|
|
||||||
{
|
|
||||||
return fmsPhotoMapper.selectFmsPhotoList(fmsPhoto);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增图片管理
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertFmsPhoto(FmsPhoto fmsPhoto)
|
|
||||||
{
|
|
||||||
return fmsPhotoMapper.insertFmsPhoto(fmsPhoto);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改图片管理
|
|
||||||
*
|
|
||||||
* @param fmsPhoto 图片管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateFmsPhoto(FmsPhoto fmsPhoto)
|
|
||||||
{
|
|
||||||
return fmsPhotoMapper.updateFmsPhoto(fmsPhoto);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除图片管理
|
|
||||||
*
|
|
||||||
* @param photoIds 需要删除的图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteFmsPhotoByIds(Long[] photoIds)
|
|
||||||
{
|
|
||||||
return fmsPhotoMapper.deleteFmsPhotoByIds(photoIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除图片管理信息
|
|
||||||
*
|
|
||||||
* @param photoId 图片管理ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteFmsPhotoById(Long photoId)
|
|
||||||
{
|
|
||||||
return fmsPhotoMapper.deleteFmsPhotoById(photoId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
package com.hig.fms.utils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FilenameUtils;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
public class FileUpload {
|
|
||||||
/**
|
|
||||||
* 文件上传处理
|
|
||||||
*
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String writeUploadFile(MultipartFile file,String path) {
|
|
||||||
String filename = file.getOriginalFilename();
|
|
||||||
System.out.println("原始文件名:" + filename);
|
|
||||||
// String realpath = "D:/image/photo/" + module +"/";
|
|
||||||
File fileDir = new File(path);
|
|
||||||
if (!fileDir.exists())
|
|
||||||
fileDir.mkdirs();
|
|
||||||
|
|
||||||
String extname = FilenameUtils.getExtension(filename);
|
|
||||||
String allowImgFormat = "gif,jpg,jpeg,png";
|
|
||||||
if (!allowImgFormat.contains(extname.toLowerCase())) {
|
|
||||||
return "NOT_IMAGE";
|
|
||||||
}
|
|
||||||
|
|
||||||
filename = Math.abs(file.getOriginalFilename().hashCode()) + RandomUtils.createRandomString( 4 ) + "." + extname;
|
|
||||||
InputStream input = null;
|
|
||||||
FileOutputStream fos = null;
|
|
||||||
try {
|
|
||||||
input = file.getInputStream();
|
|
||||||
fos = new FileOutputStream(path + "/" + filename);
|
|
||||||
IOUtils.copy(input, fos);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
} finally {
|
|
||||||
/*IOUtils.closeQuietly(input);
|
|
||||||
IOUtils.closeQuietly(fos);*/
|
|
||||||
if (input != null) {
|
|
||||||
try {
|
|
||||||
input.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fos != null) {
|
|
||||||
try {
|
|
||||||
fos.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
package com.hig.fms.utils;
|
|
||||||
|
|
||||||
public class RandomUtils {
|
|
||||||
private static final String charlist = "0123456789";
|
|
||||||
|
|
||||||
public static String createRandomString(int len) {
|
|
||||||
String str = new String();
|
|
||||||
for (int i = 0; i < len; i++) {
|
|
||||||
str += charlist.charAt(getRandom(charlist.length()));
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getRandom(int mod) {
|
|
||||||
if (mod < 1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int ret = getInt() % mod;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int getInt() {
|
|
||||||
int ret = Math.abs(Long.valueOf(getRandomNumString()).intValue());
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String getRandomNumString() {
|
|
||||||
double d = Math.random();
|
|
||||||
String dStr = String.valueOf(d).replaceAll("[^\\d]", "");
|
|
||||||
if (dStr.length() > 1) {
|
|
||||||
dStr = dStr.substring(0, dStr.length() - 1);
|
|
||||||
}
|
|
||||||
return dStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
package com.hig.onlineexam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.onlineexam.domain.ExamFinishAnswer;
|
|
||||||
import com.hig.onlineexam.service.IExamFinishAnswerService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/onlineexam/finishanswer")
|
|
||||||
public class ExamFinishAnswerController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamFinishAnswerService examFinishAnswerService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:finishanswer:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamFinishAnswer> list = examFinishAnswerService.selectExamFinishAnswerList(examFinishAnswer);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试成绩列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:finishanswer:export')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
List<ExamFinishAnswer> list = examFinishAnswerService.selectExamFinishAnswerList(examFinishAnswer);
|
|
||||||
ExcelUtil<ExamFinishAnswer> util = new ExcelUtil<ExamFinishAnswer>(ExamFinishAnswer.class);
|
|
||||||
return util.exportExcel(list, "考试成绩数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试成绩详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:finishanswer:query')")
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examFinishAnswerService.selectExamFinishAnswerById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:finishanswer:add')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
return toAjax(examFinishAnswerService.insertExamFinishAnswer(examFinishAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维护考试成绩
|
|
||||||
*/
|
|
||||||
@PostMapping("/save")
|
|
||||||
public AjaxResult save(@RequestBody ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
System.out.println("examFinishAnswer:" + examFinishAnswer.toString());
|
|
||||||
return toAjax(examFinishAnswerService.intoExamFinishAnswer(examFinishAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:finishanswer:edit')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
return toAjax(examFinishAnswerService.updateExamFinishAnswer(examFinishAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:finishanswer:remove')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examFinishAnswerService.deleteExamFinishAnswerByIds(examCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
package com.hig.onlineexam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsContentData;
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsData;
|
|
||||||
import com.hig.onlineexam.service.IExamQuestionsContentDataService;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsAnswer;
|
|
||||||
import com.hig.questions.service.IExamQuestionsAnswerService;
|
|
||||||
import com.hig.utils.DigitUtils;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/onlineexam")
|
|
||||||
public class ExamQuestionsContentDataController {
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsContentDataService examQuestionsContentDataService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsAnswerService examQuestionsAnswerService;
|
|
||||||
|
|
||||||
@GetMapping("/content")
|
|
||||||
public AjaxResult option(@RequestBody ExamQuestionsContentData examQuestionsContentData)
|
|
||||||
{
|
|
||||||
ExamQuestionsContentData contentData = examQuestionsContentDataService.selectExamQuestionsContent(examQuestionsContentData);
|
|
||||||
return AjaxResult.success(contentData);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/data")
|
|
||||||
public AjaxResult data(@RequestBody ExamQuestionsContentData examQuestionsContentData)
|
|
||||||
{
|
|
||||||
ExamQuestionsContentData contentData = examQuestionsContentDataService.selectExamQuestionsContent(examQuestionsContentData);
|
|
||||||
|
|
||||||
// 转换题号
|
|
||||||
|
|
||||||
String str = DigitUtils.toChinese(String.valueOf(contentData.getQuestionsNumber()));
|
|
||||||
contentData.setQuestionsNumberText("第" + str + "题");
|
|
||||||
|
|
||||||
List<ExamQuestionsAnswer> examQuestionsOptionList = examQuestionsAnswerService.selectExamQuestionsOptionList(examQuestionsContentData.getQuestionsCode());
|
|
||||||
|
|
||||||
ExamQuestionsData examQuestionsData = new ExamQuestionsData(contentData, examQuestionsOptionList);
|
|
||||||
return AjaxResult.success(examQuestionsData);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
package com.hig.onlineexam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsListData;
|
|
||||||
import com.hig.onlineexam.service.IExamQuestionsListDataService;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/onlineexam/questionslist")
|
|
||||||
public class ExamQuestionsListDataController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
IExamQuestionsListDataService examQuestionsListDataService;
|
|
||||||
|
|
||||||
@GetMapping()
|
|
||||||
public AjaxResult getQuestionsList(ExamQuestionsListData examQuestionsListData)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsListData> examQuestionsList = examQuestionsListDataService.selectQuestionsList(examQuestionsListData);
|
|
||||||
return AjaxResult.success(examQuestionsList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
package com.hig.onlineexam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.onlineexam.domain.ExamTaskAnswer;
|
|
||||||
import com.hig.onlineexam.service.IExamTaskAnswerService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试实时数据Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/onlineexam/taskanswer")
|
|
||||||
public class ExamTaskAnswerController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskAnswerService examTaskAnswerService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamTaskAnswer> list = examTaskAnswerService.selectExamTaskAnswerList(examTaskAnswer);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试实时数据列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
List<ExamTaskAnswer> list = examTaskAnswerService.selectExamTaskAnswerList(examTaskAnswer);
|
|
||||||
ExcelUtil<ExamTaskAnswer> util = new ExcelUtil<ExamTaskAnswer>(ExamTaskAnswer.class);
|
|
||||||
return util.exportExcel(list, "考试实时数据数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试实时数据详细信息
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examTaskAnswerService.selectExamTaskAnswerById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试实时数据
|
|
||||||
*/
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
|
|
||||||
return toAjax(examTaskAnswerService.insertExamTaskAnswer(examTaskAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试实时数据
|
|
||||||
*/
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskAnswerService.updateExamTaskAnswer(examTaskAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试实时数据
|
|
||||||
*/
|
|
||||||
@GetMapping("/remove/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskAnswerService.deleteExamTaskAnswerByIds(examCodes));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试实时数据
|
|
||||||
*/
|
|
||||||
@PostMapping("/delete")
|
|
||||||
public AjaxResult delete(ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
return toAjax(examTaskAnswerService.deleteExamTaskAnswer(examTaskAnswer));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
package com.hig.onlineexam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.exam.domain.ExamTaskManager;
|
|
||||||
import com.hig.exam.service.IExamTaskManagerService;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamTitleData;
|
|
||||||
import com.hig.onlineexam.service.IExamTitleDataService;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/onlineexam/examtitle")
|
|
||||||
public class ExamTitleController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
IExamTitleDataService examTitleDataService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
IExamTaskManagerService examTaskManagerService;
|
|
||||||
|
|
||||||
@GetMapping(value = "/selectCurrentExam")
|
|
||||||
public AjaxResult selectCurrentExam()
|
|
||||||
{
|
|
||||||
|
|
||||||
LoginUser user=SecurityUtils.getLoginUser();
|
|
||||||
List<ExamTitleData> list= examTaskManagerService.selectCurrentExam(user.getUser().getUserCode());
|
|
||||||
//ExamTitleData examTitleData = examTitleDataService.selectCurrentExam(user.getUser().getUserCode());
|
|
||||||
//return AjaxResult.success(examTitleData);
|
|
||||||
return AjaxResult.success(list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,112 +0,0 @@
|
||||||
package com.hig.onlineexam.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.onlineexam.domain.ExamUserScore;
|
|
||||||
import com.hig.onlineexam.service.IExamUserScoreService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-03-03
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/onlineexam/userscore")
|
|
||||||
public class ExamUserScoreController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamUserScoreService examUserScoreService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:userscore:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamUserScore> list = examUserScoreService.selectExamUserScoreList(examUserScore);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试成绩列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:userscore:export')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
List<ExamUserScore> list = examUserScoreService.selectExamUserScoreList(examUserScore);
|
|
||||||
ExcelUtil<ExamUserScore> util = new ExcelUtil<ExamUserScore>(ExamUserScore.class);
|
|
||||||
return util.exportExcel(list, "考试成绩数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试成绩详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:userscore:query')")
|
|
||||||
@GetMapping(value = "/{examCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examUserScoreService.selectExamUserScoreById(examCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:userscore:add')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
return toAjax(examUserScoreService.insertExamUserScore(examUserScore));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维护考试成绩
|
|
||||||
*/
|
|
||||||
@PostMapping("/into")
|
|
||||||
public AjaxResult into(@RequestBody ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
return toAjax(examUserScoreService.intoExamUserScore(examUserScore));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:userscore:edit')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
return toAjax(examUserScoreService.updateExamUserScore(examUserScore));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('onlineexam:userscore:remove')")
|
|
||||||
@Log(title = "考试成绩", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{examCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] examCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examUserScoreService.deleteExamUserScoreByIds(examCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
package com.hig.onlineexam.domain;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩对象 exam_finish_answer
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-03-02
|
|
||||||
*/
|
|
||||||
public class ExamFinishAnswer extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 考试用户 */
|
|
||||||
private String userCode;
|
|
||||||
|
|
||||||
/** 题目代码 */
|
|
||||||
private String questionsCode;
|
|
||||||
|
|
||||||
/** 正确答案 */
|
|
||||||
@Excel(name = "正确答案")
|
|
||||||
private String rightAnswer;
|
|
||||||
|
|
||||||
/** 分数 */
|
|
||||||
@Excel(name = "分数")
|
|
||||||
private Long examScore;
|
|
||||||
|
|
||||||
/** 题目回答 */
|
|
||||||
@Excel(name = "题目回答")
|
|
||||||
private String questionsAnswer;
|
|
||||||
|
|
||||||
/** 题目得分 */
|
|
||||||
@Excel(name = "题目得分")
|
|
||||||
private Long questionsScore;
|
|
||||||
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setUserCode(String userCode)
|
|
||||||
{
|
|
||||||
this.userCode = userCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserCode()
|
|
||||||
{
|
|
||||||
return userCode;
|
|
||||||
}
|
|
||||||
public void setQuestionsCode(String questionsCode)
|
|
||||||
{
|
|
||||||
this.questionsCode = questionsCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuestionsCode()
|
|
||||||
{
|
|
||||||
return questionsCode;
|
|
||||||
}
|
|
||||||
public void setRightAnswer(String rightAnswer)
|
|
||||||
{
|
|
||||||
this.rightAnswer = rightAnswer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRightAnswer()
|
|
||||||
{
|
|
||||||
return rightAnswer;
|
|
||||||
}
|
|
||||||
public void setExamScore(Long examScore)
|
|
||||||
{
|
|
||||||
this.examScore = examScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getExamScore()
|
|
||||||
{
|
|
||||||
return examScore;
|
|
||||||
}
|
|
||||||
public void setQuestionsAnswer(String questionsAnswer)
|
|
||||||
{
|
|
||||||
this.questionsAnswer = questionsAnswer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuestionsAnswer()
|
|
||||||
{
|
|
||||||
return questionsAnswer;
|
|
||||||
}
|
|
||||||
public void setQuestionsScore(Long questionsScore)
|
|
||||||
{
|
|
||||||
this.questionsScore = questionsScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getQuestionsScore()
|
|
||||||
{
|
|
||||||
return questionsScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("userCode", getUserCode())
|
|
||||||
.append("questionsCode", getQuestionsCode())
|
|
||||||
.append("rightAnswer", getRightAnswer())
|
|
||||||
.append("examScore", getExamScore())
|
|
||||||
.append("questionsAnswer", getQuestionsAnswer())
|
|
||||||
.append("questionsScore", getQuestionsScore())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,147 +0,0 @@
|
||||||
package com.hig.onlineexam.domain;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试实时数据对象 exam_task_answer
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
public class ExamTaskAnswer extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
@Excel(name = "考试代码")
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 考试用户 */
|
|
||||||
@Excel(name = "考试用户")
|
|
||||||
private String userCode;
|
|
||||||
|
|
||||||
/** 题目代码 */
|
|
||||||
@Excel(name = "题目代码")
|
|
||||||
private String questionsCode;
|
|
||||||
|
|
||||||
|
|
||||||
private String examTimes;
|
|
||||||
|
|
||||||
public String getExamTimes() {
|
|
||||||
return examTimes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExamTimes(String examTimes) {
|
|
||||||
this.examTimes = examTimes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 题号 */
|
|
||||||
@Excel(name = "题号")
|
|
||||||
private Long questionsNumber;
|
|
||||||
|
|
||||||
/** 试题类型 */
|
|
||||||
@Excel(name = "试题类型")
|
|
||||||
private Long questionsType;
|
|
||||||
|
|
||||||
/** 题目回答 */
|
|
||||||
@Excel(name = "题目回答")
|
|
||||||
private String questionsAnswer;
|
|
||||||
|
|
||||||
/** 是否标记 */
|
|
||||||
@Excel(name = "是否标记")
|
|
||||||
private String isMark;
|
|
||||||
|
|
||||||
/** 是否当前 */
|
|
||||||
@Excel(name = "是否当前")
|
|
||||||
private String isCurrent;
|
|
||||||
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setUserCode(String userCode)
|
|
||||||
{
|
|
||||||
this.userCode = userCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserCode()
|
|
||||||
{
|
|
||||||
return userCode;
|
|
||||||
}
|
|
||||||
public void setQuestionsCode(String questionsCode)
|
|
||||||
{
|
|
||||||
this.questionsCode = questionsCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuestionsCode()
|
|
||||||
{
|
|
||||||
return questionsCode;
|
|
||||||
}
|
|
||||||
public void setQuestionsNumber(Long questionsNumber)
|
|
||||||
{
|
|
||||||
this.questionsNumber = questionsNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getQuestionsNumber()
|
|
||||||
{
|
|
||||||
return questionsNumber;
|
|
||||||
}
|
|
||||||
public void setQuestionsType(Long questionsType)
|
|
||||||
{
|
|
||||||
this.questionsType = questionsType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getQuestionsType()
|
|
||||||
{
|
|
||||||
return questionsType;
|
|
||||||
}
|
|
||||||
public void setQuestionsAnswer(String questionsAnswer)
|
|
||||||
{
|
|
||||||
this.questionsAnswer = questionsAnswer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuestionsAnswer()
|
|
||||||
{
|
|
||||||
return questionsAnswer;
|
|
||||||
}
|
|
||||||
public void setIsMark(String isMark)
|
|
||||||
{
|
|
||||||
this.isMark = isMark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsMark()
|
|
||||||
{
|
|
||||||
return isMark;
|
|
||||||
}
|
|
||||||
public void setIsCurrent(String isCurrent)
|
|
||||||
{
|
|
||||||
this.isCurrent = isCurrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsCurrent()
|
|
||||||
{
|
|
||||||
return isCurrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("userCode", getUserCode())
|
|
||||||
.append("questionsCode", getQuestionsCode())
|
|
||||||
.append("questionsNumber", getQuestionsNumber())
|
|
||||||
.append("questionsType", getQuestionsType())
|
|
||||||
.append("questionsAnswer", getQuestionsAnswer())
|
|
||||||
.append("isMark", getIsMark())
|
|
||||||
.append("isCurrent", getIsCurrent())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,166 +0,0 @@
|
||||||
package com.hig.onlineexam.domain;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩对象 exam_user_score
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-03-03
|
|
||||||
*/
|
|
||||||
public class ExamUserScore extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 考试人员 */
|
|
||||||
private String userCode;
|
|
||||||
|
|
||||||
/** 开始时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
/** 结束时间 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date endTime;
|
|
||||||
|
|
||||||
/** 分数 */
|
|
||||||
@Excel(name = "分数")
|
|
||||||
private Integer examScore;
|
|
||||||
|
|
||||||
/** 题目分数 */
|
|
||||||
@Excel(name = "题目分数")
|
|
||||||
private Integer questionsScore;
|
|
||||||
|
|
||||||
/** 题目数 */
|
|
||||||
@Excel(name = "题目数")
|
|
||||||
private Integer examNumber;
|
|
||||||
|
|
||||||
/** 答题数 */
|
|
||||||
@Excel(name = "答题数")
|
|
||||||
private Integer answeredNumber;
|
|
||||||
|
|
||||||
/** 未答题数 */
|
|
||||||
@Excel(name = "未答题数")
|
|
||||||
private Integer notAnswered;
|
|
||||||
|
|
||||||
/** 状态 */
|
|
||||||
@Excel(name = "状态")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
public void setExamCode(String examCode)
|
|
||||||
{
|
|
||||||
this.examCode = examCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExamCode()
|
|
||||||
{
|
|
||||||
return examCode;
|
|
||||||
}
|
|
||||||
public void setUserCode(String userCode)
|
|
||||||
{
|
|
||||||
this.userCode = userCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserCode()
|
|
||||||
{
|
|
||||||
return userCode;
|
|
||||||
}
|
|
||||||
public void setStartTime(Date startTime)
|
|
||||||
{
|
|
||||||
this.startTime = startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getStartTime()
|
|
||||||
{
|
|
||||||
return startTime;
|
|
||||||
}
|
|
||||||
public void setEndTime(Date endTime)
|
|
||||||
{
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getEndTime()
|
|
||||||
{
|
|
||||||
return endTime;
|
|
||||||
}
|
|
||||||
public void setExamScore(Integer examScore)
|
|
||||||
{
|
|
||||||
this.examScore = examScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExamScore()
|
|
||||||
{
|
|
||||||
return examScore;
|
|
||||||
}
|
|
||||||
public void setQuestionsScore(Integer questionsScore)
|
|
||||||
{
|
|
||||||
this.questionsScore = questionsScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getQuestionsScore()
|
|
||||||
{
|
|
||||||
return questionsScore;
|
|
||||||
}
|
|
||||||
public void setExamNumber(Integer examNumber)
|
|
||||||
{
|
|
||||||
this.examNumber = examNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getExamNumber()
|
|
||||||
{
|
|
||||||
return examNumber;
|
|
||||||
}
|
|
||||||
public void setAnsweredNumber(Integer answeredNumber)
|
|
||||||
{
|
|
||||||
this.answeredNumber = answeredNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getAnsweredNumber()
|
|
||||||
{
|
|
||||||
return answeredNumber;
|
|
||||||
}
|
|
||||||
public void setNotAnswered(Integer notAnswered)
|
|
||||||
{
|
|
||||||
this.notAnswered = notAnswered;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNotAnswered()
|
|
||||||
{
|
|
||||||
return notAnswered;
|
|
||||||
}
|
|
||||||
public void setStatus(Integer status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("examCode", getExamCode())
|
|
||||||
.append("userCode", getUserCode())
|
|
||||||
.append("startTime", getStartTime())
|
|
||||||
.append("endTime", getEndTime())
|
|
||||||
.append("examScore", getExamScore())
|
|
||||||
.append("questionsScore", getQuestionsScore())
|
|
||||||
.append("examNumber", getExamNumber())
|
|
||||||
.append("answeredNumber", getAnsweredNumber())
|
|
||||||
.append("notAnswered", getNotAnswered())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
package com.hig.onlineexam.domain.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ExamQuestionsContentData {
|
|
||||||
private String bankCode;
|
|
||||||
private String examCode;
|
|
||||||
private int questionsId;
|
|
||||||
private int questionsNumber;
|
|
||||||
private String questionsNumberText;
|
|
||||||
private String questionsCode;
|
|
||||||
private String questionsContent;
|
|
||||||
private int questionsType;
|
|
||||||
private int questionsScore;
|
|
||||||
private int rateNumber;
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
package com.hig.onlineexam.domain.dto;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.questions.domain.ExamQuestionsAnswer;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ExamQuestionsData {
|
|
||||||
|
|
||||||
private ExamQuestionsContentData examQuestionsContentData;
|
|
||||||
private List<ExamQuestionsAnswer> examQuestionsOptionList;
|
|
||||||
|
|
||||||
|
|
||||||
public ExamQuestionsData(ExamQuestionsContentData examQuestionsContentData,
|
|
||||||
List<ExamQuestionsAnswer> examQuestionsOptionList) {
|
|
||||||
super();
|
|
||||||
this.examQuestionsContentData = examQuestionsContentData;
|
|
||||||
this.examQuestionsOptionList = examQuestionsOptionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
package com.hig.onlineexam.domain.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ExamQuestionsListData {
|
|
||||||
private String examCode;
|
|
||||||
private String userCode;
|
|
||||||
private String questionsCode;
|
|
||||||
private int questionsNumber;
|
|
||||||
private int questionsType;
|
|
||||||
private int questionsScore;
|
|
||||||
private String questionsAnswer;
|
|
||||||
private int isMark;
|
|
||||||
private int isCurrent;
|
|
||||||
}
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
package com.hig.onlineexam.domain.dto;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ExamTitleData {
|
|
||||||
/** 考试序号 */
|
|
||||||
private Long examId;
|
|
||||||
|
|
||||||
/** 考试代码 */
|
|
||||||
private String examCode;
|
|
||||||
|
|
||||||
/** 考试名称 */
|
|
||||||
private String examName;
|
|
||||||
|
|
||||||
private Integer examType;
|
|
||||||
private Integer examTimes;
|
|
||||||
/** 考试说明 */
|
|
||||||
private String examDescribe;
|
|
||||||
|
|
||||||
/** 组卷方式 */
|
|
||||||
private String buildType;
|
|
||||||
|
|
||||||
/** 强制抽卷 */
|
|
||||||
private String forceDone;
|
|
||||||
|
|
||||||
/** 考试题库 */
|
|
||||||
private String examBank;
|
|
||||||
|
|
||||||
/** 考试题库文字 */
|
|
||||||
private String examBankText;
|
|
||||||
|
|
||||||
|
|
||||||
/** 图片链接 */
|
|
||||||
private String pictureUrl;
|
|
||||||
|
|
||||||
/** 开始时间 */
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
/** 结束时间 */
|
|
||||||
private Date endTime;
|
|
||||||
|
|
||||||
/** 当前日期 */
|
|
||||||
private Date currentDate;
|
|
||||||
/** 考试时长 */
|
|
||||||
private String examDuration;
|
|
||||||
|
|
||||||
private int diffTime;
|
|
||||||
|
|
||||||
/** 判断题数 */
|
|
||||||
private int judgeNumber;
|
|
||||||
|
|
||||||
/** 单选题数 */
|
|
||||||
private int radioNumber;
|
|
||||||
|
|
||||||
/** 多选题数 */
|
|
||||||
private int choiceNumber;
|
|
||||||
|
|
||||||
private int questionsScore;
|
|
||||||
/** 状态 */
|
|
||||||
private Long status;
|
|
||||||
|
|
||||||
/** 创建人 */
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/** 创建部门 */
|
|
||||||
private int createDept;
|
|
||||||
|
|
||||||
/** 创建时间 */
|
|
||||||
private Date createTime;
|
|
||||||
}
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
package com.hig.onlineexam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.onlineexam.domain.ExamFinishAnswer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
public interface ExamFinishAnswerMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
public ExamFinishAnswer selectExamFinishAnswerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 考试成绩集合
|
|
||||||
*/
|
|
||||||
public List<ExamFinishAnswer> selectExamFinishAnswerList(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试结束将考试成绩拷入
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int intoExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamFinishAnswerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除个人考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamFinishAnswerByIds(String[] examCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
package com.hig.onlineexam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsContentData;
|
|
||||||
|
|
||||||
public interface ExamQuestionsContentDataMapper {
|
|
||||||
public ExamQuestionsContentData selectExamQuestionsContent(ExamQuestionsContentData questionsContentData);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
package com.hig.onlineexam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsListData;
|
|
||||||
|
|
||||||
public interface ExamQuestionsListDataMapper {
|
|
||||||
public List<ExamQuestionsListData> selectQuestionsList(ExamQuestionsListData examQuestionsListData);
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
package com.hig.onlineexam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.onlineexam.domain.ExamTaskAnswer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试实时数据Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
public interface ExamTaskAnswerMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 考试实时数据
|
|
||||||
*/
|
|
||||||
public ExamTaskAnswer selectExamTaskAnswerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据列表
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 考试实时数据集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskAnswer> selectExamTaskAnswerList(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试实时数据
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskAnswer(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试实时数据
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskAnswer(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除个人单条考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskAnswer(ExamTaskAnswer examTaskAnswer);
|
|
||||||
/**
|
|
||||||
* 删除考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskAnswerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskAnswerByIds(String[] examCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package com.hig.onlineexam.mapper;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamTitleData;
|
|
||||||
|
|
||||||
public interface ExamTitleDataMapper {
|
|
||||||
public ExamTitleData selectCurrentExam(String userCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
package com.hig.onlineexam.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.onlineexam.domain.ExamUserScore;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Mapper接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-03-03
|
|
||||||
*/
|
|
||||||
public interface ExamUserScoreMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
public ExamUserScore selectExamUserScoreById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 考试成绩集合
|
|
||||||
*/
|
|
||||||
public List<ExamUserScore> selectExamUserScoreList(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维护考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int intoExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamUserScoreById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamUserScoreByIds(String[] examCodes);
|
|
||||||
}
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
package com.hig.onlineexam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.onlineexam.domain.ExamFinishAnswer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
public interface IExamFinishAnswerService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
public ExamFinishAnswer selectExamFinishAnswerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 考试成绩集合
|
|
||||||
*/
|
|
||||||
public List<ExamFinishAnswer> selectExamFinishAnswerList(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试结束将考试成绩拷入
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int intoExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamFinishAnswerByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除个人考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamFinishAnswer(ExamFinishAnswer examFinishAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamFinishAnswerById(String examCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
package com.hig.onlineexam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsContentData;
|
|
||||||
|
|
||||||
public interface IExamQuestionsContentDataService {
|
|
||||||
public ExamQuestionsContentData selectExamQuestionsContent(ExamQuestionsContentData questionsContentData);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
package com.hig.onlineexam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsListData;
|
|
||||||
|
|
||||||
public interface IExamQuestionsListDataService {
|
|
||||||
public List<ExamQuestionsListData> selectQuestionsList(ExamQuestionsListData examQuestionsListData);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
package com.hig.onlineexam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.onlineexam.domain.ExamTaskAnswer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试实时数据Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
public interface IExamTaskAnswerService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 考试实时数据
|
|
||||||
*/
|
|
||||||
public ExamTaskAnswer selectExamTaskAnswerById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据列表
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 考试实时数据集合
|
|
||||||
*/
|
|
||||||
public List<ExamTaskAnswer> selectExamTaskAnswerList(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试实时数据
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamTaskAnswer(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试实时数据
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamTaskAnswer(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除个人单条考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskAnswer(ExamTaskAnswer examTaskAnswer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskAnswerByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试实时数据信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamTaskAnswerById(String examCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package com.hig.onlineexam.service;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamTitleData;
|
|
||||||
|
|
||||||
public interface IExamTitleDataService {
|
|
||||||
public ExamTitleData selectCurrentExam(String userCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
package com.hig.onlineexam.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.hig.onlineexam.domain.ExamUserScore;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Service接口
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-03-03
|
|
||||||
*/
|
|
||||||
public interface IExamUserScoreService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
public ExamUserScore selectExamUserScoreById(String examCode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 考试成绩集合
|
|
||||||
*/
|
|
||||||
public List<ExamUserScore> selectExamUserScoreList(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维护考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int intoExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamUserScore(ExamUserScore examUserScore);
|
|
||||||
|
|
||||||
public int deleteExamUserScoreByIds(String[] examCodes);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteExamUserScoreById(String examCode);
|
|
||||||
}
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
package com.hig.onlineexam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.onlineexam.mapper.ExamFinishAnswerMapper;
|
|
||||||
import com.hig.exam.domain.ExamTaskPerson;
|
|
||||||
import com.hig.exam.service.IExamTaskPersonService;
|
|
||||||
import com.hig.onlineexam.domain.ExamFinishAnswer;
|
|
||||||
import com.hig.onlineexam.domain.ExamUserScore;
|
|
||||||
import com.hig.onlineexam.service.IExamFinishAnswerService;
|
|
||||||
import com.hig.onlineexam.service.IExamUserScoreService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamFinishAnswerServiceImpl implements IExamFinishAnswerService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamFinishAnswerMapper examFinishAnswerMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamUserScoreService examUserScoreService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamTaskPersonService examTaskPersonService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamFinishAnswer selectExamFinishAnswerById(String examCode)
|
|
||||||
{
|
|
||||||
return examFinishAnswerMapper.selectExamFinishAnswerById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamFinishAnswer> selectExamFinishAnswerList(ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
return examFinishAnswerMapper.selectExamFinishAnswerList(examFinishAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamFinishAnswer(ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
return examFinishAnswerMapper.insertExamFinishAnswer(examFinishAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*
|
|
||||||
* @param examFinishAnswer 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamFinishAnswer(ExamFinishAnswer examFinishAnswer)
|
|
||||||
{
|
|
||||||
return examFinishAnswerMapper.updateExamFinishAnswer(examFinishAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamFinishAnswerByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
return examFinishAnswerMapper.deleteExamFinishAnswerByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamFinishAnswerById(String examCode)
|
|
||||||
{
|
|
||||||
return examFinishAnswerMapper.deleteExamFinishAnswerById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int intoExamFinishAnswer(ExamFinishAnswer examFinishAnswer) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
examFinishAnswerMapper.deleteExamFinishAnswer(examFinishAnswer);
|
|
||||||
|
|
||||||
int result = examFinishAnswerMapper.intoExamFinishAnswer(examFinishAnswer);
|
|
||||||
|
|
||||||
// 维护成绩数据
|
|
||||||
ExamUserScore examUserScore = new ExamUserScore();
|
|
||||||
examUserScore.setExamCode(examFinishAnswer.getExamCode());
|
|
||||||
examUserScore.setUserCode(examFinishAnswer.getUserCode());
|
|
||||||
|
|
||||||
result = examUserScoreService.intoExamUserScore(examUserScore);
|
|
||||||
|
|
||||||
// 更新状态
|
|
||||||
ExamTaskPerson examTaskPerson = new ExamTaskPerson();
|
|
||||||
examTaskPerson.setExamCode(examFinishAnswer.getExamCode());
|
|
||||||
examTaskPerson.setuserCode(examFinishAnswer.getUserCode());
|
|
||||||
examTaskPersonService.updateDoneStatus(examTaskPerson);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteExamFinishAnswer(ExamFinishAnswer examFinishAnswer) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examFinishAnswerMapper.deleteExamFinishAnswer(examFinishAnswer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
package com.hig.onlineexam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsContentData;
|
|
||||||
import com.hig.onlineexam.mapper.ExamQuestionsContentDataMapper;
|
|
||||||
import com.hig.onlineexam.service.IExamQuestionsContentDataService;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ExamQuestionsContentDataServiceImpl implements IExamQuestionsContentDataService {
|
|
||||||
@Autowired
|
|
||||||
ExamQuestionsContentDataMapper examQuestionsContentDataMapper;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ExamQuestionsContentData selectExamQuestionsContent(ExamQuestionsContentData questionsContentData) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examQuestionsContentDataMapper.selectExamQuestionsContent(questionsContentData);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
package com.hig.onlineexam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamQuestionsListData;
|
|
||||||
import com.hig.onlineexam.mapper.ExamQuestionsListDataMapper;
|
|
||||||
import com.hig.onlineexam.service.IExamQuestionsListDataService;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ExamQuestionsListDataServiceImpl implements IExamQuestionsListDataService {
|
|
||||||
@Autowired
|
|
||||||
ExamQuestionsListDataMapper examQuestionsListDataMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ExamQuestionsListData> selectQuestionsList(ExamQuestionsListData examQuestionsListData) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examQuestionsListDataMapper.selectQuestionsList(examQuestionsListData);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
package com.hig.onlineexam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.onlineexam.mapper.ExamTaskAnswerMapper;
|
|
||||||
import com.hig.onlineexam.domain.ExamTaskAnswer;
|
|
||||||
import com.hig.onlineexam.domain.ExamUserScore;
|
|
||||||
import com.hig.onlineexam.service.IExamTaskAnswerService;
|
|
||||||
import com.hig.onlineexam.service.IExamUserScoreService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试实时数据Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-02-24
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamTaskAnswerServiceImpl implements IExamTaskAnswerService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamTaskAnswerMapper examTaskAnswerMapper;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 考试实时数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamTaskAnswer selectExamTaskAnswerById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskAnswerMapper.selectExamTaskAnswerById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试实时数据列表
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 考试实时数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamTaskAnswer> selectExamTaskAnswerList(ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
return examTaskAnswerMapper.selectExamTaskAnswerList(examTaskAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试实时数据
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamTaskAnswer(ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
// 安全删除
|
|
||||||
examTaskAnswerMapper.deleteExamTaskAnswer(examTaskAnswer);
|
|
||||||
|
|
||||||
return examTaskAnswerMapper.insertExamTaskAnswer(examTaskAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试实时数据
|
|
||||||
*
|
|
||||||
* @param examTaskAnswer 考试实时数据
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamTaskAnswer(ExamTaskAnswer examTaskAnswer)
|
|
||||||
{
|
|
||||||
return examTaskAnswerMapper.updateExamTaskAnswer(examTaskAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试实时数据
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskAnswerByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
return examTaskAnswerMapper.deleteExamTaskAnswerByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试实时数据信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试实时数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskAnswerById(String examCode)
|
|
||||||
{
|
|
||||||
return examTaskAnswerMapper.deleteExamTaskAnswerById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteExamTaskAnswer(ExamTaskAnswer examTaskAnswer) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examTaskAnswerMapper.deleteExamTaskAnswer(examTaskAnswer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
package com.hig.onlineexam.service.impl;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.hig.onlineexam.domain.dto.ExamTitleData;
|
|
||||||
import com.hig.onlineexam.mapper.ExamTitleDataMapper;
|
|
||||||
import com.hig.onlineexam.service.IExamTitleDataService;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ExamTitleDataServiceImpl implements IExamTitleDataService {
|
|
||||||
@Autowired
|
|
||||||
ExamTitleDataMapper examTitleDataMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ExamTitleData selectCurrentExam(String userCode) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examTitleDataMapper.selectCurrentExam(userCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
package com.hig.onlineexam.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.hig.onlineexam.mapper.ExamUserScoreMapper;
|
|
||||||
import com.hig.onlineexam.domain.ExamUserScore;
|
|
||||||
import com.hig.onlineexam.service.IExamUserScoreService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试成绩Service业务层处理
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2023-03-03
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ExamUserScoreServiceImpl implements IExamUserScoreService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ExamUserScoreMapper examUserScoreMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExamUserScore selectExamUserScoreById(String examCode)
|
|
||||||
{
|
|
||||||
return examUserScoreMapper.selectExamUserScoreById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试成绩列表
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 考试成绩
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<ExamUserScore> selectExamUserScoreList(ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
return examUserScoreMapper.selectExamUserScoreList(examUserScore);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertExamUserScore(ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
return examUserScoreMapper.insertExamUserScore(examUserScore);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试成绩
|
|
||||||
*
|
|
||||||
* @param examUserScore 考试成绩
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateExamUserScore(ExamUserScore examUserScore)
|
|
||||||
{
|
|
||||||
return examUserScoreMapper.updateExamUserScore(examUserScore);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除考试成绩
|
|
||||||
*
|
|
||||||
* @param examCodes 需要删除的考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamUserScoreByIds(String[] examCodes)
|
|
||||||
{
|
|
||||||
return examUserScoreMapper.deleteExamUserScoreByIds(examCodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试成绩信息
|
|
||||||
*
|
|
||||||
* @param examCode 考试成绩ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteExamUserScoreById(String examCode)
|
|
||||||
{
|
|
||||||
return examUserScoreMapper.deleteExamUserScoreById(examCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int intoExamUserScore(ExamUserScore examUserScore) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// 安全删除
|
|
||||||
examUserScoreMapper.deleteExamUserScore(examUserScore);
|
|
||||||
return examUserScoreMapper.intoExamUserScore(examUserScore);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteExamUserScore(ExamUserScore examUserScore) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return examUserScoreMapper.deleteExamUserScore(examUserScore);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.questions.domain.ExamBankPicture;
|
|
||||||
import com.hig.questions.service.IExamBankPictureService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 题库图片Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-22
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/bankpicture")
|
|
||||||
public class ExamBankPictureController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamBankPictureService examBankPictureService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询题库图片列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:bankpicture:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamBankPicture examBankPicture)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamBankPicture> list = examBankPictureService.selectExamBankPictureList(examBankPicture);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出题库图片列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:bankpicture:export')")
|
|
||||||
@Log(title = "题库图片", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamBankPicture examBankPicture)
|
|
||||||
{
|
|
||||||
List<ExamBankPicture> list = examBankPictureService.selectExamBankPictureList(examBankPicture);
|
|
||||||
ExcelUtil<ExamBankPicture> util = new ExcelUtil<ExamBankPicture>(ExamBankPicture.class);
|
|
||||||
return util.exportExcel(list, "题库图片数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取题库图片详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:bankpicture:query')")
|
|
||||||
@GetMapping(value = "/{photoCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("photoCode") String photoCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examBankPictureService.selectExamBankPictureById(photoCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增题库图片
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:bankpicture:add')")
|
|
||||||
@Log(title = "题库图片", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamBankPicture examBankPicture)
|
|
||||||
{
|
|
||||||
return toAjax(examBankPictureService.insertExamBankPicture(examBankPicture));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改题库图片
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:bankpicture:edit')")
|
|
||||||
@Log(title = "题库图片", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamBankPicture examBankPicture)
|
|
||||||
{
|
|
||||||
return toAjax(examBankPictureService.updateExamBankPicture(examBankPicture));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除题库图片
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:bankpicture:remove')")
|
|
||||||
@Log(title = "题库图片", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{photoCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] photoCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examBankPictureService.deleteExamBankPictureByIds(photoCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,109 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsAnswer;
|
|
||||||
import com.hig.questions.service.IExamQuestionsAnswerService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试题目答案Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-29
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/answer")
|
|
||||||
public class ExamQuestionsAnswerController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsAnswerService examQuestionsAnswerService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试题目答案列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamQuestionsAnswer examQuestionsAnswer)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamQuestionsAnswer> list = examQuestionsAnswerService.selectExamQuestionsAnswerList(examQuestionsAnswer);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/optionlist/{questionsCode}")
|
|
||||||
public AjaxResult optionList(@PathVariable("questionsCode") String questionsCode)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsAnswer> list = examQuestionsAnswerService.selectExamQuestionsOptionList(questionsCode);
|
|
||||||
return AjaxResult.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试题目答案列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:answer:export')")
|
|
||||||
@Log(title = "考试题目答案", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamQuestionsAnswer examQuestionsAnswer)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsAnswer> list = examQuestionsAnswerService.selectExamQuestionsAnswerList(examQuestionsAnswer);
|
|
||||||
ExcelUtil<ExamQuestionsAnswer> util = new ExcelUtil<ExamQuestionsAnswer>(ExamQuestionsAnswer.class);
|
|
||||||
return util.exportExcel(list, "考试题目答案数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试题目答案详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:answer:query')")
|
|
||||||
@GetMapping(value = "/{questionsCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("questionsCode") String questionsCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examQuestionsAnswerService.selectExamQuestionsAnswerById(questionsCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试题目答案
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:answer:add')")
|
|
||||||
@Log(title = "考试题目答案", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/add")
|
|
||||||
public AjaxResult add(@RequestBody ExamQuestionsAnswer examQuestionsAnswer)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsAnswerService.insertExamQuestionsAnswer(examQuestionsAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试题目答案
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:answer:edit')")
|
|
||||||
@Log(title = "考试题目答案", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamQuestionsAnswer examQuestionsAnswer)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsAnswerService.updateExamQuestionsAnswer(examQuestionsAnswer));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试题目答案
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:answer:remove')")
|
|
||||||
@Log(title = "考试题目答案", businessType = BusinessType.DELETE)
|
|
||||||
@GetMapping("/delete/{questionsCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] questionsCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsAnswerService.deleteExamQuestionsAnswerByIds(questionsCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,210 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.cms.utils.FileUpload;
|
|
||||||
import com.hig.questions.domain.ExamBankPicture;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsBank;
|
|
||||||
import com.hig.questions.service.IExamBankPictureService;
|
|
||||||
import com.hig.questions.service.IExamQuestionsBankService;
|
|
||||||
import com.hig.utils.UUIDGenerator;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 题库管理Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-19
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/questionsbank")
|
|
||||||
public class ExamQuestionsBankController extends BaseController
|
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(ExamQuestionsBankController.class);
|
|
||||||
|
|
||||||
@Value("${cms.exam.photo-path:/photo/exam}")
|
|
||||||
private String photopath;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsBankService examQuestionsBankService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamBankPictureService examBankPictureService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询题库管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamQuestionsBank examQuestionsBank)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamQuestionsBank> list = examQuestionsBankService.selectExamQuestionsBankList(examQuestionsBank);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/arraylist/{bankCodes}")
|
|
||||||
public AjaxResult arrayList(@PathVariable("bankCodes") String bankCodes)
|
|
||||||
{
|
|
||||||
// startPage();
|
|
||||||
// log.debug("bankCodes: {}", bankCodes);
|
|
||||||
List<ExamQuestionsBank> list = examQuestionsBankService.selectExamQuestionsBankListByCode(bankCodes.split(","));
|
|
||||||
return AjaxResult.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出题库管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:export')")
|
|
||||||
@Log(title = "题库管理", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamQuestionsBank examQuestionsBank)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsBank> list = examQuestionsBankService.selectExamQuestionsBankList(examQuestionsBank);
|
|
||||||
ExcelUtil<ExamQuestionsBank> util = new ExcelUtil<ExamQuestionsBank>(ExamQuestionsBank.class);
|
|
||||||
return util.exportExcel(list, "题库管理数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导入题库管理数据
|
|
||||||
*/
|
|
||||||
@Log(title = "题库管理", businessType = BusinessType.IMPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:import')")
|
|
||||||
@PostMapping("/importData")
|
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
||||||
{
|
|
||||||
ExcelUtil<ExamQuestionsBank> util = new ExcelUtil<ExamQuestionsBank>(ExamQuestionsBank.class);
|
|
||||||
List<ExamQuestionsBank> examQuestionsBankList = util.importExcel(file.getInputStream());
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
String operName = loginUser.getUsername();
|
|
||||||
String message = examQuestionsBankService.importExamQuestionsBank(examQuestionsBankList, updateSupport, operName);
|
|
||||||
return AjaxResult.success(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载题库管理导入模板
|
|
||||||
*/
|
|
||||||
@GetMapping("/importTemplate")
|
|
||||||
public AjaxResult importTemplate()
|
|
||||||
{
|
|
||||||
ExcelUtil<ExamQuestionsBank> util = new ExcelUtil<ExamQuestionsBank>(ExamQuestionsBank.class);
|
|
||||||
return util.importTemplateExcel("题库管理数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取题库管理详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:query')")
|
|
||||||
@GetMapping(value = "/{bankCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("bankCode") String bankCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examQuestionsBankService.selectExamQuestionsBankById(bankCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增题库管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:add')")
|
|
||||||
@Log(title = "题库管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamQuestionsBank examQuestionsBank)
|
|
||||||
{
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
log.debug("用户名: {}", loginUser.getUser().getUserName());
|
|
||||||
log.debug("部门ID: {}", loginUser.getUser().getDept().getDeptId());
|
|
||||||
examQuestionsBank.setCreateBy(loginUser.getUser().getUserName());
|
|
||||||
examQuestionsBank.setCreateDept(loginUser.getUser().getDept().getDeptId());
|
|
||||||
examQuestionsBank.setBankCode(UUIDGenerator.generate());
|
|
||||||
|
|
||||||
log.debug("examQuestionsBank: {}", examQuestionsBank.toString());
|
|
||||||
return toAjax(examQuestionsBankService.insertExamQuestionsBank(examQuestionsBank));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改题库管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:edit')")
|
|
||||||
@Log(title = "题库管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamQuestionsBank examQuestionsBank)
|
|
||||||
{
|
|
||||||
log.debug("examQuestionsBank: {}", examQuestionsBank.toString());
|
|
||||||
return toAjax(examQuestionsBankService.updateExamQuestionsBank(examQuestionsBank));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除题库管理
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsbank:remove')")
|
|
||||||
@Log(title = "题库管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{bankCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] bankCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsBankService.deleteExamQuestionsBankByIds(bankCodes));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增参数配置
|
|
||||||
*/
|
|
||||||
@PostMapping("/uploadphoto/{bankcode}")
|
|
||||||
public AjaxResult uploadPhoto(@PathVariable String bankcode,
|
|
||||||
@RequestParam("file") MultipartFile file)
|
|
||||||
{
|
|
||||||
// 取得原始文件名
|
|
||||||
String originalfile = file.getOriginalFilename();
|
|
||||||
|
|
||||||
// 拼接路径
|
|
||||||
String path = RuoYiConfig.getProfile() + photopath;
|
|
||||||
log.debug("拼接路径为: {}", path);
|
|
||||||
String filename = FileUpload.writeUploadFile(file,path);
|
|
||||||
String fileurl = photopath + "/" + filename;
|
|
||||||
log.debug("fileurl: {}", fileurl);
|
|
||||||
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
// 相应赋值
|
|
||||||
ExamBankPicture examBankPicture = new ExamBankPicture(bankcode, path, fileurl, filename, originalfile);
|
|
||||||
|
|
||||||
log.debug("examBankPicture: {}", examBankPicture.toString());
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
examBankPictureService.deleteExamBankPictureById(bankcode);
|
|
||||||
count = examBankPictureService.insertExamBankPicture(examBankPicture);
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
return AjaxResult.error(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.success(examBankPicture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsContent;
|
|
||||||
import com.hig.questions.service.IExamQuestionsContentService;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 题目内容表Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-28
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/questionscontent")
|
|
||||||
public class ExamQuestionsContentController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsContentService examQuestionsContentService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询题目内容表列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionscontent:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamQuestionsContent examQuestionsContent)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamQuestionsContent> list = examQuestionsContentService.selectExamQuestionsContentList(examQuestionsContent);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出题目内容表列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionscontent:export')")
|
|
||||||
@Log(title = "题目内容表", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamQuestionsContent examQuestionsContent)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsContent> list = examQuestionsContentService.selectExamQuestionsContentList(examQuestionsContent);
|
|
||||||
ExcelUtil<ExamQuestionsContent> util = new ExcelUtil<ExamQuestionsContent>(ExamQuestionsContent.class);
|
|
||||||
return util.exportExcel(list, "题目内容表数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取题目内容表详细信息
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/{questionsCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("questionsCode") String questionsCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examQuestionsContentService.selectExamQuestionsContentById(questionsCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增题目内容表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionscontent:add')")
|
|
||||||
@Log(title = "题目内容表", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody ExamQuestionsContent examQuestionsContent)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsContentService.insertExamQuestionsContent(examQuestionsContent));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改题目内容表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionscontent:edit')")
|
|
||||||
@Log(title = "题目内容表", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody ExamQuestionsContent examQuestionsContent)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsContentService.updateExamQuestionsContent(examQuestionsContent));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除题目内容表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionscontent:remove')")
|
|
||||||
@Log(title = "题目内容表", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{questionsCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] questionsCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsContentService.deleteExamQuestionsContentByIds(questionsCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,268 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.questions.domain.ExamQuestions;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsAnswer;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsContent;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsProperty;
|
|
||||||
import com.hig.questions.service.IExamQuestionsAnswerService;
|
|
||||||
import com.hig.questions.service.IExamQuestionsContentService;
|
|
||||||
import com.hig.questions.service.IExamQuestionsPropertyService;
|
|
||||||
import com.hig.questions.service.IExamQuestionsService;
|
|
||||||
import com.hig.utils.UUIDGenerator;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 考试题目Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-28
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/examquestions")
|
|
||||||
public class ExamQuestionsController extends BaseController
|
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(ExamQuestionsController.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsService examQuestionsService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsAnswerService examQuestionsAnswerService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsContentService examQuestionsContentService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsPropertyService examQuestionsPropertyService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询考试题目列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamQuestions examQuestions)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamQuestions> list = examQuestionsService.selectExamQuestionsList(examQuestions);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出考试题目列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:export')")
|
|
||||||
@Log(title = "考试题目", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamQuestions examQuestions)
|
|
||||||
{
|
|
||||||
List<ExamQuestions> list = examQuestionsService.selectExamQuestionsList(examQuestions);
|
|
||||||
ExcelUtil<ExamQuestions> util = new ExcelUtil<ExamQuestions>(ExamQuestions.class);
|
|
||||||
return util.exportExcel(list, "考试题目数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导入考试题目数据
|
|
||||||
*/
|
|
||||||
@Log(title = "考试题目", businessType = BusinessType.IMPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:import')")
|
|
||||||
@PostMapping("/importData")
|
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport,String bankCode) throws Exception
|
|
||||||
{
|
|
||||||
ExcelUtil<ExamQuestions> util = new ExcelUtil<ExamQuestions>(ExamQuestions.class);
|
|
||||||
List<ExamQuestions> examQuestionsList = util.importExcel(file.getInputStream());
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
String operName = loginUser.getUsername();
|
|
||||||
List<ExamQuestions> examQuestions=new ArrayList<>();
|
|
||||||
examQuestionsList.forEach(x->{
|
|
||||||
x.setBankCode(bankCode);
|
|
||||||
String tmp= x.getQuestionsTypeStr();
|
|
||||||
boolean flag=false;
|
|
||||||
if("判断题".equals(tmp)){
|
|
||||||
x.setQuestionsType(1);
|
|
||||||
flag=true;
|
|
||||||
}
|
|
||||||
if("单选题".equals(tmp)){
|
|
||||||
x.setQuestionsType(2);
|
|
||||||
flag=true;
|
|
||||||
}
|
|
||||||
if("多选题".equals(tmp)){
|
|
||||||
x.setQuestionsType(3);
|
|
||||||
flag=true;
|
|
||||||
}
|
|
||||||
if(flag){
|
|
||||||
examQuestions.add(x);
|
|
||||||
}
|
|
||||||
if(StringUtils.isEmpty(x.getRateNumberStr())){
|
|
||||||
x.setRateNumber(0);
|
|
||||||
}else{
|
|
||||||
x.setRateNumber(x.getRateNumberStr().length()/2);
|
|
||||||
}
|
|
||||||
x.setCreateBy(operName);
|
|
||||||
x.setCreateTime(new Date());
|
|
||||||
x.setQuestionsCode(UUID.randomUUID().toString());
|
|
||||||
});
|
|
||||||
if(CollectionUtils.isEmpty(examQuestions)){
|
|
||||||
return AjaxResult.error("导入数据为空!");
|
|
||||||
}
|
|
||||||
|
|
||||||
String message = examQuestionsService.importExamQuestions(examQuestions, updateSupport, operName);
|
|
||||||
return AjaxResult.success(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载考试题目导入模板
|
|
||||||
*/
|
|
||||||
@GetMapping("/importTemplate")
|
|
||||||
public AjaxResult importTemplate()
|
|
||||||
{
|
|
||||||
ExcelUtil<ExamQuestions> util = new ExcelUtil<ExamQuestions>(ExamQuestions.class);
|
|
||||||
return util.importTemplateExcel("考试题目数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取考试题目详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:query')")
|
|
||||||
@GetMapping(value = "/{questionsCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("questionsCode") String questionsCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examQuestionsService.selectExamQuestionsById(questionsCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增考试题目
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:add')")
|
|
||||||
@Log(title = "考试题目", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/add")
|
|
||||||
public AjaxResult add(@RequestBody ExamQuestions examQuestions)
|
|
||||||
{
|
|
||||||
// 取得用户单位
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
examQuestions.setCreateBy(loginUser.getUser().getUserName());
|
|
||||||
examQuestions.setCreateDept(loginUser.getUser().getDept().getDeptId());
|
|
||||||
List<ExamQuestionsAnswer> answerList = examQuestions.getAnswerList();
|
|
||||||
|
|
||||||
ExamQuestionsProperty examQuestionsProperty = new ExamQuestionsProperty(examQuestions.getBankCode(),null,examQuestions.getQuestionsCode(),examQuestions.getQuestionsTitle(),
|
|
||||||
examQuestions.getQuestionsType(),examQuestions.getQuestionsScore(),examQuestions.getRateNumber(),examQuestions.getRightAnswer(),examQuestions.getAnswerAnalyse(),
|
|
||||||
0,examQuestions.getCreateBy(), examQuestions.getCreateDept());
|
|
||||||
|
|
||||||
ExamQuestionsContent examQuestionsContent = new ExamQuestionsContent(examQuestions.getQuestionsCode(), examQuestions.getQuestionsContent());
|
|
||||||
|
|
||||||
log.debug("examQuestionsContent: {}", examQuestionsContent.toString());
|
|
||||||
|
|
||||||
// 开始保存数据
|
|
||||||
|
|
||||||
// 保存题目选项
|
|
||||||
// 安全删除
|
|
||||||
examQuestionsAnswerService.deleteExamQuestionsAnswerById(examQuestions.getQuestionsCode());
|
|
||||||
for (ExamQuestionsAnswer questionsAnswer: answerList) {
|
|
||||||
questionsAnswer.setOrderId(null);
|
|
||||||
examQuestionsAnswerService.insertExamQuestionsAnswer(questionsAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存题目数据
|
|
||||||
int count = 0;
|
|
||||||
examQuestionsContentService.deleteExamQuestionsContentById(examQuestions.getQuestionsCode());
|
|
||||||
|
|
||||||
count = examQuestionsContentService.insertExamQuestionsContent(examQuestionsContent);
|
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
return new AjaxResult(0,"更新题目信息出错!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 安全删除
|
|
||||||
examQuestionsPropertyService.deleteExamQuestionsPropertyById(examQuestions.getQuestionsCode());
|
|
||||||
|
|
||||||
return toAjax(examQuestionsPropertyService.insertExamQuestionsProperty(examQuestionsProperty));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改考试题目
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:edit')")
|
|
||||||
@Log(title = "考试题目", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamQuestions examQuestions)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsAnswer> answerList = examQuestions.getAnswerList();
|
|
||||||
|
|
||||||
ExamQuestionsProperty examQuestionsProperty = new ExamQuestionsProperty(examQuestions.getBankCode(),null,examQuestions.getQuestionsCode(),examQuestions.getQuestionsTitle(),
|
|
||||||
examQuestions.getQuestionsType(),examQuestions.getQuestionsScore(),examQuestions.getRateNumber(),examQuestions.getRightAnswer(),examQuestions.getAnswerAnalyse(),
|
|
||||||
0,examQuestions.getCreateBy(), examQuestions.getCreateDept());
|
|
||||||
|
|
||||||
ExamQuestionsContent examQuestionsContent = new ExamQuestionsContent(examQuestions.getQuestionsCode(), examQuestions.getQuestionsContent());
|
|
||||||
|
|
||||||
|
|
||||||
// 开始保存数据
|
|
||||||
|
|
||||||
// 保存题目选项
|
|
||||||
// 安全删除
|
|
||||||
examQuestionsAnswerService.deleteExamQuestionsAnswerById(examQuestions.getQuestionsCode());
|
|
||||||
for (ExamQuestionsAnswer questionsAnswer: answerList) {
|
|
||||||
examQuestionsAnswerService.insertExamQuestionsAnswer(questionsAnswer);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存题目数据
|
|
||||||
int count = 0;
|
|
||||||
examQuestionsContentService.deleteExamQuestionsContentById(examQuestions.getQuestionsCode());
|
|
||||||
|
|
||||||
count = examQuestionsContentService.insertExamQuestionsContent(examQuestionsContent);
|
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
return new AjaxResult(0,"更新题目信息出错!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return toAjax(examQuestionsPropertyService.updateExamQuestionsProperty(examQuestionsProperty));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除考试题目
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:examquestions:remove')")
|
|
||||||
@Log(title = "考试题目", businessType = BusinessType.DELETE)
|
|
||||||
@GetMapping("/delete/{questionsCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] questionsCodes)
|
|
||||||
{
|
|
||||||
int count = questionsCodes.length;
|
|
||||||
for (String questionsCode: questionsCodes) {
|
|
||||||
examQuestionsAnswerService.deleteExamQuestionsAnswerById(questionsCode);
|
|
||||||
examQuestionsContentService.deleteExamQuestionsContentById(questionsCode);
|
|
||||||
examQuestionsPropertyService.deleteExamQuestionsPropertyById(questionsCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return toAjax(count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsList;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsProperty;
|
|
||||||
import com.hig.questions.service.IExamQuestionsListService;
|
|
||||||
import com.hig.questions.service.IExamQuestionsPropertyService;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 题目属性Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-28
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/questionslist")
|
|
||||||
public class ExamQuestionsListController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsListService examQuestionsListService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询题目属性列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamQuestionsList examQuestionsList)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamQuestionsProperty> list = examQuestionsListService.selectExamQuestionsList(examQuestionsList.getBankCodes());
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/selectlist/{examCode}")
|
|
||||||
public AjaxResult selectList(@PathVariable("examCode") String examCode)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsProperty> list = examQuestionsListService.selectChoiceExamQuestionsList(examCode);
|
|
||||||
return AjaxResult.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
package com.hig.questions.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.hig.questions.domain.ExamQuestionsProperty;
|
|
||||||
import com.hig.questions.service.IExamQuestionsPropertyService;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 题目属性Controller
|
|
||||||
*
|
|
||||||
* @author qnsdt
|
|
||||||
* @date 2022-12-28
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/questions/questionsproperty")
|
|
||||||
public class ExamQuestionsPropertyController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IExamQuestionsPropertyService examQuestionsPropertyService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询题目属性列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsproperty:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(ExamQuestionsProperty examQuestionsProperty)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<ExamQuestionsProperty> list = examQuestionsPropertyService.selectExamQuestionsPropertyList(examQuestionsProperty);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出题目属性列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsproperty:export')")
|
|
||||||
@Log(title = "题目属性", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(ExamQuestionsProperty examQuestionsProperty)
|
|
||||||
{
|
|
||||||
List<ExamQuestionsProperty> list = examQuestionsPropertyService.selectExamQuestionsPropertyList(examQuestionsProperty);
|
|
||||||
ExcelUtil<ExamQuestionsProperty> util = new ExcelUtil<ExamQuestionsProperty>(ExamQuestionsProperty.class);
|
|
||||||
return util.exportExcel(list, "题目属性数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取题目属性详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsproperty:query')")
|
|
||||||
@GetMapping(value = "/{questionsCode}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("questionsCode") String questionsCode)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(examQuestionsPropertyService.selectExamQuestionsPropertyById(questionsCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增题目属性
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsproperty:add')")
|
|
||||||
@Log(title = "题目属性", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/add")
|
|
||||||
public AjaxResult add(@RequestBody ExamQuestionsProperty examQuestionsProperty)
|
|
||||||
{
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
examQuestionsProperty.setCreateBy(loginUser.getUser().getUserName());
|
|
||||||
examQuestionsProperty.setCreateDept(loginUser.getUser().getDept().getDeptId());
|
|
||||||
|
|
||||||
return toAjax(examQuestionsPropertyService.insertExamQuestionsProperty(examQuestionsProperty));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改题目属性
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsproperty:edit')")
|
|
||||||
@Log(title = "题目属性", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/update")
|
|
||||||
public AjaxResult edit(@RequestBody ExamQuestionsProperty examQuestionsProperty)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsPropertyService.updateExamQuestionsProperty(examQuestionsProperty));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除题目属性
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('questions:questionsproperty:remove')")
|
|
||||||
@Log(title = "题目属性", businessType = BusinessType.DELETE)
|
|
||||||
@GetMapping("/delete/{questionsCodes}")
|
|
||||||
public AjaxResult remove(@PathVariable String[] questionsCodes)
|
|
||||||
{
|
|
||||||
return toAjax(examQuestionsPropertyService.deleteExamQuestionsPropertyByIds(questionsCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue