Merge remote-tracking branch 'origin/master'

This commit is contained in:
乐天 2018-12-11 21:00:29 +08:00
commit 29e8dc5241
32 changed files with 3028 additions and 1152 deletions

View File

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
url: jdbc:mysql://localhost:3306/jeesis-exam?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
username: root
password: root
# 从库数据源

View File

@ -14,7 +14,7 @@ ruoyi:
# 开发环境配置
server:
# 服务端口
port: 80
port: 8099
servlet:
# 项目contextPath
context-path: /

View File

@ -12,54 +12,54 @@
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!--<file>${log.path}/sys-info.log</file>-->
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
<!--&lt;!&ndash; 按天回滚 daily &ndash;&gt;-->
<!--<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>-->
<!--&lt;!&ndash; 日志最大的历史 60天 &ndash;&gt;-->
<!--<maxHistory>60</maxHistory>-->
<!--</rollingPolicy>-->
<!--<encoder>-->
<!--<pattern>${log.pattern}</pattern>-->
<!--</encoder>-->
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
<!--<level>INFO</level>-->
<!--<onMatch>ACCEPT</onMatch>-->
<!--<onMismatch>DENY</onMismatch>-->
<!--</filter>-->
<!--</appender>-->
<!---->
<!--<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!--<file>${log.path}/sys-error.log</file>-->
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
<!--<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>-->
<!--&lt;!&ndash; 日志最大的历史 60天 &ndash;&gt;-->
<!--<maxHistory>60</maxHistory>-->
<!--</rollingPolicy>-->
<!--<encoder>-->
<!--<pattern>${log.pattern}</pattern>-->
<!--</encoder>-->
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
<!--<level>ERROR</level>-->
<!--<onMatch>ACCEPT</onMatch>-->
<!--<onMismatch>DENY</onMismatch>-->
<!--</filter>-->
<!--</appender>-->
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!--<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!--<file>${log.path}/sys-user.log</file>-->
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
<!--&lt;!&ndash; 按天回滚 daily &ndash;&gt;-->
<!--<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>-->
<!--&lt;!&ndash; 日志最大的历史 60天 &ndash;&gt;-->
<!--<maxHistory>60</maxHistory>-->
<!--</rollingPolicy>-->
<!--<encoder>-->
<!--<pattern>${log.pattern}</pattern>-->
<!--</encoder>-->
<!--</appender>-->
<!-- 显示形成的sql、使用的参数、结果集 -->
<!--
@ -74,13 +74,13 @@
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--<root level="info">-->
<!--<appender-ref ref="file_info" />-->
<!--<appender-ref ref="file_error" />-->
<!--</root>-->
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
<!--<logger name="sys-user" level="info">-->
<!--<appender-ref ref="sys-user"/>-->
<!--</logger>-->
</configuration>

File diff suppressed because one or more lines are too long

View File

