Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -1,319 +1,339 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :inline="true">
|
<el-form :inline="true">
|
||||||
<el-form-item label="部门名称">
|
<el-form-item label="部门名称">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.deptName"
|
v-model="queryParams.deptName"
|
||||||
placeholder="请输入部门名称"
|
placeholder="请输入部门名称"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-select v-model="queryParams.status" placeholder="部门状态" clearable size="small">
|
<el-select v-model="queryParams.status" placeholder="部门状态" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in statusOptions"
|
v-for="dict in statusOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="dict.dictValue"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
>搜索</el-button>
|
>搜索</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:dept:add']"
|
v-hasPermi="['system:dept:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="deptList"
|
:data="deptList"
|
||||||
row-key="deptId"
|
row-key="deptId"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
>
|
>
|
||||||
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
||||||
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
||||||
<el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"></el-table-column>
|
<el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"></el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['system:dept:edit']"
|
v-hasPermi="['system:dept:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="handleAdd(scope.row)"
|
@click="handleAdd(scope.row)"
|
||||||
v-hasPermi="['system:dept:add']"
|
v-hasPermi="['system:dept:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.parentId != 0"
|
v-if="scope.row.parentId != 0"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['system:dept:remove']"
|
v-hasPermi="['system:dept:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 添加或修改部门对话框 -->
|
<!-- 添加或修改部门对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px">
|
<el-dialog :title="title" :visible.sync="open" width="600px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" v-if="form.parentId !== 0">
|
<el-col :span="24" v-if="form.parentId !== 0">
|
||||||
<el-form-item label="上级部门" prop="parentId">
|
<el-form-item label="上级部门" prop="parentId">
|
||||||
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
<treeselect
|
||||||
</el-form-item>
|
v-model="form.parentId"
|
||||||
</el-col>
|
:options="deptOptions"
|
||||||
<el-col :span="12">
|
:normalizer="normalizer"
|
||||||
<el-form-item label="部门名称" prop="deptName">
|
placeholder="选择上级部门"
|
||||||
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="显示排序" prop="orderNum">
|
<el-form-item label="部门名称" prop="deptName">
|
||||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="负责人" prop="leader">
|
<el-form-item label="显示排序" prop="orderNum">
|
||||||
<el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系电话" prop="phone">
|
<el-form-item label="负责人" prop="leader">
|
||||||
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
<el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="邮箱" prop="email">
|
<el-form-item label="联系电话" prop="phone">
|
||||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="部门状态">
|
<el-form-item label="邮箱" prop="email">
|
||||||
<el-radio-group v-model="form.status">
|
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||||
<el-radio
|
</el-form-item>
|
||||||
v-for="dict in statusOptions"
|
</el-col>
|
||||||
:key="dict.dictValue"
|
<el-col :span="12">
|
||||||
:label="dict.dictValue"
|
<el-form-item label="部门状态">
|
||||||
>{{dict.dictLabel}}</el-radio>
|
<el-radio-group v-model="form.status">
|
||||||
</el-radio-group>
|
<el-radio
|
||||||
</el-form-item>
|
v-for="dict in statusOptions"
|
||||||
</el-col>
|
:key="dict.dictValue"
|
||||||
</el-row>
|
:label="dict.dictValue"
|
||||||
</el-form>
|
>{{dict.dictLabel}}</el-radio>
|
||||||
<div slot="footer" class="dialog-footer">
|
</el-radio-group>
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
</el-form-item>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
</el-col>
|
||||||
</div>
|
</el-row>
|
||||||
</el-dialog>
|
</el-form>
|
||||||
</div>
|
<div slot="footer" class="dialog-footer">
|
||||||
</template>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
<script>
|
</div>
|
||||||
import { listDept, getDept, delDept, addDept, updateDept } from "@/api/system/dept";
|
</el-dialog>
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
</div>
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
</template>
|
||||||
|
|
||||||
export default {
|
<script>
|
||||||
name: "Dept",
|
import {
|
||||||
components: { Treeselect },
|
listDept,
|
||||||
data() {
|
getDept,
|
||||||
return {
|
delDept,
|
||||||
// 遮罩层
|
addDept,
|
||||||
loading: true,
|
updateDept
|
||||||
// 表格树数据
|
} from "@/api/system/dept";
|
||||||
deptList: [],
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
// 部门树选项
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
deptOptions: [],
|
|
||||||
// 弹出层标题
|
export default {
|
||||||
title: "",
|
name: "Dept",
|
||||||
// 是否显示弹出层
|
components: { Treeselect },
|
||||||
open: false,
|
data() {
|
||||||
// 状态数据字典
|
return {
|
||||||
statusOptions: [],
|
// 遮罩层
|
||||||
// 查询参数
|
loading: true,
|
||||||
queryParams: {
|
// 表格树数据
|
||||||
deptName: undefined,
|
deptList: [],
|
||||||
status: undefined
|
// 部门树选项
|
||||||
},
|
deptOptions: [],
|
||||||
// 表单参数
|
// 弹出层标题
|
||||||
form: {},
|
title: "",
|
||||||
// 表单校验
|
// 是否显示弹出层
|
||||||
rules: {
|
open: false,
|
||||||
parentId: [
|
// 状态数据字典
|
||||||
{ required: true, message: "上级部门不能为空", trigger: "blur" }
|
statusOptions: [],
|
||||||
],
|
// 查询参数
|
||||||
deptName: [
|
queryParams: {
|
||||||
{ required: true, message: "部门名称不能为空", trigger: "blur" }
|
deptName: undefined,
|
||||||
],
|
status: undefined,
|
||||||
orderNum: [
|
schoolId: undefined
|
||||||
{ required: true, message: "菜单顺序不能为空", trigger: "blur" }
|
},
|
||||||
],
|
// 表单参数
|
||||||
email: [
|
form: {},
|
||||||
{
|
// 表单校验
|
||||||
type: "email",
|
rules: {
|
||||||
message: "'请输入正确的邮箱地址",
|
parentId: [
|
||||||
trigger: ["blur", "change"]
|
{ required: true, message: "上级部门不能为空", trigger: "blur" }
|
||||||
}
|
],
|
||||||
],
|
deptName: [
|
||||||
phone: [
|
{ required: true, message: "部门名称不能为空", trigger: "blur" }
|
||||||
{
|
],
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
orderNum: [
|
||||||
message: "请输入正确的手机号码",
|
{ required: true, message: "菜单顺序不能为空", trigger: "blur" }
|
||||||
trigger: "blur"
|
],
|
||||||
}
|
email: [
|
||||||
]
|
{
|
||||||
}
|
type: "email",
|
||||||
};
|
message: "'请输入正确的邮箱地址",
|
||||||
},
|
trigger: ["blur", "change"]
|
||||||
created() {
|
}
|
||||||
this.getList();
|
],
|
||||||
this.getDicts("sys_normal_disable").then(response => {
|
phone: [
|
||||||
this.statusOptions = response.data;
|
{
|
||||||
});
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||||
},
|
message: "请输入正确的手机号码",
|
||||||
methods: {
|
trigger: "blur"
|
||||||
/** 查询部门列表 */
|
}
|
||||||
getList() {
|
]
|
||||||
this.loading = true;
|
}
|
||||||
listDept(this.queryParams).then(response => {
|
};
|
||||||
this.deptList = this.handleTree(response.data, "deptId");
|
},
|
||||||
this.loading = false;
|
created() {
|
||||||
});
|
this.getList();
|
||||||
},
|
this.getDicts("sys_normal_disable").then(response => {
|
||||||
/** 转换部门数据结构 */
|
this.statusOptions = response.data;
|
||||||
normalizer(node) {
|
});
|
||||||
if (node.children && !node.children.length) {
|
},
|
||||||
delete node.children;
|
methods: {
|
||||||
}
|
/** 查询部门列表 */
|
||||||
return {
|
getList() {
|
||||||
id: node.deptId,
|
this.loading = true;
|
||||||
label: node.deptName,
|
listDept(this.queryParams).then(response => {
|
||||||
children: node.children
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
};
|
this.loading = false;
|
||||||
},
|
});
|
||||||
/** 查询部门下拉树结构 */
|
},
|
||||||
getTreeselect() {
|
/** 转换部门数据结构 */
|
||||||
listDept().then(response => {
|
normalizer(node) {
|
||||||
this.deptOptions = this.handleTree(response.data, "deptId");
|
if (node.children && !node.children.length) {
|
||||||
});
|
delete node.children;
|
||||||
},
|
}
|
||||||
// 字典状态字典翻译
|
return {
|
||||||
statusFormat(row, column) {
|
id: node.deptId,
|
||||||
return this.selectDictLabel(this.statusOptions, row.status);
|
label: node.deptName,
|
||||||
},
|
children: node.children
|
||||||
// 取消按钮
|
};
|
||||||
cancel() {
|
},
|
||||||
this.open = false;
|
/** 查询部门下拉树结构 */
|
||||||
this.reset();
|
getTreeselect() {
|
||||||
},
|
listDept().then(response => {
|
||||||
// 表单重置
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
||||||
reset() {
|
});
|
||||||
this.form = {
|
},
|
||||||
deptId: undefined,
|
// 字典状态字典翻译
|
||||||
parentId: undefined,
|
statusFormat(row, column) {
|
||||||
deptName: undefined,
|
return this.selectDictLabel(this.statusOptions, row.status);
|
||||||
orderNum: undefined,
|
},
|
||||||
leader: undefined,
|
// 取消按钮
|
||||||
phone: undefined,
|
cancel() {
|
||||||
email: undefined,
|
this.open = false;
|
||||||
status: "0"
|
this.reset();
|
||||||
};
|
},
|
||||||
this.resetForm("form");
|
// 表单重置
|
||||||
},
|
reset() {
|
||||||
/** 搜索按钮操作 */
|
this.form = {
|
||||||
handleQuery() {
|
deptId: undefined,
|
||||||
this.getList();
|
parentId: undefined,
|
||||||
},
|
deptName: undefined,
|
||||||
/** 新增按钮操作 */
|
orderNum: undefined,
|
||||||
handleAdd(row) {
|
leader: undefined,
|
||||||
this.reset();
|
phone: undefined,
|
||||||
this.getTreeselect();
|
email: undefined,
|
||||||
if (row != undefined) {
|
status: "0",
|
||||||
this.form.parentId = row.deptId;
|
schoolId: undefined
|
||||||
}
|
};
|
||||||
this.open = true;
|
this.resetForm("form");
|
||||||
this.title = "添加部门";
|
},
|
||||||
},
|
/** 搜索按钮操作 */
|
||||||
/** 修改按钮操作 */
|
handleQuery() {
|
||||||
handleUpdate(row) {
|
this.getList();
|
||||||
this.reset();
|
},
|
||||||
this.getTreeselect();
|
/** 新增按钮操作 */
|
||||||
getDept(row.deptId).then(response => {
|
handleAdd(row) {
|
||||||
this.form = response.data;
|
this.reset();
|
||||||
this.open = true;
|
this.getTreeselect();
|
||||||
this.title = "修改部门";
|
if (row != undefined) {
|
||||||
});
|
this.form.parentId = row.deptId;
|
||||||
},
|
}
|
||||||
/** 提交按钮 */
|
this.open = true;
|
||||||
submitForm: function() {
|
this.title = "添加部门";
|
||||||
this.$refs["form"].validate(valid => {
|
},
|
||||||
if (valid) {
|
/** 修改按钮操作 */
|
||||||
if (this.form.deptId != undefined) {
|
handleUpdate(row) {
|
||||||
updateDept(this.form).then(response => {
|
this.reset();
|
||||||
if (response.code === 200) {
|
this.getTreeselect();
|
||||||
this.msgSuccess("修改成功");
|
getDept(row.deptId).then(response => {
|
||||||
this.open = false;
|
this.form = response.data;
|
||||||
this.getList();
|
this.open = true;
|
||||||
} else {
|
this.title = "修改部门";
|
||||||
this.msgError(response.msg);
|
});
|
||||||
}
|
},
|
||||||
});
|
/** 提交按钮 */
|
||||||
} else {
|
submitForm: function() {
|
||||||
addDept(this.form).then(response => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (response.code === 200) {
|
if (valid) {
|
||||||
this.msgSuccess("新增成功");
|
if (this.form.deptId != undefined) {
|
||||||
this.open = false;
|
updateDept(this.form).then(response => {
|
||||||
this.getList();
|
if (response.code === 200) {
|
||||||
} else {
|
this.msgSuccess("修改成功");
|
||||||
this.msgError(response.msg);
|
this.open = false;
|
||||||
}
|
this.getList();
|
||||||
});
|
} else {
|
||||||
}
|
this.msgError(response.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
} else {
|
||||||
/** 删除按钮操作 */
|
addDept(this.form).then(response => {
|
||||||
handleDelete(row) {
|
if (response.code === 200) {
|
||||||
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
|
this.msgSuccess("新增成功");
|
||||||
confirmButtonText: "确定",
|
this.open = false;
|
||||||
cancelButtonText: "取消",
|
this.getList();
|
||||||
type: "warning"
|
} else {
|
||||||
}).then(function() {
|
this.msgError(response.msg);
|
||||||
return delDept(row.deptId);
|
}
|
||||||
}).then(() => {
|
});
|
||||||
this.getList();
|
}
|
||||||
this.msgSuccess("删除成功");
|
}
|
||||||
}).catch(function() {});
|
});
|
||||||
}
|
},
|
||||||
}
|
/** 删除按钮操作 */
|
||||||
};
|
handleDelete(row) {
|
||||||
|
this.$confirm(
|
||||||
|
'是否确认删除名称为"' + row.deptName + '"的数据项?',
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(function() {
|
||||||
|
return delDept(row.deptId);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(function() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
@ -188,7 +188,7 @@
|
|||||||
<el-input v-model="form.mastername" placeholder="请输入联系人" />
|
<el-input v-model="form.mastername" placeholder="请输入联系人" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="电话" prop="tel">
|
<el-form-item label="电话" prop="tel">
|
||||||
<el-input v-model="form.tel" placeholder="请输入电话" />
|
<el-input v-model="form.tel" placeholder="请输入电话" maxlength="11" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="紧急联系人" prop="emMan">
|
<el-form-item label="紧急联系人" prop="emMan">
|
||||||
<el-input v-model="form.emMan" placeholder="请输入紧急联系人" />
|
<el-input v-model="form.emMan" placeholder="请输入紧急联系人" />
|
||||||
@ -206,7 +206,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="幼儿园规模" prop="scale">
|
<el-form-item label="幼儿园规模" prop="scale">
|
||||||
<el-select v-model="form.scale" placeholder="请选择">
|
<el-select v-model="form.scale">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in scaleOptions"
|
v-for="dict in scaleOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -334,6 +334,7 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
xxdm: undefined,
|
||||||
schoolName: undefined,
|
schoolName: undefined,
|
||||||
nameShort: undefined,
|
nameShort: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
@ -369,7 +370,19 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
schoolName: [
|
schoolName: [
|
||||||
{ required: true, message: "机构名称不能为空", trigger: "blur" }
|
{
|
||||||
|
required: true,
|
||||||
|
message: "机构名称不能为空",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
tel: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||||
|
message: "请输入正确的手机号码",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -428,6 +441,7 @@ export default {
|
|||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
|
xxdm: undefined,
|
||||||
schoolName: undefined,
|
schoolName: undefined,
|
||||||
nameShort: undefined,
|
nameShort: undefined,
|
||||||
type: "1",
|
type: "1",
|
||||||
|
577
ruoyi/pom.xml
577
ruoyi/pom.xml
@ -1,287 +1,292 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>2.2.0</version>
|
<version>2.2.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ruoyi</name>
|
<name>ruoyi</name>
|
||||||
<url>http://www.benyiedu.com</url>
|
<url>http://www.benyiedu.com</url>
|
||||||
<description>本一智慧平台管理系统</description>
|
<description>本一智慧平台管理系统</description>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.1.1.RELEASE</version>
|
<version>2.1.1.RELEASE</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version>
|
<mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version>
|
||||||
<pagehelper.spring.boot.starter.version>1.2.5</pagehelper.spring.boot.starter.version>
|
<pagehelper.spring.boot.starter.version>1.2.5</pagehelper.spring.boot.starter.version>
|
||||||
<fastjson.version>1.2.47</fastjson.version>
|
<fastjson.version>1.2.47</fastjson.version>
|
||||||
<druid.version>1.1.14</druid.version>
|
<druid.version>1.1.14</druid.version>
|
||||||
<commons.io.version>2.5</commons.io.version>
|
<commons.io.version>2.5</commons.io.version>
|
||||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||||
<bitwalker.version>1.19</bitwalker.version>
|
<bitwalker.version>1.19</bitwalker.version>
|
||||||
<jwt.version>0.9.0</jwt.version>
|
<jwt.version>0.9.0</jwt.version>
|
||||||
<swagger.version>2.9.2</swagger.version>
|
<swagger.version>2.9.2</swagger.version>
|
||||||
<poi.version>3.17</poi.version>
|
<poi.version>3.17</poi.version>
|
||||||
<oshi.version>3.9.1</oshi.version>
|
<oshi.version>3.9.1</oshi.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringBoot 核心包 -->
|
<!-- SpringBoot 核心包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot 测试 -->
|
<!-- SpringBoot 测试 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot 拦截器 -->
|
<!-- SpringBoot 拦截器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot Web容器 -->
|
<!-- SpringBoot Web容器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- spring-boot-devtools -->
|
<!-- spring-boot-devtools -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- spring security 安全认证 -->
|
<!-- spring security 安全认证 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-security</artifactId>
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- redis 缓存操作 -->
|
<!-- redis 缓存操作 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- pool 对象池 -->
|
<!-- pool 对象池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>commons-pool2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Mysql驱动包 -->
|
<!-- Mysql驱动包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot集成mybatis框架 -->
|
<!-- SpringBoot集成mybatis框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
<version>${mybatis.spring.boot.starter.version}</version>
|
<version>${mybatis.spring.boot.starter.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- pagehelper 分页插件 -->
|
<!-- pagehelper 分页插件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<version>${pagehelper.spring.boot.starter.version}</version>
|
<version>${pagehelper.spring.boot.starter.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--阿里数据库连接池 -->
|
<!--阿里数据库连接池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid.version}</version>
|
<version>${druid.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--常用工具类 -->
|
<!--常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--io常用工具类 -->
|
<!--io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>${commons.io.version}</version>
|
<version>${commons.io.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--文件上传工具类 -->
|
<!--文件上传工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>${commons.fileupload.version}</version>
|
<version>${commons.fileupload.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 解析客户端操作系统、浏览器等 -->
|
<!-- 解析客户端操作系统、浏览器等 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>eu.bitwalker</groupId>
|
<groupId>eu.bitwalker</groupId>
|
||||||
<artifactId>UserAgentUtils</artifactId>
|
<artifactId>UserAgentUtils</artifactId>
|
||||||
<version>${bitwalker.version}</version>
|
<version>${bitwalker.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里JSON解析器 -->
|
<!-- 阿里JSON解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Spring框架基本的核心工具-->
|
<!--Spring框架基本的核心工具-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Token生成与解析-->
|
<!--Token生成与解析-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt</artifactId>
|
<artifactId>jjwt</artifactId>
|
||||||
<version>${jwt.version}</version>
|
<version>${jwt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger2-->
|
<!-- swagger2-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger2</artifactId>
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
|
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
<version>1.5.21</version>
|
<version>1.5.21</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
<version>1.5.21</version>
|
<version>1.5.21</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger2-UI-->
|
<!-- swagger2-UI-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 获取系统信息 -->
|
<!-- 获取系统信息 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.oshi</groupId>
|
<groupId>com.github.oshi</groupId>
|
||||||
<artifactId>oshi-core</artifactId>
|
<artifactId>oshi-core</artifactId>
|
||||||
<version>${oshi.version}</version>
|
<version>${oshi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.java.dev.jna</groupId>
|
<groupId>net.java.dev.jna</groupId>
|
||||||
<artifactId>jna</artifactId>
|
<artifactId>jna</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.java.dev.jna</groupId>
|
<groupId>net.java.dev.jna</groupId>
|
||||||
<artifactId>jna-platform</artifactId>
|
<artifactId>jna-platform</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- excel工具 -->
|
<!-- excel工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>${poi.version}</version>
|
<version>${poi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--velocity代码生成使用模板 -->
|
<!--velocity代码生成使用模板 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 定时任务 -->
|
<!-- 定时任务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
<groupId>org.quartz-scheduler</groupId>
|
||||||
<artifactId>quartz</artifactId>
|
<artifactId>quartz</artifactId>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.mchange</groupId>
|
<groupId>com.mchange</groupId>
|
||||||
<artifactId>c3p0</artifactId>
|
<artifactId>c3p0</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
</dependencies>
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-jdbc</artifactId>
|
||||||
<build>
|
<version>5.1.5.RELEASE</version>
|
||||||
<finalName>${project.artifactId}</finalName>
|
</dependency>
|
||||||
<plugins>
|
|
||||||
<plugin>
|
</dependencies>
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<build>
|
||||||
<configuration>
|
<finalName>${project.artifactId}</finalName>
|
||||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
<plugins>
|
||||||
</configuration>
|
<plugin>
|
||||||
</plugin>
|
<groupId>org.springframework.boot</groupId>
|
||||||
</plugins>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</build>
|
<configuration>
|
||||||
|
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||||
<repositories>
|
</configuration>
|
||||||
<repository>
|
</plugin>
|
||||||
<id>public</id>
|
</plugins>
|
||||||
<name>aliyun nexus</name>
|
</build>
|
||||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
|
||||||
<releases>
|
<repositories>
|
||||||
<enabled>true</enabled>
|
<repository>
|
||||||
</releases>
|
<id>public</id>
|
||||||
</repository>
|
<name>aliyun nexus</name>
|
||||||
</repositories>
|
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||||
|
<releases>
|
||||||
<pluginRepositories>
|
<enabled>true</enabled>
|
||||||
<pluginRepository>
|
</releases>
|
||||||
<id>public</id>
|
</repository>
|
||||||
<name>aliyun nexus</name>
|
</repositories>
|
||||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
|
||||||
<releases>
|
<pluginRepositories>
|
||||||
<enabled>true</enabled>
|
<pluginRepository>
|
||||||
</releases>
|
<id>public</id>
|
||||||
<snapshots>
|
<name>aliyun nexus</name>
|
||||||
<enabled>false</enabled>
|
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||||
</snapshots>
|
<releases>
|
||||||
</pluginRepository>
|
<enabled>true</enabled>
|
||||||
</pluginRepositories>
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -1,85 +1,94 @@
|
|||||||
package com.ruoyi.framework.web.controller;
|
package com.ruoyi.framework.web.controller;
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
import java.util.UUID;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import com.ruoyi.project.system.domain.BySchool;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import com.ruoyi.project.system.domain.SysDept;
|
||||||
import com.github.pagehelper.PageHelper;
|
import org.slf4j.Logger;
|
||||||
import com.github.pagehelper.PageInfo;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
import com.ruoyi.framework.web.page.PageDomain;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.web.page.TableSupport;
|
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||||
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
/**
|
import com.ruoyi.framework.web.page.PageDomain;
|
||||||
* web层通用数据处理
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
*
|
import com.ruoyi.framework.web.page.TableSupport;
|
||||||
* @author ruoyi
|
|
||||||
*/
|
/**
|
||||||
public class BaseController
|
* web层通用数据处理
|
||||||
{
|
*
|
||||||
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
|
* @author ruoyi
|
||||||
|
*/
|
||||||
/**
|
public class BaseController
|
||||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
{
|
||||||
*/
|
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
|
||||||
@InitBinder
|
|
||||||
public void initBinder(WebDataBinder binder)
|
public static String getUUID32()
|
||||||
{
|
{
|
||||||
// Date 类型转换
|
return UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
||||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
}
|
||||||
{
|
|
||||||
@Override
|
/**
|
||||||
public void setAsText(String text)
|
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||||
{
|
*/
|
||||||
setValue(DateUtils.parseDate(text));
|
@InitBinder
|
||||||
}
|
public void initBinder(WebDataBinder binder)
|
||||||
});
|
{
|
||||||
}
|
// Date 类型转换
|
||||||
|
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
||||||
/**
|
{
|
||||||
* 设置请求分页数据
|
@Override
|
||||||
*/
|
public void setAsText(String text)
|
||||||
protected void startPage()
|
{
|
||||||
{
|
setValue(DateUtils.parseDate(text));
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
}
|
||||||
Integer pageNum = pageDomain.getPageNum();
|
});
|
||||||
Integer pageSize = pageDomain.getPageSize();
|
}
|
||||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
|
||||||
{
|
/**
|
||||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
* 设置请求分页数据
|
||||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
*/
|
||||||
}
|
protected void startPage()
|
||||||
}
|
{
|
||||||
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
/**
|
Integer pageNum = pageDomain.getPageNum();
|
||||||
* 响应请求分页数据
|
Integer pageSize = pageDomain.getPageSize();
|
||||||
*/
|
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
{
|
||||||
protected TableDataInfo getDataTable(List<?> list)
|
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||||
{
|
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
}
|
||||||
rspData.setCode(HttpStatus.SUCCESS);
|
}
|
||||||
rspData.setRows(list);
|
|
||||||
rspData.setTotal(new PageInfo(list).getTotal());
|
/**
|
||||||
return rspData;
|
* 响应请求分页数据
|
||||||
}
|
*/
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
/**
|
protected TableDataInfo getDataTable(List<?> list)
|
||||||
* 响应返回结果
|
{
|
||||||
*
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
* @param rows 影响行数
|
rspData.setCode(HttpStatus.SUCCESS);
|
||||||
* @return 操作结果
|
rspData.setRows(list);
|
||||||
*/
|
rspData.setTotal(new PageInfo(list).getTotal());
|
||||||
protected AjaxResult toAjax(int rows)
|
return rspData;
|
||||||
{
|
}
|
||||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
|
||||||
}
|
/**
|
||||||
}
|
* 响应返回结果
|
||||||
|
*
|
||||||
|
* @param rows 影响行数
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
protected AjaxResult toAjax(int rows)
|
||||||
|
{
|
||||||
|
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -4,6 +4,8 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.project.system.service.ISysDeptService;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -22,6 +24,9 @@ import com.ruoyi.framework.web.controller.BaseController;
|
|||||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
|
import com.ruoyi.project.system.domain.SysDept;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 幼儿园机构Controller
|
* 幼儿园机构Controller
|
||||||
@ -29,6 +34,11 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
|||||||
* @author tsbz
|
* @author tsbz
|
||||||
* @date 2020-04-08
|
* @date 2020-04-08
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/school")
|
@RequestMapping("/system/school")
|
||||||
public class BySchoolController extends BaseController
|
public class BySchoolController extends BaseController
|
||||||
@ -36,6 +46,11 @@ public class BySchoolController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IBySchoolService bySchoolService;
|
private IBySchoolService bySchoolService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询幼儿园机构列表
|
* 查询幼儿园机构列表
|
||||||
*/
|
*/
|
||||||
@ -71,17 +86,45 @@ public class BySchoolController extends BaseController
|
|||||||
return AjaxResult.success(bySchoolService.selectBySchoolById(id));
|
return AjaxResult.success(bySchoolService.selectBySchoolById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增幼儿园机构
|
* 新增幼儿园机构
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//调取jdbctemplate方法 读取数据库中的ID值
|
||||||
|
@Resource
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:school:add')")
|
@PreAuthorize("@ss.hasPermi('system:school:add')")
|
||||||
@Log(title = "幼儿园机构", businessType = BusinessType.INSERT)
|
@Log(title = "幼儿园机构", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BySchool bySchool)
|
public AjaxResult add(@RequestBody BySchool bySchool)
|
||||||
{
|
{
|
||||||
|
//从school表中取出当前最大的ID值 并且将其赋值给dept中的ordernumber
|
||||||
|
String maxId = jdbcTemplate.queryForObject(String.format("select MAX(id) from by_school"),String.class);
|
||||||
|
|
||||||
|
String uuid = getUUID32();
|
||||||
|
|
||||||
|
//将UUID赋值给xxdm
|
||||||
|
bySchool.setXxdm(uuid);
|
||||||
bySchool.setCreateUser(SecurityUtils.getLoginUser().getUser().getUserId());
|
bySchool.setCreateUser(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||||
bySchool.setApprovalUser(SecurityUtils.getLoginUser().getUser().getUserId());
|
bySchool.setApprovalUser(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||||
bySchool.setCreateTime(new Date());
|
bySchool.setCreateTime(new Date());
|
||||||
|
|
||||||
|
//创建dept实例 并且向要添加的dept中设置各个参数
|
||||||
|
SysDept dept = new SysDept();
|
||||||
|
dept.setSchoolId(bySchool.getXxdm());
|
||||||
|
dept.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
dept.setParentId(200L);
|
||||||
|
dept.setAncestors("0,100,200");
|
||||||
|
dept.setDeptName(bySchool.getSchoolName());
|
||||||
|
dept.setOrderNum(maxId);
|
||||||
|
dept.setPhone(bySchool.getTel());
|
||||||
|
dept.setLeader(SecurityUtils.getUsername());
|
||||||
|
//插入数据
|
||||||
|
deptService.insertDept(dept);
|
||||||
|
|
||||||
return toAjax(bySchoolService.insertBySchool(bySchool));
|
return toAjax(bySchoolService.insertBySchool(bySchool));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,134 +1,137 @@
|
|||||||
package com.ruoyi.project.system.controller;
|
package com.ruoyi.project.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import com.ruoyi.project.system.service.IBySchoolService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.framework.web.controller.BaseController;
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||||
import com.ruoyi.project.system.domain.SysDept;
|
import com.ruoyi.framework.web.controller.BaseController;
|
||||||
import com.ruoyi.project.system.service.ISysDeptService;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.project.system.domain.SysDept;
|
||||||
/**
|
import com.ruoyi.project.system.service.ISysDeptService;
|
||||||
* 部门信息
|
|
||||||
*
|
/**
|
||||||
* @author ruoyi
|
* 部门信息
|
||||||
*/
|
*
|
||||||
@RestController
|
* @author ruoyi
|
||||||
@RequestMapping("/system/dept")
|
*/
|
||||||
public class SysDeptController extends BaseController
|
@RestController
|
||||||
{
|
@RequestMapping("/system/dept")
|
||||||
@Autowired
|
public class SysDeptController extends BaseController
|
||||||
private ISysDeptService deptService;
|
{
|
||||||
|
@Autowired
|
||||||
/**
|
private ISysDeptService deptService;
|
||||||
* 获取部门列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
/**
|
||||||
@GetMapping("/list")
|
* 获取部门列表
|
||||||
public AjaxResult list(SysDept dept)
|
*/
|
||||||
{
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
@GetMapping("/list")
|
||||||
return AjaxResult.success(depts);
|
public AjaxResult list(SysDept dept)
|
||||||
}
|
{
|
||||||
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
/**
|
return AjaxResult.success(depts);
|
||||||
* 根据部门编号获取详细信息
|
}
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
/**
|
||||||
@GetMapping(value = "/{deptId}")
|
* 根据部门编号获取详细信息
|
||||||
public AjaxResult getInfo(@PathVariable Long deptId)
|
*/
|
||||||
{
|
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||||
return AjaxResult.success(deptService.selectDeptById(deptId));
|
@GetMapping(value = "/{deptId}")
|
||||||
}
|
public AjaxResult getInfo(@PathVariable Long deptId)
|
||||||
|
{
|
||||||
/**
|
return AjaxResult.success(deptService.selectDeptById(deptId));
|
||||||
* 获取部门下拉树列表
|
}
|
||||||
*/
|
|
||||||
@GetMapping("/treeselect")
|
/**
|
||||||
public AjaxResult treeselect(SysDept dept)
|
* 获取部门下拉树列表
|
||||||
{
|
*/
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
@GetMapping("/treeselect")
|
||||||
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
public AjaxResult treeselect(SysDept dept)
|
||||||
}
|
{
|
||||||
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
/**
|
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
||||||
* 加载对应角色部门列表树
|
}
|
||||||
*/
|
|
||||||
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
/**
|
||||||
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
* 加载对应角色部门列表树
|
||||||
{
|
*/
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
||||||
AjaxResult ajax = AjaxResult.success();
|
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
||||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
{
|
||||||
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
return ajax;
|
AjaxResult ajax = AjaxResult.success();
|
||||||
}
|
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||||
|
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
|
||||||
/**
|
return ajax;
|
||||||
* 新增部门
|
}
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
/**
|
||||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
* 新增部门
|
||||||
@PostMapping
|
*/
|
||||||
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||||
{
|
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
@PostMapping
|
||||||
{
|
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
||||||
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
{
|
||||||
}
|
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||||
dept.setCreateBy(SecurityUtils.getUsername());
|
{
|
||||||
return toAjax(deptService.insertDept(dept));
|
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
|
dept.setCreateBy(SecurityUtils.getUsername());
|
||||||
/**
|
return toAjax(deptService.insertDept(dept));
|
||||||
* 修改部门
|
}
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
/**
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
* 修改部门
|
||||||
@PutMapping
|
*/
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||||
{
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
@PutMapping
|
||||||
{
|
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
||||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
{
|
||||||
}
|
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
||||||
else if (dept.getParentId().equals(dept.getDeptId()))
|
{
|
||||||
{
|
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
}
|
||||||
}
|
else if (dept.getParentId().equals(dept.getDeptId()))
|
||||||
dept.setUpdateBy(SecurityUtils.getUsername());
|
{
|
||||||
return toAjax(deptService.updateDept(dept));
|
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||||
}
|
}
|
||||||
|
dept.setUpdateBy(SecurityUtils.getUsername());
|
||||||
/**
|
return toAjax(deptService.updateDept(dept));
|
||||||
* 删除部门
|
}
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
/**
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
* 删除部门
|
||||||
@DeleteMapping("/{deptId}")
|
*/
|
||||||
public AjaxResult remove(@PathVariable Long deptId)
|
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||||
{
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
if (deptService.hasChildByDeptId(deptId))
|
@DeleteMapping("/{deptId}")
|
||||||
{
|
public AjaxResult remove(@PathVariable Long deptId)
|
||||||
return AjaxResult.error("存在下级部门,不允许删除");
|
{
|
||||||
}
|
if (deptService.hasChildByDeptId(deptId))
|
||||||
if (deptService.checkDeptExistUser(deptId))
|
{
|
||||||
{
|
return AjaxResult.error("存在下级部门,不允许删除");
|
||||||
return AjaxResult.error("部门存在用户,不允许删除");
|
}
|
||||||
}
|
if (deptService.checkDeptExistUser(deptId))
|
||||||
return toAjax(deptService.deleteDeptById(deptId));
|
{
|
||||||
}
|
return AjaxResult.error("部门存在用户,不允许删除");
|
||||||
}
|
}
|
||||||
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -4,6 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
|||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -12,13 +13,21 @@ import java.util.Date;
|
|||||||
* @author tsbz
|
* @author tsbz
|
||||||
* @date 2020-04-08
|
* @date 2020-04-08
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class BySchool extends BaseEntity
|
public class BySchool extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 幼儿园ID */
|
/** 幼儿园ID */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
// 学校代码(与dept相关联)
|
||||||
|
private String xxdm;
|
||||||
|
|
||||||
/** 机构名称 */
|
/** 机构名称 */
|
||||||
@Excel(name = "机构名称")
|
@Excel(name = "机构名称")
|
||||||
private String schoolName;
|
private String schoolName;
|
||||||
@ -131,6 +140,17 @@ public class BySchool extends BaseEntity
|
|||||||
@Excel(name = "当前学期")
|
@Excel(name = "当前学期")
|
||||||
private String dqxq;
|
private String dqxq;
|
||||||
|
|
||||||
|
//部门
|
||||||
|
private SysDept dept;
|
||||||
|
|
||||||
|
public SysDept getDept() {
|
||||||
|
return dept;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDept(SysDept dept) {
|
||||||
|
this.dept = dept;
|
||||||
|
}
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -393,10 +413,21 @@ public class BySchool extends BaseEntity
|
|||||||
return dqxq;
|
return dqxq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getXxdm() {
|
||||||
|
return xxdm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXxdm(String xxdm) {
|
||||||
|
this.xxdm = xxdm;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("id", getId())
|
.append("id", getId())
|
||||||
|
.append("xxdm",getXxdm())
|
||||||
.append("schoolName", getSchoolName())
|
.append("schoolName", getSchoolName())
|
||||||
.append("nameShort", getNameShort())
|
.append("nameShort", getNameShort())
|
||||||
.append("type", getType())
|
.append("type", getType())
|
||||||
@ -427,6 +458,9 @@ public class BySchool extends BaseEntity
|
|||||||
.append("openDeadline", getOpenDeadline())
|
.append("openDeadline", getOpenDeadline())
|
||||||
.append("dqxn", getDqxn())
|
.append("dqxn", getDqxn())
|
||||||
.append("dqxq", getDqxq())
|
.append("dqxq", getDqxq())
|
||||||
|
.append("dept", getDept())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,202 +1,216 @@
|
|||||||
package com.ruoyi.project.system.domain;
|
package com.ruoyi.project.system.domain;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门表 sys_dept
|
* 部门表 sys_dept
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class SysDept extends BaseEntity
|
public class SysDept extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 部门ID */
|
/** 部门ID */
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/** 父部门ID */
|
/** 父部门ID */
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
/** 祖级列表 */
|
/** 祖级列表 */
|
||||||
private String ancestors;
|
private String ancestors;
|
||||||
|
|
||||||
/** 部门名称 */
|
/** 部门名称 */
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
private String orderNum;
|
private String orderNum;
|
||||||
|
|
||||||
/** 负责人 */
|
/** 负责人 */
|
||||||
private String leader;
|
private String leader;
|
||||||
|
|
||||||
/** 联系电话 */
|
/** 联系电话 */
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/** 邮箱 */
|
/** 邮箱 */
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/** 部门状态:0正常,1停用 */
|
/** 部门状态:0正常,1停用 */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/** 父部门名称 */
|
/** 父部门名称 */
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
|
||||||
/** 子部门 */
|
/** 子部门 */
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<SysDept> children = new ArrayList<SysDept>();
|
||||||
|
|
||||||
public Long getDeptId()
|
/** 学校ID(与school表关联) */
|
||||||
{
|
private String schoolId;
|
||||||
return deptId;
|
|
||||||
}
|
public String getSchoolId() {
|
||||||
|
return schoolId;
|
||||||
public void setDeptId(Long deptId)
|
}
|
||||||
{
|
|
||||||
this.deptId = deptId;
|
public void setSchoolId(String schoolId) {
|
||||||
}
|
this.schoolId = schoolId;
|
||||||
|
}
|
||||||
public Long getParentId()
|
|
||||||
{
|
public Long getDeptId()
|
||||||
return parentId;
|
{
|
||||||
}
|
return deptId;
|
||||||
|
}
|
||||||
public void setParentId(Long parentId)
|
|
||||||
{
|
public void setDeptId(Long deptId)
|
||||||
this.parentId = parentId;
|
{
|
||||||
}
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
public String getAncestors()
|
|
||||||
{
|
public Long getParentId()
|
||||||
return ancestors;
|
{
|
||||||
}
|
return parentId;
|
||||||
|
}
|
||||||
public void setAncestors(String ancestors)
|
|
||||||
{
|
public void setParentId(Long parentId)
|
||||||
this.ancestors = ancestors;
|
{
|
||||||
}
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
@NotBlank(message = "部门名称不能为空")
|
|
||||||
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
public String getAncestors()
|
||||||
public String getDeptName()
|
{
|
||||||
{
|
return ancestors;
|
||||||
return deptName;
|
}
|
||||||
}
|
|
||||||
|
public void setAncestors(String ancestors)
|
||||||
public void setDeptName(String deptName)
|
{
|
||||||
{
|
this.ancestors = ancestors;
|
||||||
this.deptName = deptName;
|
}
|
||||||
}
|
|
||||||
|
@NotBlank(message = "部门名称不能为空")
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
||||||
public String getOrderNum()
|
public String getDeptName()
|
||||||
{
|
{
|
||||||
return orderNum;
|
return deptName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrderNum(String orderNum)
|
public void setDeptName(String deptName)
|
||||||
{
|
{
|
||||||
this.orderNum = orderNum;
|
this.deptName = deptName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLeader()
|
@NotBlank(message = "显示顺序不能为空")
|
||||||
{
|
public String getOrderNum()
|
||||||
return leader;
|
{
|
||||||
}
|
return orderNum;
|
||||||
|
}
|
||||||
public void setLeader(String leader)
|
|
||||||
{
|
public void setOrderNum(String orderNum)
|
||||||
this.leader = leader;
|
{
|
||||||
}
|
this.orderNum = orderNum;
|
||||||
|
}
|
||||||
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
|
||||||
public String getPhone()
|
public String getLeader()
|
||||||
{
|
{
|
||||||
return phone;
|
return leader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPhone(String phone)
|
public void setLeader(String leader)
|
||||||
{
|
{
|
||||||
this.phone = phone;
|
this.leader = leader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Email(message = "邮箱格式不正确")
|
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
public String getPhone()
|
||||||
public String getEmail()
|
{
|
||||||
{
|
return phone;
|
||||||
return email;
|
}
|
||||||
}
|
|
||||||
|
public void setPhone(String phone)
|
||||||
public void setEmail(String email)
|
{
|
||||||
{
|
this.phone = phone;
|
||||||
this.email = email;
|
}
|
||||||
}
|
|
||||||
|
@Email(message = "邮箱格式不正确")
|
||||||
public String getStatus()
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||||
{
|
public String getEmail()
|
||||||
return status;
|
{
|
||||||
}
|
return email;
|
||||||
|
}
|
||||||
public void setStatus(String status)
|
|
||||||
{
|
public void setEmail(String email)
|
||||||
this.status = status;
|
{
|
||||||
}
|
this.email = email;
|
||||||
|
}
|
||||||
public String getDelFlag()
|
|
||||||
{
|
public String getStatus()
|
||||||
return delFlag;
|
{
|
||||||
}
|
return status;
|
||||||
|
}
|
||||||
public void setDelFlag(String delFlag)
|
|
||||||
{
|
public void setStatus(String status)
|
||||||
this.delFlag = delFlag;
|
{
|
||||||
}
|
this.status = status;
|
||||||
|
}
|
||||||
public String getParentName()
|
|
||||||
{
|
public String getDelFlag()
|
||||||
return parentName;
|
{
|
||||||
}
|
return delFlag;
|
||||||
|
}
|
||||||
public void setParentName(String parentName)
|
|
||||||
{
|
public void setDelFlag(String delFlag)
|
||||||
this.parentName = parentName;
|
{
|
||||||
}
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
public List<SysDept> getChildren()
|
|
||||||
{
|
public String getParentName()
|
||||||
return children;
|
{
|
||||||
}
|
return parentName;
|
||||||
|
}
|
||||||
public void setChildren(List<SysDept> children)
|
|
||||||
{
|
public void setParentName(String parentName)
|
||||||
this.children = children;
|
{
|
||||||
}
|
this.parentName = parentName;
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public String toString() {
|
public List<SysDept> getChildren()
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
{
|
||||||
.append("deptId", getDeptId())
|
return children;
|
||||||
.append("parentId", getParentId())
|
}
|
||||||
.append("ancestors", getAncestors())
|
|
||||||
.append("deptName", getDeptName())
|
public void setChildren(List<SysDept> children)
|
||||||
.append("orderNum", getOrderNum())
|
{
|
||||||
.append("leader", getLeader())
|
this.children = children;
|
||||||
.append("phone", getPhone())
|
}
|
||||||
.append("email", getEmail())
|
|
||||||
.append("status", getStatus())
|
@Override
|
||||||
.append("delFlag", getDelFlag())
|
public String toString() {
|
||||||
.append("createBy", getCreateBy())
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("createTime", getCreateTime())
|
.append("deptId", getDeptId())
|
||||||
.append("updateBy", getUpdateBy())
|
.append("parentId", getParentId())
|
||||||
.append("updateTime", getUpdateTime())
|
.append("ancestors", getAncestors())
|
||||||
.toString();
|
.append("deptName", getDeptName())
|
||||||
}
|
.append("orderNum", getOrderNum())
|
||||||
}
|
.append("leader", getLeader())
|
||||||
|
.append("phone", getPhone())
|
||||||
|
.append("email", getEmail())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("delFlag", getDelFlag())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("school_id", getSchoolId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<resultMap type="BySchool" id="BySchoolResult">
|
<resultMap type="BySchool" id="BySchoolResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
|
<result property="xxdm" column="xxdm" />
|
||||||
<result property="schoolName" column="school_name" />
|
<result property="schoolName" column="school_name" />
|
||||||
<result property="nameShort" column="name_short" />
|
<result property="nameShort" column="name_short" />
|
||||||
<result property="type" column="type" />
|
<result property="type" column="type" />
|
||||||
@ -39,12 +40,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBySchoolVo">
|
<sql id="selectBySchoolVo">
|
||||||
select id, school_name, name_short, type, parent_id, province, provincename, regionid, regionname, area, areaname, address, mastername, tel, em_man, em_tel, status, scale, create_time, create_user, approval_user, approval_time, remark, location, is_demonstr, businesslicenseimg, open_book, fee_status, open_deadline, dqxn, dqxq from by_school
|
select id, xxdm, school_name, name_short, type, parent_id, province, provincename, regionid, regionname, area, areaname, address, mastername, tel, em_man, em_tel, status, scale, create_time, create_user, approval_user, approval_time, remark, location, is_demonstr, businesslicenseimg, open_book, fee_status, open_deadline, dqxn, dqxq from by_school
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectBySchoolList" parameterType="BySchool" resultMap="BySchoolResult">
|
<select id="selectBySchoolList" parameterType="BySchool" resultMap="BySchoolResult">
|
||||||
<include refid="selectBySchoolVo"/>
|
<include refid="selectBySchoolVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="xxdm != null and xxdm != ''"> and xxdm like concat('%', #{xxdm}, '%')</if>
|
||||||
<if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
|
<if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
|
||||||
<if test="nameShort != null and nameShort != ''"> and name_short = #{nameShort}</if>
|
<if test="nameShort != null and nameShort != ''"> and name_short = #{nameShort}</if>
|
||||||
<if test="type != null "> and type = #{type}</if>
|
<if test="type != null "> and type = #{type}</if>
|
||||||
@ -84,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<insert id="insertBySchool" parameterType="BySchool" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertBySchool" parameterType="BySchool" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into by_school
|
insert into by_school
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="xxdm != null and xxdm != ''">xxdm,</if>
|
||||||
<if test="schoolName != null and schoolName != ''">school_name,</if>
|
<if test="schoolName != null and schoolName != ''">school_name,</if>
|
||||||
<if test="nameShort != null and nameShort != ''">name_short,</if>
|
<if test="nameShort != null and nameShort != ''">name_short,</if>
|
||||||
<if test="type != null ">type,</if>
|
<if test="type != null ">type,</if>
|
||||||
@ -116,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="dqxq != null and dqxq != ''">dqxq,</if>
|
<if test="dqxq != null and dqxq != ''">dqxq,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="xxdm != null and xxdm != ''">#{xxdm},</if>
|
||||||
<if test="schoolName != null and schoolName != ''">#{schoolName},</if>
|
<if test="schoolName != null and schoolName != ''">#{schoolName},</if>
|
||||||
<if test="nameShort != null and nameShort != ''">#{nameShort},</if>
|
<if test="nameShort != null and nameShort != ''">#{nameShort},</if>
|
||||||
<if test="type != null ">#{type},</if>
|
<if test="type != null ">#{type},</if>
|
||||||
@ -152,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<update id="updateBySchool" parameterType="BySchool">
|
<update id="updateBySchool" parameterType="BySchool">
|
||||||
update by_school
|
update by_school
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="xxdm != null and schoolName != ''">xxdm = #{xxdm},</if>
|
||||||
<if test="schoolName != null and schoolName != ''">school_name = #{schoolName},</if>
|
<if test="schoolName != null and schoolName != ''">school_name = #{schoolName},</if>
|
||||||
<if test="nameShort != null and nameShort != ''">name_short = #{nameShort},</if>
|
<if test="nameShort != null and nameShort != ''">name_short = #{nameShort},</if>
|
||||||
<if test="type != null ">type = #{type},</if>
|
<if test="type != null ">type = #{type},</if>
|
||||||
|
@ -1,151 +1,155 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.project.system.mapper.SysDeptMapper">
|
<mapper namespace="com.ruoyi.project.system.mapper.SysDeptMapper">
|
||||||
|
|
||||||
<resultMap type="SysDept" id="SysDeptResult">
|
<resultMap type="SysDept" id="SysDeptResult">
|
||||||
<id property="deptId" column="dept_id" />
|
<id property="deptId" column="dept_id" />
|
||||||
<result property="parentId" column="parent_id" />
|
<result property="parentId" column="parent_id" />
|
||||||
<result property="ancestors" column="ancestors" />
|
<result property="ancestors" column="ancestors" />
|
||||||
<result property="deptName" column="dept_name" />
|
<result property="deptName" column="dept_name" />
|
||||||
<result property="orderNum" column="order_num" />
|
<result property="orderNum" column="order_num" />
|
||||||
<result property="leader" column="leader" />
|
<result property="leader" column="leader" />
|
||||||
<result property="phone" column="phone" />
|
<result property="phone" column="phone" />
|
||||||
<result property="email" column="email" />
|
<result property="email" column="email" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
<result property="parentName" column="parent_name" />
|
<result property="parentName" column="parent_name" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
</resultMap>
|
<result property="schoolId" column="school_id" />
|
||||||
|
</resultMap>
|
||||||
<sql id="selectDeptVo">
|
|
||||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
<sql id="selectDeptVo">
|
||||||
from sys_dept d
|
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.school_id
|
||||||
</sql>
|
from sys_dept d
|
||||||
|
</sql>
|
||||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
|
||||||
<include refid="selectDeptVo"/>
|
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||||
where d.del_flag = '0'
|
<include refid="selectDeptVo"/>
|
||||||
<if test="parentId != null and parentId != 0">
|
where d.del_flag = '0'
|
||||||
AND parent_id = #{parentId}
|
<if test="parentId != null and parentId != 0">
|
||||||
</if>
|
AND parent_id = #{parentId}
|
||||||
<if test="deptName != null and deptName != ''">
|
</if>
|
||||||
AND dept_name like concat('%', #{deptName}, '%')
|
<if test="deptName != null and deptName != ''">
|
||||||
</if>
|
AND dept_name like concat('%', #{deptName}, '%')
|
||||||
<if test="status != null and status != ''">
|
</if>
|
||||||
AND status = #{status}
|
<if test="status != null and status != ''">
|
||||||
</if>
|
AND status = #{status}
|
||||||
<!-- 数据范围过滤 -->
|
</if>
|
||||||
${dataScope}
|
<!-- 数据范围过滤 -->
|
||||||
order by d.parent_id, d.order_num
|
${dataScope}
|
||||||
</select>
|
order by d.parent_id, d.order_num
|
||||||
|
</select>
|
||||||
<select id="selectDeptListByRoleId" parameterType="Long" resultType="Integer">
|
|
||||||
select d.dept_id, d.parent_id
|
<select id="selectDeptListByRoleId" parameterType="Long" resultType="Integer">
|
||||||
from sys_dept d
|
select d.dept_id, d.parent_id
|
||||||
left join sys_role_dept rd on d.dept_id = rd.dept_id
|
from sys_dept d
|
||||||
where rd.role_id = #{roleId}
|
left join sys_role_dept rd on d.dept_id = rd.dept_id
|
||||||
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
where rd.role_id = #{roleId}
|
||||||
order by d.parent_id, d.order_num
|
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||||
</select>
|
order by d.parent_id, d.order_num
|
||||||
|
</select>
|
||||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
||||||
<include refid="selectDeptVo"/>
|
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||||
where dept_id = #{deptId}
|
<include refid="selectDeptVo"/>
|
||||||
</select>
|
where dept_id = #{deptId}
|
||||||
|
</select>
|
||||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
|
||||||
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||||
</select>
|
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
||||||
|
</select>
|
||||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
|
||||||
select count(1) from sys_dept
|
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||||
where del_flag = '0' and parent_id = #{deptId}
|
select count(1) from sys_dept
|
||||||
</select>
|
where del_flag = '0' and parent_id = #{deptId}
|
||||||
|
</select>
|
||||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
||||||
select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||||
</select>
|
select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
||||||
|
</select>
|
||||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
|
||||||
<include refid="selectDeptVo"/>
|
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||||
where dept_name=#{deptName} and parent_id = #{parentId}
|
<include refid="selectDeptVo"/>
|
||||||
</select>
|
where dept_name=#{deptName} and parent_id = #{parentId}
|
||||||
|
</select>
|
||||||
<insert id="insertDept" parameterType="SysDept">
|
|
||||||
insert into sys_dept(
|
<insert id="insertDept" parameterType="SysDept">
|
||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
insert into sys_dept(
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||||
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||||
<if test="leader != null and leader != ''">leader,</if>
|
<if test="orderNum != null and orderNum != ''">order_num,</if>
|
||||||
<if test="phone != null and phone != ''">phone,</if>
|
<if test="leader != null and leader != ''">leader,</if>
|
||||||
<if test="email != null and email != ''">email,</if>
|
<if test="phone != null and phone != ''">phone,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="email != null and email != ''">email,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="status != null">status,</if>
|
||||||
create_time
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
)values(
|
<if test="schoolId != null and schoolId != ''">school_id,</if>
|
||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
create_time
|
||||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
)values(
|
||||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||||
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
|
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||||
<if test="leader != null and leader != ''">#{leader},</if>
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||||
<if test="phone != null and phone != ''">#{phone},</if>
|
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
|
||||||
<if test="email != null and email != ''">#{email},</if>
|
<if test="leader != null and leader != ''">#{leader},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="phone != null and phone != ''">#{phone},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
||||||
sysdate()
|
<if test="status != null">#{status},</if>
|
||||||
)
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
</insert>
|
<if test="schoolId != null and schoolId != ''">#{schoolId},</if>
|
||||||
|
sysdate()
|
||||||
<update id="updateDept" parameterType="SysDept">
|
)
|
||||||
update sys_dept
|
</insert>
|
||||||
<set>
|
|
||||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
<update id="updateDept" parameterType="SysDept">
|
||||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
update sys_dept
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
<set>
|
||||||
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||||
<if test="leader != null">leader = #{leader},</if>
|
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||||
<if test="phone != null">phone = #{phone},</if>
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||||
<if test="email != null">email = #{email},</if>
|
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
||||||
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="leader != null">leader = #{leader},</if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="phone != null">phone = #{phone},</if>
|
||||||
update_time = sysdate()
|
<if test="email != null">email = #{email},</if>
|
||||||
</set>
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
where dept_id = #{deptId}
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
</update>
|
<if test="schoolId != null and schoolId != ''">school_id = #{schoolId},</if>
|
||||||
|
update_time = sysdate()
|
||||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
</set>
|
||||||
update sys_dept set ancestors =
|
where dept_id = #{deptId}
|
||||||
<foreach collection="depts" item="item" index="index"
|
</update>
|
||||||
separator=" " open="case dept_id" close="end">
|
|
||||||
when #{item.deptId} then #{item.ancestors}
|
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||||
</foreach>
|
update sys_dept set ancestors =
|
||||||
where dept_id in
|
<foreach collection="depts" item="item" index="index"
|
||||||
<foreach collection="depts" item="item" index="index"
|
separator=" " open="case dept_id" close="end">
|
||||||
separator="," open="(" close=")">
|
when #{item.deptId} then #{item.ancestors}
|
||||||
#{item.deptId}
|
</foreach>
|
||||||
</foreach>
|
where dept_id in
|
||||||
</update>
|
<foreach collection="depts" item="item" index="index"
|
||||||
|
separator="," open="(" close=")">
|
||||||
<update id="updateDeptStatus" parameterType="SysDept">
|
#{item.deptId}
|
||||||
update sys_dept
|
</foreach>
|
||||||
<set>
|
</update>
|
||||||
<if test="status != null and status != ''">status = #{status},</if>
|
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<update id="updateDeptStatus" parameterType="SysDept">
|
||||||
update_time = sysdate()
|
update sys_dept
|
||||||
</set>
|
<set>
|
||||||
where dept_id in (${ancestors})
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
</update>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
update_time = sysdate()
|
||||||
<delete id="deleteDeptById" parameterType="Long">
|
</set>
|
||||||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
where dept_id in (${ancestors})
|
||||||
</delete>
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDeptById" parameterType="Long">
|
||||||
|
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Reference in New Issue
Block a user