20200528-zlp-1
1已完善培训管理功能 2新增多级字典管理功能
This commit is contained in:
parent
08ddca0ca8
commit
131a235d2e
@ -18,7 +18,7 @@ import './assets/icons' // icon
|
|||||||
import './permission' // permission control
|
import './permission' // permission control
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
import { getConfigKey } from "@/api/system/config";
|
import { getConfigKey } from "@/api/system/config";
|
||||||
import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi";
|
import { parseTime, resetForm, addDateRange, selectDictLabel,selectMoeDictLabel, download, handleTree } from "@/utils/ruoyi";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
|
|
||||||
import Video from 'video.js'
|
import Video from 'video.js'
|
||||||
@ -32,6 +32,7 @@ Vue.prototype.parseTime = parseTime
|
|||||||
Vue.prototype.resetForm = resetForm
|
Vue.prototype.resetForm = resetForm
|
||||||
Vue.prototype.addDateRange = addDateRange
|
Vue.prototype.addDateRange = addDateRange
|
||||||
Vue.prototype.selectDictLabel = selectDictLabel
|
Vue.prototype.selectDictLabel = selectDictLabel
|
||||||
|
Vue.prototype.selectMoeDictLabel = selectMoeDictLabel
|
||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
Vue.prototype.handleTree = handleTree
|
Vue.prototype.handleTree = handleTree
|
||||||
|
|
||||||
|
@ -77,6 +77,18 @@ export function selectDictLabel(datas, value) {
|
|||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 回显数据字典
|
||||||
|
export function selectMoeDictLabel(datas, value) {
|
||||||
|
var actions = [];
|
||||||
|
Object.keys(datas).map((key) => {
|
||||||
|
if (datas[key].id == ('' + value)) {
|
||||||
|
actions.push(datas[key].name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
|
||||||
// 通用下载方法
|
// 通用下载方法
|
||||||
export function download(fileName) {
|
export function download(fileName) {
|
||||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="视频标题" prop="title">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.title"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
placeholder="请输入培训视频标题"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="讲师姓名" prop="lecturer">
|
<el-form-item label="讲师姓名" prop="lecturer">
|
||||||
<el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师">
|
<el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师">
|
||||||
<el-option
|
<el-option
|
||||||
@ -12,20 +21,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属类别" prop="type">
|
<el-form-item label="所属类别" prop="type">
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择所属类别" clearable size="small">
|
<el-cascader
|
||||||
<el-option label="请选择字典生成" value />
|
placeholder="请选择所属类别"
|
||||||
</el-select>
|
v-model="queryParams.type"
|
||||||
</el-form-item>
|
:options="optionTypes"
|
||||||
<el-form-item label="创建时间" prop="createtime">
|
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||||
<el-date-picker
|
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
></el-cascader>
|
||||||
style="width: 200px"
|
|
||||||
v-model="queryParams.createtime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择创建时间"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@ -71,7 +73,7 @@
|
|||||||
<el-table-column label="培训视频标题" align="center" prop="title" />
|
<el-table-column label="培训视频标题" align="center" prop="title" />
|
||||||
<el-table-column label="视频简介" align="center" prop="information" />
|
<el-table-column label="视频简介" align="center" prop="information" />
|
||||||
<el-table-column label="培训讲师" align="center" prop="lecturername" />
|
<el-table-column label="培训讲师" align="center" prop="lecturername" />
|
||||||
<el-table-column label="所属类别" align="center" prop="type" />
|
<el-table-column label="所属类别" align="center" prop="type" :formatter="typeFormat" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createtime) }}</span>
|
<span>{{ parseTime(scope.row.createtime) }}</span>
|
||||||
@ -126,7 +128,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="选择视频" prop="videourl">
|
<el-form-item label="选择视频" prop="videourl">
|
||||||
<div id="app">
|
|
||||||
<el-upload
|
<el-upload
|
||||||
class="avatar-uploader"
|
class="avatar-uploader"
|
||||||
:data="dataObj"
|
:data="dataObj"
|
||||||
@ -149,19 +150,17 @@
|
|||||||
v-else-if="imageUrl.length < 1 && imgFlag == false"
|
v-else-if="imageUrl.length < 1 && imgFlag == false"
|
||||||
class="el-icon-plus avatar-uploader-icon"
|
class="el-icon-plus avatar-uploader-icon"
|
||||||
></i>
|
></i>
|
||||||
<el-progress
|
<el-progress v-if="imgFlag == true" type="circle" :percentage="percent"></el-progress>
|
||||||
v-if="imgFlag == true"
|
|
||||||
type="circle"
|
|
||||||
:percentage="percent"
|
|
||||||
style="margin-top: 20px"
|
|
||||||
></el-progress>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属类别">
|
<el-form-item label="所属类别" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="请选择所属类别">
|
<el-cascader
|
||||||
<el-option label="请选择字典生成" value />
|
placeholder="请选择所属类别"
|
||||||
</el-select>
|
v-model="form.type"
|
||||||
|
:options="optionTypes"
|
||||||
|
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -172,8 +171,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="//unpkg.com/vue/dist/vue.js"></script>
|
|
||||||
<script src="//unpkg.com/element-ui@2.9.1/lib/index.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
listVideo,
|
listVideo,
|
||||||
@ -184,12 +181,13 @@ import {
|
|||||||
getQiNiuToken
|
getQiNiuToken
|
||||||
} from "@/api/benyi_train/video";
|
} from "@/api/benyi_train/video";
|
||||||
import { listAllLecturer } from "@/api/benyi_train/lecturer";
|
import { listAllLecturer } from "@/api/benyi_train/lecturer";
|
||||||
|
import { listMoedata } from "@/api/system/moedata";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Video",
|
name: "Video",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
qiniuUrl: "https://files.benyiedu.com/", // 个人七牛访问前缀
|
qiniuUrl: "https://files.benyiedu.com", // 个人七牛访问前缀
|
||||||
imgFlag: false,
|
imgFlag: false,
|
||||||
imageUrl: [],
|
imageUrl: [],
|
||||||
percent: 0,
|
percent: 0,
|
||||||
@ -199,6 +197,8 @@ export default {
|
|||||||
dataObj: {
|
dataObj: {
|
||||||
token: ""
|
token: ""
|
||||||
}, // 此处七牛token写成常量方便调试,正式环境需要获取token
|
}, // 此处七牛token写成常量方便调试,正式环境需要获取token
|
||||||
|
optionTypes: [],
|
||||||
|
optionListTypes: [],
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -233,21 +233,69 @@ export default {
|
|||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {}
|
rules: {
|
||||||
|
title: [
|
||||||
|
{ required: true, message: "视频标题不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
information: [
|
||||||
|
{ required: true, message: "视频简介不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
videourl: [
|
||||||
|
{ required: true, message: "培训视频不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
lecturer: [
|
||||||
|
{ required: true, message: "培训讲师不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
type: [{ required: true, message: "所属类别不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
listAllLecturer().then(response => {
|
listAllLecturer().then(response => {
|
||||||
console.log(response.lecturer);
|
//console.log(response.lecturer);
|
||||||
this.lecturerOptions = response.lecturer;
|
this.lecturerOptions = response.lecturer;
|
||||||
});
|
});
|
||||||
getQiNiuToken().then(res => {
|
getQiNiuToken().then(res => {
|
||||||
console.log(res.token);
|
//console.log(res.token);
|
||||||
this.dataObj.token = res.token;
|
this.dataObj.token = res.token;
|
||||||
});
|
});
|
||||||
|
listMoedata(this.queryParams).then(response => {
|
||||||
|
//用户遍历展示table中type的数据显示
|
||||||
|
this.optionListTypes = response.data;
|
||||||
|
//console.log(this.optionListTypes);
|
||||||
|
//第一步转换数组
|
||||||
|
this.optionTypes = this.handleTree(response.data, "id", "pid");
|
||||||
|
//第二步移除children为0的数组,也就是将children为0 设置为undefined
|
||||||
|
this.optionTypes = this.getTreeData(this.optionTypes);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 字典状态字典翻译
|
||||||
|
typeFormat(row, column) {
|
||||||
|
var actions = [];
|
||||||
|
var ary = row.type.split(",");
|
||||||
|
var lab = "";
|
||||||
|
for (var j = 0; j < ary.length; j++) {
|
||||||
|
actions.push(this.selectMoeDictLabel(this.optionListTypes, ary[j]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return actions.join(" / ");
|
||||||
|
},
|
||||||
|
// 递归判断列表,把最后的children设为undefined
|
||||||
|
getTreeData(data) {
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
if (data[i].children.length < 1) {
|
||||||
|
// children若为空数组,则将children设为undefined
|
||||||
|
data[i].children = undefined;
|
||||||
|
} else {
|
||||||
|
// children若不为空数组,则继续 递归调用 本方法
|
||||||
|
this.getTreeData(data[i].children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log(data);
|
||||||
|
return data;
|
||||||
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
this.imageUrl = "";
|
this.imageUrl = "";
|
||||||
},
|
},
|
||||||
@ -328,6 +376,11 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
if (this.queryParams.type == null) {
|
||||||
|
this.queryParams.type = "";
|
||||||
|
} else {
|
||||||
|
this.queryParams.type = this.queryParams.type.toString();
|
||||||
|
}
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
@ -361,10 +414,17 @@ export default {
|
|||||||
const id = row.id || this.ids;
|
const id = row.id || this.ids;
|
||||||
getVideo(id).then(response => {
|
getVideo(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
var actions = [];
|
||||||
|
var ary = response.data.type.split(",");
|
||||||
|
for (var j = 0; j < ary.length; j++) {
|
||||||
|
actions.push(parseInt(ary[j]));
|
||||||
|
}
|
||||||
|
this.form.type = actions;
|
||||||
|
//console.log(this.form.type);
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改培训";
|
this.title = "修改培训";
|
||||||
this.imageUrl = response.data.videourl;
|
this.imageUrl = response.data.videourl;
|
||||||
console.log(this.imageUrl);
|
//console.log(this.imageUrl);
|
||||||
//获取讲师列表
|
//获取讲师列表
|
||||||
listAllLecturer().then(response => {
|
listAllLecturer().then(response => {
|
||||||
//console.log(response.lecturer);
|
//console.log(response.lecturer);
|
||||||
@ -374,9 +434,14 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
|
//上传完成 赋值给from表单
|
||||||
|
this.form.videourl = this.imageUrl;
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.videourl = this.imageUrl;
|
//提交将type arry转字符串
|
||||||
|
//console.log(this.form.type.toString());
|
||||||
|
this.form.type = this.form.type.toString();
|
||||||
|
|
||||||
if (this.form.id != undefined) {
|
if (this.form.id != undefined) {
|
||||||
updateVideo(this.form).then(response => {
|
updateVideo(this.form).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -423,13 +488,14 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@import url("//unpkg.com/element-ui@2.9.1/lib/theme-chalk/index.css");
|
.avatar-uploader ::v-deep .el-upload {
|
||||||
.avatar-uploader .el-upload {
|
|
||||||
border: 1px dashed #d9d9d9;
|
border: 1px dashed #d9d9d9;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
width: 178px;
|
width: 178px;
|
||||||
height: 178px;
|
height: 178px;
|
||||||
}
|
}
|
||||||
@ -441,15 +507,10 @@ export default {
|
|||||||
.avatar-uploader-icon {
|
.avatar-uploader-icon {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: #8c939d;
|
color: #8c939d;
|
||||||
width: 178px;
|
|
||||||
height: 178px;
|
|
||||||
line-height: 178px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
width: 178px;
|
width: 100%;
|
||||||
height: 178px;
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public class CommonController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用上传请求
|
* 通用上传请求 wuyong
|
||||||
*/
|
*/
|
||||||
@PostMapping("/common/uploadqiniu")
|
@PostMapping("/common/uploadqiniu")
|
||||||
public AjaxResult uploadFileQiNiu(MultipartFile file) throws Exception {
|
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">
|
<select id="selectByTrainVideoList" parameterType="ByTrainVideo" resultMap="ByTrainVideoResult">
|
||||||
<include refid="selectByTrainVideoVo"/>
|
<include refid="selectByTrainVideoVo"/>
|
||||||
<where>
|
<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="information != null and information != ''"> and information = #{information}</if>
|
||||||
<if test="lecturer != null "> and lecturer = #{lecturer}</if>
|
<if test="lecturer != null "> and lecturer = #{lecturer}</if>
|
||||||
<if test="videourl != null and videourl != ''"> and videourl = #{videourl}</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="classtype != null and classtype != ''"> and classtype = #{classtype}</if>
|
||||||
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
||||||
<if test="createtime != null "> and createtime = #{createtime}</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>
|
Loading…
x
Reference in New Issue
Block a user