20200528-zlp-1
1已完善培训管理功能 2新增多级字典管理功能
This commit is contained in:
@ -96,7 +96,7 @@ public class CommonController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求
|
||||
* 通用上传请求 wuyong
|
||||
*/
|
||||
@PostMapping("/common/uploadqiniu")
|
||||
public AjaxResult uploadFileQiNiu(MultipartFile file) throws Exception {
|
||||
|
@ -0,0 +1,92 @@
|
||||
package com.ruoyi.project.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.ruoyi.project.system.domain.SysDictMoedata;
|
||||
import com.ruoyi.project.system.service.ISysDictMoedataService;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 多级字典管理Controller
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/moedata")
|
||||
public class SysDictMoedataController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDictMoedataService sysDictMoedataService;
|
||||
|
||||
/**
|
||||
* 查询多级字典管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:moedata:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysDictMoedata sysDictMoedata) {
|
||||
|
||||
List<SysDictMoedata> list = sysDictMoedataService.selectSysDictMoedataList(sysDictMoedata);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取多级字典管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:moedata:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(sysDictMoedataService.selectSysDictMoedataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增多级字典管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:moedata:add')")
|
||||
@Log(title = "多级字典管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysDictMoedata sysDictMoedata) {
|
||||
sysDictMoedata.setIsdel("0");
|
||||
if (sysDictMoedata.getPid() == null) {
|
||||
sysDictMoedata.setPid((long) 0);
|
||||
sysDictMoedata.setAncestors("0");
|
||||
} else {
|
||||
sysDictMoedata.setAncestors("0," + sysDictMoedata.getPid());
|
||||
}
|
||||
return toAjax(sysDictMoedataService.insertSysDictMoedata(sysDictMoedata));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改多级字典管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:moedata:edit')")
|
||||
@Log(title = "多级字典管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysDictMoedata sysDictMoedata) {
|
||||
return toAjax(sysDictMoedataService.updateSysDictMoedata(sysDictMoedata));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除多级字典管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:moedata:remove')")
|
||||
@Log(title = "多级字典管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(sysDictMoedataService.deleteSysDictMoedataByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.ruoyi.project.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 多级字典管理对象 sys_dict_moedata
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-28
|
||||
*/
|
||||
public class SysDictMoedata extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 父节点 */
|
||||
@Excel(name = "父节点")
|
||||
private Long pid;
|
||||
|
||||
/** 所有节点 */
|
||||
@Excel(name = "所有节点")
|
||||
private String ancestors;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long ordersum;
|
||||
|
||||
/** 标识关键字 */
|
||||
@Excel(name = "标识关键字")
|
||||
private String keyword;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private String isdel;
|
||||
|
||||
/** 子部门 */
|
||||
private List<SysDictMoedata> children = new ArrayList<SysDictMoedata>();
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPid(Long pid)
|
||||
{
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public Long getPid()
|
||||
{
|
||||
return pid;
|
||||
}
|
||||
public void setAncestors(String ancestors)
|
||||
{
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
public String getAncestors()
|
||||
{
|
||||
return ancestors;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setOrdersum(Long ordersum)
|
||||
{
|
||||
this.ordersum = ordersum;
|
||||
}
|
||||
|
||||
public Long getOrdersum()
|
||||
{
|
||||
return ordersum;
|
||||
}
|
||||
public void setKeyword(String keyword)
|
||||
{
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public String getKeyword()
|
||||
{
|
||||
return keyword;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setIsdel(String isdel)
|
||||
{
|
||||
this.isdel = isdel;
|
||||
}
|
||||
|
||||
public String getIsdel()
|
||||
{
|
||||
return isdel;
|
||||
}
|
||||
public List<SysDictMoedata> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<SysDictMoedata> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("pid", getPid())
|
||||
.append("ancestors", getAncestors())
|
||||
.append("name", getName())
|
||||
.append("ordersum", getOrdersum())
|
||||
.append("keyword", getKeyword())
|
||||
.append("status", getStatus())
|
||||
.append("isdel", getIsdel())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.system.domain.SysDictMoedata;
|
||||
|
||||
/**
|
||||
* 多级字典管理Mapper接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-28
|
||||
*/
|
||||
public interface SysDictMoedataMapper
|
||||
{
|
||||
/**
|
||||
* 查询多级字典管理
|
||||
*
|
||||
* @param id 多级字典管理ID
|
||||
* @return 多级字典管理
|
||||
*/
|
||||
public SysDictMoedata selectSysDictMoedataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询多级字典管理列表
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 多级字典管理集合
|
||||
*/
|
||||
public List<SysDictMoedata> selectSysDictMoedataList(SysDictMoedata sysDictMoedata);
|
||||
|
||||
/**
|
||||
* 新增多级字典管理
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDictMoedata(SysDictMoedata sysDictMoedata);
|
||||
|
||||
/**
|
||||
* 修改多级字典管理
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDictMoedata(SysDictMoedata sysDictMoedata);
|
||||
|
||||
/**
|
||||
* 删除多级字典管理
|
||||
*
|
||||
* @param id 多级字典管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictMoedataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除多级字典管理
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictMoedataByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.project.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.project.system.domain.SysDictMoedata;
|
||||
|
||||
/**
|
||||
* 多级字典管理Service接口
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-28
|
||||
*/
|
||||
public interface ISysDictMoedataService
|
||||
{
|
||||
/**
|
||||
* 查询多级字典管理
|
||||
*
|
||||
* @param id 多级字典管理ID
|
||||
* @return 多级字典管理
|
||||
*/
|
||||
public SysDictMoedata selectSysDictMoedataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询多级字典管理列表
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 多级字典管理集合
|
||||
*/
|
||||
public List<SysDictMoedata> selectSysDictMoedataList(SysDictMoedata sysDictMoedata);
|
||||
|
||||
/**
|
||||
* 新增多级字典管理
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDictMoedata(SysDictMoedata sysDictMoedata);
|
||||
|
||||
/**
|
||||
* 修改多级字典管理
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDictMoedata(SysDictMoedata sysDictMoedata);
|
||||
|
||||
/**
|
||||
* 批量删除多级字典管理
|
||||
*
|
||||
* @param ids 需要删除的多级字典管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictMoedataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除多级字典管理信息
|
||||
*
|
||||
* @param id 多级字典管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDictMoedataById(Long id);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.ruoyi.project.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.project.system.mapper.SysDictMoedataMapper;
|
||||
import com.ruoyi.project.system.domain.SysDictMoedata;
|
||||
import com.ruoyi.project.system.service.ISysDictMoedataService;
|
||||
|
||||
/**
|
||||
* 多级字典管理Service业务层处理
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-28
|
||||
*/
|
||||
@Service
|
||||
public class SysDictMoedataServiceImpl implements ISysDictMoedataService
|
||||
{
|
||||
@Autowired
|
||||
private SysDictMoedataMapper sysDictMoedataMapper;
|
||||
|
||||
/**
|
||||
* 查询多级字典管理
|
||||
*
|
||||
* @param id 多级字典管理ID
|
||||
* @return 多级字典管理
|
||||
*/
|
||||
@Override
|
||||
public SysDictMoedata selectSysDictMoedataById(Long id)
|
||||
{
|
||||
return sysDictMoedataMapper.selectSysDictMoedataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询多级字典管理列表
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 多级字典管理
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictMoedata> selectSysDictMoedataList(SysDictMoedata sysDictMoedata)
|
||||
{
|
||||
return sysDictMoedataMapper.selectSysDictMoedataList(sysDictMoedata);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增多级字典管理
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysDictMoedata(SysDictMoedata sysDictMoedata)
|
||||
{
|
||||
sysDictMoedata.setCreateTime(DateUtils.getNowDate());
|
||||
return sysDictMoedataMapper.insertSysDictMoedata(sysDictMoedata);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改多级字典管理
|
||||
*
|
||||
* @param sysDictMoedata 多级字典管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysDictMoedata(SysDictMoedata sysDictMoedata)
|
||||
{
|
||||
return sysDictMoedataMapper.updateSysDictMoedata(sysDictMoedata);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除多级字典管理
|
||||
*
|
||||
* @param ids 需要删除的多级字典管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDictMoedataByIds(Long[] ids)
|
||||
{
|
||||
return sysDictMoedataMapper.deleteSysDictMoedataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除多级字典管理信息
|
||||
*
|
||||
* @param id 多级字典管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDictMoedataById(Long id)
|
||||
{
|
||||
return sysDictMoedataMapper.deleteSysDictMoedataById(id);
|
||||
}
|
||||
}
|
@ -24,11 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectByTrainVideoList" parameterType="ByTrainVideo" resultMap="ByTrainVideoResult">
|
||||
<include refid="selectByTrainVideoVo"/>
|
||||
<where>
|
||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="information != null and information != ''"> and information = #{information}</if>
|
||||
<if test="lecturer != null "> and lecturer = #{lecturer}</if>
|
||||
<if test="videourl != null and videourl != ''"> and videourl = #{videourl}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="type != null and type != ''"> and type like concat('', #{type}, '%')</if>
|
||||
<if test="classtype != null and classtype != ''"> and classtype = #{classtype}</if>
|
||||
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
||||
<if test="createtime != null "> and createtime = #{createtime}</if>
|
||||
|
@ -0,0 +1,91 @@
|
||||
<?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.project.system.mapper.SysDictMoedataMapper">
|
||||
|
||||
<resultMap type="SysDictMoedata" id="SysDictMoedataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="pid" column="pid" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="name" column="name" />
|
||||
<result property="ordersum" column="ordersum" />
|
||||
<result property="keyword" column="keyword" />
|
||||
<result property="status" column="status" />
|
||||
<result property="isdel" column="isdel" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysDictMoedataVo">
|
||||
select id, pid, ancestors, name, ordersum, keyword, status, isdel, create_time from sys_dict_moedata
|
||||
</sql>
|
||||
|
||||
<select id="selectSysDictMoedataList" parameterType="SysDictMoedata" resultMap="SysDictMoedataResult">
|
||||
<include refid="selectSysDictMoedataVo"/>
|
||||
where isdel = '0'
|
||||
<if test="pid != null "> and pid = #{pid}</if>
|
||||
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="ordersum != null "> and ordersum = #{ordersum}</if>
|
||||
<if test="keyword != null and keyword != ''"> and keyword = #{keyword}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSysDictMoedataById" parameterType="Long" resultMap="SysDictMoedataResult">
|
||||
<include refid="selectSysDictMoedataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysDictMoedata" parameterType="SysDictMoedata">
|
||||
insert into sys_dict_moedata
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">id,</if>
|
||||
<if test="pid != null ">pid,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="ordersum != null ">ordersum,</if>
|
||||
<if test="keyword != null and keyword != ''">keyword,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="isdel != null and isdel != ''">isdel,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">#{id},</if>
|
||||
<if test="pid != null ">#{pid},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="ordersum != null ">#{ordersum},</if>
|
||||
<if test="keyword != null and keyword != ''">#{keyword},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="isdel != null and isdel != ''">#{isdel},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysDictMoedata" parameterType="SysDictMoedata">
|
||||
update sys_dict_moedata
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="pid != null ">pid = #{pid},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="ordersum != null ">ordersum = #{ordersum},</if>
|
||||
<if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="isdel != null and isdel != ''">isdel = #{isdel},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysDictMoedataById" parameterType="Long">
|
||||
update from sys_dict_moedata set isdel='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysDictMoedataByIds" parameterType="String">
|
||||
update from sys_dict_moedata set isdel='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user