1). 静态模板和控制器的父目录用直接业务命名;2).去除*.class文件

This commit is contained in:
tiny 2020-03-05 00:26:38 +08:00
parent 46029807cd
commit 4f3a56a765
289 changed files with 1543 additions and 14 deletions

1
.gitignore vendored
View File

@ -41,6 +41,7 @@ nbdist/
target/*
*.bak
*.class
!*/build/*.java
!*/build/*.html

View File

@ -0,0 +1,196 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增资源目录')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-resource-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">编号:</label>
<div class="col-sm-8">
<input name="id" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">父级编号:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="parentId" type="hidden" th:value="${infoResource?.id}"/>
<input class="form-control" type="text" onclick="selectResourceTree()" id="treeName" readonly="true" th:value="${infoResource?.name}" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所有父级编号:</label>
<div class="col-sm-8">
<textarea name="parentIds" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">名称:</label>
<div class="col-sm-8">
<input name="name" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">排序:</label>
<div class="col-sm-8">
<input name="sort" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="createDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="updateDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">备注信息:</label>
<div class="col-sm-8">
<input name="remarks" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">删除标记:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否为目录:</label>
<div class="col-sm-8">
<input name="isDir" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">英文名:</label>
<div class="col-sm-8">
<input name="enName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属用户ID</label>
<div class="col-sm-8">
<input name="ownerId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户组ID</label>
<div class="col-sm-8">
<input name="ownerGrpId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">6可读可写</label>
<div class="col-sm-8">
<input name="authLevelOwner" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">同组者权限(默认有可读权限)</label>
<div class="col-sm-8">
<input name="authLevelSameGrp" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">其他用户权限:</label>
<div class="col-sm-8">
<input name="authLevelOther" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">免密公钥列表(user_id1@auth_level1;user_id2@auth_level2)</label>
<div class="col-sm-8">
<input name="authKey" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">hdfs映射路径</label>
<div class="col-sm-8">
<input name="mappingPath" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">检查是否同步的时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="checkSyncTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">资源路径是否有效(-1, 0, 1),0代表未知,-1代表无效1代表有效</label>
<div class="col-sm-8">
<input name="checkValid" class="form-control" type="text" required>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
var prefix = ctx + "arj21/resource-manage"
$("#form-resource-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-resource-add').serialize());
}
}
$("input[name='createDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updateDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='checkSyncTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*资源目录-新增-选择父部门树*/
function selectResourceTree() {
var options = {
title: '资源目录选择',
width: "380",
url: prefix + "/selectResourceTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -0,0 +1,185 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改资源目录')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-resource-edit" th:object="${infoResource}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">父级编号:</label>
<div class="col-sm-8">
<div class="input-group">
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
<input class="form-control" type="text" onclick="selectResourceTree()" id="treeName" readonly="true" th:field="*{parentName}" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所有父级编号:</label>
<div class="col-sm-8">
<textarea name="parentIds" class="form-control" required>[[*{parentIds}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">名称:</label>
<div class="col-sm-8">
<input name="name" th:field="*{name}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">排序:</label>
<div class="col-sm-8">
<input name="sort" th:field="*{sort}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="createDate" th:value="${#dates.format(infoResource.createDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="updateDate" th:value="${#dates.format(infoResource.updateDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">备注信息:</label>
<div class="col-sm-8">
<input name="remarks" th:field="*{remarks}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否为目录:</label>
<div class="col-sm-8">
<input name="isDir" th:field="*{isDir}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">英文名:</label>
<div class="col-sm-8">
<input name="enName" th:field="*{enName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属用户ID</label>
<div class="col-sm-8">
<input name="ownerId" th:field="*{ownerId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户组ID</label>
<div class="col-sm-8">
<input name="ownerGrpId" th:field="*{ownerGrpId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">6可读可写</label>
<div class="col-sm-8">
<input name="authLevelOwner" th:field="*{authLevelOwner}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">同组者权限(默认有可读权限)</label>
<div class="col-sm-8">
<input name="authLevelSameGrp" th:field="*{authLevelSameGrp}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">其他用户权限:</label>
<div class="col-sm-8">
<input name="authLevelOther" th:field="*{authLevelOther}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">免密公钥列表(user_id1@auth_level1;user_id2@auth_level2)</label>
<div class="col-sm-8">
<input name="authKey" th:field="*{authKey}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">hdfs映射路径</label>
<div class="col-sm-8">
<input name="mappingPath" th:field="*{mappingPath}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">检查是否同步的时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="checkSyncTime" th:value="${#dates.format(infoResource.checkSyncTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">资源路径是否有效(-1, 0, 1),0代表未知,-1代表无效1代表有效</label>
<div class="col-sm-8">
<input name="checkValid" th:field="*{checkValid}" class="form-control" type="text" required>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
var prefix = ctx + "arj21/resource-manage";
$("#form-resource-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-resource-edit').serialize());
}
}
$("input[name='createDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updateDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='checkSyncTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*资源目录-新增-选择父部门树*/
function selectResourceTree() {
var options = {
title: '资源目录选择',
width: "380",
url: prefix + "/selectResourceTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script>
</body>
</html>

View File

@ -0,0 +1,242 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('资源目录列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<p>父级编号:</p>
<input type="text" name="parentId"/>
</li>
<li>
<p>名称:</p>
<input type="text" name="name"/>
</li>
<li>
<p>排序:</p>
<input type="text" name="sort"/>
</li>
<li class="select-time">
<p>创建时间:</p>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateDate]"/>
</li>
<li class="select-time">
<p>更新时间:</p>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginUpdateDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endUpdateDate]"/>
</li>
<li>
<p>备注信息:</p>
<input type="text" name="remarks"/>
</li>
<li>
<p>是否为目录:</p>
<input type="text" name="isDir"/>
</li>
<li>
<p>英文名:</p>
<input type="text" name="enName"/>
</li>
<li>
<p>所属用户ID</p>
<input type="text" name="ownerId"/>
</li>
<li>
<p>用户组ID</p>
<input type="text" name="ownerGrpId"/>
</li>
<li>
<p>6可读可写</p>
<input type="text" name="authLevelOwner"/>
</li>
<li>
<p>同组者权限(默认有可读权限)</p>
<input type="text" name="authLevelSameGrp"/>
</li>
<li>
<p>其他用户权限:</p>
<input type="text" name="authLevelOther"/>
</li>
<li>
<p>免密公钥列表(user_id1@auth_level1;user_id2@auth_level2)</p>
<input type="text" name="authKey"/>
</li>
<li>
<p>hdfs映射路径</p>
<input type="text" name="mappingPath"/>
</li>
<li class="select-time">
<p>检查是否同步的时间:</p>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCheckSyncTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCheckSyncTime]"/>
</li>
<li>
<p>资源路径是否有效(-1, 0, 1),0代表未知,-1代表无效1代表有效</p>
<input type="text" name="checkValid"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="arj21:resource:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="arj21:resource:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-info" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-tree-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('arj21:resource:add')}]];
var editFlag = [[${@permission.hasPermi('arj21:resource:edit')}]];
var removeFlag = [[${@permission.hasPermi('arj21:resource:remove')}]];
var prefix = ctx + "arj21/resource-manage";
$(function() {
var options = {
code: "id",
parentCode: "parentId",
expandColumn: "3",
uniqueId: "id",
url: prefix + "/list",
createUrl: prefix + "/add/{id}",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove/{id}",
exportUrl: prefix + "/export",
modalName: "资源目录",
columns: [{
field: 'selectItem',
radio: true
},
{
field : 'parentId',
title : '父级编号',
align: 'left'
},
{
field : 'parentIds',
title : '所有父级编号',
align: 'left'
},
{
field : 'name',
title : '名称',
align: 'left'
},
{
field : 'sort',
title : '排序',
align: 'left'
},
{
field : 'createDate',
title : '创建时间',
align: 'left'
},
{
field : 'updateDate',
title : '更新时间',
align: 'left'
},
{
field : 'remarks',
title : '备注信息',
align: 'left'
},
{
field : 'isDir',
title : '是否为目录',
align: 'left'
},
{
field : 'enName',
title : '英文名',
align: 'left'
},
{
field : 'ownerId',
title : '所属用户ID',
align: 'left'
},
{
field : 'ownerGrpId',
title : '用户组ID',
align: 'left'
},
{
field : 'authLevelOwner',
title : '6可读可写',
align: 'left'
},
{
field : 'authLevelSameGrp',
title : '同组者权限(默认有可读权限)',
align: 'left'
},
{
field : 'authLevelOther',
title : '其他用户权限',
align: 'left'
},
{
field : 'authKey',
title : '免密公钥列表(user_id1@auth_level1;user_id2@auth_level2)',
align: 'left'
},
{
field : 'mappingPath',
title : 'hdfs映射路径',
align: 'left'
},
{
field : 'checkSyncTime',
title : '检查是否同步的时间',
align: 'left'
},
{
field : 'checkValid',
title : '资源路径是否有效(-1, 0, 1),0代表未知,-1代表无效1代表有效',
align: 'left'
},
{
title: '操作',
align: 'center',
align: 'left',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.id + '\')"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.treeTable.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('资源目录树选择')" />
<th:block th:include="include :: ztree-css" />
</head>
<style>
body{height:auto;font-family: "Microsoft YaHei";}
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
<input id="treeId" name="treeId" type="hidden" th:value="${infoResource?.id}"/>
<input id="treeName" name="treeName" type="hidden" th:value="${infoResource?.name}"/>
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
<label id="btnShow" title="显示搜索" style="display:none;"></label>
<label id="btnHide" title="隐藏搜索"></label>
</div>
<div class="treeSearchInput" id="search">
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
</div>
<div class="treeExpandCollapse">
<a href="#" onclick="$.tree.expand()">展开</a> /
<a href="#" onclick="$.tree.collapse()">折叠</a>
</div>
<div id="tree" class="ztree treeselect"></div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
$(function() {
var url = ctx + "arj21/resource-manage/treeData";
var options = {
url: url,
expandLevel: 2,
onClick : zOnClick
};
$.tree.init(options);
});
function zOnClick(event, treeId, treeNode) {
var treeId = treeNode.id;
var treeName = treeNode.name;
$("#treeId").val(treeId);
$("#treeName").val(treeName);
}
</script>
</body>
</html>

View File

@ -0,0 +1,154 @@
package cn.com.infosouth.arj21.controller.resourcemanage;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.infosouth.arj21.domain.InfoResource;
import cn.com.infosouth.arj21.service.IInfoResourceService;
import cn.com.infosouth.common.annotation.Log;
import cn.com.infosouth.common.core.controller.BaseController;
import cn.com.infosouth.common.core.domain.AjaxResult;
import cn.com.infosouth.common.core.domain.Ztree;
import cn.com.infosouth.common.enums.BusinessType;
import cn.com.infosouth.common.utils.StringUtils;
import cn.com.infosouth.common.utils.poi.ExcelUtil;
/**
* 资源目录Controller
*
* @author kxnf
* @date 2020-03-04
*/
@Controller
@RequestMapping("/arj21/resource-manage")
public class InfoResourceController extends BaseController
{
private String prefix = "arj21/resource-manage";
@Autowired
private IInfoResourceService infoResourceService;
@RequiresPermissions("arj21:resource:view")
@GetMapping()
public String resource()
{
return prefix + "/resource";
}
/**
* 查询资源目录树列表
*/
@RequiresPermissions("arj21:resource:list")
@PostMapping("/list")
@ResponseBody
public List<InfoResource> list(InfoResource infoResource)
{
List<InfoResource> list = infoResourceService.selectInfoResourceList(infoResource);
return list;
}
/**
* 导出资源目录列表
*/
@RequiresPermissions("arj21:resource:export")
@Log(title = "资源目录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(InfoResource infoResource)
{
List<InfoResource> list = infoResourceService.selectInfoResourceList(infoResource);
ExcelUtil<InfoResource> util = new ExcelUtil<InfoResource>(InfoResource.class);
return util.exportExcel(list, "resource");
}
/**
* 新增资源目录
*/
@GetMapping(value = { "/add/{id}", "/add/" })
public String add(@PathVariable(value = "id", required = false) String id, ModelMap mmap)
{
if (StringUtils.isNotNull(id))
{
mmap.put("infoResource", infoResourceService.selectInfoResourceById(id));
}
return prefix + "/add";
}
/**
* 新增保存资源目录
*/
@RequiresPermissions("arj21:resource:add")
@Log(title = "资源目录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(InfoResource infoResource)
{
return toAjax(infoResourceService.insertInfoResource(infoResource));
}
/**
* 修改资源目录
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap)
{
InfoResource infoResource = infoResourceService.selectInfoResourceById(id);
mmap.put("infoResource", infoResource);
return prefix + "/edit";
}
/**
* 修改保存资源目录
*/
@RequiresPermissions("arj21:resource:edit")
@Log(title = "资源目录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(InfoResource infoResource)
{
return toAjax(infoResourceService.updateInfoResource(infoResource));
}
/**
* 删除
*/
@RequiresPermissions("arj21:resource:remove")
@Log(title = "资源目录", businessType = BusinessType.DELETE)
@GetMapping("/remove/{id}")
@ResponseBody
public AjaxResult remove(@PathVariable("id") String id)
{
return toAjax(infoResourceService.deleteInfoResourceById(id));
}
/**
* 选择资源目录树
*/
@GetMapping(value = { "/selectResourceTree/{id}", "/selectResourceTree/" })
public String selectResourceTree(@PathVariable(value = "id", required = false) String id, ModelMap mmap)
{
if (StringUtils.isNotNull(id))
{
mmap.put("infoResource", infoResourceService.selectInfoResourceById(id));
}
return prefix + "/tree";
}
/**
* 加载资源目录树列表
*/
@GetMapping("/treeData")
@ResponseBody
public List<Ztree> treeData()
{
List<Ztree> ztrees = infoResourceService.selectInfoResourceTree();
return ztrees;
}
}

View File

@ -0,0 +1,294 @@
package cn.com.infosouth.arj21.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.com.infosouth.common.annotation.Excel;
import cn.com.infosouth.common.core.domain.TreeEntity;
import java.util.Date;
/**
* 资源目录对象 info_resource
*
* @author kxnf
* @date 2020-03-04
*/
public class InfoResource extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 所有父级编号 */
@Excel(name = "所有父级编号")
private String parentIds;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** 创建时间 */
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 更新时间 */
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updateDate;
/** 备注信息 */
@Excel(name = "备注信息")
private String remarks;
/** 删除标记 */
private String delFlag;
/** 是否为目录 */
@Excel(name = "是否为目录")
private String isDir;
/** 英文名 */
@Excel(name = "英文名")
private String enName;
/** 所属用户ID */
@Excel(name = "所属用户ID")
private String ownerId;
/** 用户组ID */
@Excel(name = "用户组ID")
private String ownerGrpId;
/** 6可读可写 */
@Excel(name = "6可读可写")
private Long authLevelOwner;
/** 同组者权限(默认有可读权限) */
@Excel(name = "同组者权限(默认有可读权限)")
private Long authLevelSameGrp;
/** 其他用户权限 */
@Excel(name = "其他用户权限")
private Long authLevelOther;
/** 免密公钥列表(user_id1@auth_level1;user_id2@auth_level2) */
@Excel(name = "免密公钥列表(user_id1@auth_level1;user_id2@auth_level2)")
private String authKey;
/** hdfs映射路径 */
@Excel(name = "hdfs映射路径")
private String mappingPath;
/** 检查是否同步的时间 */
@Excel(name = "检查是否同步的时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date checkSyncTime;
/** 资源路径是否有效(-1, 0, 1),0代表未知,-1代表无效1代表有效 */
@Excel(name = "资源路径是否有效(-1, 0, 1),0代表未知,-1代表无效1代表有效")
private Long checkValid;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setParentIds(String parentIds)
{
this.parentIds = parentIds;
}
public String getParentIds()
{
return parentIds;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSort(Integer sort)
{
this.sort = sort;
}
public Integer getSort()
{
return sort;
}
public void setCreateDate(Date createDate)
{
this.createDate = createDate;
}
public Date getCreateDate()
{
return createDate;
}
public void setUpdateDate(Date updateDate)
{
this.updateDate = updateDate;
}
public Date getUpdateDate()
{
return updateDate;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
public void setIsDir(String isDir)
{
this.isDir = isDir;
}
public String getIsDir()
{
return isDir;
}
public void setEnName(String enName)
{
this.enName = enName;
}
public String getEnName()
{
return enName;
}
public void setOwnerId(String ownerId)
{
this.ownerId = ownerId;
}
public String getOwnerId()
{
return ownerId;
}
public void setOwnerGrpId(String ownerGrpId)
{
this.ownerGrpId = ownerGrpId;
}
public String getOwnerGrpId()
{
return ownerGrpId;
}
public void setAuthLevelOwner(Long authLevelOwner)
{
this.authLevelOwner = authLevelOwner;
}
public Long getAuthLevelOwner()
{
return authLevelOwner;
}
public void setAuthLevelSameGrp(Long authLevelSameGrp)
{
this.authLevelSameGrp = authLevelSameGrp;
}
public Long getAuthLevelSameGrp()
{
return authLevelSameGrp;
}
public void setAuthLevelOther(Long authLevelOther)
{
this.authLevelOther = authLevelOther;
}
public Long getAuthLevelOther()
{
return authLevelOther;
}
public void setAuthKey(String authKey)
{
this.authKey = authKey;
}
public String getAuthKey()
{
return authKey;
}
public void setMappingPath(String mappingPath)
{
this.mappingPath = mappingPath;
}
public String getMappingPath()
{
return mappingPath;
}
public void setCheckSyncTime(Date checkSyncTime)
{
this.checkSyncTime = checkSyncTime;
}
public Date getCheckSyncTime()
{
return checkSyncTime;
}
public void setCheckValid(Long checkValid)
{
this.checkValid = checkValid;
}
public Long getCheckValid()
{
return checkValid;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("parentIds", getParentIds())
.append("name", getName())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createDate", getCreateDate())
.append("updateBy", getUpdateBy())
.append("updateDate", getUpdateDate())
.append("remarks", getRemarks())
.append("delFlag", getDelFlag())
.append("isDir", getIsDir())
.append("enName", getEnName())
.append("ownerId", getOwnerId())
.append("ownerGrpId", getOwnerGrpId())
.append("authLevelOwner", getAuthLevelOwner())
.append("authLevelSameGrp", getAuthLevelSameGrp())
.append("authLevelOther", getAuthLevelOther())
.append("authKey", getAuthKey())
.append("mappingPath", getMappingPath())
.append("checkSyncTime", getCheckSyncTime())
.append("checkValid", getCheckValid())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package cn.com.infosouth.arj21.mapper;
import java.util.List;
import cn.com.infosouth.arj21.domain.InfoResource;
/**
* 资源目录Mapper接口
*
* @author kxnf
* @date 2020-03-04
*/
public interface InfoResourceMapper
{
/**
* 查询资源目录
*
* @param id 资源目录ID
* @return 资源目录
*/
public InfoResource selectInfoResourceById(String id);
/**
* 查询资源目录列表
*
* @param infoResource 资源目录
* @return 资源目录集合
*/
public List<InfoResource> selectInfoResourceList(InfoResource infoResource);
/**
* 新增资源目录
*
* @param infoResource 资源目录
* @return 结果
*/
public int insertInfoResource(InfoResource infoResource);
/**
* 修改资源目录
*
* @param infoResource 资源目录
* @return 结果
*/
public int updateInfoResource(InfoResource infoResource);
/**
* 删除资源目录
*
* @param id 资源目录ID
* @return 结果
*/
public int deleteInfoResourceById(String id);
/**
* 批量删除资源目录
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteInfoResourceByIds(String[] ids);
}

View File

@ -0,0 +1,69 @@
package cn.com.infosouth.arj21.service;
import java.util.List;
import cn.com.infosouth.arj21.domain.InfoResource;
import cn.com.infosouth.common.core.domain.Ztree;
/**
* 资源目录Service接口
*
* @author kxnf
* @date 2020-03-04
*/
public interface IInfoResourceService
{
/**
* 查询资源目录
*
* @param id 资源目录ID
* @return 资源目录
*/
public InfoResource selectInfoResourceById(String id);
/**
* 查询资源目录列表
*
* @param infoResource 资源目录
* @return 资源目录集合
*/
public List<InfoResource> selectInfoResourceList(InfoResource infoResource);
/**
* 新增资源目录
*
* @param infoResource 资源目录
* @return 结果
*/
public int insertInfoResource(InfoResource infoResource);
/**
* 修改资源目录
*
* @param infoResource 资源目录
* @return 结果
*/
public int updateInfoResource(InfoResource infoResource);
/**
* 批量删除资源目录
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteInfoResourceByIds(String ids);
/**
* 删除资源目录信息
*
* @param id 资源目录ID
* @return 结果
*/
public int deleteInfoResourceById(String id);
/**
* 查询资源目录树列表
*
* @return 所有资源目录信息
*/
public List<Ztree> selectInfoResourceTree();
}

View File

@ -0,0 +1,118 @@
package cn.com.infosouth.arj21.service.impl;
import java.util.List;
import java.util.ArrayList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.com.infosouth.arj21.mapper.InfoResourceMapper;
import cn.com.infosouth.arj21.domain.InfoResource;
import cn.com.infosouth.arj21.service.IInfoResourceService;
import cn.com.infosouth.common.core.domain.Ztree;
import cn.com.infosouth.common.core.text.Convert;
/**
* 资源目录Service业务层处理
*
* @author kxnf
* @date 2020-03-04
*/
@Service
public class InfoResourceServiceImpl implements IInfoResourceService
{
@Autowired
private InfoResourceMapper infoResourceMapper;
/**
* 查询资源目录
*
* @param id 资源目录ID
* @return 资源目录
*/
@Override
public InfoResource selectInfoResourceById(String id)
{
return infoResourceMapper.selectInfoResourceById(id);
}
/**
* 查询资源目录列表
*
* @param infoResource 资源目录
* @return 资源目录
*/
@Override
public List<InfoResource> selectInfoResourceList(InfoResource infoResource)
{
return infoResourceMapper.selectInfoResourceList(infoResource);
}
/**
* 新增资源目录
*
* @param infoResource 资源目录
* @return 结果
*/
@Override
public int insertInfoResource(InfoResource infoResource)
{
return infoResourceMapper.insertInfoResource(infoResource);
}
/**
* 修改资源目录
*
* @param infoResource 资源目录
* @return 结果
*/
@Override
public int updateInfoResource(InfoResource infoResource)
{
return infoResourceMapper.updateInfoResource(infoResource);
}
/**
* 删除资源目录对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteInfoResourceByIds(String ids)
{
return infoResourceMapper.deleteInfoResourceByIds(Convert.toStrArray(ids));
}
/**
* 删除资源目录信息
*
* @param id 资源目录ID
* @return 结果
*/
@Override
public int deleteInfoResourceById(String id)
{
return infoResourceMapper.deleteInfoResourceById(id);
}
/**
* 查询资源目录树列表
*
* @return 所有资源目录信息
*/
@Override
public List<Ztree> selectInfoResourceTree()
{
List<InfoResource> infoResourceList = infoResourceMapper.selectInfoResourceList(new InfoResource());
List<Ztree> ztrees = new ArrayList<Ztree>();
for (InfoResource infoResource : infoResourceList)
{
Ztree ztree = new Ztree();
ztree.setId(infoResource.getId());
ztree.setpId(infoResource.getParentId());
ztree.setName(infoResource.getName());
ztree.setTitle(infoResource.getName());
ztrees.add(ztree);
}
return ztrees;
}
}

View File

@ -0,0 +1,160 @@
<?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="cn.com.infosouth.arj21.mapper.InfoResourceMapper">
<resultMap type="InfoResource" id="InfoResourceResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="parentIds" column="parent_ids" />
<result property="name" column="name" />
<result property="sort" column="sort" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="remarks" column="remarks" />
<result property="delFlag" column="del_flag" />
<result property="isDir" column="is_dir" />
<result property="enName" column="en_name" />
<result property="ownerId" column="owner_id" />
<result property="ownerGrpId" column="owner_grp_id" />
<result property="authLevelOwner" column="auth_level_owner" />
<result property="authLevelSameGrp" column="auth_level_same_grp" />
<result property="authLevelOther" column="auth_level_other" />
<result property="authKey" column="auth_key" />
<result property="mappingPath" column="mapping_path" />
<result property="checkSyncTime" column="check_sync_time" />
<result property="checkValid" column="check_valid" />
<result property="parentName" column="parent_name" />
</resultMap>
<sql id="selectInfoResourceVo">
select id, parent_id, parent_ids, name, sort, create_by, create_date, update_by, update_date, remarks, del_flag, is_dir, en_name, owner_id, owner_grp_id, auth_level_owner, auth_level_same_grp, auth_level_other, auth_key, mapping_path, check_sync_time, check_valid from info_resource
</sql>
<select id="selectInfoResourceList" parameterType="InfoResource" resultMap="InfoResourceResult">
<include refid="selectInfoResourceVo"/>
<where>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="parentIds != null and parentIds != ''"> and parent_ids = #{parentIds}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="isDir != null and isDir != ''"> and is_dir = #{isDir}</if>
<if test="enName != null and enName != ''"> and en_name like concat('%', #{enName}, '%')</if>
<if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if>
<if test="ownerGrpId != null and ownerGrpId != ''"> and owner_grp_id = #{ownerGrpId}</if>
<if test="authLevelOwner != null "> and auth_level_owner = #{authLevelOwner}</if>
<if test="authLevelSameGrp != null "> and auth_level_same_grp = #{authLevelSameGrp}</if>
<if test="authLevelOther != null "> and auth_level_other = #{authLevelOther}</if>
<if test="authKey != null and authKey != ''"> and auth_key = #{authKey}</if>
<if test="mappingPath != null and mappingPath != ''"> and mapping_path = #{mappingPath}</if>
<if test="checkSyncTime != null "> and check_sync_time = #{checkSyncTime}</if>
<if test="checkValid != null "> and check_valid = #{checkValid}</if>
</where>
order by parent_id
</select>
<select id="selectInfoResourceById" parameterType="String" resultMap="InfoResourceResult">
select t.id, t.parent_id, t.parent_ids, t.name, t.sort, t.create_by, t.create_date, t.update_by, t.update_date, t.remarks, t.del_flag, t.is_dir, t.en_name, t.owner_id, t.owner_grp_id, t.auth_level_owner, t.auth_level_same_grp, t.auth_level_other, t.auth_key, t.mapping_path, t.check_sync_time, t.check_valid, p.name as parent_name
from info_resource t
left join info_resource p on p.id = t.parent_id
where t.id = #{id}
</select>
<insert id="insertInfoResource" parameterType="InfoResource">
insert into info_resource
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="parentId != null and parentId != ''">parent_id,</if>
<if test="parentIds != null and parentIds != ''">parent_ids,</if>
<if test="name != null and name != ''">name,</if>
<if test="sort != null ">sort,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createDate != null ">create_date,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateDate != null ">update_date,</if>
<if test="remarks != null and remarks != ''">remarks,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="isDir != null and isDir != ''">is_dir,</if>
<if test="enName != null and enName != ''">en_name,</if>
<if test="ownerId != null and ownerId != ''">owner_id,</if>
<if test="ownerGrpId != null and ownerGrpId != ''">owner_grp_id,</if>
<if test="authLevelOwner != null ">auth_level_owner,</if>
<if test="authLevelSameGrp != null ">auth_level_same_grp,</if>
<if test="authLevelOther != null ">auth_level_other,</if>
<if test="authKey != null and authKey != ''">auth_key,</if>
<if test="mappingPath != null and mappingPath != ''">mapping_path,</if>
<if test="checkSyncTime != null ">check_sync_time,</if>
<if test="checkValid != null ">check_valid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="parentIds != null and parentIds != ''">#{parentIds},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="sort != null ">#{sort},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createDate != null ">#{createDate},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateDate != null ">#{updateDate},</if>
<if test="remarks != null and remarks != ''">#{remarks},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="isDir != null and isDir != ''">#{isDir},</if>
<if test="enName != null and enName != ''">#{enName},</if>
<if test="ownerId != null and ownerId != ''">#{ownerId},</if>
<if test="ownerGrpId != null and ownerGrpId != ''">#{ownerGrpId},</if>
<if test="authLevelOwner != null ">#{authLevelOwner},</if>
<if test="authLevelSameGrp != null ">#{authLevelSameGrp},</if>
<if test="authLevelOther != null ">#{authLevelOther},</if>
<if test="authKey != null and authKey != ''">#{authKey},</if>
<if test="mappingPath != null and mappingPath != ''">#{mappingPath},</if>
<if test="checkSyncTime != null ">#{checkSyncTime},</if>
<if test="checkValid != null ">#{checkValid},</if>
</trim>
</insert>
<update id="updateInfoResource" parameterType="InfoResource">
update info_resource
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
<if test="parentIds != null and parentIds != ''">parent_ids = #{parentIds},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="sort != null ">sort = #{sort},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createDate != null ">create_date = #{createDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateDate != null ">update_date = #{updateDate},</if>
<if test="remarks != null and remarks != ''">remarks = #{remarks},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="isDir != null and isDir != ''">is_dir = #{isDir},</if>
<if test="enName != null and enName != ''">en_name = #{enName},</if>
<if test="ownerId != null and ownerId != ''">owner_id = #{ownerId},</if>
<if test="ownerGrpId != null and ownerGrpId != ''">owner_grp_id = #{ownerGrpId},</if>
<if test="authLevelOwner != null ">auth_level_owner = #{authLevelOwner},</if>
<if test="authLevelSameGrp != null ">auth_level_same_grp = #{authLevelSameGrp},</if>
<if test="authLevelOther != null ">auth_level_other = #{authLevelOther},</if>
<if test="authKey != null and authKey != ''">auth_key = #{authKey},</if>
<if test="mappingPath != null and mappingPath != ''">mapping_path = #{mappingPath},</if>
<if test="checkSyncTime != null ">check_sync_time = #{checkSyncTime},</if>
<if test="checkValid != null ">check_valid = #{checkValid},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInfoResourceById" parameterType="String">
delete from info_resource where id = #{id}
</delete>
<delete id="deleteInfoResourceByIds" parameterType="String">
delete from info_resource where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -13,7 +13,7 @@ public class TreeEntity extends BaseEntity
private String parentName;
/** 父菜单ID */
private Long parentId;
private String parentId;
/** 显示顺序 */
private Integer orderNum;
@ -31,12 +31,12 @@ public class TreeEntity extends BaseEntity
this.parentName = parentName;
}
public Long getParentId()
public String getParentId()
{
return parentId;
}
public void setParentId(Long parentId)
public void setParentId(String parentId)
{
this.parentId = parentId;
}

View File

@ -12,10 +12,10 @@ public class Ztree implements Serializable
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
private String id;
/** 节点父ID */
private Long pId;
private String pId;
/** 节点名称 */
private String name;
@ -32,22 +32,22 @@ public class Ztree implements Serializable
/** 是否能勾选 */
private boolean nocheck = false;
public Long getId()
public String getId()
{
return id;
}
public void setId(Long id)
public void setId(String id)
{
this.id = id;
}
public Long getpId()
public String getpId()
{
return pId;
}
public void setpId(Long pId)
public void setpId(String pId)
{
this.pId = pId;
}

Some files were not shown because too many files have changed in this diff Show More