This commit is contained in:
20932067@zju.edu.cn 2021-01-25 23:34:07 +08:00
parent d5a52438cd
commit 48b5c50f85
43 changed files with 1609 additions and 698 deletions

View File

@ -4,6 +4,7 @@ ENV = 'development'
# 宏驰云管理系统/开发环境
#VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://localhost:8085/dev-api'
#VUE_APP_BASE_API = 'http://apibase.hchyun.com/dev-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询接口类名列表
export function listApiclass(query) {
return request({
url: '/system/apiclass/list',
url: '/tool/apiclass/list',
method: 'get',
params: query
})
@ -12,7 +12,7 @@ export function listApiclass(query) {
// 获取模块管理选项列表
export function queryListApiclass() {
return request({
url: '/system/module/querylist',
url: '/tool/module/querylist',
method: 'get',
})
}
@ -20,7 +20,7 @@ export function queryListApiclass() {
// 查询接口类名详细
export function getApiclass(id) {
return request({
url: '/system/apiclass/' + id,
url: '/tool/apiclass/' + id,
method: 'get'
})
}
@ -28,7 +28,7 @@ export function getApiclass(id) {
// 新增接口类名
export function addApiclass(data) {
return request({
url: '/system/apiclass',
url: '/tool/apiclass',
method: 'post',
data: data
})
@ -37,7 +37,7 @@ export function addApiclass(data) {
// 修改接口类名
export function updateApiclass(data) {
return request({
url: '/system/apiclass',
url: '/tool/apiclass',
method: 'put',
data: data
})
@ -46,7 +46,7 @@ export function updateApiclass(data) {
// 删除接口类名
export function delApiclass(id) {
return request({
url: '/system/apiclass/' + id,
url: '/tool/apiclass/' + id,
method: 'delete'
})
}
@ -54,7 +54,7 @@ export function delApiclass(id) {
// 导出接口类名
export function exportApiclass(query) {
return request({
url: '/system/apiclass/export',
url: '/tool/apiclass/export',
method: 'get',
params: query
})

View File

@ -5,7 +5,7 @@ import request from '@/utils/request'
// 查询模块管理列表
export function listModule(query) {
return request({
url: '/system/module/list',
url: '/tool/module/list',
method: 'get',
params: query
})
@ -14,7 +14,7 @@ export function listModule(query) {
// 获取模块管理选项列表
export function queryListModule() {
return request({
url: '/system/module/querylist',
url: '/tool/module/querylist',
method: 'get',
})
}
@ -22,7 +22,7 @@ export function queryListModule() {
// 查询模块管理详细
export function getModule(id) {
return request({
url: '/system/module/' + id,
url: '/tool/module/' + id,
method: 'get'
})
}
@ -30,7 +30,7 @@ export function getModule(id) {
// 新增模块管理
export function addModule(data) {
return request({
url: '/system/module',
url: '/tool/module',
method: 'post',
data: data
})
@ -39,7 +39,7 @@ export function addModule(data) {
// 修改模块管理
export function updateModule(data) {
return request({
url: '/system/module',
url: '/tool/module',
method: 'put',
data: data
})
@ -48,7 +48,7 @@ export function updateModule(data) {
// 删除模块管理
export function delModule(id) {
return request({
url: '/system/module/' + id,
url: '/tool/module/' + id,
method: 'delete'
})
}
@ -56,7 +56,7 @@ export function delModule(id) {
// 导出模块管理
export function exportModule(query) {
return request({
url: '/system/module/export',
url: '/tool/module/export',
method: 'get',
params: query
})

View File

@ -92,6 +92,32 @@ export const constantRoutes = [
}
]
},
{
path: '/apiclass',
component: Layout,
hidden: true,
children: [
{
path: 'edit/:apiclassId(\\d+)',
component: (resolve) => require(['@/views/tool/apiclass/editTable'], resolve),
name: 'ApiclassEdit',
meta: { title: '类生成配置' }
}
]
},
{
path: '/module',
component: Layout,
hidden: true,
children: [
{
path: 'edit/:moduleId(\\d+)',
component: (resolve) => require(['@/views/tool/module/editTable'], resolve),
name: 'ModuleEdit',
meta: { title: '模块生成配置' }
}
]
},
{
path: '/job',
component: Layout,
@ -114,10 +140,10 @@ export const constantRoutes = [
path: 'edit/:tableId(\\d+)',
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
name: 'GenEdit',
meta: { title: '修改生成配置' }
meta: { title: '数据库生成配置' }
}
]
}
},
]
export default new Router({

View File

@ -40,6 +40,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -49,6 +50,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -59,6 +61,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -69,6 +72,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -78,6 +82,7 @@
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-s-operation"
size="mini"
@click="handleJobLog"

View File

@ -65,6 +65,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -75,6 +76,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleClean"
@ -84,6 +86,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -293,4 +296,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -59,6 +59,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -69,6 +70,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleClean"
@ -78,6 +80,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"

View File

@ -75,6 +75,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -85,6 +86,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleClean"
@ -94,6 +96,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"

View File

@ -1,329 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="模块id" prop="mId">
<!-- <el-select -->
<!-- <el-input-->
<!-- v-model="queryParams.mId"-->
<!-- placeholder="请输入模块id"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
</el-form-item>
<el-form-item label="类名" prop="cName">
<el-input
v-model="queryParams.cName"
placeholder="请输入类名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类描述" prop="cDescribe">
<el-input
v-model="queryParams.cDescribe"
placeholder="请输入类描述"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangeCreateTime"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</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"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:apiclass:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:apiclass:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:apiclass:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:apiclass:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="apiclassList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="类id" align="center" prop="id" />-->
<el-table-column label="模块id" align="center" prop="mId" />
<el-table-column label="类名" align="center" prop="cName" />
<el-table-column label="类描述" align="center" prop="cDescribe" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
</template>
</el-table-column>
<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="['system:apiclass:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:apiclass: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" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="模块id" prop="mId">
<el-input v-model="form.mId" placeholder="请输入模块id" />
</el-form-item>
<el-form-item label="类名" prop="cName">
<el-input v-model="form.cName" placeholder="请输入类名" />
</el-form-item>
<el-form-item label="类描述" prop="cDescribe">
<el-input v-model="form.cDescribe" placeholder="请输入类描述" />
</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 { listApiclass, getApiclass, delApiclass, addApiclass, updateApiclass, exportApiclass } from "@/api/system/apiclass";
import {queryListModule} from "@/api/system/module"
export default {
name: "Apiclass",
components: {
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
apiclassList: [],
//
model:[],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
mId: null,
cName: null,
cDescribe: null,
},
//
form: {},
//
rules: {
mId: [
{ required: true, message: "模块id不能为空}", trigger: "blur" },
],
cName: [
{ required: true, message: "类名不能为空}", trigger: "blur" },
],
cDescribe: [
{ required: true, message: "类描述不能为空}", trigger: "blur" },
],
}
};
},
created() {
this.getList();
queryListModule().then(respone =>{
console.log(respone)
})
},
methods: {
/** 查询接口类名列表 */
getList() {
this.loading = true;
listApiclass(this.addCreateDateRange(this.queryParams,this.daterangeCreateTime)).then(response =>{
this.apiclassList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
mId: null,
cName: null,
cDescribe: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
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
getApiclass(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改接口类名";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateApiclass(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addApiclass(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除接口类名编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delApiclass(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有接口类名数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportApiclass(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>

View File

@ -53,6 +53,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -62,6 +63,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -72,6 +74,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -82,6 +85,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -91,6 +95,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-refresh"
size="mini"
@click="handleClearCache"
@ -167,8 +172,10 @@
</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>
<el-button type="primary"
plain @click="submitForm"> </el-button>
<el-button @click="cancel"
plain> </el-button>
</div>
</el-dialog>
</div>
@ -353,4 +360,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -31,6 +31,7 @@
<el-button
type="primary"
icon="el-icon-plus"
plain
size="mini"
@click="handleAdd"
v-hasPermi="['system:dept:add']"
@ -56,17 +57,17 @@
</el-table-column>
<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"
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dept:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:dept:add']"
>新增</el-button>
@ -313,4 +314,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -40,6 +40,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -49,6 +50,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -59,6 +61,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -69,6 +72,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -96,6 +100,7 @@
<el-button
size="mini"
type="text"
plain
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
@ -103,6 +108,7 @@
<el-button
size="mini"
type="text"
plain
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
@ -347,4 +353,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -59,6 +59,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -68,6 +69,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -78,6 +80,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -88,6 +91,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -97,6 +101,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-refresh"
size="mini"
@click="handleClearCache"
@ -357,4 +362,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -32,6 +32,7 @@
type="primary"
icon="el-icon-plus"
size="mini"
plain
@click="handleAdd"
v-hasPermi="['system:menu:add']"
>新增</el-button>
@ -62,16 +63,16 @@
</el-table-column>
<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"
<el-button size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:add']"
>新增</el-button>
@ -396,4 +397,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -39,6 +39,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -48,6 +49,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -58,6 +60,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -337,4 +340,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -39,6 +39,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -48,6 +49,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -58,6 +60,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -68,6 +71,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -108,7 +112,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -319,4 +323,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -48,6 +48,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
v-on:click="handleAdd"
@ -58,6 +59,7 @@
<el-button
type="success"
icon="el-icon-edit"
plain
size="mini"
:disabled="single"
v-on:click="handleUpdate"
@ -67,6 +69,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -77,6 +80,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
v-on:click="handleExport"

View File

@ -59,6 +59,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -68,6 +69,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -78,6 +80,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -88,6 +91,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -592,4 +596,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -86,6 +86,7 @@
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@ -95,6 +96,7 @@
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@ -105,6 +107,7 @@
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@ -115,6 +118,7 @@
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
@ -124,6 +128,7 @@
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
@ -662,4 +667,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -0,0 +1,118 @@
<template>
<el-form ref="apiclassInfoForm" :model="info" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="类名" prop="cName">
<el-input placeholder="请输入类名" v-model="info.packageName" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="前缀" prop="prefix">
<el-input v-model="info.prefix" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="模块名" prop="cName">
<el-select v-model="info.mId" placeholder="请选择模块" @change="transform" clearable>
<el-option
v-for="item in moduleList"
:key="item.id"
:label="item.mName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类名" prop="cName">
<el-input placeholder="请输入类名" @input="transform" v-model="info.cName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="作者" prop="author">
<el-input placeholder="请输入" v-model="info.author"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类描述" prop="cDescribe">
<el-input placeholder="请输入" v-model="info.cDescribe"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电子邮件" prop="email">
<el-input placeholder="请输入" v-model="info.email"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注">
<el-input type="textarea" :rows="3" v-model="info.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {queryListModule} from "@/api/tool/module"
export default {
name: "ApiclassInfoForm",
props: {
info: {
type: Object,
default: null
}
},
data() {
return {
moduleList:[],
rules: {
packageName: [
{required: true, message: "包名不能为空", trigger: "blur"},
],
mId: [
{required: true, message: "模块不能为空", trigger: "blur"},
],
cName: [
{required: true, message: "类名不能为空", trigger: "blur"},
],
cDescribe: [
{required: true, message: "类描述不能为空", trigger: "blur"},
],
author: [
{required: true, message: "作者不能为空", trigger: "blur"},
],
email: [
{required: true, message: "电子邮件不能为空", trigger: "blur"},
{
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
message: '电子邮件格式有误',
trigger: "blur"
},
],
}
};
},
created() {
queryListModule().then(respone => {
this.moduleList = respone.data
})
},
methods:{
transform() {
var mid = this.info.mId
var str = ''
var start = true
for (let i = 0; i < this.moduleList.length; i++) {
if (mid == this.moduleList[i].id) {
str = this.moduleList[i].mName
start = false
}
}
if (start) {
str = ''
}
this.info.packageName = 'com.hchyun.' + str +"."
this.info.prefix = str+":"+this.info.cName + ":"
},
}
};
</script>

View File

@ -0,0 +1,206 @@
<template>
<el-card>
<el-tabs v-model="activeName">
<el-tab-pane label="基本信息" name="basic">
<apiclass-info-form ref="apiclassInfo" :info="info"/>
</el-tab-pane>
<el-tab-pane label="字段信息" name="cloum">
<el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight">
<el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag"/>
<el-table-column
label="字段列名"
prop="columnName"
min-width="10%"
:show-overflow-tooltip="true"
/>
<el-table-column label="字段描述" min-width="10%">
<template slot-scope="scope">
<el-input v-model="scope.row.columnComment"></el-input>
</template>
</el-table-column>
<el-table-column
label="物理类型"
prop="columnType"
min-width="10%"
:show-overflow-tooltip="true"
/>
<el-table-column label="Java类型" min-width="11%">
<template slot-scope="scope">
<el-select v-model="scope.row.javaType">
<el-option label="Long" value="Long"/>
<el-option label="String" value="String"/>
<el-option label="Integer" value="Integer"/>
<el-option label="Double" value="Double"/>
<el-option label="BigDecimal" value="BigDecimal"/>
<el-option label="Date" value="Date"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="java属性" min-width="10%">
<template slot-scope="scope">
<el-input v-model="scope.row.javaField"></el-input>
</template>
</el-table-column>
<el-table-column label="插入" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isInsert"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="编辑" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isEdit"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="列表" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isList"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="查询" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isQuery"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="查询方式" min-width="10%">
<template slot-scope="scope">
<el-select v-model="scope.row.queryType">
<el-option label="=" value="EQ"/>
<el-option label="!=" value="NE"/>
<el-option label=">" value="GT"/>
<el-option label=">=" value="GTE"/>
<el-option label="<" value="LT"/>
<el-option label="<=" value="LTE"/>
<el-option label="LIKE" value="LIKE"/>
<el-option label="BETWEEN" value="BETWEEN"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="必填" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isRequired"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="是否正则" min-width="10%">
<template slot-scope="scope">
<el-select v-model="scope.row.isRegular">
<el-option v-for="item in regularOptions" :key="item.id"
:label="item.name"
:value="item.id"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="显示类型" min-width="12%">
<template slot-scope="scope">
<el-select v-model="scope.row.htmlType">
<el-option label="文本框" value="input"/>
<el-option label="文本域" value="textarea"/>
<el-option label="下拉框" value="select"/>
<el-option label="单选框" value="radio"/>
<el-option label="复选框" value="checkbox"/>
<el-option label="日期控件" value="datetime"/>
<el-option label="图片上传" value="imageUpload"/>
<el-option label="文件上传" value="fileUpload"/>
<el-option label="富文本控件" value="editor"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="字典类型" min-width="12%">
<template slot-scope="scope">
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择">
<el-option
v-for="dict in dictOptions"
:key="dict.dictType"
:label="dict.dictName"
:value="dict.dictType">
<span style="float: left">{{ dict.dictName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span>
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="生成信息" name="genInfo">
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus"/>
</el-tab-pane>
</el-tabs>
<el-form label-width="100px">
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
<el-button type="primary" @click="submitForm()">提交</el-button>
<el-button @click="close()">返回</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import ApiclassInfoForm from "./apiclassInfoForm";
import {getApiclass} from "@/api/tool/apiclass";
export default {
name: "ApiclassEdit",
components: {ApiclassInfoForm}
,
data(){
return{
info:[],
};
},
created() {
const apiclassId = this.$route.params && this.$route.params.apiclassId;
if (apiclassId){
getApiclass(apiclassId).then(response => {
this.info = response.data;
});
}
console.log(apiclassId)
},
methods:{
/** 提交按钮 */
submitForm() {
const apiclassForm = this.$refs.apiclassInfo.$refs.apiclassInfoForm;
console.log(apiclassForm.model)
// const genForm = this.$refs.genInfo.$refs.genInfoForm;
Promise.all([apiclassForm].map(this.getFormPromise)).then(res => {
console.log(res)
const validateResult = res.every(item => !!item);
if (validateResult) {
// const genTable = Object.assign({}, basicForm.model, genForm.model);
// genTable.columns = this.cloumns;
// genTable.params = {
// treeCode: genTable.treeCode,
// treeName: genTable.treeName,
// treeParentCode: genTable.treeParentCode,
// parentMenuId: genTable.parentMenuId
// };
// updateGenTable(genTable).then(res => {
// this.msgSuccess(res.msg);
// if (res.code === 200) {
// this.close();
// }
// });
} else {
this.msgError("表单校验未通过,请重新检查提交内容");
}
});
},
getFormPromise(form) {
return new Promise(resolve => {
form.validate(res => {
resolve(res);
});
});
},
/** 关闭按钮 */
close() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ path: "/tool/apiclass", query: { t: Date.now()}})
}
},
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,417 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="模块" prop="mId">
<el-select v-model="queryParams.mId" placeholder="请选择模块" v-on:change="handleQuery" clearable size="small">
<el-option
v-for="item in moduleList"
:key="item.id"
:label="item.mName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="类名" prop="cName">
<el-input
v-model="queryParams.cName"
placeholder="请输入类名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类描述" prop="cDescribe">
<el-input
v-model="queryParams.cDescribe"
placeholder="请输入类描述"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangeCreateTime"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</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"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['tool:apiclass:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tool:apiclass:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['tool:apiclass:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['tool:apiclass:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="apiclassList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" align="center"/>
<el-table-column label="包名" width="180" align="center" prop="packageName"/>
<el-table-column label="模块" align="center" prop="module.mName"/>
<el-table-column label="模块名称" align="center" prop="module.mDescribe"/>
<el-table-column label="类名" align="center" prop="cName"/>
<el-table-column label="类描述" align="center" prop="cDescribe"/>
<el-table-column label="作者" align="center" prop="author"/>
<el-table-column label="电子邮件" width="180" align="center" prop="email"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column width="280" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
type="text"
size="small"
icon="el-icon-view"
@click="handlePreview(scope.row)"
v-hasPermi="['tool:apiclass:preview']"
>预览</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['tool:apiclass:edit']"
>修改</el-button>
<el-button
type="text"
size="small"
icon="el-icon-edit-outline"
@click="handleEditTable(scope.row)"
v-hasPermi="['tool:apiclass:update']"
>接口</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['tool:apiclass:remove']"
>删除</el-button>
<el-button
type="text"
size="small"
icon="el-icon-download"
@click="handleGenTable(scope.row)"
v-hasPermi="['tool:apiclass:code']"
>生成代码</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" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="包名" prop="packageName">
<el-input v-model="form.packageName" :disabled="true"/>
</el-form-item>
<el-form-item label="前缀" prop="prefix">
<el-input v-model="form.prefix" :disabled="true"/>
</el-form-item>
<el-form-item label="模块" prop="mId">
<el-select v-model="form.mId" placeholder="请选择模块" @change="transform" clearable>
<el-option
v-for="item in moduleList"
:key="item.id"
:label="item.mName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="类名" prop="cName">
<el-input v-model="form.cName" @input="transform" placeholder="请输入类名"/>
</el-form-item>
<el-form-item label="类描述" prop="cDescribe">
<el-input v-model="form.cDescribe" placeholder="请输入类描述"/>
</el-form-item>
<el-form-item label="作者" prop="author">
<el-input v-model="form.author" placeholder="请输入作者"/>
</el-form-item>
<el-form-item label="电子邮件" prop="email">
<el-input v-model="form.email" placeholder="请输入电子邮件"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注"/>
</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 { listApiclass, getApiclass, delApiclass, addApiclass, updateApiclass, exportApiclass } from "@/api/tool/apiclass";
import {queryListModule} from "@/api/tool/module"
export default {
name: "Apiclass",
components: {},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
apiclassList: [],
//
moduleList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
mId: null,
cName: null,
cDescribe: null,
},
//
form: {},
//
rules: {
packageName: [
{required: true, message: "包名不能为空", trigger: "blur"},
],
prefix: [
{required: true, message: "包名不能为空", trigger: "blur"},
],
mId: [
{required: true, message: "模块不能为空", trigger: "blur"},
],
cName: [
{required: true, message: "类名不能为空", trigger: "blur"},
],
cDescribe: [
{required: true, message: "类描述不能为空", trigger: "blur"},
],
author: [
{required: true, message: "作者不能为空", trigger: "blur"},
],
email: [
{required: true, message: "电子邮件不能为空", trigger: "blur"},
{
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
message: '电子邮件格式有误',
trigger: "blur"
},
],
}
};
},
created() {
this.getList();
queryListModule().then(respone => {
this.moduleList = respone.data
})
},
methods: {
/** 查询接口类名列表 */
getList() {
this.loading = true;
listApiclass(this.addCreateDateRange(this.queryParams, this.daterangeCreateTime)).then(response => {
this.apiclassList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
handleEditTable(row){
const apiclassId = row.id || this.ids[0];
this.$router.push("/apiclass/edit/" + apiclassId);
},
transform() {
var mid = this.form.mId
var str = ''
var start = true
for (let i = 0; i < this.moduleList.length; i++) {
if (mid == this.moduleList[i].id) {
str = this.moduleList[i].mName
start = false
}
}
if (start) {
str = ''
}
this.form.packageName = 'com.hchyun.' + str +"."
this.form.prefix = str+":"+this.form.cName + ":"
},
//
reset() {
this.form = {
id: null,
mId: null,
cName: "",
cDescribe: null,
packageName: "com.hchyun.",
author: "hchyun",
email: "clay@huchyun.com",
remark: null,
prefix: ""
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
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
getApiclass(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改接口类名";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateApiclass(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addApiclass(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除接口类名编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delApiclass(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有接口类名数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportApiclass(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>

View File

@ -3,23 +3,23 @@
<el-row>
<el-col :span="12">
<el-form-item label="表名称" prop="tableName">
<el-input placeholder="请输入仓库名称" v-model="info.tableName" />
<el-input placeholder="请输入仓库名称" v-model="info.tableName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="表描述" prop="tableComment">
<el-input placeholder="请输入" v-model="info.tableComment" />
<el-input placeholder="请输入" v-model="info.tableComment"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="实体类名称" prop="className">
<el-input placeholder="请输入" v-model="info.className" />
<el-input placeholder="请输入" v-model="info.className"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="作者" prop="functionAuthor">
<el-input placeholder="请输入" v-model="info.functionAuthor" />
<el-input placeholder="请输入" v-model="info.functionAuthor"/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -31,31 +31,31 @@
</el-form>
</template>
<script>
export default {
name: "BasicInfoForm",
props: {
info: {
type: Object,
default: null
}
},
data() {
return {
rules: {
tableName: [
{ required: true, message: "请输入表名称", trigger: "blur" }
],
tableComment: [
{ required: true, message: "请输入表描述", trigger: "blur" }
],
className: [
{ required: true, message: "请输入实体类名称", trigger: "blur" }
],
functionAuthor: [
{ required: true, message: "请输入作者", trigger: "blur" }
]
export default {
name: "BasicInfoForm",
props: {
info: {
type: Object,
default: null
}
};
}
};
},
data() {
return {
rules: {
tableName: [
{required: true, message: "请输入表名称", trigger: "blur"}
],
tableComment: [
{required: true, message: "请输入表描述", trigger: "blur"}
],
className: [
{required: true, message: "请输入实体类名称", trigger: "blur"}
],
functionAuthor: [
{required: true, message: "请输入作者", trigger: "blur"}
]
}
};
}
};
</script>

View File

@ -0,0 +1,201 @@
<template>
<el-card>
<el-tabs v-model="activeName">
<el-tab-pane label="基本信息" name="basic">
<module-info-form ref="moduleInfo" :info="info"/>
</el-tab-pane>
<el-tab-pane label="字段信息" name="cloum">
<el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight">
<el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag"/>
<el-table-column
label="字段列名"
prop="columnName"
min-width="10%"
:show-overflow-tooltip="true"
/>
<el-table-column label="字段描述" min-width="10%">
<template slot-scope="scope">
<el-input v-model="scope.row.columnComment"></el-input>
</template>
</el-table-column>
<el-table-column
label="物理类型"
prop="columnType"
min-width="10%"
:show-overflow-tooltip="true"
/>
<el-table-column label="Java类型" min-width="11%">
<template slot-scope="scope">
<el-select v-model="scope.row.javaType">
<el-option label="Long" value="Long"/>
<el-option label="String" value="String"/>
<el-option label="Integer" value="Integer"/>
<el-option label="Double" value="Double"/>
<el-option label="BigDecimal" value="BigDecimal"/>
<el-option label="Date" value="Date"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="java属性" min-width="10%">
<template slot-scope="scope">
<el-input v-model="scope.row.javaField"></el-input>
</template>
</el-table-column>
<el-table-column label="插入" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isInsert"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="编辑" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isEdit"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="列表" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isList"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="查询" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isQuery"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="查询方式" min-width="10%">
<template slot-scope="scope">
<el-select v-model="scope.row.queryType">
<el-option label="=" value="EQ"/>
<el-option label="!=" value="NE"/>
<el-option label=">" value="GT"/>
<el-option label=">=" value="GTE"/>
<el-option label="<" value="LT"/>
<el-option label="<=" value="LTE"/>
<el-option label="LIKE" value="LIKE"/>
<el-option label="BETWEEN" value="BETWEEN"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="必填" min-width="5%">
<template slot-scope="scope">
<el-checkbox true-label="1" v-model="scope.row.isRequired"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="是否正则" min-width="10%">
<template slot-scope="scope">
<el-select v-model="scope.row.isRegular">
<el-option v-for="item in regularOptions" :key="item.id"
:label="item.name"
:value="item.id"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="显示类型" min-width="12%">
<template slot-scope="scope">
<el-select v-model="scope.row.htmlType">
<el-option label="文本框" value="input"/>
<el-option label="文本域" value="textarea"/>
<el-option label="下拉框" value="select"/>
<el-option label="单选框" value="radio"/>
<el-option label="复选框" value="checkbox"/>
<el-option label="日期控件" value="datetime"/>
<el-option label="图片上传" value="imageUpload"/>
<el-option label="文件上传" value="fileUpload"/>
<el-option label="富文本控件" value="editor"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="字典类型" min-width="12%">
<template slot-scope="scope">
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择">
<el-option
v-for="dict in dictOptions"
:key="dict.dictType"
:label="dict.dictName"
:value="dict.dictType">
<span style="float: left">{{ dict.dictName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span>
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="生成信息" name="genInfo">
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus"/>
</el-tab-pane>
</el-tabs>
<el-form label-width="100px">
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
<el-button type="primary" @click="submitForm()">提交</el-button>
<el-button @click="close()">返回</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import {getModule} from "@/api/tool/module";
import ModuleInfoForm from "@/views/tool/module/moduleInfoForm";
export default {
name: "ModuleEdit",
components: {ModuleInfoForm},
data(){
return{
info:[],
};
},
created() {
const moduleId = this.$route.params && this.$route.params.moduleId;
if (moduleId){
getModule(moduleId).then(response => {
this.info = response.data;
});
}
},
methods:{
/** 提交按钮 */
submitForm() {
const moduleForm = this.$refs.moduleInfo.$refs.moduleInfoForm;
Promise.all([moduleForm].map(this.getFormPromise)).then(res => {
const validateResult = res.every(item => !!item);
if (validateResult) {
// const genTable = Object.assign({}, basicForm.model, genForm.model);
// genTable.columns = this.cloumns;
// genTable.params = {
// treeCode: genTable.treeCode,
// treeName: genTable.treeName,
// treeParentCode: genTable.treeParentCode,
// parentMenuId: genTable.parentMenuId
// };
// updateGenTable(genTable).then(res => {
// this.msgSuccess(res.msg);
// if (res.code === 200) {
// this.close();
// }
// });
} else {
this.msgError("表单校验未通过,请重新检查提交内容");
}
});
},
getFormPromise(form) {
return new Promise(resolve => {
form.validate(res => {
resolve(res);
});
});
},
/** 关闭按钮 */
close() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ path: "/tool/module", query: { t: Date.now()}})
}
},
}
</script>
<style scoped>
</style>

View File

@ -45,7 +45,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:module:add']"
v-hasPermi="['tool:module:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
@ -56,7 +56,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:module:edit']"
v-hasPermi="['tool:module:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
@ -67,7 +67,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:module:remove']"
v-hasPermi="['tool:module:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
@ -77,7 +77,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:module:export']"
v-hasPermi="['tool:module:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -87,6 +87,7 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="模块名称" align="center" prop="mName" />
<el-table-column label="模块描述" align="center" prop="mDescribe" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
@ -99,20 +100,41 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
type="text"
size="small"
icon="el-icon-view"
@click="handlePreview(scope.row)"
v-hasPermi="['tool:apiclass:preview']"
>预览</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:module:edit']"
v-hasPermi="['tool:apiclass:edit']"
>修改</el-button>
<el-button
type="text"
size="small"
icon="el-icon-edit-outline"
@click="handleEditTable(scope.row)"
v-hasPermi="['tool:apiclass:update']"
>接口</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:module:remove']"
v-hasPermi="['tool:module:remove']"
>删除</el-button>
<el-button
type="text"
size="small"
icon="el-icon-download"
@click="handleGenTable(scope.row)"
v-hasPermi="['tool:apiclass:code']"
>生成代码</el-button>
</template>
</el-table-column>
</el-table>
@ -134,6 +156,9 @@
<el-form-item label="模块描述" prop="mDescribe">
<el-input v-model="form.mDescribe" placeholder="请输入模块描述" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -144,7 +169,7 @@
</template>
<script>
import { listModule, getModule, delModule, addModule, updateModule, exportModule } from "@/api/system/module";
import { listModule, getModule, delModule, addModule, updateModule, exportModule } from "@/api/tool/module";
export default {
name: "Module",
@ -216,6 +241,7 @@ export default {
id: null,
mName: null,
mDescribe: null,
remark: null,
};
this.resetForm("form");
},
@ -252,6 +278,10 @@ export default {
this.title = "修改模块管理";
});
},
handleEditTable(row){
const moduleId = row.id || this.ids[0];
this.$router.push("/module/edit/" + moduleId);
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {

View File

@ -0,0 +1,85 @@
<template>
<el-form ref="moduleInfoForm" :model="info" :rules="rules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="模块名称" prop="cName">
<el-input placeholder="请输入类名" v-model="info.mDescribe"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="模块描述" prop="cName">
<el-input placeholder="请输入类名" v-model="info.mName"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注">
<el-input type="textarea" :rows="3" v-model="info.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {queryListModule} from "@/api/tool/module"
export default {
name: "ModuleInfoForm",
props: {
info: {
type: Object,
default: null
}
},
data() {
return {
moduleList:[],
rules: {
packageName: [
{required: true, message: "包名不能为空", trigger: "blur"},
],
mId: [
{required: true, message: "模块不能为空", trigger: "blur"},
],
cName: [
{required: true, message: "类名不能为空", trigger: "blur"},
],
cDescribe: [
{required: true, message: "类描述不能为空", trigger: "blur"},
],
author: [
{required: true, message: "作者不能为空", trigger: "blur"},
],
email: [
{required: true, message: "电子邮件不能为空", trigger: "blur"},
{
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
message: '电子邮件格式有误',
trigger: "blur"
},
],
}
};
},
created() {
queryListModule().then(respone => {
this.moduleList = respone.data
})
},
methods:{
transform() {
var mid = this.info.mId
var str = ''
var start = true
for (let i = 0; i < this.moduleList.length; i++) {
if (mid == this.moduleList[i].id) {
str = this.moduleList[i].mName
start = false
}
}
if (start) {
str = ''
}
this.info.packageName = 'com.hchyun.' + str
},
}
};
</script>

View File

@ -1,4 +1,4 @@
package com.hchyun.web.controller.system;
package com.hchyun.generator.controller;
import java.io.Serializable;
import java.util.List;
@ -21,8 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
import com.hchyun.common.annotation.Log;
import com.hchyun.common.core.entity.AjaxResult;
import com.hchyun.common.enums.BusinessType;
import com.hchyun.system.entity.Apiclass;
import com.hchyun.system.service.ApiclassService;
import com.hchyun.generator.entity.Apiclass;
import com.hchyun.generator.service.ApiclassService;
import com.hchyun.common.utils.poi.ExcelUtil;
/**
@ -32,7 +32,7 @@ import com.hchyun.common.utils.poi.ExcelUtil;
* @date 2021-01-24
*/
@RestController
@RequestMapping("/system/apiclass")
@RequestMapping("/tool/apiclass")
public class ApiclassController extends HcyBaseController {
protected final Logger logger = LoggerFactory.getLogger(ApiclassController.class);
@ -44,7 +44,7 @@ public class ApiclassController extends HcyBaseController {
* 获取到api类的select选项
* @return
*/
@PreAuthorize("@ss.hasAnyPermi('system:apiclass:querylist')")
@PreAuthorize("@ss.hasAnyPermi('tool:apiclass:querylist')")
@GetMapping("querylist")
public AjaxResult queryList(){
try {
@ -63,7 +63,7 @@ public class ApiclassController extends HcyBaseController {
/**
* 查询接口类名列表
*/
@PreAuthorize("@ss.hasPermi('system:apiclass:list')")
@PreAuthorize("@ss.hasPermi('tool:apiclass:list')")
@GetMapping("/list")
public Serializable list(Apiclass apiclass) {
try {
@ -83,7 +83,7 @@ public class ApiclassController extends HcyBaseController {
/**
* 导出接口类名列表
*/
@PreAuthorize("@ss.hasPermi('system:apiclass:export')")
@PreAuthorize("@ss.hasPermi('tool:apiclass:export')")
@Log(title = "接口类名", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(Apiclass apiclass) {
@ -104,7 +104,7 @@ public class ApiclassController extends HcyBaseController {
/**
* 获取接口类名详细信息
*/
@PreAuthorize("@ss.hasPermi('system:apiclass:query')")
@PreAuthorize("@ss.hasPermi('tool:apiclass:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
try {
@ -123,7 +123,7 @@ public class ApiclassController extends HcyBaseController {
/**
* 新增接口类名
*/
@PreAuthorize("@ss.hasPermi('system:apiclass:add')")
@PreAuthorize("@ss.hasPermi('tool:apiclass:add')")
@Log(title = "接口类名", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Apiclass apiclass) {
@ -152,7 +152,7 @@ public class ApiclassController extends HcyBaseController {
/**
* 修改接口类名
*/
@PreAuthorize("@ss.hasPermi('system:apiclass:edit')")
@PreAuthorize("@ss.hasPermi('tool:apiclass:edit')")
@Log(title = "接口类名", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Apiclass apiclass) {
@ -182,7 +182,7 @@ public class ApiclassController extends HcyBaseController {
/**
* 删除接口类名
*/
@PreAuthorize("@ss.hasPermi('system:apiclass:remove')")
@PreAuthorize("@ss.hasPermi('tool:apiclass:remove')")
@Log(title = "接口类名", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {

View File

@ -1,4 +1,4 @@
package com.hchyun.web.controller.system;
package com.hchyun.generator.controller;
import java.io.Serializable;
import java.util.List;
@ -7,7 +7,6 @@ import java.util.List;
import com.hchyun.common.constant.ReturnConstants;
import com.hchyun.common.core.controller.HcyBaseController;
import com.hchyun.common.utils.ServerResult;
import com.hchyun.system.entity.Apiclass;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
@ -23,10 +22,9 @@ import org.springframework.web.bind.annotation.RestController;
import com.hchyun.common.annotation.Log;
import com.hchyun.common.core.entity.AjaxResult;
import com.hchyun.common.enums.BusinessType;
import com.hchyun.system.entity.Module;
import com.hchyun.system.service.ModuleService;
import com.hchyun.generator.entity.Module;
import com.hchyun.generator.service.ModuleService;
import com.hchyun.common.utils.poi.ExcelUtil;
import com.hchyun.common.core.page.TableDataInfo;
/**
* 模块管理Controller
@ -35,7 +33,7 @@ import com.hchyun.common.core.page.TableDataInfo;
* @date 2021-01-24
*/
@RestController
@RequestMapping("/system/module")
@RequestMapping("/tool/module")
public class ModuleController extends HcyBaseController {
protected final Logger logger = LoggerFactory.getLogger(ModuleController.class);
@ -47,7 +45,7 @@ public class ModuleController extends HcyBaseController {
* 获取到api类的select选项
* @return
*/
@PreAuthorize("@ss.hasAnyPermi('system:module:querylist')")
@PreAuthorize("@ss.hasAnyPermi('tool:module:querylist')")
@GetMapping("querylist")
public AjaxResult queryList(){
try {
@ -68,7 +66,7 @@ public class ModuleController extends HcyBaseController {
/**
* 查询模块管理列表
*/
@PreAuthorize("@ss.hasPermi('system:module:list')")
@PreAuthorize("@ss.hasPermi('tool:module:list')")
@GetMapping("/list")
public Serializable list(Module module) {
try {
@ -88,7 +86,7 @@ public class ModuleController extends HcyBaseController {
/**
* 导出模块管理列表
*/
@PreAuthorize("@ss.hasPermi('system:module:export')")
@PreAuthorize("@ss.hasPermi('tool:module:export')")
@Log(title = "模块管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(Module module) {
@ -109,7 +107,7 @@ public class ModuleController extends HcyBaseController {
/**
* 获取模块管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:module:query')")
@PreAuthorize("@ss.hasPermi('tool:module:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
try {
@ -128,7 +126,7 @@ public class ModuleController extends HcyBaseController {
/**
* 新增模块管理
*/
@PreAuthorize("@ss.hasPermi('system:module:add')")
@PreAuthorize("@ss.hasPermi('tool:module:add')")
@Log(title = "模块管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Module module) {
@ -154,7 +152,7 @@ public class ModuleController extends HcyBaseController {
/**
* 修改模块管理
*/
@PreAuthorize("@ss.hasPermi('system:module:edit')")
@PreAuthorize("@ss.hasPermi('tool:module:edit')")
@Log(title = "模块管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Module module) {
@ -181,7 +179,7 @@ public class ModuleController extends HcyBaseController {
/**
* 删除模块管理
*/
@PreAuthorize("@ss.hasPermi('system:module:remove')")
@PreAuthorize("@ss.hasPermi('tool:module:remove')")
@Log(title = "模块管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {

View File

@ -1,8 +1,9 @@
package com.hchyun.system.dao;
package com.hchyun.generator.dao;
import com.hchyun.generator.entity.Apiclass;
import java.util.List;
import com.hchyun.system.entity.Apiclass;
/**
* 接口类名Mapper接口

View File

@ -1,7 +1,8 @@
package com.hchyun.system.dao;
package com.hchyun.generator.dao;
import com.hchyun.generator.entity.Module;
import java.util.List;
import com.hchyun.system.entity.Module;
/**
* 模块管理Mapper接口

View File

@ -0,0 +1,155 @@
package com.hchyun.generator.entity;
import com.hchyun.common.annotation.Excel;
import com.hchyun.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 接口类名对象 sys_apiclass
*
* @author hchyun
* @date 2021-01-24
*/
@ApiModel("接口类名")
public class Apiclass extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 类id
*/
private Long id;
/**
* 模块id
*/
@Excel(name = "模块id")
private Long mId;
/**
* 类名
*/
@Excel(name = "类名")
private String cName;
/**
* 类描述
*/
@Excel(name = "类描述")
private String cDescribe;
/**
* 包名
*/
@Excel(name = "包名")
private String packageName;
/**
* 前缀
*/
@Excel(name = "前缀")
private String prefix;
/**
* 作者
*/
@Excel(name = "作者")
private String author;
/**
* 电子邮件
*/
@Excel(name = "电子邮件")
private String email;
/**
* 模块类
*/
private Module module;
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public Module getModule() {
return module;
}
public void setModule(Module module) {
this.module = module;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setmId(Long mId) {
this.mId = mId;
}
public Long getmId() {
return mId;
}
public void setcName(String cName) {
this.cName = cName;
}
public String getcName() {
return cName;
}
public void setcDescribe(String cDescribe) {
this.cDescribe = cDescribe;
}
public String getcDescribe() {
return cDescribe;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mId", getmId())
.append("cName", getcName())
.append("cDescribe", getcDescribe())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -0,0 +1,70 @@
package com.hchyun.generator.entity;
import com.hchyun.common.annotation.Excel;
import com.hchyun.common.core.entity.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 模块管理对象 sys_module
*
* @author hchyun
* @date 2021-01-24
*/
public class Module extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 模块id
*/
private Long id;
/**
* 模块名称
*/
@Excel(name = "模块名称")
private String mName;
/**
* 模块描述
*/
@Excel(name = "模块描述")
private String mDescribe;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setmName(String mName) {
this.mName = mName;
}
public String getmName() {
return mName;
}
public void setmDescribe(String mDescribe) {
this.mDescribe = mDescribe;
}
public String getmDescribe() {
return mDescribe;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mName", getmName())
.append("mDescribe", getmDescribe())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -1,9 +1,9 @@
package com.hchyun.system.service;
package com.hchyun.generator.service;
import java.util.List;
import com.hchyun.common.utils.ServerResult;
import com.hchyun.system.entity.Apiclass;
import com.hchyun.generator.entity.Apiclass;
/**
* 接口类名Service接口

View File

@ -1,9 +1,10 @@
package com.hchyun.system.service;
package com.hchyun.generator.service;
import java.util.List;
import com.hchyun.common.utils.ServerResult;
import com.hchyun.system.entity.Module;
import com.hchyun.generator.entity.Module;
import java.util.List;
/**
* 模块管理Service接口

View File

@ -1,20 +1,17 @@
package com.hchyun.system.service.impl;
package com.hchyun.generator.service.impl;
import java.util.List;
import com.hchyun.common.constant.ReturnConstants;
import com.hchyun.common.utils.DateUtils;
import com.hchyun.common.utils.SecurityUtils;
import com.hchyun.common.utils.DateUtils;
import com.hchyun.common.utils.SecurityUtils;
import com.hchyun.common.utils.ServerResult;
import com.hchyun.generator.dao.ApiclassDao;
import com.hchyun.generator.entity.Apiclass;
import com.hchyun.generator.service.ApiclassService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hchyun.system.dao.ApiclassDao;
import com.hchyun.system.entity.Apiclass;
import com.hchyun.system.service.ApiclassService;
/**
* 接口类名Service业务层处理

View File

@ -1,7 +1,9 @@
package com.hchyun.generator.service;
package com.hchyun.generator.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.hchyun.generator.service.IGenTableColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hchyun.common.core.text.Convert;
@ -14,7 +16,7 @@ import com.hchyun.generator.dao.GenTableColumnDao;
* @author hchyun
*/
@Service
public class GenTableColumnServiceImpl implements IGenTableColumnService
public class GenTableColumnServiceImpl implements IGenTableColumnService
{
@Autowired
private GenTableColumnDao genTableColumnDao;

View File

@ -1,4 +1,4 @@
package com.hchyun.generator.service;
package com.hchyun.generator.service.impl;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -11,6 +11,7 @@ import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import com.hchyun.generator.service.IGenTableService;
import org.apache.commons.io.IOUtils;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;

View File

@ -1,20 +1,17 @@
package com.hchyun.system.service.impl;
package com.hchyun.generator.service.impl;
import java.util.List;
import com.hchyun.common.constant.ReturnConstants;
import com.hchyun.common.utils.DateUtils;
import com.hchyun.common.utils.SecurityUtils;
import com.hchyun.common.utils.DateUtils;
import com.hchyun.common.utils.SecurityUtils;
import com.hchyun.common.utils.ServerResult;
import com.hchyun.generator.dao.ModuleDao;
import com.hchyun.generator.entity.Module;
import com.hchyun.generator.service.ModuleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hchyun.system.dao.ModuleDao;
import com.hchyun.system.entity.Module;
import com.hchyun.system.service.ModuleService;
/**
* 模块管理Service业务层处理

View File

@ -0,0 +1,111 @@
<?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.hchyun.generator.dao.ApiclassDao">
<resultMap type="com.hchyun.generator.entity.Apiclass" id="ApiclassResult">
<result property="id" column="id" />
<result property="mId" column="m_id" />
<result property="cName" column="c_name" />
<result property="cDescribe" column="c_describe" />
<result property="packageName" column="package_name" />
<result property="author" column="author" />
<result property="email" column="email" />
<result property="remark" column="remark" />
<result property="prefix" column="prefix" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<resultMap id="ApiclassModuleResult" type="com.hchyun.generator.entity.Apiclass" extends="ApiclassResult">
<collection property="module" notNullColumn="id" javaType="com.hchyun.generator.entity.Module" resultMap="ModuleResult" />
</resultMap>
<resultMap type="com.hchyun.generator.entity.Module" id="ModuleResult">
<result property="id" column="id" />
<result property="mName" column="m_name" />
<result property="mDescribe" column="m_describe" />
</resultMap>
<sql id="selectApiclassVo">
select id, m_id, c_name, c_describe, package_name, author, email, remark,prefix, create_time, create_by, update_time, update_by from sys_apiclass
</sql>
<select id="selectApiclassList" parameterType="Apiclass" resultMap="ApiclassModuleResult">
select a.id,a.m_id,a.c_name,a.c_describe,a.package_name,a.author,a.email,a.prefix,a.remark,a.create_by,a.create_time,
a.update_time,a.update_by,m.id,m.m_name,m.m_describe
from sys_apiclass a
left join sys_module m on a.m_id = m.id
<where>
<if test="mId != null "> and a.m_id = #{mId}</if>
<if test="cName != null and cName != ''"> and a.c_name like concat('%', #{cName}, '%')</if>
<if test="author != null and author != ''"> and a.author like concat('%', #{author}, '%')</if>
<if test="email != null and email != ''"> and a.email like concat('%', #{email}, '%')</if>
<if test="cDescribe != null and cDescribe != ''"> and a.c_describe like concat('%', #{cDescribe}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and a.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>
<select id="selectApiclassById" parameterType="Long" resultMap="ApiclassResult">
<include refid="selectApiclassVo"/>
where id = #{id}
</select>
<insert id="insertApiclass" parameterType="Apiclass" useGeneratedKeys="true" keyProperty="id">
insert into sys_apiclass
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mId != null">m_id,</if>
<if test="cName != null and cName != ''">c_name,</if>
<if test="cDescribe != null and cDescribe != ''">c_describe,</if>
<if test="packageName != null and packageName != ''">package_name,</if>
<if test="author != null and author != ''">author,</if>
<if test="email != null and email != ''">email,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="prefix != null and prefix != ''">prefix,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mId != null">#{mId},</if>
<if test="cName != null and cName != ''">#{cName},</if>
<if test="cDescribe != null and cDescribe != ''">#{cDescribe},</if>
<if test="packageName != null and packageName != ''">#{packageName},</if>
<if test="author != null and author != ''">#{author},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="prefix != null and prefix != ''">#{prefix},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateApiclass" parameterType="Apiclass">
update sys_apiclass
<trim prefix="SET" suffixOverrides=",">
<if test="mId != null">m_id = #{mId},</if>
<if test="cName != null and cName != ''">c_name = #{cName},</if>
<if test="cDescribe != null and cDescribe != ''">c_describe = #{cDescribe},</if>
<if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
<if test="author != null and author != ''">author = #{author},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="prefix != null and prefix != ''">prefix = #{prefix},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteApiclassById" parameterType="Long">
delete from sys_apiclass where id = #{id}
</delete>
<delete id="deleteApiclassByIds" parameterType="String">
delete from sys_apiclass where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -2,12 +2,13 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hchyun.system.dao.ModuleDao">
<mapper namespace="com.hchyun.generator.dao.ModuleDao">
<resultMap type="Module" id="ModuleResult">
<result property="id" column="id" />
<result property="mName" column="m_name" />
<result property="mDescribe" column="m_describe" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
@ -15,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectModuleVo">
select id, m_name, m_describe, create_time, create_by, update_time, update_by from sys_module
select id, m_name, m_describe, remark, create_time, create_by, update_time, update_by from sys_module
</sql>
<select id="selectModuleList" parameterType="Module" resultMap="ModuleResult">
@ -37,12 +38,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mName != null and mName != ''">m_name,</if>
<if test="mDescribe != null and mDescribe != ''">m_describe,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mName != null and mName != ''">#{mName},</if>
<if test="mDescribe != null and mDescribe != ''">#{mDescribe},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
@ -53,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="mName != null and mName != ''">m_name = #{mName},</if>
<if test="mDescribe != null and mDescribe != ''">m_describe = #{mDescribe},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>

View File

@ -1,90 +0,0 @@
package com.hchyun.system.entity;
import com.hchyun.common.annotation.Excel;
import com.hchyun.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 接口类名对象 sys_apiclass
*
* @author hchyun
* @date 2021-01-24
*/
@ApiModel("接口类名")
public class Apiclass extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 类id */
@ApiModelProperty("类id")
private Long id;
/** 模块id */
@Excel(name = "模块id")
@ApiModelProperty("模块id")
private Long mId;
/** 类名 */
@Excel(name = "类名")
@ApiModelProperty("类名")
private String cName;
/** 类描述 */
@Excel(name = "类描述")
@ApiModelProperty("类描述")
private String cDescribe;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setmId(Long mId)
{
this.mId = mId;
}
public Long getmId()
{
return mId;
}
public void setcName(String cName)
{
this.cName = cName;
}
public String getcName()
{
return cName;
}
public void setcDescribe(String cDescribe)
{
this.cDescribe = cDescribe;
}
public String getcDescribe()
{
return cDescribe;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mId", getmId())
.append("cName", getcName())
.append("cDescribe", getcDescribe())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -1,69 +0,0 @@
package com.hchyun.system.entity;
import com.hchyun.common.annotation.Excel;
import com.hchyun.common.core.entity.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 模块管理对象 sys_module
*
* @author hchyun
* @date 2021-01-24
*/
public class Module extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 模块id */
private Long id;
/** 模块名称 */
@Excel(name = "模块名称")
private String mName;
/** 模块描述 */
@Excel(name = "模块描述")
private String mDescribe;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setmName(String mName)
{
this.mName = mName;
}
public String getmName()
{
return mName;
}
public void setmDescribe(String mDescribe)
{
this.mDescribe = mDescribe;
}
public String getmDescribe()
{
return mDescribe;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mName", getmName())
.append("mDescribe", getmDescribe())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -1,77 +0,0 @@
<?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.hchyun.system.dao.ApiclassDao">
<resultMap type="Apiclass" id="ApiclassResult">
<result property="id" column="id" />
<result property="mId" column="m_id" />
<result property="cName" column="c_name" />
<result property="cDescribe" column="c_describe" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectApiclassVo">
select id, m_id, c_name, c_describe, create_time, create_by, update_time, update_by from sys_apiclass
</sql>
<select id="selectApiclassList" parameterType="Apiclass" resultMap="ApiclassResult">
<include refid="selectApiclassVo"/>
<where>
<if test="mId != null "> and m_id = #{mId}</if>
<if test="cName != null and cName != ''"> and c_name like concat('%', #{cName}, '%')</if>
<if test="cDescribe != null and cDescribe != ''"> and c_describe like concat('%', #{cDescribe}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>
<select id="selectApiclassById" parameterType="Long" resultMap="ApiclassResult">
<include refid="selectApiclassVo"/>
where id = #{id}
</select>
<insert id="insertApiclass" parameterType="Apiclass" useGeneratedKeys="true" keyProperty="id">
insert into sys_apiclass
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mId != null">m_id,</if>
<if test="cName != null and cName != ''">c_name,</if>
<if test="cDescribe != null and cDescribe != ''">c_describe,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mId != null">#{mId},</if>
<if test="cName != null and cName != ''">#{cName},</if>
<if test="cDescribe != null and cDescribe != ''">#{cDescribe},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateApiclass" parameterType="Apiclass">
update sys_apiclass
<trim prefix="SET" suffixOverrides=",">
<if test="mId != null">m_id = #{mId},</if>
<if test="cName != null and cName != ''">c_name = #{cName},</if>
<if test="cDescribe != null and cDescribe != ''">c_describe = #{cDescribe},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteApiclassById" parameterType="Long">
delete from sys_apiclass where id = #{id}
</delete>
<delete id="deleteApiclassByIds" parameterType="String">
delete from sys_apiclass where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>