@ -5507,8 +5507,8 @@ del {
}
20% {
-webkit-transform: scaleY (1);
transform: scaleY (1);
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
}
@ -5556,18 +5556,18 @@ del {
}
@-webkit-keyframes sk-wanderingCubeMove {
25% {
25%{
-webkit-transform: translateX(42px) rotate(-90deg) scale(0.5);
transform: translateX(42px) rotate(-90deg) scale(0.5);
}
50% {
50%{
/* Hack to make FF rotate in the right direction */
-webkit-transform: translateX(42px) translateY(42px) rotate(-179deg);
transform: translateX(42px) translateY(42px) rotate(-179deg);
}
50 .1 % {
50.1% {
-webkit-transform: translateX(42px) translateY(42px) rotate(-180deg);
transform: translateX(42px) translateY(42px) rotate(-180deg);
}
@ -6661,7 +6661,7 @@ body.rtls .top-navigation .footer.fixed, body.rtls.top-navigation .footer.fixed
}
/*
*
* SKIN blue 云企联管理系统
* SKIN blue 云企联管理系统
* NAME - blue/purple
*
*/

View File

@ -477,6 +477,10 @@
add: function(id) {
var url = $.common.isEmpty(id) ? $.table._option.createUrl : $.table._option.createUrl.replace("{id}", id);
$.modal.open("添加" + $.table._option.modalName, url);
},
//跳转自定义
jumpModeltoUrl: function(modelName,url) {
$.modal.open(modelName, url);
},
// 修改信息
edit: function(id) {

File diff suppressed because it is too large Load Diff

125
ruoyi-exam/ruoyi-exam.iml Normal file
View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ruoyi-framework" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.34" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.34" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.34" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.12.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.github.penggle:kaptcha:2.3.2" level="project" />
<orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235-1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-hash:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-cipher:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-ogdl:1.4.0" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-event:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.4.0" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.11" level="project" />
<orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
<orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.19" level="project" />
<orderEntry type="module" module-name="ruoyi-common" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.6" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:4.2.1" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-starter:2.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-core:1.1.0" level="project" />
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-base:1.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-weekend:1.1.4.2" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.0" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.5" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.4" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.9.1" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.2" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:2.7.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.47" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
</component>
</module>

View File

@ -1,6 +1,11 @@
package com.ruoyi.exam.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.ruoyi.framework.web.util.ShiroUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -21,61 +26,65 @@ import com.ruoyi.common.utils.ExcelUtil;
/**
* 试题分类 信息操作处理
*
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
@Controller
@RequestMapping("/exam/examQuestionCategory")
public class ExamQuestionCategoryController extends BaseController
{
private String prefix = "exam/examQuestionCategory";
private String prefix = "exam/examQuestionCategory";
@Autowired
private IExamQuestionCategoryService examQuestionCategoryService;
@RequiresPermissions("exam:examQuestionCategory:view")
@GetMapping()
public String examQuestionCategory()
{
return prefix + "/examQuestionCategory";
return prefix + "/examQuestionCategory";
}
/**
* 查询试题分类列表
*/
@RequiresPermissions("exam:examQuestionCategory:list")
@PostMapping("/list")
@GetMapping("/list")
@ResponseBody
public TableDataInfo list(ExamQuestionCategory examQuestionCategory)
public List<ExamQuestionCategory> list(ExamQuestionCategory examQuestionCategory)
{
List<ExamQuestionCategory> list = examQuestionCategoryService.selectExamQuestionCategoryPage(examQuestionCategory);
return getDataTable(list);
List<ExamQuestionCategory> list = examQuestionCategoryService.selectExamQuestionCategoryList(examQuestionCategory);
return list;
}
/**
* 导出试题分类列表
*/
@RequiresPermissions("exam:examQuestionCategory:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ExamQuestionCategory examQuestionCategory)
{
List<ExamQuestionCategory> list = examQuestionCategoryService.selectExamQuestionCategoryList(examQuestionCategory);
ExcelUtil<ExamQuestionCategory> util = new ExcelUtil<ExamQuestionCategory>(ExamQuestionCategory.class);
return util.exportExcel(list, "examQuestionCategory");
}
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ExamQuestionCategory examQuestionCategory)
{
List<ExamQuestionCategory> list = examQuestionCategoryService.selectExamQuestionCategoryList(examQuestionCategory);
ExcelUtil<ExamQuestionCategory> util = new ExcelUtil<ExamQuestionCategory>(ExamQuestionCategory.class);
return util.exportExcel(list, "examQuestionCategory");
}
/**
* 新增试题分类
*/
@GetMapping("/add")
public String add()
@GetMapping("/add/{parentId}")
public String add(@PathVariable("parentId") String parentId, ModelMap mmap)
{
return prefix + "/add";
mmap.put("examQuestionCategory", examQuestionCategoryService.selectExamQuestionCategoryById(parentId));
return prefix + "/add";
}
/**
* 新增保存试题分类
*/
@ -84,8 +93,10 @@ public class ExamQuestionCategoryController extends BaseController
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ExamQuestionCategory examQuestionCategory)
{
return toAjax(examQuestionCategoryService.insert(examQuestionCategory));
{
examQuestionCategory.setCreateBy(ShiroUtils.getLoginName());
examQuestionCategory.setCreateDate(new Date());
return toAjax(examQuestionCategoryService.insertExamQuestionCategory(examQuestionCategory));
}
/**
@ -94,11 +105,11 @@ public class ExamQuestionCategoryController extends BaseController
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap)
{
ExamQuestionCategory examQuestionCategory = examQuestionCategoryService.selectById(id);
ExamQuestionCategory examQuestionCategory = examQuestionCategoryService.selectExamQuestionCategoryById(id);
mmap.put("examQuestionCategory", examQuestionCategory);
return prefix + "/edit";
return prefix + "/edit";
}
/**
* 修改保存试题分类
*/
@ -107,10 +118,10 @@ public class ExamQuestionCategoryController extends BaseController
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ExamQuestionCategory examQuestionCategory)
{
return toAjax(examQuestionCategoryService.updateById(examQuestionCategory));
{
return toAjax(examQuestionCategoryService.updateExamQuestionCategory(examQuestionCategory));
}
/**
* 删除试题分类
*/
@ -119,8 +130,52 @@ public class ExamQuestionCategoryController extends BaseController
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(examQuestionCategoryService.deleteByIds(ids));
{
return toAjax(examQuestionCategoryService.deleteExamQuestionCategoryByIds(ids));
}
/**
* 选择部门树
*/
@GetMapping("/selectExamQuestionCategoryTree/{examQuestionCategoryId}")
public String selectDeptTree(@PathVariable("examQuestionCategoryId") String examQuestionCategoryId, ModelMap mmap)
{
mmap.put("examQuestionCategory", examQuestionCategoryService.selectExamQuestionCategoryById(examQuestionCategoryId));
return prefix + "/tree";
}
/**
* 加载列表树
*/
@GetMapping("/treeData")
@ResponseBody
public List<Map<String, Object>> treeData()
{
List<Map<String, Object>> tree = examQuestionCategoryService.selectDeptTree();
return tree;
}
/**
* 选择部门树
*/
@GetMapping("/treeDataForAdd")
@ResponseBody
public List<Map<String, Object>> treeDataForAdd()
{
List<Map<String, Object>> tree = examQuestionCategoryService.selectDeptTree();
List<Map<String, Object>> res = new ArrayList<>();
for (Map<String, Object> stringObjectMap : tree) {
String pId = stringObjectMap.get("pId").toString();
if(pId.equals("0")||pId.equals("1")){
res.add(stringObjectMap);
}
}
return res;
}
}

View File

@ -1,15 +1,12 @@
package com.ruoyi.exam.controller;
import java.util.Enumeration;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.exam.domain.ExamQuestion;
@ -19,11 +16,12 @@ import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.utils.ExcelUtil;
/**
* 问题 信息操作处理
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
@Controller
@RequestMapping("/exam/examQuestion")
@ -40,6 +38,14 @@ public class ExamQuestionController extends BaseController
{
return prefix + "/examQuestion";
}
@GetMapping("/choiceadd/{id}")
public String addChoiceUrl(@PathVariable("id") String id, ModelMap mmap)
{
mmap.put("categoryId",id);
mmap.put("type",1);
return prefix + "/choiceadd";
}
/**
* 查询问题列表
@ -49,7 +55,7 @@ public class ExamQuestionController extends BaseController
@ResponseBody
public TableDataInfo list(ExamQuestion examQuestion)
{
List<ExamQuestion> list = examQuestionService.selectExamQuestionPage(examQuestion);
List<ExamQuestion> list = examQuestionService.selectExamQuestionList(examQuestion);
return getDataTable(list);
}
@ -83,9 +89,11 @@ public class ExamQuestionController extends BaseController
@Log(title = "问题", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ExamQuestion examQuestion)
{
return toAjax(examQuestionService.insert(examQuestion));
public AjaxResult addSave(ExamQuestion examQuestion,@RequestParam(value = "number", required = true) String[] number,
@RequestParam(value = "content", required = true) String[] content)
{
return toAjax(examQuestionService.insertQuestion(examQuestion,number,content));
}
/**
@ -94,7 +102,7 @@ public class ExamQuestionController extends BaseController
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap)
{
ExamQuestion examQuestion = examQuestionService.selectById(id);
ExamQuestion examQuestion = examQuestionService.selectExamQuestionById(id);
mmap.put("examQuestion", examQuestion);
return prefix + "/edit";
}
@ -108,7 +116,7 @@ public class ExamQuestionController extends BaseController
@ResponseBody
public AjaxResult editSave(ExamQuestion examQuestion)
{
return toAjax(examQuestionService.updateById(examQuestion));
return toAjax(examQuestionService.updateExamQuestion(examQuestion));
}
/**
@ -120,7 +128,7 @@ public class ExamQuestionController extends BaseController
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(examQuestionService.deleteByIds(ids));
return toAjax(examQuestionService.deleteExamQuestionByIds(ids));
}
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.exam.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
import javax.persistence.Id;
import java.util.Date;
@ -10,149 +11,130 @@ import java.util.Date;
* 试题分类表 exam_question_category
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public class ExamQuestionCategory
{
private static final long serialVersionUID = 1L;
/** */
@Id
private String id;
@Id
private Long id;
/** 分类 */
private String name;
/** */
private String parentId;
private Long parentId;
/** */
private String parentIds;
/** 创建者 */
private String createBy;
/** 创建时间 */
private Date createDate;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private Date updateDate;
/** 备注信息 */
private String remarks;
/** 删除标记 */
private String delFlag;
/** 设置 */
public void setId(String id)
private String orderNum;
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public void setId(Long id)
{
this.id = id;
}
/** 获取 */
public String getId()
public Long getId()
{
return id;
}
/** 设置分类 */
public void setName(String name)
{
this.name = name;
}
/** 获取分类 */
public String getName()
{
return name;
}
/** 设置 */
public void setParentId(String parentId)
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
/** 获取 */
public String getParentId()
public Long getParentId()
{
return parentId;
}
/** 设置 */
public void setParentIds(String parentIds)
{
this.parentIds = parentIds;
}
/** 获取 */
public String getParentIds()
{
return parentIds;
}
/** 设置创建者 */
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
/** 获取创建者 */
public String getCreateBy()
{
return createBy;
}
/** 设置创建时间 */
public void setCreateDate(Date createDate)
{
this.createDate = createDate;
}
/** 获取创建时间 */
public Date getCreateDate()
{
return createDate;
}
/** 设置更新者 */
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
/** 获取更新者 */
public String getUpdateBy()
{
return updateBy;
}
/** 设置更新时间 */
public void setUpdateDate(Date updateDate)
{
this.updateDate = updateDate;
}
/** 获取更新时间 */
public Date getUpdateDate()
{
return updateDate;
}
/** 设置备注信息 */
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
/** 获取备注信息 */
public String getRemarks()
{
return remarks;
}
/** 设置删除标记 */
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
/** 获取删除标记 */
public String getDelFlag()
{
return delFlag;

View File

@ -8,10 +8,17 @@ import com.ruoyi.framework.web.base.MyMapper;
* 试题分类 数据层
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public interface ExamQuestionCategoryMapper extends MyMapper<ExamQuestionCategory>
{
/**
* 查询试题分类信息
*
* @param id 试题分类ID
* @return 试题分类信息
*/
public ExamQuestionCategory selectExamQuestionCategoryById(String id);
/**
* 查询试题分类列表
@ -21,4 +28,36 @@ public interface ExamQuestionCategoryMapper extends MyMapper<ExamQuestionCatego
*/
public List<ExamQuestionCategory> selectExamQuestionCategoryList(ExamQuestionCategory examQuestionCategory);
/**
* 新增试题分类
*
* @param examQuestionCategory 试题分类信息
* @return 结果
*/
public int insertExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
/**
* 修改试题分类
*
* @param examQuestionCategory 试题分类信息
* @return 结果
*/
public int updateExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
/**
* 删除试题分类
*
* @param id 试题分类ID
* @return 结果
*/
public int deleteExamQuestionCategoryById(String id);
/**
* 批量删除试题分类
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExamQuestionCategoryByIds(String[] ids);
}

View File

@ -8,10 +8,17 @@ import com.ruoyi.framework.web.base.MyMapper;
* 问题点评 数据层
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public interface ExamQuestionCommentMapper extends MyMapper<ExamQuestionComment>
{
/**
* 查询问题点评信息
*
* @param id 问题点评ID
* @return 问题点评信息
*/
public ExamQuestionComment selectExamQuestionCommentById(String id);
/**
* 查询问题点评列表
@ -21,4 +28,36 @@ public interface ExamQuestionCommentMapper extends MyMapper<ExamQuestionComment
*/
public List<ExamQuestionComment> selectExamQuestionCommentList(ExamQuestionComment examQuestionComment);
/**
* 新增问题点评
*
* @param examQuestionComment 问题点评信息
* @return 结果
*/
public int insertExamQuestionComment(ExamQuestionComment examQuestionComment);
/**
* 修改问题点评
*
* @param examQuestionComment 问题点评信息
* @return 结果
*/
public int updateExamQuestionComment(ExamQuestionComment examQuestionComment);
/**
* 删除问题点评
*
* @param id 问题点评ID
* @return 结果
*/
public int deleteExamQuestionCommentById(String id);
/**
* 批量删除问题点评
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExamQuestionCommentByIds(String[] ids);
}

View File

@ -8,10 +8,17 @@ import com.ruoyi.framework.web.base.MyMapper;
* 问题选项 数据层
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public interface ExamQuestionItemMapper extends MyMapper<ExamQuestionItem>
{
/**
* 查询问题选项信息
*
* @param id 问题选项ID
* @return 问题选项信息
*/
public ExamQuestionItem selectExamQuestionItemById(String id);
/**
* 查询问题选项列表
@ -21,4 +28,36 @@ public interface ExamQuestionItemMapper extends MyMapper<ExamQuestionItem>
*/
public List<ExamQuestionItem> selectExamQuestionItemList(ExamQuestionItem examQuestionItem);
/**
* 新增问题选项
*
* @param examQuestionItem 问题选项信息
* @return 结果
*/
public int insertExamQuestionItem(ExamQuestionItem examQuestionItem);
/**
* 修改问题选项
*
* @param examQuestionItem 问题选项信息
* @return 结果
*/
public int updateExamQuestionItem(ExamQuestionItem examQuestionItem);
/**
* 删除问题选项
*
* @param id 问题选项ID
* @return 结果
*/
public int deleteExamQuestionItemById(String id);
/**
* 批量删除问题选项
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExamQuestionItemByIds(String[] ids);
}

View File

@ -8,10 +8,17 @@ import com.ruoyi.framework.web.base.MyMapper;
* 问题 数据层
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public interface ExamQuestionMapper extends MyMapper<ExamQuestion>
{
/**
* 查询问题信息
*
* @param id 问题ID
* @return 问题信息
*/
public ExamQuestion selectExamQuestionById(String id);
/**
* 查询问题列表
@ -21,4 +28,36 @@ public interface ExamQuestionMapper extends MyMapper<ExamQuestion>
*/
public List<ExamQuestion> selectExamQuestionList(ExamQuestion examQuestion);
/**
* 新增问题
*
* @param examQuestion 问题信息
* @return 结果
*/
public int insertExamQuestion(ExamQuestion examQuestion);
/**
* 修改问题
*
* @param examQuestion 问题信息
* @return 结果
*/
public int updateExamQuestion(ExamQuestion examQuestion);
/**
* 删除问题
*
* @param id 问题ID
* @return 结果
*/
public int deleteExamQuestionById(String id);
/**
* 批量删除问题
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExamQuestionByIds(String[] ids);
}

View File

@ -2,29 +2,56 @@ package com.ruoyi.exam.service;
import com.ruoyi.exam.domain.ExamQuestionCategory;
import java.util.List;
import java.util.Map;
import com.ruoyi.framework.web.base.AbstractBaseService;
/**
* 试题分类 服务层
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public interface IExamQuestionCategoryService extends AbstractBaseService<ExamQuestionCategory>
{
/**
* 查询试题分类分页列表
* 查询试题分类信息
*
* @param examQuestionCategory 试题分类信息
* @return 试题分类集合
* @param id 试题分类ID
* @return 试题分类信息
*/
public List<ExamQuestionCategory> selectExamQuestionCategoryPage(ExamQuestionCategory examQuestionCategory);
/**
public ExamQuestionCategory selectExamQuestionCategoryById(String id);
/**
* 查询试题分类列表
*
* @param examQuestionCategory 试题分类信息
* @return 试题分类集合
*/
public List<ExamQuestionCategory> selectExamQuestionCategoryList(ExamQuestionCategory examQuestionCategory);
public List<ExamQuestionCategory> selectExamQuestionCategoryList(ExamQuestionCategory examQuestionCategory);
/**
* 新增试题分类
*
* @param examQuestionCategory 试题分类信息
* @return 结果
*/
public int insertExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
/**
* 修改试题分类
*
* @param examQuestionCategory 试题分类信息
* @return 结果
*/
public int updateExamQuestionCategory(ExamQuestionCategory examQuestionCategory);
/**
* 删除试题分类信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExamQuestionCategoryByIds(String ids);
List<Map<String,Object>> selectDeptTree();
}

View File

@ -7,24 +7,49 @@ import com.ruoyi.framework.web.base.AbstractBaseService;
* 问题 服务层
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
public interface IExamQuestionService extends AbstractBaseService<ExamQuestion>
{
/**
* 查询问题分页列表
* 查询问题信息
*
* @param examQuestion 问题信息
* @return 问题集合
* @param id 问题ID
* @return 问题信息
*/
public List<ExamQuestion> selectExamQuestionPage(ExamQuestion examQuestion);
/**
public ExamQuestion selectExamQuestionById(String id);
/**
* 查询问题列表
*
* @param examQuestion 问题信息
* @return 问题集合
*/
public List<ExamQuestion> selectExamQuestionList(ExamQuestion examQuestion);
public List<ExamQuestion> selectExamQuestionList(ExamQuestion examQuestion);
/**
* 新增问题
*
* @param examQuestion 问题信息
* @return 结果
*/
public int insertExamQuestion(ExamQuestion examQuestion);
/**
* 修改问题
*
* @param examQuestion 问题信息
* @return 结果
*/
public int updateExamQuestion(ExamQuestion examQuestion);
/**
* 删除问题信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExamQuestionByIds(String ids);
int insertQuestion(ExamQuestion examQuestion, String[] number, String[] content);
}

View File

@ -1,6 +1,12 @@
package com.ruoyi.exam.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.system.domain.SysDept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.ExamQuestionCategoryMapper;
@ -8,41 +14,99 @@ import com.ruoyi.exam.domain.ExamQuestionCategory;
import com.ruoyi.exam.service.IExamQuestionCategoryService;
import com.ruoyi.common.support.Convert;
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
/**
* 试题分类 服务层实现
*
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
@Service
public class ExamQuestionCategoryServiceImpl extends AbstractBaseServiceImpl<ExamQuestionCategoryMapper,ExamQuestionCategory> implements IExamQuestionCategoryService
{
@Autowired
private ExamQuestionCategoryMapper examQuestionCategoryMapper;
public class ExamQuestionCategoryServiceImpl extends AbstractBaseServiceImpl<ExamQuestionCategoryMapper, ExamQuestionCategory> implements IExamQuestionCategoryService {
@Autowired
private ExamQuestionCategoryMapper examQuestionCategoryMapper;
/**
* 查询试题分类列表
*
* @param examQuestionCategory 试题分类信息
* @return 试题分类集合
*/
@Override
public List<ExamQuestionCategory> selectExamQuestionCategoryList(ExamQuestionCategory examQuestionCategory)
{
return examQuestionCategoryMapper.selectExamQuestionCategoryList(examQuestionCategory);
}
/**
* 查询试题分类分页列表
* 查询试题分类信息
*
* @param id 试题分类ID
* @return 试题分类信息
*/
@Override
public ExamQuestionCategory selectExamQuestionCategoryById(String id) {
return examQuestionCategoryMapper.selectExamQuestionCategoryById(id);
}
/**
* 查询试题分类列表
*
* @param examQuestionCategory 试题分类信息
* @return 试题分类集合
*/
@Override
public List<ExamQuestionCategory> selectExamQuestionCategoryPage(ExamQuestionCategory examQuestionCategory)
{
public List<ExamQuestionCategory> selectExamQuestionCategoryList(ExamQuestionCategory examQuestionCategory) {
startPage();
return examQuestionCategoryMapper.selectExamQuestionCategoryList(examQuestionCategory);
}
/**
* 新增试题分类
*
* @param examQuestionCategory 试题分类信息
* @return 结果
*/
@Override
public int insertExamQuestionCategory(ExamQuestionCategory examQuestionCategory) {
return examQuestionCategoryMapper.insertExamQuestionCategory(examQuestionCategory);
}
/**
* 修改试题分类
*
* @param examQuestionCategory 试题分类信息
* @return 结果
*/
@Override
public int updateExamQuestionCategory(ExamQuestionCategory examQuestionCategory) {
return examQuestionCategoryMapper.updateExamQuestionCategory(examQuestionCategory);
}
/**
* 删除试题分类对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteExamQuestionCategoryByIds(String ids) {
return examQuestionCategoryMapper.deleteExamQuestionCategoryByIds(Convert.toStrArray(ids));
}
@Override
public List<Map<String, Object>> selectDeptTree() {
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
List<ExamQuestionCategory> deptList = selectExamQuestionCategoryList(new ExamQuestionCategory());
trees = getTrees(deptList, false, null);
return trees;
}
private List<Map<String, Object>> getTrees(List<ExamQuestionCategory> deptList, boolean isCheck, List<String> roleDeptList) {
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
for (ExamQuestionCategory dept : deptList) {
Map<String, Object> deptMap = new HashMap<String, Object>();
deptMap.put("id", dept.getId());
deptMap.put("pId", dept.getParentId());
deptMap.put("name", dept.getName());
deptMap.put("title", dept.getName());
if (isCheck) {
deptMap.put("checked", roleDeptList.contains(dept.getId() + dept.getName()));
} else {
deptMap.put("checked", false);
}
trees.add(deptMap);
}
return trees;
}
}

View File

@ -1,6 +1,12 @@
package com.ruoyi.exam.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.ruoyi.exam.domain.ExamQuestionItem;
import com.ruoyi.exam.mapper.ExamQuestionItemMapper;
import com.ruoyi.framework.web.util.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.ExamQuestionMapper;
@ -10,9 +16,9 @@ import com.ruoyi.common.support.Convert;
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
/**
* 问题 服务层实现
*
*
* @author zhujj
* @date 2018-12-07
* @date 2018-12-06
*/
@Service
public class ExamQuestionServiceImpl extends AbstractBaseServiceImpl<ExamQuestionMapper,ExamQuestion> implements IExamQuestionService
@ -20,29 +26,91 @@ public class ExamQuestionServiceImpl extends AbstractBaseServiceImpl<ExamQuestio
@Autowired
private ExamQuestionMapper examQuestionMapper;
@Autowired
private ExamQuestionItemMapper examQuestionItemMapper;
/**
* 查询问题列表
*
* @param examQuestion 问题信息
* @return 问题集合
*/
* 查询问题信息
*
* @param id 问题ID
* @return 问题信息
*/
@Override
public ExamQuestion selectExamQuestionById(String id)
{
return examQuestionMapper.selectExamQuestionById(id);
}
/**
* 查询问题列表
*
* @param examQuestion 问题信息
* @return 问题集合
*/
@Override
public List<ExamQuestion> selectExamQuestionList(ExamQuestion examQuestion)
{
return examQuestionMapper.selectExamQuestionList(examQuestion);
startPage();
return examQuestionMapper.selectExamQuestionList(examQuestion);
}
/**
* 新增问题
*
* @param examQuestion 问题信息
* @return 结果
*/
@Override
public int insertExamQuestion(ExamQuestion examQuestion)
{
return examQuestionMapper.insertExamQuestion(examQuestion);
}
/**
* 修改问题
*
* @param examQuestion 问题信息
* @return 结果
*/
@Override
public int updateExamQuestion(ExamQuestion examQuestion)
{
return examQuestionMapper.updateExamQuestion(examQuestion);
}
/**
* 删除问题对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteExamQuestionByIds(String ids)
{
return examQuestionMapper.deleteExamQuestionByIds(Convert.toStrArray(ids));
}
@Override
public int insertQuestion(ExamQuestion examQuestion, String[] number, String[] content) {
Date date = new Date();
examQuestion.setCreateDate(date);
examQuestion.setCreateBy(ShiroUtils.getLoginName());
int i = examQuestionMapper.insertExamQuestion(examQuestion);
examQuestion.setCreateDate(null);
List<ExamQuestion> select = examQuestionMapper.selectExamQuestionList(examQuestion);
ExamQuestionItem examQuestionItem = new ExamQuestionItem();
for (int i1 = 0; i1 < number.length; i1++) {examQuestionItem.setContent(content[i1]);
examQuestionItem.setNumber(number[i1]);
examQuestionItem.setExamQuestionId(select.get(0).getId()+"");
examQuestionItem.setCreateDate(date);
examQuestionItem.setCreateBy(ShiroUtils.getLoginName());
examQuestionItemMapper.insertExamQuestionItem(examQuestionItem);
}
return i ;
}
/**
* 查询问题分页列表
*
* @param examQuestion 问题信息
* @return 问题集合
*/
@Override
public List<ExamQuestion> selectExamQuestionPage(ExamQuestion examQuestion)
{
startPage();
return examQuestionMapper.selectExamQuestionList(examQuestion);
}
}

View File

@ -15,15 +15,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateDate" column="update_date" />
<result property="remarks" column="remarks" />
<result property="delFlag" column="del_flag" />
<result property="orderNum" column="order_num" />
</resultMap>
<sql id="selectExamQuestionCategoryVo">
id, name, parent_id, parent_ids, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
select id, name, parent_id, parent_ids, create_by, create_date, update_by, update_date, remarks, del_flag,order_num from exam_question_category
</sql>
<select id="selectExamQuestionCategoryList" parameterType="ExamQuestionCategory" resultMap="ExamQuestionCategoryResult">
select
<include refid="selectExamQuestionCategoryVo"/>
from exam_question_category
<where>
<if test="id != null and id != '' "> and id = #{id}</if>
<if test="name != null and name != '' "> and name = #{name}</if>
@ -38,5 +38,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectExamQuestionCategoryById" parameterType="String" resultMap="ExamQuestionCategoryResult">
<include refid="selectExamQuestionCategoryVo"/>
where id = #{id}
</select>
<insert id="insertExamQuestionCategory" parameterType="ExamQuestionCategory">
insert into exam_question_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">id,</if>
<if test="name != null and name != '' ">name,</if>
<if test="parentId != null and parentId != '' ">parent_id,</if>
<if test="parentIds != null and parentIds != '' ">parent_ids,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="createDate != null ">create_date,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
<if test="updateDate != null ">update_date,</if>
<if test="remarks != null and remarks != '' ">remarks,</if>
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">#{id},</if>
<if test="name != null and name != '' ">#{name},</if>
<if test="parentId != null and parentId != '' ">#{parentId},</if>
<if test="parentIds != null and parentIds != '' ">#{parentIds},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="createDate != null ">#{createDate},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
<if test="updateDate != null ">#{updateDate},</if>
<if test="remarks != null and remarks != '' ">#{remarks},</if>
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
</trim>
</insert>
<update id="updateExamQuestionCategory" parameterType="ExamQuestionCategory">
update exam_question_category
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != '' ">name = #{name},</if>
<if test="parentId != null and parentId != '' ">parent_id = #{parentId},</if>
<if test="parentIds != null and parentIds != '' ">parent_ids = #{parentIds},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="createDate != null ">create_date = #{createDate},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="updateDate != null ">update_date = #{updateDate},</if>
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteExamQuestionCategoryById" parameterType="String">
delete from exam_question_category where id = #{id}
</delete>
<delete id="deleteExamQuestionCategoryByIds" parameterType="String">
delete from exam_question_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -18,12 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectExamQuestionItemVo">
id, content, number, exam_question_id, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
select id, content, number, exam_question_id, create_by, create_date, update_by, update_date, remarks, del_flag from exam_question_item
</sql>
<select id="selectExamQuestionItemList" parameterType="ExamQuestionItem" resultMap="ExamQuestionItemResult">
select
<include refid="selectExamQuestionItemVo"/>
from exam_question_item
<where>
<if test="id != null and id != '' "> and id = #{id}</if>
<if test="content != null and content != '' "> and content = #{content}</if>
@ -37,6 +36,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
</where>
</select>
<select id="selectExamQuestionItemById" parameterType="String" resultMap="ExamQuestionItemResult">
<include refid="selectExamQuestionItemVo"/>
where id = #{id}
</select>
<insert id="insertExamQuestionItem" parameterType="ExamQuestionItem">
insert into exam_question_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">id,</if>
<if test="content != null and content != '' ">content,</if>
<if test="number != null and number != '' ">number,</if>
<if test="examQuestionId != null and examQuestionId != '' ">exam_question_id,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="createDate != null ">create_date,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
<if test="updateDate != null ">update_date,</if>
<if test="remarks != null and remarks != '' ">remarks,</if>
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">#{id},</if>
<if test="content != null and content != '' ">#{content},</if>
<if test="number != null and number != '' ">#{number},</if>
<if test="examQuestionId != null and examQuestionId != '' ">#{examQuestionId},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="createDate != null ">#{createDate},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
<if test="updateDate != null ">#{updateDate},</if>
<if test="remarks != null and remarks != '' ">#{remarks},</if>
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
</trim>
</insert>
<update id="updateExamQuestionItem" parameterType="ExamQuestionItem">
update exam_question_item
<trim prefix="SET" suffixOverrides=",">
<if test="content != null and content != '' ">content = #{content},</if>
<if test="number != null and number != '' ">number = #{number},</if>
<if test="examQuestionId != null and examQuestionId != '' ">exam_question_id = #{examQuestionId},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="createDate != null ">create_date = #{createDate},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="updateDate != null ">update_date = #{updateDate},</if>
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteExamQuestionItemById" parameterType="String">
delete from exam_question_item where id = #{id}
</delete>
<delete id="deleteExamQuestionItemByIds" parameterType="String">
delete from exam_question_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.exam.mapper.ExamQuestionMapper">
<resultMap type="ExamQuestion" id="ExamQuestionResult">
<result property="id" column="id" />
<result property="title" column="title" />
@ -20,12 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectExamQuestionVo">
id, title, answer, type, label, category_id, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
select id, title, answer, type, label, category_id, create_by, create_date, update_by, update_date, remarks, del_flag from exam_question
</sql>
<select id="selectExamQuestionList" parameterType="ExamQuestion" resultMap="ExamQuestionResult">
select
<include refid="selectExamQuestionVo"/>
from exam_question
<where>
<if test="id != null and id != '' "> and id = #{id}</if>
<if test="title != null and title != '' "> and title = #{title}</if>
@ -42,5 +41,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectExamQuestionById" parameterType="String" resultMap="ExamQuestionResult">
<include refid="selectExamQuestionVo"/>
where id = #{id}
</select>
<insert id="insertExamQuestion" parameterType="ExamQuestion">
insert into exam_question
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">id,</if>
<if test="title != null and title != '' ">title,</if>
<if test="answer != null and answer != '' ">answer,</if>
<if test="type != null and type != '' ">type,</if>
<if test="label != null and label != '' ">label,</if>
<if test="categoryId != null and categoryId != '' ">category_id,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="createDate != null ">create_date,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
<if test="updateDate != null ">update_date,</if>
<if test="remarks != null and remarks != '' ">remarks,</if>
<if test="delFlag != null and delFlag != '' ">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != '' ">#{id},</if>
<if test="title != null and title != '' ">#{title},</if>
<if test="answer != null and answer != '' ">#{answer},</if>
<if test="type != null and type != '' ">#{type},</if>
<if test="label != null and label != '' ">#{label},</if>
<if test="categoryId != null and categoryId != '' ">#{categoryId},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="createDate != null ">#{createDate},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
<if test="updateDate != null ">#{updateDate},</if>
<if test="remarks != null and remarks != '' ">#{remarks},</if>
<if test="delFlag != null and delFlag != '' ">#{delFlag},</if>
</trim>
</insert>
<update id="updateExamQuestion" parameterType="ExamQuestion">
update exam_question
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != '' ">title = #{title},</if>
<if test="answer != null and answer != '' ">answer = #{answer},</if>
<if test="type != null and type != '' ">type = #{type},</if>
<if test="label != null and label != '' ">label = #{label},</if>
<if test="categoryId != null and categoryId != '' ">category_id = #{categoryId},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="createDate != null ">create_date = #{createDate},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="updateDate != null ">update_date = #{updateDate},</if>
<if test="remarks != null and remarks != '' ">remarks = #{remarks},</if>
<if test="delFlag != null and delFlag != '' ">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteExamQuestionById" parameterType="String">
delete from exam_question where id = #{id}
</delete>
<delete id="deleteExamQuestionByIds" parameterType="String">
delete from exam_question where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,140 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-examQuestion-add">
<div class="form-group">
<input type="hidden" id="categoryId" name="categoryId" th:value="${categoryId}">
<input type="hidden" id="type" name="type" th:value="${type}">
<label class="col-sm-3 control-label">问题标题:</label>
<div class="col-sm-8">
<input id="title" name="title" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">问题答案:</label>
<div class="col-sm-8">
<input id="answer" name="answer" class="form-control" type="text">
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label">问题选项:</label>
<div class="col-sm-1">
<input style="padding: 6px 10px" id="number1" name="number" class="form-control" type="text" value="A" readonly>
</div>
<div class="col-sm-7">
<input id="content1" name="content" class="form-control" type="text">
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label"></label>
<div class="col-sm-1">
<input style="padding: 6px 10px" id="number2" name="number" class="form-control" type="text" value="B" readonly>
</div>
<div class="col-sm-7">
<input id="content2" name="content" class="form-control" type="text">
</div>
</div>
<div class="form-group" id="addOption">
<label class="col-sm-4 control-label"></label>
<div class="col-sm-7">
<a style="text-align: center;color: #999;border: 1px #ccc dashed;display:block;height: 34px
;line-height: 34px" href="javascript:addOption();">添加选项</a>
</div>
</div>
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="col-sm-3 control-label">标签:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="label" name="label" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input id="remarks" name="remarks" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
$(function () {
if ($.validator) {
$.validator.prototype.elements = function () {
var validator = this,
rulesCache = {};
return $([]).add(this.currentForm.elements)
.filter(":input")
.not(":submit, :reset, :image, [disabled]")
.not(this.settings.ignore)
.filter(function () {
var elementIdentification = this.id || this.name;
!elementIdentification && validator.settings.debug && window.console && console.error("%o has no id nor name assigned", this);
if (elementIdentification in rulesCache || !validator.objectLength($(this).rules()))
return false;
rulesCache[elementIdentification] = true;
return true;
});
};
}
});
var item = ["C","D","E","F","G","H","I","G","K","L","M","N"];
var index = 0;
var prefix = ctx + "exam/examQuestion"
$("#form-examQuestion-add").validate({
rules:{
title:{
required:true,
},
content:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-examQuestion-add').serialize());
}
}
function addOption(){
$("#addOption").before(' <div class="form-group update1" id="div'+item[index]+'"> <label class="col-sm-3 control-label"></label> <div class="col-sm-1"> ' +
'<input style="padding: 6px 10px" id="number'+item[index]+'" name="number" class="form-control update2" type="text" value="'+item[index]+'" readonly> ' +
'</div> <div class="col-sm-7"> <input name="content" class="form-control" type="text"> </div> <div class="col-sm-1"> <a class="update3" style="text-align: center;color: #999;border: 1px #ccc dashed;display:block;height: 34px;line-height: 34px" href="javascript:deleteOption(\''+item[index++]+'\');">X</a> </div></div>')
}
function deleteOption(id){
debugger
$("#div"+id).remove();
index--;
var index1 = 0;
var index2 = 0;
var index3 = 0
$(".update1").each(function(){
$(this).attr("id","div"+item[index1++])
})
$(".update2").each(function(){
$(this).attr("value",item[index2++])
})
$(".update3").each(function(){
$(this).attr("href",'javascript:deleteOption(\''+item[index3++]+'\');');
})
}
</script>
</body>
</html>

View File

@ -2,178 +2,225 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
问题标题:<input type="text" name="title"/>
</li>
<div class="ui-layout-west">
<div class="main-content">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> 题库
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool menuItem" href="#" onclick="examQuestionCategory()"
title="题库管理"><i
class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i
class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i
class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新题库"><i
class="fa fa-refresh"></i></button>
</div>
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
</div>
<li>
问题答案:<input type="text" name="answer"/>
</li>
<li>
问题类型:<input type="text" name="type"/>
</li>
<div class="container-div ui-layout-center">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<input type="hidden" id="categoryId" name="categoryId">
<div class="select-list">
<ul>
<li>
问题标题:<input type="text" name="title"/>
</li>
<li>
标签:<input type="text" name="label"/>
</li>
<li>
问题类型:<select name="type" th:with="type=${@dict.getType('exam_question_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
类别:<input type="text" name="categoryId"/>
</li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<li>
创建者:<input type="text" name="createBy"/>
</li>
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="addChoiceQuestion()" shiro:hasPermission="exam:examQuestion:add">
<i class="fa fa-plus"></i> 添加选择题
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"
shiro:hasPermission="exam:examQuestion:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="exam:examQuestion:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:examQuestion:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('exam:examQuestion:edit')}]];
var removeFlag = [[${@permission.hasPermi('exam:examQuestion:remove')}]];
var prefix = ctx + "exam/examQuestion";
<li>
创建时间:<input type="text" name="createDate"/>
</li>
$(function () {
$('body').layout({west__size: 185});
queryExamQuestionList();
queryExamQuestionCategoryTree();
});
<li>
更新者:<input type="text" name="updateBy"/>
</li>
<li>
更新时间:<input type="text" name="updateDate"/>
</li>
<li>
备注信息:<input type="text" name="remarks"/>
</li>
<li>
删除标记:<input type="text" name="delFlag"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="exam:examQuestion:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="exam:examQuestion:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="exam:examQuestion:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:examQuestion:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('exam:examQuestion:edit')}]];
var removeFlag = [[${@permission.hasPermi('exam:examQuestion:remove')}]];
var prefix = ctx + "exam/examQuestion";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "问题",
search: false,
showExport: true,
columns: [{
checkbox: true
},
{
field : 'id',
title : '',
visible: false
},
{
field : 'title',
title : '问题标题',
sortable: true
},
{
field : 'answer',
title : '问题答案',
sortable: true
},
{
field : 'type',
title : '问题类型',
sortable: true
},
{
field : 'label',
title : '标签',
sortable: true
},
{
field : 'categoryId',
title : '类别',
sortable: true
},
{
field : 'createBy',
title : '创建者',
sortable: true
},
{
field : 'createDate',
title : '创建时间',
sortable: true
},
{
field : 'updateBy',
title : '更新者',
sortable: true
},
{
field : 'updateDate',
title : '更新时间',
sortable: true
},
{
field : 'remarks',
title : '备注信息',
sortable: true
},
{
field : 'delFlag',
title : '删除标记',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
function queryExamQuestionList() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "问题",
search: false,
showExport: true,
columns: [{
checkbox: true
},
{
field: 'id',
title: 'ID',
sortable: true
},
{
field: 'title',
title: '问题标题',
sortable: true
},
{
field: 'answer',
title: '问题答案',
sortable: true
},
{
field: 'type',
title: '问题类型',
sortable: true
},
{
field: 'label',
title: '标签',
sortable: true
},
{
field: 'createBy',
title: '创建者',
sortable: true
},
{
field: 'createDate',
title: '创建时间',
sortable: true
},
{
field: 'updateBy',
title: '更新者',
sortable: true
},
{
field: 'updateDate',
title: '更新时间',
sortable: true
},
{
field: 'remarks',
title: '备注信息',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
return actions.join('');
}
}]
};
$.table.init(options);
};
function queryExamQuestionCategoryTree() {
var url = ctx + "exam/examQuestionCategory/treeData";
var options = {
url: url,
expandLevel: 2,
onClick: zOnClick
};
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
if(treeNode.pId == 1 || treeNode.pId == 0 ||treeNode.pId == null) {
return;
}
$("#categoryId").val(treeNode.id);
$.table.search();
}
}
$('#btnExpand').click(function () {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function () {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function () {
queryExamQuestionCategoryTree();
});
/*用户管理-部门*/
function examQuestionCategory() {
var url = ctx + "exam/examQuestionCategory";
createMenuItem(url, "题库管理");
}
function addChoiceQuestion(){
if($("#categoryId").val() == null||$("#categoryId").val() == ''){
alert("请选择题库!")
return;
}
var url = prefix + "/choiceadd/"+$("#categoryId").val();
$.operate.jumpModeltoUrl("添加选择题",url);
}
</script>
</body>
</html>

View File

@ -5,60 +5,26 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-examQuestionCategory-add">
<div class="form-group">
<label class="col-sm-3 control-label">分类:</label>
<input id="treeId" name="parentId" type="hidden" th:value="${examQuestionCategory.id}" />
<div class="form-group">
<label class="col-sm-3 control-label ">上级名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" onclick="selectExamQuestionCategoryTree()" id="treeName" readonly="true" th:value="${examQuestionCategory.name}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">名称:</label>
<div class="col-sm-8">
<input id="name" name="name" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input id="parentId" name="parentId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input id="parentIds" name="parentIds" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建者:</label>
<div class="col-sm-8">
<input id="createBy" name="createBy" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createDate" name="createDate" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新者:</label>
<div class="col-sm-8">
<input id="updateBy" name="updateBy" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<input id="updateDate" name="updateDate" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input id="remarks" name="remarks" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标记:</label>
<div class="col-sm-8">
<input id="delFlag" name="delFlag" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
@ -66,7 +32,7 @@
var prefix = ctx + "exam/examQuestionCategory"
$("#form-examQuestionCategory-add").validate({
rules:{
xxxx:{
name:{
required:true,
},
}
@ -77,6 +43,23 @@
$.operate.save(prefix + "/add", $('#form-examQuestionCategory-add').serialize());
}
}
function selectExamQuestionCategoryTree() {
var options = {
title: '分类选择',
width: "380",
url: prefix + "/selectExamQuestionCategoryTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -12,19 +12,19 @@
<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input id="parentId" name="parentId" th:field="*{parentId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input id="parentIds" name="parentIds" th:field="*{parentIds}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label"></label>-->
<!--<div class="col-sm-8">-->
<!--<input id="parentId" name="parentId" th:field="*{parentId}" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label"></label>-->
<!--<div class="col-sm-8">-->
<!--<input id="parentIds" name="parentIds" th:field="*{parentIds}" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">
<label class="col-sm-3 control-label">创建者:</label>
<div class="col-sm-8">
<input id="createBy" name="createBy" th:field="*{createBy}" class="form-control" type="text">
@ -47,19 +47,19 @@
<div class="col-sm-8">
<input id="updateDate" name="updateDate" th:field="*{updateDate}" class="form-control" type="text">
</div>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input id="remarks" name="remarks" th:field="*{remarks}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标记:</label>
<div class="col-sm-8">
<input id="delFlag" name="delFlag" th:field="*{delFlag}" class="form-control" type="text">
</div>
</div>
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label">删除标记:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="delFlag" name="delFlag" th:field="*{delFlag}" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
</form>
</div>
<div th:include="include::footer"></div>

View File

@ -3,159 +3,123 @@
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
分类:<input type="text" name="name"/>
</li>
<li>
<input type="text" name="parentId"/>
</li>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
分类:<input type="text" name="name"/>
</li>
<li>
<input type="text" name="parentIds"/>
</li>
<li>
创建者:<input type="text" name="createBy"/>
</li>
<li>
创建时间:<input type="text" name="createDate"/>
</li>
<li>
更新者:<input type="text" name="updateBy"/>
</li>
<li>
更新时间:<input type="text" name="updateDate"/>
</li>
<li>
备注信息:<input type="text" name="remarks"/>
</li>
<li>
删除标记:<input type="text" name="delFlag"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="exam:examQuestionCategory:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="exam:examQuestionCategory:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="exam:examQuestionCategory:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:examQuestionCategory:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('exam:examQuestionCategory:edit')}]];
var removeFlag = [[${@permission.hasPermi('exam:examQuestionCategory:remove')}]];
var prefix = ctx + "exam/examQuestionCategory";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "试题分类",
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add(1)" shiro:hasPermission="exam:examQuestionCategory:add">
<i class="fa fa-plus"></i> 添加
</a>
<!--<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()"-->
<!--shiro:hasPermission="exam:examQuestionCategory:edit">-->
<!--<i class="fa fa-edit"></i> 修改-->
<!--</a>-->
<!--<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"-->
<!--shiro:hasPermission="exam:examQuestionCategory:remove">-->
<!--<i class="fa fa-remove"></i> 删除-->
<!--</a>-->
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()"-->
<!--shiro:hasPermission="exam:examQuestionCategory:export">-->
<!--<i class="fa fa-download"></i> 导出-->
<!--</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('exam:examQuestionCategory:edit')}]];
var removeFlag = [[${@permission.hasPermi('exam:examQuestionCategory:remove')}]];
var prefix = ctx + "exam/examQuestionCategory";
debugger
$(function () {
var options = {
code: "id",
parentCode: "parentId",
uniqueId: "id",
url: prefix + "/list",
createUrl: prefix + "/add/{id}",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "试题分类",
search: false,
showExport: true,
columns: [{
checkbox: true
},
columns: [{
field: 'selectItem',
radio: true
},
{
field: 'name',
title: '分类',
align: "left"
},
{
field: 'orderNum',
title: '排序',
align: "left"
},
{
field : 'id',
title : '',
visible: false
},
{
field : 'name',
title : '分类',
sortable: true
},
{
field : 'parentId',
title : '',
sortable: true
},
{
field : 'parentIds',
title : '',
sortable: true
},
{
field : 'createBy',
field : 'createBy',
title : '创建者',
sortable: true
align: "left"
},
{
field : 'createDate',
field : 'createDate',
title : '创建时间',
sortable: true
align: "left"
},
{
field : 'updateBy',
field : 'updateBy',
title : '更新者',
sortable: true
align: "left"
},
{
field : 'updateDate',
field : 'updateDate',
title : '更新时间',
sortable: true
align: "left"
},
{
field : 'remarks',
field : 'remarks',
title : '备注信息',
sortable: true
align: "left"
},
{
field : 'delFlag',
title : '删除标记',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
{
title: '操作',
align: 'left',
formatter: function (value, row, index) {
if(row.id == 1){
return '';
}
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
return actions.join('');
}
}]
};
$.treeTable.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<style>
body{height:auto;font-family: "Microsoft YaHei";}
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
<input id="treeId" name="treeId" type="hidden" th:value="${examQuestionCategory.id}"/>
<input id="treeName" name="treeName" type="hidden" th:value="${examQuestionCategory.name}"/>
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
<label id="btnShow" title="显示搜索" style="display:none;"></label>
<label id="btnHide" title="隐藏搜索"></label>
</div>
<div class="treeSearchInput" id="search">
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
</div>
<div class="treeExpandCollapse">
<a href="#" onclick="$.tree.expand()">展开</a> /
<a href="#" onclick="$.tree.collapse()">折叠</a>
</div>
<div id="tree" class="ztree treeselect"></div>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:inline="javascript">
$(function() {
var url = ctx + "exam/examQuestionCategory/treeDataForAdd";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
});
function zOnClick(event, treeId, treeNode) {
var treeId = treeNode.id;
var treeName = treeNode.name;
$("#treeId").val(treeId);
$("#treeName").val(treeName);
}
</script>
</body>
</html>

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>3.0</version>
<version>3.1</version>
</dependency>
</dependencies>

View File

@ -2,6 +2,7 @@ package com.ruoyi.quartz.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.domain.SysJobLog;
import tk.mybatis.mapper.common.Mapper;
@ -11,8 +12,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysJobLogMapper extends Mapper<SysJobLog>
{
public interface SysJobLogMapper extends Mapper<SysJobLog>,MyMapper<SysJobLog> {
/**
* 获取quartz调度器日志的计划任务
*

View File

@ -1,6 +1,8 @@
package com.ruoyi.quartz.mapper;
import java.util.List;
import com.ruoyi.framework.web.base.MyMapper;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.system.domain.SysConfig;
import tk.mybatis.mapper.common.Mapper;
@ -10,8 +12,7 @@ import tk.mybatis.mapper.common.Mapper;
*
* @author ruoyi
*/
public interface SysJobMapper extends Mapper<SysJob>
{
public interface SysJobMapper extends Mapper<SysJob>,MyMapper<SysJob> {
/**
* 查询调度任务日志集合
*

View File

@ -81,9 +81,9 @@
formatter: function(value, row, index) {
if (row.parentId != 0) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit">编辑</i></a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="#" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus">新增</i></a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.deptId + '\')"><i class="fa fa-remove">删除</i></a>');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit">编辑</i></a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="#" onclick="$.operate.add(\'' + row.id + '\')"><i class="fa fa-plus">新增</i></a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove">删除</i></a>');
return actions.join('');
} else {
return "";