添加公司信息
This commit is contained in:
parent
9845410dbf
commit
e5f69d7747
66
ruoyi-ui/src/api/base/company.js
Normal file
66
ruoyi-ui/src/api/base/company.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询公司管理列表
|
||||||
|
export function listCompany(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/company/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询公司管理详细
|
||||||
|
export function getCompany(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/company/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增公司管理
|
||||||
|
export function addCompany(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/company',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改公司管理
|
||||||
|
export function updateCompany(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/company',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 公司状态修改
|
||||||
|
export function changeCompanyEnabled(id, enabled) {
|
||||||
|
const data = {
|
||||||
|
id,
|
||||||
|
enabled
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/base/company/changeEnabled',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除公司管理
|
||||||
|
export function delCompany(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/company/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出公司管理
|
||||||
|
export function exportCompany(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/company/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
@ -1,102 +1,102 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="classObj" class="app-wrapper">
|
<div :class="classObj" class="app-wrapper">
|
||||||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
|
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
|
||||||
<sidebar class="sidebar-container" />
|
<sidebar class="sidebar-container" />
|
||||||
<div :class="{hasTagsView:needTagsView}" class="main-container">
|
<div :class="{hasTagsView:needTagsView}" class="main-container">
|
||||||
<div :class="{'fixed-header':fixedHeader}">
|
<div :class="{'fixed-header':fixedHeader}">
|
||||||
<navbar />
|
<navbar />
|
||||||
<tags-view v-if="needTagsView" />
|
<tags-view v-if="needTagsView" />
|
||||||
</div>
|
</div>
|
||||||
<app-main />
|
<app-main />
|
||||||
<right-panel v-if="showSettings">
|
<right-panel v-if="showSettings">
|
||||||
<settings />
|
<settings />
|
||||||
</right-panel>
|
</right-panel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import RightPanel from '@/components/RightPanel'
|
import RightPanel from '@/components/RightPanel'
|
||||||
import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
|
import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
|
||||||
import ResizeMixin from './mixin/ResizeHandler'
|
import ResizeMixin from './mixin/ResizeHandler'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Layout',
|
name: 'Layout',
|
||||||
components: {
|
components: {
|
||||||
AppMain,
|
AppMain,
|
||||||
Navbar,
|
Navbar,
|
||||||
RightPanel,
|
RightPanel,
|
||||||
Settings,
|
Settings,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
TagsView
|
TagsView
|
||||||
},
|
},
|
||||||
mixins: [ResizeMixin],
|
mixins: [ResizeMixin],
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
sidebar: state => state.app.sidebar,
|
sidebar: state => state.app.sidebar,
|
||||||
device: state => state.app.device,
|
device: state => state.app.device,
|
||||||
showSettings: state => state.settings.showSettings,
|
showSettings: state => state.settings.showSettings,
|
||||||
needTagsView: state => state.settings.tagsView,
|
needTagsView: state => state.settings.tagsView,
|
||||||
fixedHeader: state => state.settings.fixedHeader
|
fixedHeader: state => state.settings.fixedHeader
|
||||||
}),
|
}),
|
||||||
classObj() {
|
classObj() {
|
||||||
return {
|
return {
|
||||||
hideSidebar: !this.sidebar.opened,
|
hideSidebar: !this.sidebar.opened,
|
||||||
openSidebar: this.sidebar.opened,
|
openSidebar: this.sidebar.opened,
|
||||||
withoutAnimation: this.sidebar.withoutAnimation,
|
withoutAnimation: this.sidebar.withoutAnimation,
|
||||||
mobile: this.device === 'mobile'
|
mobile: this.device === 'mobile'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClickOutside() {
|
handleClickOutside() {
|
||||||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "~@/assets/styles/mixin.scss";
|
@import "~@/assets/styles/mixin.scss";
|
||||||
@import "~@/assets/styles/variables.scss";
|
@import "~@/assets/styles/variables.scss";
|
||||||
|
|
||||||
.app-wrapper {
|
.app-wrapper {
|
||||||
@include clearfix;
|
@include clearfix;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
&.mobile.openSidebar {
|
&.mobile.openSidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer-bg {
|
.drawer-bg {
|
||||||
background: #000;
|
background: #000;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
top: 0;
|
top: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-header {
|
.fixed-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
width: calc(100% - #{$sideBarWidth});
|
width: calc(100% - #{$sideBarWidth});
|
||||||
transition: width 0.28s;
|
transition: width 0.28s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hideSidebar .fixed-header {
|
.hideSidebar .fixed-header {
|
||||||
width: calc(100% - 54px)
|
width: calc(100% - 54px)
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile .fixed-header {
|
.mobile .fixed-header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
382
ruoyi-ui/src/views/base/company/index.vue
Normal file
382
ruoyi-ui/src/views/base/company/index.vue
Normal file
@ -0,0 +1,382 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="公司简称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入公司简称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="enabled">
|
||||||
|
<el-select v-model="queryParams.enabled" placeholder="请选择状态" clearable size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in enabledOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictValue"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker clearable size="small" style="width: 200px"
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择创建时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['base:company:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['base:company:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['base:company:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['base:company:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" stripe border fit highlight-current-row :data="companyList" @selection-change="handleSelectionChange" @sort-change='tableSortChange'>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="编号" width="80" align="center">
|
||||||
|
<template slot-scope="scope">{{scope.$index + 1}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="UUID" align="center" prop="id" v-if = "show" />
|
||||||
|
<el-table-column label="排序" align="center" prop="sort" sortable='custom' :sort-orders="['ascending', 'descending']" />
|
||||||
|
<el-table-column label="公司代码" align="center" prop="codeid" sortable='custom' :sort-orders="['ascending', 'descending']" />
|
||||||
|
<el-table-column label="公司简称" align="center" prop="name" sortable='custom' :sort-orders="['ascending', 'descending']" />
|
||||||
|
<el-table-column label="状态" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.enabled"
|
||||||
|
active-value="0"
|
||||||
|
inactive-value="1"
|
||||||
|
@change="handleStatusChange(scope.row)"
|
||||||
|
></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['base:company:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['base:company:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改公司管理对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="公司代码" prop="codeid">
|
||||||
|
<el-input v-model="form.codeid" placeholder="请输入公司代码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="公司简称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入公司简称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-select v-model="form.enabled" placeholder="请选择状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in enabledOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictValue"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listCompany, getCompany, delCompany, addCompany, updateCompany,changeCompanyEnabled, exportCompany } from "@/api/base/company";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 公司管理表格数据
|
||||||
|
companyList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 状态字典
|
||||||
|
enabledOptions: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
enabled: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
orderByColumn:'sort',
|
||||||
|
isAsc:'desc',
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
sort: [
|
||||||
|
{ required: true, message: "排序不能为空", trigger: "blur" }
|
||||||
|
], codeid: [
|
||||||
|
{ required: true, message: "公司代码不能为空", trigger: "blur" }
|
||||||
|
], name: [
|
||||||
|
{ required: true, message: "公司简称不能为空", trigger: "blur" }
|
||||||
|
], enabled: [
|
||||||
|
{ required: true, message: "状态(0正常 1停用)不能为空", trigger: "blur" }
|
||||||
|
], createBy: [
|
||||||
|
{ required: true, message: "创建者不能为空", trigger: "blur" }
|
||||||
|
], createTime: [
|
||||||
|
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||||
|
], }
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getDicts("sys_enable").then(response => {
|
||||||
|
this.enabledOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 公司管理排序 */
|
||||||
|
tableSortChange(column, prop, order) {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
if (column.order === 'descending') {
|
||||||
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
this.queryParams.isAsc = 'desc';
|
||||||
|
} else {
|
||||||
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
this.queryParams.isAsc = 'asc';
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 查询公司管理列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listCompany(this.queryParams).then(response => {
|
||||||
|
this.companyList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 状态字典翻译
|
||||||
|
enabledFormat(row, column) {
|
||||||
|
return this.selectDictLabel(this.enabledOptions, row.enabled);
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 用户状态修改
|
||||||
|
handleStatusChange(row) {
|
||||||
|
let text = row.enabled === "0" ? "启用" : "停用";
|
||||||
|
this.$confirm('确认要"' + text + '""' + row.name + '"公司吗?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return changeCompanyEnabled(row.id, row.enabled);
|
||||||
|
}).then(() => {
|
||||||
|
this.msgSuccess(text + "成功");
|
||||||
|
}).catch(function() {
|
||||||
|
row.enabled = row.enabled === "0" ? "1" : "0";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
sort: undefined,
|
||||||
|
codeid: undefined,
|
||||||
|
name: undefined,
|
||||||
|
enabled: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!=1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加公司管理";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getCompany(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改公司管理";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != undefined) {
|
||||||
|
updateCompany(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCompany(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$confirm('是否确认删除公司管理编号为"' + ids + '"的数据项?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return delCompany(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("删除成功");
|
||||||
|
}).catch(function() {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
const queryParams = this.queryParams;
|
||||||
|
this.$confirm('是否确认导出所有公司管理数据项?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return exportCompany(queryParams);
|
||||||
|
}).then(response => {
|
||||||
|
this.download(response.msg);
|
||||||
|
}).catch(function() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -4,24 +4,24 @@ import com.ruoyi.common.core.lang.UUID;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ID生成器工具类
|
* ID生成器工具类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class IdUtils
|
public class IdUtils
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 获取随机UUID
|
* 获取随机UUID
|
||||||
*
|
*
|
||||||
* @return 随机UUID
|
* @return 随机UUID
|
||||||
*/
|
*/
|
||||||
public static String randomUUID()
|
public static String randomUUID()
|
||||||
{
|
{
|
||||||
return UUID.randomUUID().toString();
|
return UUID.randomUUID().toString().toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 简化的UUID,去掉了横线
|
* 简化的UUID,去掉了横线
|
||||||
*
|
*
|
||||||
* @return 简化的UUID,去掉了横线
|
* @return 简化的UUID,去掉了横线
|
||||||
*/
|
*/
|
||||||
public static String simpleUUID()
|
public static String simpleUUID()
|
||||||
@ -31,17 +31,17 @@ public class IdUtils
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
|
* 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
|
||||||
*
|
*
|
||||||
* @return 随机UUID
|
* @return 随机UUID
|
||||||
*/
|
*/
|
||||||
public static String fastUUID()
|
public static String fastUUID()
|
||||||
{
|
{
|
||||||
return UUID.fastUUID().toString();
|
return UUID.fastUUID().toString().toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
|
* 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
|
||||||
*
|
*
|
||||||
* @return 简化的UUID,去掉了横线
|
* @return 简化的UUID,去掉了横线
|
||||||
*/
|
*/
|
||||||
public static String fastSimpleUUID()
|
public static String fastSimpleUUID()
|
||||||
|
@ -16,19 +16,20 @@ import javax.imageio.ImageIO;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码工具类
|
* 验证码工具类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class VerifyCodeUtils
|
public class VerifyCodeUtils
|
||||||
{
|
{
|
||||||
// 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
|
// 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
|
||||||
public static final String VERIFY_CODES = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
// public static final String VERIFY_CODES = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
||||||
|
public static final String VERIFY_CODES = "123456789";
|
||||||
|
|
||||||
private static Random random = new SecureRandom();
|
private static Random random = new SecureRandom();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用系统默认字符源生成验证码
|
* 使用系统默认字符源生成验证码
|
||||||
*
|
*
|
||||||
* @param verifySize 验证码长度
|
* @param verifySize 验证码长度
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -39,7 +40,7 @@ public class VerifyCodeUtils
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用指定源生成验证码
|
* 使用指定源生成验证码
|
||||||
*
|
*
|
||||||
* @param verifySize 验证码长度
|
* @param verifySize 验证码长度
|
||||||
* @param sources 验证码字符源
|
* @param sources 验证码字符源
|
||||||
* @return
|
* @return
|
||||||
@ -62,7 +63,7 @@ public class VerifyCodeUtils
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 输出指定验证码图片流
|
* 输出指定验证码图片流
|
||||||
*
|
*
|
||||||
* @param w
|
* @param w
|
||||||
* @param h
|
* @param h
|
||||||
* @param os
|
* @param os
|
||||||
@ -223,4 +224,4 @@ public class VerifyCodeUtils
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ import com.ruoyi.framework.datasource.DynamicDataSource;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* druid 配置多数据源
|
* druid 配置多数据源
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ -58,10 +58,10 @@ public class DruidConfig
|
|||||||
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
|
||||||
return new DynamicDataSource(masterDataSource, targetDataSources);
|
return new DynamicDataSource(masterDataSource, targetDataSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置数据源
|
* 设置数据源
|
||||||
*
|
*
|
||||||
* @param targetDataSources 备选数据源集合
|
* @param targetDataSources 备选数据源集合
|
||||||
* @param sourceName 数据源名称
|
* @param sourceName 数据源名称
|
||||||
* @param beanName bean名称
|
* @param beanName bean名称
|
||||||
@ -109,7 +109,7 @@ public class DruidConfig
|
|||||||
// 获取common.js
|
// 获取common.js
|
||||||
String text = Utils.readFromResource(filePath);
|
String text = Utils.readFromResource(filePath);
|
||||||
// 正则替换banner, 除去底部的广告信息
|
// 正则替换banner, 除去底部的广告信息
|
||||||
text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
//text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
||||||
text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
||||||
response.getWriter().write(text);
|
response.getWriter().write(text);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,112 @@
|
|||||||
|
package com.ruoyi.project.mr.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.IdUtils;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||||
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||||
|
import com.ruoyi.framework.web.controller.BaseController;
|
||||||
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
|
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||||
|
import com.ruoyi.project.mr.service.IBaseCompanyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司管理Controller
|
||||||
|
*
|
||||||
|
* @author mr
|
||||||
|
* @date 2020-01-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/company")
|
||||||
|
public class BaseCompanyController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IBaseCompanyService baseCompanyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司管理列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BaseCompany> list = baseCompanyService.selectBaseCompanyList(baseCompany);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出公司管理列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:export')")
|
||||||
|
@Log(title = "公司管理", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public AjaxResult export(BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
List<BaseCompany> list = baseCompanyService.selectBaseCompanyList(baseCompany);
|
||||||
|
ExcelUtil<BaseCompany> util = new ExcelUtil<BaseCompany>(BaseCompany.class);
|
||||||
|
return util.exportExcel(list, "公司信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取公司管理详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(baseCompanyService.selectBaseCompanyById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:add')")
|
||||||
|
@Log(title = "公司管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
baseCompany.setId(IdUtils.fastUUID());
|
||||||
|
return toAjax(baseCompanyService.insertBaseCompany(baseCompany));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公司管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:edit')")
|
||||||
|
@Log(title = "公司管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
return toAjax(baseCompanyService.updateBaseCompany(baseCompany));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公司管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:remove')")
|
||||||
|
@Log(title = "公司管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(baseCompanyService.deleteBaseCompanyByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态修改
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('base:company:edit')")
|
||||||
|
@Log(title = "公司管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/changeEnabled")
|
||||||
|
public AjaxResult changeEnabled(@RequestBody BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
baseCompany.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return toAjax(baseCompanyService.updateBaseCompanyEnabled(baseCompany));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
package com.ruoyi.project.mr.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司管理对象 base_company
|
||||||
|
*
|
||||||
|
* @author mr
|
||||||
|
* @date 2020-01-04
|
||||||
|
*/
|
||||||
|
public class BaseCompany extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** UUID */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 排序 */
|
||||||
|
@Excel(name = "排序")
|
||||||
|
private Long sort;
|
||||||
|
|
||||||
|
/** 公司代码 */
|
||||||
|
@Excel(name = "公司代码")
|
||||||
|
private String codeid;
|
||||||
|
|
||||||
|
/** 公司简称 */
|
||||||
|
@Excel(name = "公司简称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 状态(0正常 1停用) */
|
||||||
|
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||||
|
private String enabled;
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setSort(Long sort)
|
||||||
|
{
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getSort()
|
||||||
|
{
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
public void setCodeid(String codeid)
|
||||||
|
{
|
||||||
|
this.codeid = codeid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodeid()
|
||||||
|
{
|
||||||
|
return codeid;
|
||||||
|
}
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setEnabled(String enabled)
|
||||||
|
{
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnabled()
|
||||||
|
{
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("sort", getSort())
|
||||||
|
.append("codeid", getCodeid())
|
||||||
|
.append("name", getName())
|
||||||
|
.append("enabled", getEnabled())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.project.mr.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author mr
|
||||||
|
* @date 2020-01-04
|
||||||
|
*/
|
||||||
|
public interface BaseCompanyMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询公司管理
|
||||||
|
*
|
||||||
|
* @param id 公司管理ID
|
||||||
|
* @return 公司管理
|
||||||
|
*/
|
||||||
|
public BaseCompany selectBaseCompanyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司管理列表
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 公司管理集合
|
||||||
|
*/
|
||||||
|
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司管理
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBaseCompany(BaseCompany baseCompany);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公司管理
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseCompany(BaseCompany baseCompany);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公司管理
|
||||||
|
*
|
||||||
|
* @param id 公司管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseCompanyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公司管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseCompanyByIds(String[] ids);
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.ruoyi.project.mr.service;
|
||||||
|
|
||||||
|
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司管理Service接口
|
||||||
|
*
|
||||||
|
* @author mr
|
||||||
|
* @date 2020-01-04
|
||||||
|
*/
|
||||||
|
public interface IBaseCompanyService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询公司管理
|
||||||
|
*
|
||||||
|
* @param id 公司管理ID
|
||||||
|
* @return 公司管理
|
||||||
|
*/
|
||||||
|
public BaseCompany selectBaseCompanyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司管理列表
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 公司管理集合
|
||||||
|
*/
|
||||||
|
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司管理
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBaseCompany(BaseCompany baseCompany);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公司管理
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseCompany(BaseCompany baseCompany);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公司管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的公司管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseCompanyByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公司管理信息
|
||||||
|
*
|
||||||
|
* @param id 公司管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseCompanyById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公司状态
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseCompanyEnabled(BaseCompany baseCompany);
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
package com.ruoyi.project.mr.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.project.mr.domain.BaseCompany;
|
||||||
|
import com.ruoyi.project.mr.mapper.BaseCompanyMapper;
|
||||||
|
import com.ruoyi.project.mr.service.IBaseCompanyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author mr
|
||||||
|
* @date 2020-01-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BaseCompanyServiceImpl implements IBaseCompanyService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private BaseCompanyMapper baseCompanyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司管理
|
||||||
|
*
|
||||||
|
* @param id 公司管理ID
|
||||||
|
* @return 公司管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BaseCompany selectBaseCompanyById(String id)
|
||||||
|
{
|
||||||
|
return baseCompanyMapper.selectBaseCompanyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询公司管理列表
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 公司管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
return baseCompanyMapper.selectBaseCompanyList(baseCompany);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增公司管理
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBaseCompany(BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
baseCompany.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return baseCompanyMapper.insertBaseCompany(baseCompany);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改公司管理
|
||||||
|
*
|
||||||
|
* @param baseCompany 公司管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBaseCompany(BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
baseCompany.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return baseCompanyMapper.updateBaseCompany(baseCompany);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除公司管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的公司管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBaseCompanyByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return baseCompanyMapper.deleteBaseCompanyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除公司管理信息
|
||||||
|
*
|
||||||
|
* @param id 公司管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBaseCompanyById(String id)
|
||||||
|
{
|
||||||
|
return baseCompanyMapper.deleteBaseCompanyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户状态
|
||||||
|
*
|
||||||
|
* @param baseCompany 用户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBaseCompanyEnabled(BaseCompany baseCompany)
|
||||||
|
{
|
||||||
|
baseCompany.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return baseCompanyMapper.updateBaseCompany(baseCompany);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -21,4 +21,4 @@ Spring Boot Version: ${spring-boot.version}
|
|||||||
// `=---=' //
|
// `=---=' //
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
||||||
// 佛祖保佑 永不宕机 永无BUG //
|
// 佛祖保佑 永不宕机 永无BUG //
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
94
ruoyi/src/main/resources/mybatis/base/BaseCompanyMapper.xml
Normal file
94
ruoyi/src/main/resources/mybatis/base/BaseCompanyMapper.xml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?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.mr.mapper.BaseCompanyMapper">
|
||||||
|
|
||||||
|
<resultMap type="BaseCompany" id="BaseCompanyResult">
|
||||||
|
<result property="id" column="ID" />
|
||||||
|
<result property="sort" column="Sort" />
|
||||||
|
<result property="codeid" column="CodeID" />
|
||||||
|
<result property="name" column="Name" />
|
||||||
|
<result property="enabled" column="Enabled" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBaseCompanyVo">
|
||||||
|
select ID, Sort, CodeID, Name, Enabled, create_by, create_time, update_by, update_time, remark from base_company
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBaseCompanyList" parameterType="BaseCompany" resultMap="BaseCompanyResult">
|
||||||
|
<include refid="selectBaseCompanyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="name != null and name != ''"> and Name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="enabled != null and enabled != ''"> and Enabled = #{enabled}</if>
|
||||||
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||||
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBaseCompanyById" parameterType="String" resultMap="BaseCompanyResult">
|
||||||
|
<include refid="selectBaseCompanyVo"/>
|
||||||
|
where ID = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBaseCompany" parameterType="BaseCompany">
|
||||||
|
insert into base_company
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null and id != ''">ID,</if>
|
||||||
|
<if test="sort != null ">Sort,</if>
|
||||||
|
<if test="codeid != null and codeid != ''">CodeID,</if>
|
||||||
|
<if test="name != null and name != ''">Name,</if>
|
||||||
|
<if test="enabled != null and enabled != ''">Enabled,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null ">create_time,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
<if test="updateTime != null ">update_time,</if>
|
||||||
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null and id != ''">#{id},</if>
|
||||||
|
<if test="sort != null ">#{sort},</if>
|
||||||
|
<if test="codeid != null and codeid != ''">#{codeid},</if>
|
||||||
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
|
<if test="enabled != null and enabled != ''">#{enabled},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null ">#{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null ">#{updateTime},</if>
|
||||||
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBaseCompany" parameterType="BaseCompany">
|
||||||
|
update base_company
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="sort != null ">Sort = #{sort},</if>
|
||||||
|
<if test="codeid != null and codeid != ''">CodeID = #{codeid},</if>
|
||||||
|
<if test="name != null and name != ''">Name = #{name},</if>
|
||||||
|
<if test="enabled != null and enabled != ''">Enabled = #{enabled},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where ID = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBaseCompanyById" parameterType="String">
|
||||||
|
delete from base_company where ID = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBaseCompanyByIds" parameterType="String">
|
||||||
|
delete from base_company where ID in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -97,7 +97,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="${businessName}List" stripe height @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($javaField=$column.javaField)
|
#set($javaField=$column.javaField)
|
||||||
@ -140,7 +140,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -436,4 +436,4 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user