试卷分类管理
This commit is contained in:
parent
960dca4982
commit
fa4aa371ab
|
|
@ -0,0 +1,184 @@
|
||||||
|
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;
|
||||||
|
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 com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.exam.domain.ExamPaperCategory;
|
||||||
|
import com.ruoyi.exam.service.IExamPaperCategoryService;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.ExcelUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷分类 信息操作处理
|
||||||
|
*
|
||||||
|
* @author zhujj
|
||||||
|
* @date 2018-12-11
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/exam/examPaperCategory")
|
||||||
|
public class ExamPaperCategoryController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "exam/examPaperCategory";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IExamPaperCategoryService examPaperCategoryService;
|
||||||
|
|
||||||
|
@RequiresPermissions("exam:examPaperCategory:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String examPaperCategory()
|
||||||
|
{
|
||||||
|
return prefix + "/examPaperCategory";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷分类列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("exam:examPaperCategory:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public List<ExamPaperCategory> list(ExamPaperCategory examPaperCategory)
|
||||||
|
{
|
||||||
|
List<ExamPaperCategory> list = examPaperCategoryService.selectExamPaperCategoryPage(examPaperCategory);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出试卷分类列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("exam:examPaperCategory:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(ExamPaperCategory examPaperCategory)
|
||||||
|
{
|
||||||
|
List<ExamPaperCategory> list = examPaperCategoryService.selectExamPaperCategoryList(examPaperCategory);
|
||||||
|
ExcelUtil<ExamPaperCategory> util = new ExcelUtil<ExamPaperCategory>(ExamPaperCategory.class);
|
||||||
|
return util.exportExcel(list, "examPaperCategory");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增试卷分类
|
||||||
|
*/
|
||||||
|
@GetMapping("/add/{parentId}")
|
||||||
|
public String add(@PathVariable("parentId") String parentId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
mmap.put("examPaperCategory",examPaperCategoryService.selectById(parentId));
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存试卷分类
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("exam:examPaperCategory:add")
|
||||||
|
@Log(title = "试卷分类", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(ExamPaperCategory examPaperCategory)
|
||||||
|
{
|
||||||
|
examPaperCategory.setCreateBy(ShiroUtils.getLoginName());
|
||||||
|
examPaperCategory.setCreateDate(new Date());
|
||||||
|
examPaperCategory.setDelFlag("0");
|
||||||
|
return toAjax(examPaperCategoryService.insert(examPaperCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改试卷分类
|
||||||
|
*/
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Integer id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
ExamPaperCategory examPaperCategory = examPaperCategoryService.selectById(id);
|
||||||
|
mmap.put("examPaperCategory", examPaperCategory);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存试卷分类
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("exam:examPaperCategory:edit")
|
||||||
|
@Log(title = "试卷分类", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(ExamPaperCategory examPaperCategory)
|
||||||
|
{
|
||||||
|
examPaperCategory.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
|
examPaperCategory.setUpdateDate(new Date());
|
||||||
|
return toAjax(examPaperCategoryService.updateSelectiveById(examPaperCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除试卷分类
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("exam:examPaperCategory:remove")
|
||||||
|
@Log(title = "试卷分类", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(examPaperCategoryService.deleteByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/selectExamPaperCategoryTree/{examPaperCategoryId}")
|
||||||
|
public String selectDeptTree(@PathVariable("examPaperCategoryId") String examPaperCategoryId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
mmap.put("examPaperCategory", examPaperCategoryService.selectById(examPaperCategoryId));
|
||||||
|
return prefix + "/tree";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择试卷分类树
|
||||||
|
*/
|
||||||
|
@GetMapping("/treeDataForAdd")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> treeDataForAdd()
|
||||||
|
{
|
||||||
|
List<Map<String, Object>> tree = examPaperCategoryService.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
|
@RequiresPermissions("system:examPaperCategory:remove")
|
||||||
|
@PostMapping("/remove/{id}")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(@PathVariable("id") Integer id)
|
||||||
|
{
|
||||||
|
ExamPaperCategory examPaperCategory = new ExamPaperCategory();
|
||||||
|
examPaperCategory.setParentId(id);
|
||||||
|
if (examPaperCategoryService.selectList(examPaperCategory).size() > 0)
|
||||||
|
{
|
||||||
|
return error(1, "存在下级分类,不允许删除");
|
||||||
|
}
|
||||||
|
|
||||||
|
return toAjax(examPaperCategoryService.deleteById(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,194 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷分类表 exam_paper_category
|
||||||
|
*
|
||||||
|
* @author zhujj
|
||||||
|
* @date 2018-12-11
|
||||||
|
*/
|
||||||
|
public class ExamPaperCategory
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 试卷分类 */
|
||||||
|
@Id
|
||||||
|
private Integer id;
|
||||||
|
/** 部门ID */
|
||||||
|
private Integer deptId;
|
||||||
|
/** */
|
||||||
|
private Integer parentId;
|
||||||
|
/** */
|
||||||
|
private String parentIds;
|
||||||
|
/** 分类 */
|
||||||
|
private String name;
|
||||||
|
/** 排序号 */
|
||||||
|
private Integer orderNum;
|
||||||
|
/** 创建者 */
|
||||||
|
private String createBy;
|
||||||
|
/** 创建时间 */
|
||||||
|
private Date createDate;
|
||||||
|
/** 更新者 */
|
||||||
|
private String updateBy;
|
||||||
|
/** 更新时间 */
|
||||||
|
private Date updateDate;
|
||||||
|
/** 备注信息 */
|
||||||
|
private String remarks;
|
||||||
|
/** 删除标记 */
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/** 设置试卷分类 */
|
||||||
|
public void setId(Integer id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取试卷分类 */
|
||||||
|
public Integer getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/** 设置部门ID */
|
||||||
|
public void setDeptId(Integer deptId)
|
||||||
|
{
|
||||||
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取部门ID */
|
||||||
|
public Integer getDeptId()
|
||||||
|
{
|
||||||
|
return deptId;
|
||||||
|
}
|
||||||
|
/** 设置 */
|
||||||
|
public void setParentId(Integer parentId)
|
||||||
|
{
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取 */
|
||||||
|
public Integer getParentId()
|
||||||
|
{
|
||||||
|
return parentId;
|
||||||
|
}
|
||||||
|
/** 设置 */
|
||||||
|
public void setParentIds(String parentIds)
|
||||||
|
{
|
||||||
|
this.parentIds = parentIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取 */
|
||||||
|
public String getParentIds()
|
||||||
|
{
|
||||||
|
return parentIds;
|
||||||
|
}
|
||||||
|
/** 设置分类 */
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取分类 */
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/** 设置排序号 */
|
||||||
|
public void setOrderNum(Integer orderNum)
|
||||||
|
{
|
||||||
|
this.orderNum = orderNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取排序号 */
|
||||||
|
public Integer getOrderNum()
|
||||||
|
{
|
||||||
|
return orderNum;
|
||||||
|
}
|
||||||
|
/** 设置创建者 */
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("deptId", getDeptId())
|
||||||
|
.append("parentId", getParentId())
|
||||||
|
.append("parentIds", getParentIds())
|
||||||
|
.append("name", getName())
|
||||||
|
.append("orderNum", getOrderNum())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createDate", getCreateDate())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateDate", getUpdateDate())
|
||||||
|
.append("remarks", getRemarks())
|
||||||
|
.append("delFlag", getDelFlag())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.ruoyi.exam.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.exam.domain.ExamPaperCategory;
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.framework.web.base.MyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷分类 数据层
|
||||||
|
*
|
||||||
|
* @author zhujj
|
||||||
|
* @date 2018-12-11
|
||||||
|
*/
|
||||||
|
public interface ExamPaperCategoryMapper extends MyMapper<ExamPaperCategory>
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷分类列表
|
||||||
|
*
|
||||||
|
* @param examPaperCategory 试卷分类信息
|
||||||
|
* @return 试卷分类集合
|
||||||
|
*/
|
||||||
|
public List<ExamPaperCategory> selectExamPaperCategoryList(ExamPaperCategory examPaperCategory);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.ruoyi.exam.service;
|
||||||
|
|
||||||
|
import com.ruoyi.exam.domain.ExamPaperCategory;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.ruoyi.framework.web.base.AbstractBaseService;
|
||||||
|
/**
|
||||||
|
* 试卷分类 服务层
|
||||||
|
*
|
||||||
|
* @author zhujj
|
||||||
|
* @date 2018-12-11
|
||||||
|
*/
|
||||||
|
public interface IExamPaperCategoryService extends AbstractBaseService<ExamPaperCategory>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询试卷分类分页列表
|
||||||
|
*
|
||||||
|
* @param examPaperCategory 试卷分类信息
|
||||||
|
* @return 试卷分类集合
|
||||||
|
*/
|
||||||
|
public List<ExamPaperCategory> selectExamPaperCategoryPage(ExamPaperCategory examPaperCategory);
|
||||||
|
/**
|
||||||
|
* 查询试卷分类列表
|
||||||
|
*
|
||||||
|
* @param examPaperCategory 试卷分类信息
|
||||||
|
* @return 试卷分类集合
|
||||||
|
*/
|
||||||
|
public List<ExamPaperCategory> selectExamPaperCategoryList(ExamPaperCategory examPaperCategory);
|
||||||
|
|
||||||
|
|
||||||
|
List<Map<String,Object>> selectDeptTree();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
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.exam.domain.ExamQuestionCategory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.exam.mapper.ExamPaperCategoryMapper;
|
||||||
|
import com.ruoyi.exam.domain.ExamPaperCategory;
|
||||||
|
import com.ruoyi.exam.service.IExamPaperCategoryService;
|
||||||
|
import com.ruoyi.common.support.Convert;
|
||||||
|
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
|
||||||
|
/**
|
||||||
|
* 试卷分类 服务层实现
|
||||||
|
*
|
||||||
|
* @author zhujj
|
||||||
|
* @date 2018-12-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ExamPaperCategoryServiceImpl extends AbstractBaseServiceImpl<ExamPaperCategoryMapper,ExamPaperCategory> implements IExamPaperCategoryService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ExamPaperCategoryMapper examPaperCategoryMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷分类列表
|
||||||
|
*
|
||||||
|
* @param examPaperCategory 试卷分类信息
|
||||||
|
* @return 试卷分类集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ExamPaperCategory> selectExamPaperCategoryList(ExamPaperCategory examPaperCategory)
|
||||||
|
{
|
||||||
|
return examPaperCategoryMapper.selectExamPaperCategoryList(examPaperCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> selectDeptTree() {
|
||||||
|
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
||||||
|
List<ExamPaperCategory> deptList = selectExamPaperCategoryList(new ExamPaperCategory());
|
||||||
|
trees = getTrees(deptList, false, null);
|
||||||
|
return trees;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map<String, Object>> getTrees(List<ExamPaperCategory> deptList, boolean isCheck, List<String> roleDeptList) {
|
||||||
|
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
||||||
|
for (ExamPaperCategory 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷分类分页列表
|
||||||
|
*
|
||||||
|
* @param examPaperCategory 试卷分类信息
|
||||||
|
* @return 试卷分类集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ExamPaperCategory> selectExamPaperCategoryPage(ExamPaperCategory examPaperCategory)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
return examPaperCategoryMapper.selectExamPaperCategoryList(examPaperCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.exam.mapper.ExamPaperCategoryMapper">
|
||||||
|
|
||||||
|
<resultMap type="ExamPaperCategory" id="ExamPaperCategoryResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="deptId" column="dept_id" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="parentIds" column="parent_ids" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="orderNum" column="order_num" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createDate" column="create_date" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateDate" column="update_date" />
|
||||||
|
<result property="remarks" column="remarks" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectExamPaperCategoryVo">
|
||||||
|
id, dept_id, parent_id, parent_ids, name, order_num, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||||
|
|
||||||
|
<select id="selectExamPaperCategoryList" parameterType="ExamPaperCategory" resultMap="ExamPaperCategoryResult">
|
||||||
|
select
|
||||||
|
<include refid="selectExamPaperCategoryVo"/>
|
||||||
|
from exam_paper_category
|
||||||
|
<where>
|
||||||
|
<if test="id != null "> and id = #{id}</if>
|
||||||
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="parentIds != null and parentIds != '' "> and parent_ids = #{parentIds}</if>
|
||||||
|
<if test="name != null and name != '' "> and name = #{name}</if>
|
||||||
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||||
|
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
|
||||||
|
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||||
|
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
|
||||||
|
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||||
|
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
|
||||||
|
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
<!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-examPaperCategory-add">
|
||||||
|
<input id="treeId" name="parentId" type="hidden" th:value="${examPaperCategory.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="selectExamPaperCategoryTree()" id="treeName" readonly="true" th:value="${examPaperCategory.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="orderNum" name="orderNum" 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">
|
||||||
|
var prefix = ctx + "exam/examPaperCategory"
|
||||||
|
$("#form-examPaperCategory-add").validate({
|
||||||
|
rules:{
|
||||||
|
name:{
|
||||||
|
required:true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-examPaperCategory-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectExamPaperCategoryTree() {
|
||||||
|
var options = {
|
||||||
|
title: '分类选择',
|
||||||
|
width: "380",
|
||||||
|
url: prefix + "/selectExamPaperCategoryTree/" + $("#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>
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
<!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-examPaperCategory-edit" th:object="${examPaperCategory}">
|
||||||
|
<input id="id" name="id" th:field="*{id}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">分类:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<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="orderNum" name="orderNum" th:field="*{orderNum}" 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" th:field="*{remarks}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var prefix = ctx + "exam/examPaperCategory"
|
||||||
|
$("#form-examPaperCategory-edit").validate({
|
||||||
|
rules:{
|
||||||
|
name:{
|
||||||
|
required:true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-examPaperCategory-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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:examPaperCategory:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<!--<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="exam:examPaperCategory:edit">-->
|
||||||
|
<!--<i class="fa fa-edit"></i> 修改-->
|
||||||
|
<!--</a>-->
|
||||||
|
<!--<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="exam:examPaperCategory:remove">-->
|
||||||
|
<!--<i class="fa fa-remove"></i> 删除-->
|
||||||
|
<!--</a>-->
|
||||||
|
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="exam:examPaperCategory: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:examPaperCategory:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('exam:examPaperCategory:remove')}]];
|
||||||
|
var prefix = ctx + "exam/examPaperCategory";
|
||||||
|
|
||||||
|
$(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: [{
|
||||||
|
field: 'selectItem',
|
||||||
|
radio: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field : 'name',
|
||||||
|
title : '分类',
|
||||||
|
align: "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field : 'createBy',
|
||||||
|
title : '创建者',
|
||||||
|
align: "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field : 'remarks',
|
||||||
|
title : '备注信息',
|
||||||
|
align: "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
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="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.treeTable.init(options);
|
||||||
|
});
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
$.modal.confirm("确定删除该条" + $.table._option.modalName + "信息吗?", function() {
|
||||||
|
$.ajax({
|
||||||
|
type : 'post',
|
||||||
|
url: prefix + "/remove/" + id,
|
||||||
|
success : function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$.modal.msgSuccess(result.msg);
|
||||||
|
$.treeTable.refresh();
|
||||||
|
} else {
|
||||||
|
$.modal.msgError(result.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -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="${examPaperCategory.id}"/>
|
||||||
|
<input id="treeName" name="treeName" type="hidden" th:value="${examPaperCategory.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/examPaperCategory/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>
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
var prefix = ctx + "exam/examQuestionCategory"
|
var prefix = ctx + "exam/examQuestionCategory"
|
||||||
$("#form-examQuestionCategory-edit").validate({
|
$("#form-examQuestionCategory-edit").validate({
|
||||||
rules:{
|
rules:{
|
||||||
xxxx:{
|
name:{
|
||||||
required:true,
|
required:true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue