与官方代码同步

master
gcii 7 years ago
parent 7aa8a4c9e3
commit e66c852b6c

@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.Global; import com.ruoyi.common.config.Global;
import com.ruoyi.common.config.ServerConfig; import com.ruoyi.common.config.ServerConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
@ -88,4 +89,24 @@ public class CommonController
return AjaxResult.error(e.getMessage()); return AjaxResult.error(e.getMessage());
} }
} }
/**
*
*/
@GetMapping("/common/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
// 本地资源路径
String localPath = Global.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
} }

@ -73,7 +73,7 @@ spring:
# MyBatis # MyBatis
mybatis: mybatis:
# 搜索指定包别名 # 搜索指定包别名
typeAliasesPackage: com.ruoyi typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件 # 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件 # 加载全局的配置文件
@ -109,7 +109,7 @@ shiro:
# 设置Cookie的过期时间天为单位 # 设置Cookie的过期时间天为单位
maxAge: 30 maxAge: 30
session: session:
# Session超时时间默认30分钟 # Session超时时间-1代表永不过期默认30分钟
expireTime: 30 expireTime: 30
# 同步session到数据库的周期默认1分钟 # 同步session到数据库的周期默认1分钟
dbSyncPeriod: 1 dbSyncPeriod: 1

@ -3,7 +3,15 @@
<!-- 磁盘缓存位置 --> <!-- 磁盘缓存位置 -->
<diskStore path="java.io.tmpdir"/> <diskStore path="java.io.tmpdir"/>
<!-- maxEntriesLocalHeap:堆内存中最大缓存对象数0没有限制 -->
<!-- maxElementsInMemory 在内存中缓存的element的最大数目。-->
<!-- eternal:elements是否永久有效如果为truetimeouts将被忽略element将永不过期 -->
<!-- timeToIdleSeconds:失效前的空闲秒数当eternal为false时这个属性才有效0为不限制 -->
<!-- timeToLiveSeconds:失效前的存活秒数创建时间到失效时间的间隔为存活时间当eternal为false时这个属性才有效0为不限制 -->
<!-- overflowToDisk 如果内存中数据超过内存限制,是否要缓存到磁盘上 -->
<!-- statistics是否收集统计信息。如果需要监控缓存使用情况应该打开这个选项。默认为关闭统计会影响性能。设置statistics="true"开启统计 -->
<!-- 默认缓存 --> <!-- 默认缓存 -->
<defaultCache <defaultCache
maxEntriesLocalHeap="1000" maxEntriesLocalHeap="1000"
@ -22,8 +30,8 @@
overflowToDisk="false" overflowToDisk="false"
statistics="true"> statistics="true">
</cache> </cache>
<!-- 系统活跃用户缓存 --> <!-- 系统活跃用户缓存 -->
<cache name="sys-userCache" <cache name="sys-userCache"
maxEntriesLocalHeap="10000" maxEntriesLocalHeap="10000"
overflowToDisk="false" overflowToDisk="false"
@ -32,7 +40,18 @@
timeToLiveSeconds="0" timeToLiveSeconds="0"
timeToIdleSeconds="0" timeToIdleSeconds="0"
statistics="true"> statistics="true">
</cache> </cache>
<!-- 系统会话缓存 -->
<cache name="shiro-activeSessionCache"
maxElementsInMemory="10000"
overflowToDisk="true"
eternal="true"
timeToLiveSeconds="0"
timeToIdleSeconds="0"
diskPersistent="true"
diskExpiryThreadIntervalSeconds="600">
</cache>
</ehcache> </ehcache>

@ -61,7 +61,7 @@
} }
.krajee-default .file-thumb-progress .progress, .krajee-default .file-thumb-progress .progress-bar { .krajee-default .file-thumb-progress .progress, .krajee-default .file-thumb-progress .progress-bar {
height: 11px; height: 20px;
font-family: Verdana, Helvetica, sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-size: 9px; font-size: 9px;
} }

File diff suppressed because one or more lines are too long

@ -23,7 +23,7 @@
top: 0; top: 0;
width: 200px; width: 200px;
border: 1px #ddd solid; border: 1px #ddd solid;
height: 440px; height: 450px;
padding: 4px; padding: 4px;
box-shadow: 0px 0px 12px #ddd; box-shadow: 0px 0px 12px #ddd;
text-align: center; text-align: center;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -339,6 +339,7 @@ label.error {
z-index:99; z-index:99;
right: 3px right: 3px
} }
.Validform_error,input.error,select.error { .Validform_error,input.error,select.error {
background-color: #fbe2e2; background-color: #fbe2e2;
border-color: #c66161; border-color: #c66161;
@ -573,13 +574,13 @@ label.error {
} }
/** 表单查询条件 **/ /** 表单查询条件 **/
ul { .select-list ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
-webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-tap-highlight-color: rgba(0,0,0,0);
} }
li { .select-list li {
list-style: none; list-style: none;
} }
@ -639,8 +640,8 @@ label {
.select-list li p{ .select-list li p{
float: left; float: left;
width: 80px; width: 65px;
margin: 5px 15px 5px 0px; margin: 5px 5px 5px 0px;
text-align:right; text-align:right;
} }
@ -798,7 +799,7 @@ label {
.table-striped .table, .table-striped .table, .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td { .table-striped .table, .table-striped .table, .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
border-bottom: 1px solid #e7eaec!important; border-bottom: 1px solid #e7eaec!important;
background-color: transparent!important; background-color: transparent;
border: 0px; border: 0px;
} }

@ -245,9 +245,9 @@
} }
}, },
// 搜索-默认第一个form // 搜索-默认第一个form
search: function(formId, data) { search: function(formId, tableId, data) {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
var params = $.btTable.bootstrapTable('getOptions'); var params = $.common.isEmpty(tableId) ? $.btTable.bootstrapTable('getOptions') : $("#" + tableId).bootstrapTable('getOptions');
params.queryParams = function(params) { params.queryParams = function(params) {
var search = $.common.formToJSON(currentId); var search = $.common.formToJSON(currentId);
if($.common.isNotEmpty(data)){ if($.common.isNotEmpty(data)){
@ -262,7 +262,11 @@
search.isAsc = params.order; search.isAsc = params.order;
return search; return search;
} }
$.btTable.bootstrapTable('refresh', params); if($.common.isNotEmpty(tableId)){
$("#" + tableId).bootstrapTable('refresh', params);
} else{
$.btTable.bootstrapTable('refresh', params);
}
}, },
// 导出数据 // 导出数据
exportExcel: function(formId) { exportExcel: function(formId) {
@ -429,8 +433,9 @@
$.bttTable = $('#' + options.id).bootstrapTreeTable({ $.bttTable = $('#' + options.id).bootstrapTreeTable({
code: options.code, // 用于设置父子关系 code: options.code, // 用于设置父子关系
parentCode: options.parentCode, // 用于设置父子关系 parentCode: options.parentCode, // 用于设置父子关系
type: 'post', // 请求方式(* type: 'post', // 请求方式(*
url: options.url, // 请求后台的URL* url: options.url, // 请求后台的URL*
data: options.data, // 无url时用于渲染的数据
ajaxParams: options.ajaxParams, // 请求数据的ajax的data属性 ajaxParams: options.ajaxParams, // 请求数据的ajax的data属性
rootIdValue: options.rootIdValue, // 设置指定根节点id值 rootIdValue: options.rootIdValue, // 设置指定根节点id值
height: options.height, // 表格树的高度 height: options.height, // 表格树的高度
@ -477,10 +482,16 @@
// 表单封装处理 // 表单封装处理
form: { form: {
// 表单重置 // 表单重置
reset: function(formId) { reset: function(formId, tableId) {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
$("#" + currentId)[0].reset(); $("#" + currentId)[0].reset();
$.btTable.bootstrapTable('refresh'); if ($.table._option.type == table_type.bootstrapTable) {
if($.common.isEmpty(tableId)){
$.btTable.bootstrapTable('refresh');
} else{
$("#" + tableId).bootstrapTable('refresh');
}
}
}, },
// 获取选中复选框项 // 获取选中复选框项
selectCheckeds: function(name) { selectCheckeds: function(name) {
@ -1190,6 +1201,10 @@
// 不允许根父节点选择 // 不允许根父节点选择
notAllowParents: function(_tree) { notAllowParents: function(_tree) {
var nodes = _tree.getSelectedNodes(); var nodes = _tree.getSelectedNodes();
if(nodes.length == 0){
$.modal.msgError("请选择节点后提交");
return false;
}
for (var i = 0; i < nodes.length; i++) { for (var i = 0; i < nodes.length; i++) {
if (nodes[i].level == 0) { if (nodes[i].level == 0) {
$.modal.msgError("不能选择根节点(" + nodes[i].name + ""); $.modal.msgError("不能选择根节点(" + nodes[i].name + "");

@ -180,33 +180,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>和弦图</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="graph_flot.html#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="graph_flot.html#">选项1</a>
</li>
<li><a href="graph_flot.html#">选项2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<div class="echarts" id="echarts-chord-chart"></div>
</div>
</div>
</div>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
@ -261,33 +234,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>力导向布局图</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="graph_flot.html#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="graph_flot.html#">选项1</a>
</li>
<li><a href="graph_flot.html#">选项2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<div class="echarts" id="echarts-force-chart"></div>
</div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
@ -1065,182 +1011,6 @@
mapChart.setOption(mapoption); mapChart.setOption(mapoption);
$(window).resize(mapChart.resize); $(window).resize(mapChart.resize);
var chordChart = echarts.init(document.getElementById("echarts-chord-chart"));
var chordoption = {
title : {
text: '测试数据',
subtext: 'From d3.js',
x:'right',
y:'bottom'
},
tooltip : {
trigger: 'item',
formatter: function (params) {
if (params.indicator2) { // is edge
return params.value.weight;
} else {// is node
return params.name
}
}
},
toolbox: {
show : true,
feature : {
restore : {show: true},
magicType: {show: true, type: ['force', 'chord']},
saveAsImage : {show: true}
}
},
legend: {
x: 'left',
data:['group1','group2', 'group3', 'group4']
},
series : [
{
type:'chord',
sort : 'ascending',
sortSub : 'descending',
showScale : true,
showScaleText : true,
data : [
{name : 'group1'},
{name : 'group2'},
{name : 'group3'},
{name : 'group4'}
],
itemStyle : {
normal : {
label : {
show : false
}
}
},
matrix : [
[11975, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],
[ 8010, 16145, 8090, 8045],
[ 1013, 990, 940, 6907]
]
}
]
};
chordChart.setOption(chordoption);
$(window).resize(chordChart.resize);
var forceChart = echarts.init(document.getElementById("echarts-force-chart"));
var forceoption ={
title : {
text: '人物关系:乔布斯',
subtext: '数据来自人立方',
x:'right',
y:'bottom'
},
tooltip : {
trigger: 'item',
formatter: '{a} : {b}'
},
toolbox: {
show : true,
feature : {
restore : {show: true},
magicType: {show: true, type: ['force', 'chord']},
saveAsImage : {show: true}
}
},
legend: {
x: 'left',
data:['家人','朋友']
},
series : [
{
type:'force',
name : "人物关系",
ribbonType: false,
categories : [
{
name: '人物'
},
{
name: '家人'
},
{
name:'朋友'
}
],
itemStyle: {
normal: {
label: {
show: true,
textStyle: {
color: '#333'
}
},
nodeStyle : {
brushType : 'both',
borderColor : 'rgba(255,215,0,0.4)',
borderWidth : 1
},
linkStyle: {
type: 'curve'
}
},
emphasis: {
label: {
show: false
// textStyle: null // 默认使用全局文本样式详见TEXTSTYLE
},
nodeStyle : {
//r: 30
},
linkStyle : {}
}
},
useWorker: false,
minRadius : 15,
maxRadius : 25,
gravity: 1.1,
scaling: 1.1,
roam: 'move',
nodes:[
{category:0, name: '乔布斯', value : 10},
{category:1, name: '丽萨-乔布斯',value : 2},
{category:1, name: '保罗-乔布斯',value : 3},
{category:1, name: '克拉拉-乔布斯',value : 3},
{category:1, name: '劳伦-鲍威尔',value : 7},
{category:2, name: '史蒂夫-沃兹尼艾克',value : 5},
{category:2, name: '奥巴马',value : 8},
{category:2, name: '比尔-盖茨',value : 9},
{category:2, name: '乔纳森-艾夫',value : 4},
{category:2, name: '蒂姆-库克',value : 4},
{category:2, name: '龙-韦恩',value : 1},
],
links : [
{source : '丽萨-乔布斯', target : '乔布斯', weight : 1, name: '女儿'},
{source : '保罗-乔布斯', target : '乔布斯', weight : 2, name: '父亲'},
{source : '克拉拉-乔布斯', target : '乔布斯', weight : 1, name: '母亲'},
{source : '劳伦-鲍威尔', target : '乔布斯', weight : 2},
{source : '史蒂夫-沃兹尼艾克', target : '乔布斯', weight : 3, name: '合伙人'},
{source : '奥巴马', target : '乔布斯', weight : 1},
{source : '比尔-盖茨', target : '乔布斯', weight : 6, name: '竞争对手'},
{source : '乔纳森-艾夫', target : '乔布斯', weight : 1, name: '爱将'},
{source : '蒂姆-库克', target : '乔布斯', weight : 1},
{source : '龙-韦恩', target : '乔布斯', weight : 1},
{source : '克拉拉-乔布斯', target : '保罗-乔布斯', weight : 1},
{source : '奥巴马', target : '保罗-乔布斯', weight : 1},
{source : '奥巴马', target : '克拉拉-乔布斯', weight : 1},
{source : '奥巴马', target : '劳伦-鲍威尔', weight : 1},
{source : '奥巴马', target : '史蒂夫-沃兹尼艾克', weight : 1},
{source : '比尔-盖茨', target : '奥巴马', weight : 6},
{source : '比尔-盖茨', target : '克拉拉-乔布斯', weight : 1},
{source : '蒂姆-库克', target : '奥巴马', weight : 1}
]
}
]
};
forceChart.setOption(forceoption);
$(window).resize(forceChart.resize);
var gaugeChart = echarts.init(document.getElementById("echarts-gauge-chart")); var gaugeChart = echarts.init(document.getElementById("echarts-gauge-chart"));
var gaugeoption = { var gaugeoption = {
tooltip : { tooltip : {

@ -15,7 +15,7 @@
<a class="btn btn-danger" onclick="removeRowByUniqueId()"> <a class="btn btn-danger" onclick="removeRowByUniqueId()">
<i class="fa fa-remove"></i> 根据值删除行 <i class="fa fa-remove"></i> 根据值删除行
</a> </a>
<a class="btn btn-danger" onclick="removeRowAll()"> <a class="btn btn-danger" onclick="removeRowAll()">
<i class="fa fa-remove"></i> 删除所有行 <i class="fa fa-remove"></i> 删除所有行
</a> </a>
<a class="btn btn-info" onclick="updateRow()"> <a class="btn btn-info" onclick="updateRow()">

@ -4,15 +4,71 @@
<th:block th:include="include :: header('初始多表格')" /> <th:block th:include="include :: header('初始多表格')" />
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse">
<form id="form1">
<div class="select-list">
<ul>
<li>
用户名称:<input type="text" name="userName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('form1', 'bootstrap-table1')"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('form1', 'bootstrap-table1')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar1" role="group">
<a class="btn btn-success">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-1" data-mobile-responsive="true"></table> <table id="bootstrap-table1" data-mobile-responsive="true"></table>
</div> </div>
</div> </div>
<div class="row"> </div>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="form2">
<div class="select-list">
<ul>
<li>
用户名称:<input type="text" name="userName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('form2', 'bootstrap-table2')"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('form2', 'bootstrap-table2')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar2" role="group">
<a class="btn btn-success">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-2" data-mobile-responsive="true"></table> <table id="bootstrap-table2" data-mobile-responsive="true"></table>
</div> </div>
</div> </div>
</div> </div>
@ -23,12 +79,9 @@
$(function() { $(function() {
var options = { var options = {
id: "bootstrap-table-1", id: "bootstrap-table1",
toolbar: "toolbar1",
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
@ -73,8 +126,8 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"><i class="fa fa-remove"></i>删除</a>');
return actions.join(''); return actions.join('');
} }
}] }]
@ -82,21 +135,16 @@
$.table.init(options); $.table.init(options);
}); });
function queryParams(params) {
var search = $.table.queryParams(params);
search.userName = '测试1';
return search;
}
$(function() { $(function() {
var options = { var options = {
id: "bootstrap-table-2", id: "bootstrap-table2",
toolbar: "toolbar2",
url: prefix + "/list", url: prefix + "/list",
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
showColumns: false, showColumns: false,
queryParams: queryParams,
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
@ -137,8 +185,8 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)"><i class="fa fa-remove"></i>删除</a>');
return actions.join(''); return actions.join('');
} }
}] }]

@ -97,19 +97,19 @@
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
<p>商户编号:</p> <p style="width: 80px">商户编号:</p>
<input type="text" name="userId"/> <input type="text" name="userId"/>
</li> </li>
<li> <li>
<p>订单号:</p> <p style="width: 80px">订单号:</p>
<input type="text" name="orderNo"/> <input type="text" name="orderNo"/>
</li> </li>
<li> <li>
<p>日期:</p> <p style="width: 80px">日期:</p>
<input type="text" class="time-input" placeholder="日期"/> <input type="text" class="time-input" placeholder="日期"/>
</li> </li>
<li class="select-selectpicker"> <li class="select-selectpicker">
<p>状态:</p> <p style="width: 80px">状态:</p>
<select class="selectpicker" data-none-selected-text="请选择" multiple> <select class="selectpicker" data-none-selected-text="请选择" multiple>
<option value="">所有</option> <option value="">所有</option>
<option value="0">初始</option> <option value="0">初始</option>
@ -119,7 +119,7 @@
</select> </select>
</li> </li>
<li> <li>
<p>供货商通道:</p> <p style="width: 80px">供货商通道:</p>
<select> <select>
<option value="">所有</option> <option value="">所有</option>
<option value="0">腾讯</option> <option value="0">腾讯</option>
@ -128,7 +128,7 @@
</select> </select>
</li> </li>
<li> <li>
<p>来源:</p> <p style="width: 80px">来源:</p>
<select> <select>
<option value="">所有</option> <option value="">所有</option>
<option value="0">手机</option> <option value="0">手机</option>
@ -137,7 +137,7 @@
</select> </select>
</li> </li>
<li> <li>
<p>运营商:</p> <p style="width: 80px">运营商:</p>
<select> <select>
<option value="">所有</option> <option value="">所有</option>
<option value="0">移动</option> <option value="0">移动</option>
@ -146,7 +146,7 @@
</select> </select>
</li> </li>
<li class="select-time"> <li class="select-time">
<p>回调时间:</p> <p style="width: 80px">回调时间:</p>
<input type="text" class="time-input" placeholder="开始时间"/> <input type="text" class="time-input" placeholder="开始时间"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" placeholder="结束时间"/> <input type="text" class="time-input" placeholder="结束时间"/>

@ -22,6 +22,11 @@
<div class="form-control-static" th:text="${operLog.operUrl}"> <div class="form-control-static" th:text="${operLog.operUrl}">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-2 control-label">请求方式:</label>
<div class="form-control-static" th:text="${operLog.requestMethod}">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">操作方法:</label> <label class="col-sm-2 control-label">操作方法:</label>
<div class="form-control-static" th:text="${operLog.method}"> <div class="form-control-static" th:text="${operLog.method}">
@ -31,6 +36,10 @@
<label class="col-sm-2 control-label">请求参数:</label> <label class="col-sm-2 control-label">请求参数:</label>
<div class="form-control-static"><pre id="operParam"></pre></div> <div class="form-control-static"><pre id="operParam"></pre></div>
</div> </div>
<div class="form-group">
<label class="col-sm-2 control-label">返回参数:</label>
<div class="form-control-static"><pre id="jsonResult"></pre></div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">状态:</label> <label class="col-sm-2 control-label">状态:</label>
<div class="form-control-static" th:class="${operLog.status == 0 ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == 0 ? '正常' : '异常'}"> <div class="form-control-static" th:class="${operLog.status == 0 ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == 0 ? '正常' : '异常'}">
@ -47,11 +56,17 @@
<th:block th:include="include :: jsonview-js" /> <th:block th:include="include :: jsonview-js" />
<script th:inline="javascript"> <script th:inline="javascript">
$(function() { $(function() {
var json = [[${operLog.operParam}]]; var operParam = [[${operLog.operParam}]];
if ($.common.isNotEmpty(json) && json.length < 2000) { if ($.common.isNotEmpty(operParam) && operParam.length < 2000) {
$("#operParam").JSONView(json); $("#operParam").JSONView(operParam);
} else { } else {
$("#operParam").text(json); $("#operParam").text(operParam);
}
var jsonResult = [[${operLog.jsonResult}]];
if ($.common.isNotEmpty(jsonResult) && jsonResult.length < 2000) {
$("#jsonResult").JSONView(jsonResult);
} else {
$("#jsonResult").text(jsonResult);
} }
}); });
</script> </script>

@ -151,7 +151,7 @@
function searchPre() { function searchPre() {
var data = {}; var data = {};
data.businessTypes = $.common.join($('#businessTypes').selectpicker('val')); data.businessTypes = $.common.join($('#businessTypes').selectpicker('val'));
$.table.search('operlog-form', data); $.table.search('operlog-form', 'bootstrap-table', data);
} }
function resetPre() { function resetPre() {

@ -116,6 +116,9 @@
width: '10%', width: '10%',
align: "left", align: "left",
formatter: function(value, row, index) { formatter: function(value, row, index) {
if (row.menuType == 'F') {
return '-';
}
return $.table.selectDictLabel(datas, row.visible); return $.table.selectDictLabel(datas, row.visible);
} }
}, },

@ -129,7 +129,7 @@ public class Global
*/ */
public static String getDownloadPath() public static String getDownloadPath()
{ {
return getProfile() + "/download"; return getProfile() + "/download/";
} }
/** /**

@ -61,4 +61,9 @@ public class Constants
* "desc" "asc". * "desc" "asc".
*/ */
public static final String IS_ASC = "isAsc"; public static final String IS_ASC = "isAsc";
/**
*
*/
public static final String RESOURCE_PREFIX = "/profile";
} }

@ -1,8 +1,6 @@
package com.ruoyi.common.core.domain; package com.ruoyi.common.core.domain;
import java.util.HashMap; import java.util.HashMap;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
/** /**
@ -14,10 +12,13 @@ public class AjaxResult extends HashMap<String, Object>
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 状态码 */
public static final String CODE_TAG = "code"; public static final String CODE_TAG = "code";
/** 返回内容 */
public static final String MSG_TAG = "msg"; public static final String MSG_TAG = "msg";
/** 数据对象 */
public static final String DATA_TAG = "data"; public static final String DATA_TAG = "data";
/** /**
@ -44,18 +45,6 @@ public class AjaxResult extends HashMap<String, Object>
} }
} }
/** 状态类型 */
private Type type;
/** 状态码 */
private int code;
/** 返回内容 */
private String msg;
/** 数据对象 */
private Object data;
/** /**
* AjaxResult 使 * AjaxResult 使
*/ */
@ -190,53 +179,4 @@ public class AjaxResult extends HashMap<String, Object>
{ {
return new AjaxResult(Type.ERROR, msg, data); return new AjaxResult(Type.ERROR, msg, data);
} }
public Type getType()
{
return type;
}
public void setType(Type type)
{
this.type = type;
}
public int getCode()
{
return code;
}
public void setCode(int code)
{
this.code = code;
}
public String getMsg()
{
return msg;
}
public void setMsg(String msg)
{
this.msg = msg;
}
public Object getData()
{
return data;
}
public void setData(Object data)
{
this.data = data;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("code", getCode())
.append("msg", getMsg())
.append("data", getData())
.toString();
}
} }

@ -18,6 +18,9 @@ public class TreeEntity extends BaseEntity
/** 显示顺序 */ /** 显示顺序 */
private Integer orderNum; private Integer orderNum;
/** 祖级列表 */
private String ancestors;
public String getParentName() public String getParentName()
{ {
return parentName; return parentName;
@ -47,4 +50,14 @@ public class TreeEntity extends BaseEntity
{ {
this.orderNum = orderNum; this.orderNum = orderNum;
} }
public String getAncestors()
{
return ancestors;
}
public void setAncestors(String ancestors)
{
this.ancestors = ancestors;
}
} }

@ -5,6 +5,7 @@ import java.io.IOException;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.Global; import com.ruoyi.common.config.Global;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
import com.ruoyi.common.exception.file.FileSizeLimitExceededException; import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
import com.ruoyi.common.exception.file.InvalidExtensionException; import com.ruoyi.common.exception.file.InvalidExtensionException;
@ -147,7 +148,7 @@ public class FileUploadUtils
{ {
int dirLastIndex = uploadDir.lastIndexOf("/") + 1; int dirLastIndex = uploadDir.lastIndexOf("/") + 1;
String currentDir = StringUtils.substring(uploadDir, dirLastIndex); String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
String pathFileName = "/profile/" + currentDir + "/" + fileName; String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
return pathFileName; return pathFileName;
} }

@ -45,10 +45,10 @@ public class LogAspect
* *
* @param joinPoint * @param joinPoint
*/ */
@AfterReturning(pointcut = "logPointCut()") @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
public void doAfterReturning(JoinPoint joinPoint) public void doAfterReturning(JoinPoint joinPoint, Object jsonResult)
{ {
handleLog(joinPoint, null); handleLog(joinPoint, null, jsonResult);
} }
/** /**
@ -60,10 +60,10 @@ public class LogAspect
@AfterThrowing(value = "logPointCut()", throwing = "e") @AfterThrowing(value = "logPointCut()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Exception e) public void doAfterThrowing(JoinPoint joinPoint, Exception e)
{ {
handleLog(joinPoint, e); handleLog(joinPoint, e, null);
} }
protected void handleLog(final JoinPoint joinPoint, final Exception e) protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult)
{ {
try try
{ {
@ -83,6 +83,8 @@ public class LogAspect
// 请求的地址 // 请求的地址
String ip = ShiroUtils.getIp(); String ip = ShiroUtils.getIp();
operLog.setOperIp(ip); operLog.setOperIp(ip);
// 返回参数
operLog.setJsonResult(JSON.marshal(jsonResult));
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (currentUser != null) if (currentUser != null)
@ -104,6 +106,8 @@ public class LogAspect
String className = joinPoint.getTarget().getClass().getName(); String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName(); String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()"); operLog.setMethod(className + "." + methodName + "()");
// 设置请求方式
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
// 处理设置注解上的参数 // 处理设置注解上的参数
getControllerMethodDescription(controllerLog, operLog); getControllerMethodDescription(controllerLog, operLog);
// 保存数据库 // 保存数据库

@ -13,7 +13,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
// 表示通过aop框架暴露该代理对象,AopContext能够访问 // 表示通过aop框架暴露该代理对象,AopContext能够访问
@EnableAspectJAutoProxy(exposeProxy = true) @EnableAspectJAutoProxy(exposeProxy = true)
// 指定要扫描的Mapper类的包的路径 // 指定要扫描的Mapper类的包的路径
@MapperScan("com.ruoyi.*.mapper") @MapperScan("com.ruoyi.**.mapper")
public class ApplicationConfig public class ApplicationConfig
{ {

@ -0,0 +1,98 @@
package com.ruoyi.framework.config;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import javax.sql.DataSource;
import org.apache.ibatis.io.VFS;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.boot.autoconfigure.SpringBootVFS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.util.ClassUtils;
/**
* Mybatis*
*
* @author ruoyi
*/
@Configuration
public class MyBatisConfig
{
@Autowired
private Environment env;
static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
public static String setTypeAliasesPackage(String typeAliasesPackage)
{
ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
typeAliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(typeAliasesPackage) + "/" + DEFAULT_RESOURCE_PATTERN;
try
{
List<String> result = new ArrayList<String>();
Resource[] resources = resolver.getResources(typeAliasesPackage);
if (resources != null && resources.length > 0)
{
MetadataReader metadataReader = null;
for (Resource resource : resources)
{
if (resource.isReadable())
{
metadataReader = metadataReaderFactory.getMetadataReader(resource);
try
{
result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName());
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
}
if (result.size() > 0)
{
HashSet<String> h = new HashSet<String>(result);
result.clear();
result.addAll(h);
typeAliasesPackage = String.join(",", (String[]) result.toArray(new String[0]));
}
else
{
throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
}
}
catch (IOException e)
{
e.printStackTrace();
}
return typeAliasesPackage;
}
@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
{
String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
String mapperLocations = env.getProperty("mybatis.mapperLocations");
typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
VFS.addImplClass(SpringBootVFS.class);
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations));
return sessionFactory.getObject();
}
}

@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.ruoyi.common.config.Global; import com.ruoyi.common.config.Global;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
/** /**
@ -40,7 +41,7 @@ public class ResourcesConfig implements WebMvcConfigurer
public void addResourceHandlers(ResourceHandlerRegistry registry) public void addResourceHandlers(ResourceHandlerRegistry registry)
{ {
/** 本地文件上传路径 */ /** 本地文件上传路径 */
registry.addResourceHandler("/profile/**").addResourceLocations("file:" + Global.getProfile() + "/"); registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + Global.getProfile() + "/");
/** swagger配置 */ /** swagger配置 */
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");

@ -1,8 +1,14 @@
package com.ruoyi.framework.web.service; package com.ruoyi.framework.web.service;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.security.PermissionUtils; import com.ruoyi.common.utils.StringUtils;
/** /**
* RuoYi js thymeleaf * RuoYi js thymeleaf
@ -12,38 +18,217 @@ import com.ruoyi.common.utils.security.PermissionUtils;
@Service("permission") @Service("permission")
public class PermissionService public class PermissionService
{ {
private static final Logger log = LoggerFactory.getLogger(PermissionService.class);
/** 没有权限hidden用于前端隐藏按钮 */
public static final String NOACCESS = "hidden";
private static final String ROLE_DELIMETER = ",";
private static final String PERMISSION_DELIMETER = ",";
/**
* hiddenBoolean使isPermitted
*
* @param permission
* @return
*/
public String hasPermi(String permission) public String hasPermi(String permission)
{ {
return isPermittedOperator(permission) ? "" : "hidden"; return isPermitted(permission) ? StringUtils.EMPTY : NOACCESS;
} }
/**
* hasPermihiddenBoolean使isLacksPermitted
*
* @param permission
* @return
*/
public String lacksPermi(String permission)
{
return isLacksPermitted(permission) ? StringUtils.EMPTY : NOACCESS;
}
/**
* hiddenBoolean使hasAnyPermissions
*
* @param permissions PERMISSION_NAMES_DELIMETER
* @return
*/
public String hasAnyPermi(String permissions)
{
return hasAnyPermissions(permissions, PERMISSION_DELIMETER) ? StringUtils.EMPTY : NOACCESS;
}
/**
* hiddenBoolean使isRole
*
* @param role
* @return
*/
public String hasRole(String role) public String hasRole(String role)
{ {
return hasRoleOperator(role) ? "" : "hidden"; return isRole(role) ? StringUtils.EMPTY : NOACCESS;
}
/**
* hasRolehiddenBoolean使isLacksRole
*
* @param role
* @return
*/
public String lacksRole(String role)
{
return isLacksRole(role) ? StringUtils.EMPTY : NOACCESS;
}
/**
* hiddenBoolean使isAnyRoles
*
* @param roles ROLE_NAMES_DELIMETER
* @return
*/
public String hasAnyRoles(String roles)
{
return isAnyRoles(roles, ROLE_DELIMETER) ? StringUtils.EMPTY : NOACCESS;
}
/**
*
*
* @return
*/
public boolean isUser()
{
Subject subject = SecurityUtils.getSubject();
return subject != null && subject.getPrincipal() != null;
} }
/** /**
* *
* *
* @param permission * @param permission
* @return * @return
*/ */
private boolean isPermittedOperator(String permission) public boolean isPermitted(String permission)
{ {
return SecurityUtils.getSubject().isPermitted(permission); return SecurityUtils.getSubject().isPermitted(permission);
} }
/**
* isPermitted
*
* @param permission
* @return
*/
public boolean isLacksPermitted(String permission)
{
return isPermitted(permission) != true;
}
/**
*
*
* @param permissions PERMISSION_NAMES_DELIMETER
* @return
*/
public boolean hasAnyPermissions(String permissions)
{
return hasAnyPermissions(permissions, PERMISSION_DELIMETER);
}
/**
*
*
* @param permissions delimeter
* @param delimeter
* @return
*/
public boolean hasAnyPermissions(String permissions, String delimeter)
{
Subject subject = SecurityUtils.getSubject();
if (subject != null)
{
if (delimeter == null || delimeter.length() == 0)
{
delimeter = PERMISSION_DELIMETER;
}
for (String permission : permissions.split(delimeter))
{
if (permission != null && subject.isPermitted(permission.trim()) == true)
{
return true;
}
}
}
return false;
}
/** /**
* *
* *
* @param role * @param role
* @return * @return
*/ */
private boolean hasRoleOperator(String role) public boolean isRole(String role)
{ {
return SecurityUtils.getSubject().hasRole(role); return SecurityUtils.getSubject().hasRole(role);
} }
/**
* isRole
*
* @param role
* @return
*/
public boolean isLacksRole(String role)
{
return isRole(role) != true;
}
/**
*
*
* @param roles ROLE_NAMES_DELIMETER
* @return
*/
public boolean isAnyRoles(String roles)
{
return isAnyRoles(roles, ROLE_DELIMETER);
}
/**
*
*
* @param roles delimeter
* @param delimeter
* @return
*/
public boolean isAnyRoles(String roles, String delimeter)
{
Subject subject = SecurityUtils.getSubject();
if (subject != null)
{
if (delimeter == null || delimeter.length() == 0)
{
delimeter = ROLE_DELIMETER;
}
for (String role : roles.split(delimeter))
{
if (subject.hasRole(role.trim()) == true)
{
return true;
}
}
}
return false;
}
/** /**
* *
* *
@ -52,6 +237,26 @@ public class PermissionService
*/ */
public Object getPrincipalProperty(String property) public Object getPrincipalProperty(String property)
{ {
return PermissionUtils.getPrincipalProperty(property); Subject subject = SecurityUtils.getSubject();
if (subject != null)
{
Object principal = subject.getPrincipal();
try
{
BeanInfo bi = Introspector.getBeanInfo(principal.getClass());
for (PropertyDescriptor pd : bi.getPropertyDescriptors())
{
if (pd.getName().equals(property) == true)
{
return pd.getReadMethod().invoke(principal, (Object[]) null);
}
}
}
catch (Exception e)
{
log.error("Error reading property [{}] from principal of type [{}]", property, principal.getClass().getName());
}
}
return null;
} }
} }

@ -21,8 +21,8 @@ public class GenConfig
/** 生成包路径 */ /** 生成包路径 */
public static String packageName; public static String packageName;
/** 自动去除表前缀,默认是true */ /** 自动去除表前缀,默认是false */
public static String autoRemovePre; public static boolean autoRemovePre;
/** 表前缀(类名不会包含表前缀) */ /** 表前缀(类名不会包含表前缀) */
public static String tablePrefix; public static String tablePrefix;
@ -49,13 +49,13 @@ public class GenConfig
GenConfig.packageName = packageName; GenConfig.packageName = packageName;
} }
public static String getAutoRemovePre() public static boolean getAutoRemovePre()
{ {
return autoRemovePre; return autoRemovePre;
} }
@Value("${autoRemovePre}") @Value("${autoRemovePre}")
public void setAutoRemovePre(String autoRemovePre) public void setAutoRemovePre(boolean autoRemovePre)
{ {
GenConfig.autoRemovePre = autoRemovePre; GenConfig.autoRemovePre = autoRemovePre;
} }

@ -9,7 +9,6 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -138,7 +137,7 @@ public class GenController extends BaseController
@Log(title = "代码生成", businessType = BusinessType.UPDATE) @Log(title = "代码生成", businessType = BusinessType.UPDATE)
@PostMapping("/edit") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult editSave(@Validated GenTable genTable, BindingResult result) public AjaxResult editSave(@Validated GenTable genTable)
{ {
genTableService.validateEdit(genTable); genTableService.validateEdit(genTable);
genTableService.updateGenTable(genTable); genTableService.updateGenTable(genTable);

@ -325,7 +325,22 @@ public class GenTableColumn extends BaseEntity
public static boolean isSuperColumn(String javaField) public static boolean isSuperColumn(String javaField)
{ {
return StringUtils.equalsAnyIgnoreCase(javaField, "createBy", "createTime", "updateBy", "updateTime", "remark"); return StringUtils.equalsAnyIgnoreCase(javaField,
//BaseEntity
"createBy", "createTime", "updateBy", "updateTime", "remark",
//TreeEntity
"parentName", "parentId", "orderNum", "ancestors");
}
public boolean isUsableColumn()
{
return isUsableColumn(javaField);
}
public static boolean isUsableColumn(String javaField)
{
//isSuperColumn()中的名单用于避免生成多余Domain属性若某些属性在生成页面时需要用到不能忽略则放在此处白名单
return StringUtils.equalsAnyIgnoreCase(javaField, "parentId" , "orderNum");
} }
public String readConverterExp() public String readConverterExp()

@ -314,6 +314,10 @@ public class GenTableServiceImpl implements IGenTableService
break; break;
} }
} }
if (StringUtils.isNull(table.getPkColumn()))
{
table.setPkColumn(columns.get(0));
}
} }
/** /**

@ -19,7 +19,7 @@ public class GenUtils
*/ */
public static void initTable(GenTable genTable, String operName) public static void initTable(GenTable genTable, String operName)
{ {
genTable.setClassName(StringUtils.convertToCamelCase(genTable.getTableName())); genTable.setClassName(convertClassName(genTable.getTableName()));
genTable.setPackageName(GenConfig.getPackageName()); genTable.setPackageName(GenConfig.getPackageName());
genTable.setModuleName(getModuleName(GenConfig.getPackageName())); genTable.setModuleName(getModuleName(GenConfig.getPackageName()));
genTable.setBusinessName(getBusinessName(genTable.getTableName())); genTable.setBusinessName(getBusinessName(genTable.getTableName()));
@ -152,6 +152,25 @@ public class GenUtils
return businessName; return businessName;
} }
/**
* Java
*
* @param tableName
* @return
*/
public static String convertClassName(String tableName)
{
boolean autoRemovePre = GenConfig.getAutoRemovePre();
String tablePrefix = GenConfig.getTablePrefix();
if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix))
{
String[] searchList = StringUtils.split(tablePrefix, ",");
String[] replacementList = emptyList(searchList.length);
tableName = StringUtils.replaceEach(tableName, searchList, replacementList);
}
return StringUtils.convertToCamelCase(tableName);
}
/** /**
* *
* *
@ -199,4 +218,20 @@ public class GenUtils
return 0; return 0;
} }
} }
/**
*
*
* @param length
* @return
*/
public static String[] emptyList(int length)
{
String[] values = new String[length];
for (int i = 0; i < length; i++)
{
values[i] = StringUtils.EMPTY;
}
return values;
}
} }

@ -76,6 +76,10 @@ public class VelocityUtils
{ {
context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE));
} }
if (paramsObj.containsKey(GenConstants.TREE_NAME))
{
context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME));
}
} }
/** /**
@ -129,27 +133,27 @@ public class VelocityUtils
if (template.contains("domain.java.vm")) if (template.contains("domain.java.vm"))
{ {
fileName = StringUtils.format("{}/domain/{}.java ", javaPath, className); fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
} }
else if (template.contains("mapper.java.vm")) else if (template.contains("mapper.java.vm"))
{ {
fileName = StringUtils.format("{}/mapper/{}Mapper.java ", javaPath, className); fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className);
} }
else if (template.contains("service.java.vm")) else if (template.contains("service.java.vm"))
{ {
fileName = StringUtils.format("{}/service/I{}Service.java ", javaPath, className); fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className);
} }
else if (template.contains("serviceImpl.java.vm")) else if (template.contains("serviceImpl.java.vm"))
{ {
fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java ", javaPath, className); fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className);
} }
else if (template.contains("controller.java.vm")) else if (template.contains("controller.java.vm"))
{ {
fileName = StringUtils.format("{}/controller/{}Controller.java ", javaPath, className); fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className);
} }
else if (template.contains("mapper.xml.vm")) else if (template.contains("mapper.xml.vm"))
{ {
fileName = StringUtils.format("{}/{}Mapper.xml ", mybatisPath, className); fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className);
} }
else if (template.contains("list.html.vm")) else if (template.contains("list.html.vm"))
{ {

@ -5,7 +5,7 @@ gen:
author: ruoyi author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system packageName: com.ruoyi.system
# 自动去除表前缀,默认是true # 自动去除表前缀,默认是false
autoRemovePre: true autoRemovePre: false
# 表前缀(类名不会包含表前缀) # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sys_ tablePrefix: sys_

@ -14,7 +14,8 @@
<form class="form-horizontal m" id="form-${businessName}-add"> <form class="form-horizontal m" id="form-${businessName}-add">
#foreach($column in $columns) #foreach($column in $columns)
#set($field=$column.javaField) #set($field=$column.javaField)
#if($column.insert && !$column.superColumn && !$column.pk) #if($column.insert && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf("")) #set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1) #if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) #set($comment=$column.columnComment.substring(0, $parentheseIndex))
@ -28,10 +29,9 @@
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) #set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)})
#set($deptId = "${className}?.deptId") #set($treeId = "${className}?.${treeCode}")
#set($deptName = "${className}?.deptName") <input id="treeId" name="${treeParentCode}" type="hidden" th:value="${${treeId}}"/>
<input id="treeId" name="${treeParentCode}" type="hidden" th:value="${${deptId}}"/> <input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:value="${${treeName}}"#if($column.required) required#end>
<input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:value="${${deptName}}"#if($column.required) required#end>
<span class="input-group-addon"><i class="fa fa-search"></i></span> <span class="input-group-addon"><i class="fa fa-search"></i></span>
</div> </div>
</div> </div>
@ -67,8 +67,8 @@
<label class="col-sm-3 control-label">${comment}</label> <label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}"> <div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}">
<input type="radio" th:id="${dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:checked="${dict.default}"#if($column.required) required#end> <input type="radio" th:id="${'${field}_' + dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:checked="${dict.default}"#if($column.required) required#end>
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'${field}_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
</div> </div>
@ -102,6 +102,7 @@
</div> </div>
#end #end
#end #end
#end
#end #end
</form> </form>
</div> </div>
@ -131,7 +132,6 @@
minView: "month", minView: "month",
autoclose: true autoclose: true
}); });
#break
#end #end
#end #end
#if($table.tree) #if($table.tree)

@ -14,7 +14,8 @@
<form class="form-horizontal m" id="form-${businessName}-edit" th:object="${${className}}"> <form class="form-horizontal m" id="form-${businessName}-edit" th:object="${${className}}">
<input name="${pkColumn.javaField}" th:field="*{${pkColumn.javaField}}" type="hidden"> <input name="${pkColumn.javaField}" th:field="*{${pkColumn.javaField}}" type="hidden">
#foreach($column in $columns) #foreach($column in $columns)
#if($column.edit && !$column.superColumn && !$column.pk) #if($column.edit && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf("")) #set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1) #if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) #set($comment=$column.columnComment.substring(0, $parentheseIndex))
@ -29,8 +30,6 @@
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) #set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)})
#set($deptId = "${className}?.deptId")
#set($deptName = "${className}?.deptName")
<input id="treeId" name="${treeParentCode}" type="hidden" th:field="*{${treeParentCode}}" /> <input id="treeId" name="${treeParentCode}" type="hidden" th:field="*{${treeParentCode}}" />
<input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:field="*{parentName}"#if($column.required) required#end> <input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:field="*{parentName}"#if($column.required) required#end>
<span class="input-group-addon"><i class="fa fa-search"></i></span> <span class="input-group-addon"><i class="fa fa-search"></i></span>
@ -68,8 +67,8 @@
<label class="col-sm-3 control-label">${comment}</label> <label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}"> <div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}">
<input type="radio" th:id="${dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:field="*{${field}}"#if($column.required) required#end> <input type="radio" th:id="${'${field}_' + dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:field="*{${field}}"#if($column.required) required#end>
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'${field}_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
</div> </div>
@ -103,6 +102,7 @@
</div> </div>
#end #end
#end #end
#end
#end #end
</form> </form>
</div> </div>
@ -132,7 +132,6 @@
minView: "month", minView: "month",
autoclose: true autoclose: true
}); });
#break
#end #end
#end #end
#if($table.tree) #if($table.tree)

@ -31,7 +31,7 @@
<th:block th:include="include :: ztree-js" /> <th:block th:include="include :: ztree-js" />
<script th:inline="javascript"> <script th:inline="javascript">
$(function() { $(function() {
var url = ctx + "system/${businessName}/treeData"; var url = ctx + "${moduleName}/${businessName}/treeData";
var options = { var options = {
url: url, url: url,
expandLevel: 2, expandLevel: 2,

@ -28,21 +28,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#if($column.query) #if($column.query)
#if($column.queryType == "EQ") #if($column.queryType == "EQ")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName = #{$javaField}</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName = #{$javaField}</if>
#elseif($queryType == "NE") #elseif($queryType == "NE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName != #{$javaField}</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName != #{$javaField}</if>
#elseif($queryType == "GT") #elseif($queryType == "GT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt; #{$javaField}</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt; #{$javaField}</if>
#elseif($queryType == "GTE") #elseif($queryType == "GTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt;= #{$javaField}</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt;= #{$javaField}</if>
#elseif($queryType == "LT") #elseif($queryType == "LT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt; #{$javaField}</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt; #{$javaField}</if>
#elseif($queryType == "LTE") #elseif($queryType == "LTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt;= #{$javaField}</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt;= #{$javaField}</if>
#elseif($queryType == "LIKE") #elseif($queryType == "LIKE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName like concat('%', #{$javaField}, '%')</if> <if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName like concat('%', #{$javaField}, '%')</if>
#elseif($queryType == "BETWEEN") #elseif($queryType == "BETWEEN")
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if> <if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if>
#end #end
#end #end
#end #end
@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="select${ClassName}Vo"/> <include refid="select${ClassName}Vo"/>
where ${pkColumn.columnName} = #{${pkColumn.javaField}} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
#elseif($table.tree) #elseif($table.tree)
select#foreach($column in $columns) t.$column.columnName,#end p.dept_name as parent_name select#foreach($column in $columns) t.$column.columnName,#end p.${tree_name} as parent_name
from ${tableName} t from ${tableName} t
left join ${tableName} p on p.${pkColumn.columnName} = t.${tree_parent_code} left join ${tableName} p on p.${pkColumn.columnName} = t.${tree_parent_code}
where t.${pkColumn.columnName} = #{${pkColumn.javaField}} where t.${pkColumn.columnName} = #{${pkColumn.javaField}}

@ -35,6 +35,10 @@ public class SysOperLog extends BaseEntity
@Excel(name = "请求方法") @Excel(name = "请求方法")
private String method; private String method;
/** 请求方式 */
@Excel(name = "请求方式")
private String requestMethod;
/** 操作类别0其它 1后台用户 2手机端用户 */ /** 操作类别0其它 1后台用户 2手机端用户 */
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
private Integer operatorType; private Integer operatorType;
@ -63,6 +67,10 @@ public class SysOperLog extends BaseEntity
@Excel(name = "请求参数") @Excel(name = "请求参数")
private String operParam; private String operParam;
/** 返回参数 */
@Excel(name = "返回参数")
private String jsonResult;
/** 操作状态0正常 1异常 */ /** 操作状态0正常 1异常 */
@Excel(name = "状态", readConverterExp = "0=正常,1=异常") @Excel(name = "状态", readConverterExp = "0=正常,1=异常")
private Integer status; private Integer status;
@ -125,6 +133,16 @@ public class SysOperLog extends BaseEntity
this.method = method; this.method = method;
} }
public String getRequestMethod()
{
return requestMethod;
}
public void setRequestMethod(String requestMethod)
{
this.requestMethod = requestMethod;
}
public Integer getOperatorType() public Integer getOperatorType()
{ {
return operatorType; return operatorType;
@ -195,6 +213,16 @@ public class SysOperLog extends BaseEntity
this.operParam = operParam; this.operParam = operParam;
} }
public String getJsonResult()
{
return jsonResult;
}
public void setJsonResult(String jsonResult)
{
this.jsonResult = jsonResult;
}
public Integer getStatus() public Integer getStatus()
{ {
return status; return status;
@ -233,6 +261,7 @@ public class SysOperLog extends BaseEntity
.append("businessType", getBusinessType()) .append("businessType", getBusinessType())
.append("businessTypes", getBusinessTypes()) .append("businessTypes", getBusinessTypes())
.append("method", getMethod()) .append("method", getMethod())
.append("requestMethod", getRequestMethod())
.append("operatorType", getOperatorType()) .append("operatorType", getOperatorType())
.append("operName", getOperName()) .append("operName", getOperName())
.append("deptName", getDeptName()) .append("deptName", getDeptName())

@ -4,7 +4,7 @@ import java.util.List;
import com.ruoyi.system.domain.SysUserPost; import com.ruoyi.system.domain.SysUserPost;
/** /**
* *
* *
* @author ruoyi * @author ruoyi
*/ */

@ -5,7 +5,7 @@ import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
/** /**
* *
* *
* @author ruoyi * @author ruoyi
*/ */

@ -1,7 +1,6 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.domain.Ztree; import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.system.domain.SysDictType; import com.ruoyi.system.domain.SysDictType;

@ -5,30 +5,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.SysOperLogMapper"> <mapper namespace="com.ruoyi.system.mapper.SysOperLogMapper">
<resultMap type="SysOperLog" id="SysOperLogResult"> <resultMap type="SysOperLog" id="SysOperLogResult">
<id property="operId" column="oper_id" /> <id property="operId" column="oper_id" />
<result property="title" column="title" /> <result property="title" column="title" />
<result property="businessType" column="business_type" /> <result property="businessType" column="business_type" />
<result property="method" column="method" /> <result property="method" column="method" />
<result property="operatorType" column="operator_type" /> <result property="requestMethod" column="request_method" />
<result property="operName" column="oper_name" /> <result property="operatorType" column="operator_type" />
<result property="deptName" column="dept_name" /> <result property="operName" column="oper_name" />
<result property="operUrl" column="oper_url" /> <result property="deptName" column="dept_name" />
<result property="operIp" column="oper_ip" /> <result property="operUrl" column="oper_url" />
<result property="operLocation" column="oper_location" /> <result property="operIp" column="oper_ip" />
<result property="operParam" column="oper_param" /> <result property="operLocation" column="oper_location" />
<result property="status" column="status" /> <result property="operParam" column="oper_param" />
<result property="errorMsg" column="error_msg" /> <result property="jsonResult" column="json_result" />
<result property="operTime" column="oper_time" /> <result property="status" column="status" />
<result property="errorMsg" column="error_msg" />
<result property="operTime" column="oper_time" />
</resultMap> </resultMap>
<sql id="selectOperLogVo"> <sql id="selectOperLogVo">
select oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
from sys_oper_log from sys_oper_log
</sql> </sql>
<insert id="insertOperlog" parameterType="SysOperLog"> <insert id="insertOperlog" parameterType="SysOperLog">
insert into sys_oper_log(title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time) insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, GETDATE()) values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, GETDATE())
</insert> </insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">

@ -1382,6 +1382,7 @@ CREATE TABLE [dbo].[sys_oper_log] (
[title] nvarchar(50) DEFAULT (N'') NULL, [title] nvarchar(50) DEFAULT (N'') NULL,
[business_type] int DEFAULT ((0)) NULL, [business_type] int DEFAULT ((0)) NULL,
[method] nvarchar(100) DEFAULT (N'') NULL, [method] nvarchar(100) DEFAULT (N'') NULL,
[request_method] nvarchar(10) DEFAULT (N'') NULL,
[operator_type] int DEFAULT ((0)) NULL, [operator_type] int DEFAULT ((0)) NULL,
[oper_name] nvarchar(50) DEFAULT (N'') NULL, [oper_name] nvarchar(50) DEFAULT (N'') NULL,
[dept_name] nvarchar(50) DEFAULT (N'') NULL, [dept_name] nvarchar(50) DEFAULT (N'') NULL,
@ -1389,6 +1390,7 @@ CREATE TABLE [dbo].[sys_oper_log] (
[oper_ip] nvarchar(50) DEFAULT (N'') NULL, [oper_ip] nvarchar(50) DEFAULT (N'') NULL,
[oper_location] nvarchar(255) DEFAULT (N'') NULL, [oper_location] nvarchar(255) DEFAULT (N'') NULL,
[oper_param] nvarchar(2000) DEFAULT (N'') NULL, [oper_param] nvarchar(2000) DEFAULT (N'') NULL,
[json_result] nvarchar(2000) DEFAULT (N'') NULL,
[status] int DEFAULT ((0)) NULL, [status] int DEFAULT ((0)) NULL,
[error_msg] nvarchar(2000) DEFAULT (N'') NULL, [error_msg] nvarchar(2000) DEFAULT (N'') NULL,
[oper_time] datetime2(7) DEFAULT NULL NULL [oper_time] datetime2(7) DEFAULT NULL NULL
@ -1423,6 +1425,13 @@ EXEC sp_addextendedproperty
'COLUMN', N'method' 'COLUMN', N'method'
GO GO
EXEC sp_addextendedproperty
'MS_Description', N'请求方式',
'SCHEMA', N'dbo',
'TABLE', N'sys_oper_log',
'COLUMN', N'request_method'
GO
EXEC sp_addextendedproperty EXEC sp_addextendedproperty
'MS_Description', N'操作类别0其它 1后台用户 2手机端用户', 'MS_Description', N'操作类别0其它 1后台用户 2手机端用户',
'SCHEMA', N'dbo', 'SCHEMA', N'dbo',
@ -1472,6 +1481,13 @@ EXEC sp_addextendedproperty
'COLUMN', N'oper_param' 'COLUMN', N'oper_param'
GO GO
EXEC sp_addextendedproperty
'MS_Description', N'返回参数',
'SCHEMA', N'dbo',
'TABLE', N'sys_oper_log',
'COLUMN', N'json_result'
GO
EXEC sp_addextendedproperty EXEC sp_addextendedproperty
'MS_Description', N'操作状态0正常 1异常', 'MS_Description', N'操作状态0正常 1异常',
'SCHEMA', N'dbo', 'SCHEMA', N'dbo',
Loading…
Cancel
Save