parent
85767d9453
commit
8185f7d6b8
|
|
@ -1,5 +1,8 @@
|
|||
package com.ruoyi.dfm.controller;
|
||||
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.dfm.constant.UserConstants;
|
||||
import com.ruoyi.dfm.pojo.Page;
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
|
|
@ -7,12 +10,15 @@ import com.ruoyi.dfm.pojo.UserQueryBean;
|
|||
import com.ruoyi.dfm.service.FileService;
|
||||
import com.ruoyi.dfm.service.UserService;
|
||||
import com.ruoyi.dfm.util.Md5Util;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -21,7 +27,7 @@ import java.util.List;
|
|||
|
||||
@Controller
|
||||
@RequestMapping("/user.do")
|
||||
public class UserController extends BaseController{
|
||||
public class UserController extends com.ruoyi.common.core.controller.BaseController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
|
||||
|
||||
@Autowired
|
||||
|
|
@ -94,7 +100,21 @@ public class UserController extends BaseController{
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用户管理控制器,默认打开个人资料方法
|
||||
* @param req
|
||||
* @param res
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public ModelAndView list(HttpServletRequest req,
|
||||
HttpServletResponse res) throws Exception {
|
||||
return new ModelAndView("dfm/userList");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @param req
|
||||
|
|
@ -102,35 +122,28 @@ public class UserController extends BaseController{
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/getUserList")
|
||||
public ModelAndView getUserList(HttpServletRequest req,
|
||||
HttpServletResponse res) throws Exception {
|
||||
String currentPage = req.getParameter("currentPage");
|
||||
Page page = new Page();
|
||||
if(currentPage == null || "".equals(currentPage.trim()))
|
||||
{
|
||||
page.setCurrentPage(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
page.setCurrentPage(Integer.parseInt(currentPage));
|
||||
}
|
||||
|
||||
UserInfo currentUser = getUserInfo(req);
|
||||
List<UserInfo> rs = null;
|
||||
if(UserConstants.USER_LEVEL_ADMIN == currentUser.getGroupId()) {
|
||||
rs = userService.getAllUser(page);
|
||||
} else if(UserConstants.USER_LEVEL_DEP_ADMIN == currentUser.getGroupId()) {
|
||||
//部门管理员,只能获取自己部门的用户
|
||||
UserQueryBean userQueryBean = new UserQueryBean();
|
||||
userQueryBean.setDepartment(currentUser.getDepartment());
|
||||
rs = userService.getByQueryBean(userQueryBean, page);
|
||||
}
|
||||
req.setAttribute("userList", rs);
|
||||
req.setAttribute("page", page);
|
||||
return new ModelAndView("userList");
|
||||
}
|
||||
|
||||
// @RequestMapping("/getUserList")
|
||||
// @ResponseBody
|
||||
// public TableDataInfo getUserList(HttpServletRequest req, HttpServletResponse res) throws Exception {
|
||||
// startPage();
|
||||
// Page page = new Page();
|
||||
// PageDomain pageDomain = TableSupport.getPageDomain();
|
||||
// page.setCurrentPage(pageDomain.getPageNum());
|
||||
// page.setPageSize(pageDomain.getPageSize());
|
||||
//
|
||||
// UserInfo currentUser = ShiroUtils.getLoginUser();
|
||||
// List<UserInfo> rs = null;
|
||||
// if(UserConstants.USER_LEVEL_ADMIN == currentUser.getGroupId()) {
|
||||
// rs = userService.getAllUser(page);
|
||||
// } else if(UserConstants.USER_LEVEL_DEP_ADMIN == currentUser.getGroupId()) {
|
||||
// //部门管理员,只能获取自己部门的用户
|
||||
// UserQueryBean userQueryBean = new UserQueryBean();
|
||||
// userQueryBean.setDepartment(currentUser.getDepartment());
|
||||
// rs = userService.getByQueryBean(userQueryBean, page);
|
||||
// }
|
||||
// return getDataTable(rs);
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -194,7 +207,7 @@ public class UserController extends BaseController{
|
|||
String ustr = req.getParameter("uid");
|
||||
if(ustr == null || "".equals(ustr))
|
||||
{
|
||||
uid = getUserInfo(req).getId();
|
||||
uid = ShiroUtils.getLoginUser().getId();
|
||||
}else
|
||||
{
|
||||
uid = Integer.parseInt(ustr);
|
||||
|
|
@ -231,7 +244,7 @@ public class UserController extends BaseController{
|
|||
groupId = UserConstants.USER_LEVEL_DEP_ADMIN;
|
||||
}
|
||||
|
||||
UserInfo user1 = getUserInfo(req);
|
||||
UserInfo user1 = ShiroUtils.getLoginUser();
|
||||
try {
|
||||
UserInfo user = new UserInfo();
|
||||
user.setId(Integer.parseInt(id));
|
||||
|
|
@ -262,10 +275,11 @@ public class UserController extends BaseController{
|
|||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/queryUser")
|
||||
public ModelAndView queryUser(HttpServletRequest req,
|
||||
@RequestMapping("/getUserList")
|
||||
@ResponseBody
|
||||
public TableDataInfo queryUser(HttpServletRequest req,
|
||||
HttpServletResponse res) throws Exception {
|
||||
|
||||
startPage();
|
||||
String name = req.getParameter("name");
|
||||
String username = req.getParameter("username");
|
||||
String department = req.getParameter("department");
|
||||
|
|
@ -278,20 +292,15 @@ public class UserController extends BaseController{
|
|||
queryBean.setProjectGroup(projectGroup);
|
||||
queryBean.setState(state);
|
||||
queryBean.setUsername(username);
|
||||
|
||||
//构造分页参数
|
||||
String currentPage = req.getParameter("currentPage");
|
||||
Page page = new Page();
|
||||
if(currentPage == null || "".equals(currentPage.trim()))
|
||||
{
|
||||
page.setCurrentPage(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
page.setCurrentPage(Integer.parseInt(currentPage));
|
||||
}
|
||||
|
||||
UserInfo currentUser = getUserInfo(req);
|
||||
Page page = new Page();
|
||||
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||
page.setCurrentPage(pageDomain.getPageNum());
|
||||
page.setPageSize(pageDomain.getPageSize());
|
||||
|
||||
UserInfo currentUser = ShiroUtils.getLoginUser();
|
||||
|
||||
|
||||
List<UserInfo> rs = null;
|
||||
if(UserConstants.USER_LEVEL_ADMIN == currentUser.getGroupId()) {
|
||||
rs = userService.getByQueryBean(queryBean , page);
|
||||
|
|
@ -300,11 +309,7 @@ public class UserController extends BaseController{
|
|||
queryBean.setDepartment(currentUser.getDepartment());
|
||||
rs = userService.getByQueryBean(queryBean, page);
|
||||
}
|
||||
|
||||
//List<UserInfo> list = userService.getByQueryBean(queryBean , page);
|
||||
req.setAttribute("page", page);
|
||||
req.setAttribute("userList", rs);
|
||||
return new ModelAndView("userList");
|
||||
return getDataTable(rs);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
package com.ruoyi.dfm.service;
|
||||
|
||||
import com.ruoyi.dfm.dao.MenuDAO;
|
||||
import com.ruoyi.dfm.pojo.MenuInfo;
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class MenuService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MenuService.class);
|
||||
@Autowired
|
||||
private MenuDAO menuDAO;
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID获取该用户拥有的菜单列表
|
||||
* @return
|
||||
*/
|
||||
public List<MenuInfo> getMenuByUser(UserInfo user)
|
||||
{
|
||||
return menuDAO.getByGroup(user.getGroupId());
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,10 @@ package com.ruoyi.web.controller.system;
|
|||
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.dfm.pojo.MenuInfo;
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import com.ruoyi.dfm.service.MenuService;
|
||||
import com.ruoyi.dfm.service.UserService;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
|
|
@ -22,27 +26,37 @@ import java.util.List;
|
|||
@Controller
|
||||
public class SysIndexController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
// @Autowired
|
||||
// private ISysMenuService menuService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
MenuService menuService;
|
||||
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
// 系统首页
|
||||
@GetMapping("/index")
|
||||
public String index(ModelMap mmap)
|
||||
{
|
||||
// 取身份信息
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
UserInfo user = ShiroUtils.getLoginUser();
|
||||
// SysUser user = ShiroUtils.getSysUser();
|
||||
// 根据用户id取出菜单
|
||||
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
||||
// List<SysMenu> menus = menuService.selectMenusByUser(user);
|
||||
//FIXME 临时查询
|
||||
List<MenuInfo> menus = menuService.getMenuByGroup(1);
|
||||
|
||||
mmap.put("menus", menus);
|
||||
mmap.put("user", user);
|
||||
mmap.put("sideTheme", configService.selectConfigByKey("sys.index.sideTheme"));
|
||||
mmap.put("skinName", configService.selectConfigByKey("sys.index.skinName"));
|
||||
mmap.put("copyrightYear", Global.getCopyrightYear());
|
||||
mmap.put("demoEnabled", Global.isDemoEnabled());
|
||||
return "index";
|
||||
return "index_dfm";
|
||||
}
|
||||
|
||||
// 切换主题
|
||||
|
|
|
|||
|
|
@ -1,46 +1,46 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.framework.shiro.service.SysRegisterService;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 注册验证
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
public class SysRegisterController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private SysRegisterService registerService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@GetMapping("/register")
|
||||
public String register()
|
||||
{
|
||||
return "register";
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
@ResponseBody
|
||||
public AjaxResult ajaxRegister(SysUser user)
|
||||
{
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||
{
|
||||
return error("当前系统没有开启注册功能!");
|
||||
}
|
||||
String msg = registerService.register(user);
|
||||
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
}
|
||||
}
|
||||
//package com.ruoyi.web.controller.system;
|
||||
//
|
||||
//import com.ruoyi.common.core.controller.BaseController;
|
||||
//import com.ruoyi.common.core.domain.AjaxResult;
|
||||
//import com.ruoyi.framework.shiro.service.SysRegisterService;
|
||||
//import com.ruoyi.system.domain.SysUser;
|
||||
//import com.ruoyi.system.service.ISysConfigService;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Controller;
|
||||
//import org.springframework.util.StringUtils;
|
||||
//import org.springframework.web.bind.annotation.GetMapping;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.ResponseBody;
|
||||
//
|
||||
///**
|
||||
// * 注册验证
|
||||
// *
|
||||
// * @author ruoyi
|
||||
// */
|
||||
//@Controller
|
||||
//public class SysRegisterController extends BaseController
|
||||
//{
|
||||
// @Autowired
|
||||
// private SysRegisterService registerService;
|
||||
//
|
||||
// @Autowired
|
||||
// private ISysConfigService configService;
|
||||
//
|
||||
// @GetMapping("/register")
|
||||
// public String register()
|
||||
// {
|
||||
// return "register";
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/register")
|
||||
// @ResponseBody
|
||||
// public AjaxResult ajaxRegister(SysUser user)
|
||||
// {
|
||||
// if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||
// {
|
||||
// return error("当前系统没有开启注册功能!");
|
||||
// }
|
||||
// String msg = registerService.register(user);
|
||||
// return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,196 @@
|
|||
<!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="role-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
员工姓名:<input type="text" name="name"/>
|
||||
</li>
|
||||
<li>
|
||||
用户名:<input type="text" name="username"/>
|
||||
</li>
|
||||
<li>
|
||||
所在部门:<input type="text" name="department"/>
|
||||
</li>
|
||||
<li>
|
||||
项目组:<input type="text" name="projectGroup"/>
|
||||
</li>
|
||||
<li>
|
||||
状态:<select name="state">
|
||||
<option value="-1">--请选择--</option>
|
||||
<option value="0">启用</option>
|
||||
<option value="1">禁用</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" >
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" >
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" >
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" >-->
|
||||
<!--<i class="fa fa-download"></i> 导出-->
|
||||
<!--</a>-->
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:role:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:role:remove')}]];
|
||||
var prefix = ctx + "user.do";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/getUserList",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
sortName: "roleSort",
|
||||
modalName: "用户",
|
||||
columns: [
|
||||
// {
|
||||
// checkbox: true
|
||||
// },
|
||||
// {
|
||||
// field: 'id',
|
||||
// title: '员工ID'
|
||||
// },
|
||||
{
|
||||
field: 'name',
|
||||
title: '员工姓名',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'username',
|
||||
title: '用户名',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'department',
|
||||
title: '所在部门',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'projectGroup',
|
||||
title: '项目组',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'email',
|
||||
title: 'Email',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'ccEmail',
|
||||
title: '抄送Email',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'groupId',
|
||||
title: '是否管理员',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
sortable: true
|
||||
},
|
||||
// {
|
||||
// field: 'roleSort',
|
||||
// title: '操作',
|
||||
// sortable: true
|
||||
// },
|
||||
// {
|
||||
// visible: editFlag == 'hidden' ? false : true,
|
||||
// title: '角色状态',
|
||||
// align: 'center',
|
||||
// formatter: function (value, row, index) {
|
||||
// return statusTools(row);
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// field: 'createTime',
|
||||
// title: '创建时间',
|
||||
// sortable: true
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
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.roleId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.roleId + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
var more = [];
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authDataScope(" + row.roleId + ")'><i class='fa fa-check-square-o'></i>数据权限</a> ");
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authUser(" + row.roleId + ")'><i class='fa fa-user'></i>分配用户</a>");
|
||||
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
/* 角色管理-分配数据权限 */
|
||||
function authDataScope(roleId) {
|
||||
var url = prefix + '/authDataScope/' + roleId;
|
||||
$.modal.open("分配数据权限", url);
|
||||
}
|
||||
|
||||
/* 角色管理-分配用户 */
|
||||
function authUser(roleId) {
|
||||
var url = prefix + '/authUser/' + roleId;
|
||||
$.modal.openTab("分配用户", url);
|
||||
}
|
||||
|
||||
/* 角色状态显示 */
|
||||
function statusTools(row) {
|
||||
if (row.status == 1) {
|
||||
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.roleId + '\')"></i> ';
|
||||
} else {
|
||||
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.roleId + '\')"></i> ';
|
||||
}
|
||||
}
|
||||
|
||||
/* 角色管理-停用 */
|
||||
function disable(roleId) {
|
||||
$.modal.confirm("确认要停用角色吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "roleId": roleId, "status": 1 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 角色管理启用 */
|
||||
function enable(roleId) {
|
||||
$.modal.confirm("确认要启用角色吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "roleId": roleId, "status": 0 });
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>若依系统首页</title>
|
||||
<title>若依系统首页111111111111</title>
|
||||
<!-- 避免IE使用兼容模式 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link th:href="@{favicon.ico}" rel="shortcut icon"/>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
</div>
|
||||
<a th:href="@{/index}">
|
||||
<li class="logo hidden-xs">
|
||||
<span class="logo-lg">RuoYi</span>
|
||||
<span class="logo-lg">DFM</span>
|
||||
</li>
|
||||
</a>
|
||||
<div class="sidebar-collapse">
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
</a>
|
||||
<div class="pull-left info">
|
||||
<p>[[${user.loginName}]]</p>
|
||||
<p>[[${user.name}]]</p>
|
||||
<a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
|
||||
<a th:href="@{logout}" style="padding-left:5px;"><i class="fa fa-sign-out text-danger"></i> 注销</a>
|
||||
</div>
|
||||
|
|
@ -49,6 +49,14 @@
|
|||
<li>
|
||||
<a class="menuItem" th:href="@{/system/main}"><i class="fa fa-home"></i> <span class="nav-label">首页</span> </a>
|
||||
</li>
|
||||
|
||||
<!--private int id;-->
|
||||
<!--private String url;-->
|
||||
<!--private String menuName;-->
|
||||
<!--private int menuLevel;-->
|
||||
<!--private int parentId;-->
|
||||
|
||||
|
||||
<li th:each="menu : ${menus}">
|
||||
<a th:class="@{${!#strings.isEmpty(menu.url) && menu.url != '#'} ? ${menu.target}}" th:href="@{${#strings.isEmpty(menu.url)} ? |#| : ${menu.url}}">
|
||||
<i class="fa fa-bar-chart-o" th:class="${menu.icon}"></i>
|
||||
|
|
@ -189,7 +197,7 @@
|
|||
<li class="dropdown user-menu">
|
||||
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
|
||||
<img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="user-image">
|
||||
<span class="hidden-xs">[[${#strings.defaultString(user.userName, '-')}]]</span>
|
||||
<span class="hidden-xs">[[${#strings.defaultString(user.name, '-')}]]</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="mt5">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.common.core.controller;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -182,4 +183,25 @@ public class BaseController
|
|||
{
|
||||
return StringUtils.format("redirect:{}", url);
|
||||
}
|
||||
|
||||
|
||||
protected void outputMsg(HttpServletResponse res , String msg) throws Exception
|
||||
{
|
||||
PrintWriter out = res.getWriter();
|
||||
res.setContentType("text/html");
|
||||
res.setCharacterEncoding("utf-8");
|
||||
out.write(msg);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
protected void outputJson(HttpServletResponse res , String msg) throws Exception
|
||||
{
|
||||
PrintWriter out = res.getWriter();
|
||||
res.setContentType("text/json");
|
||||
res.setCharacterEncoding("utf-8");
|
||||
out.write(msg);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.framework.shiro.realm;
|
|||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationInfo;
|
||||
|
|
@ -93,7 +95,7 @@ public class UserRealm extends AuthorizingRealm
|
|||
password = new String(upToken.getPassword());
|
||||
}
|
||||
|
||||
SysUser user = null;
|
||||
UserInfo user = null;
|
||||
try
|
||||
{
|
||||
user = loginService.login(username, password);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.ruoyi.framework.shiro.service;
|
||||
|
||||
import com.ruoyi.dfm.dao.UserDAO;
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import com.ruoyi.dfm.service.UserService;
|
||||
import com.ruoyi.dfm.util.Md5Util;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
@ -32,13 +36,16 @@ public class SysLoginService
|
|||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
// @Autowired
|
||||
// private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
UserDAO userDAO;
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
public SysUser login(String username, String password)
|
||||
public UserInfo login(String username, String password)
|
||||
{
|
||||
// 验证码校验
|
||||
if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA)))
|
||||
|
|
@ -52,24 +59,25 @@ public class SysLoginService
|
|||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
|
||||
throw new UserNotExistsException();
|
||||
}
|
||||
// 密码如果不在指定范围内 错误
|
||||
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||
throw new UserPasswordNotMatchException();
|
||||
}
|
||||
|
||||
// 用户名不在指定范围内 错误
|
||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||
throw new UserPasswordNotMatchException();
|
||||
}
|
||||
// // 密码如果不在指定范围内 错误
|
||||
// if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
// || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||
// throw new UserPasswordNotMatchException();
|
||||
// }
|
||||
//
|
||||
// // 用户名不在指定范围内 错误
|
||||
// if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
// || username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||
// throw new UserPasswordNotMatchException();
|
||||
// }
|
||||
|
||||
// 查询用户信息
|
||||
SysUser user = userService.selectUserByLoginName(username);
|
||||
// SysUser user = userService.get
|
||||
UserInfo userInfo = userDAO.checkUser(username, Md5Util.md5(password));
|
||||
|
||||
/**
|
||||
if (user == null && maybeMobilePhoneNumber(username))
|
||||
|
|
@ -83,29 +91,29 @@ public class SysLoginService
|
|||
}
|
||||
*/
|
||||
|
||||
if (user == null)
|
||||
if (userInfo == null)
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists")));
|
||||
throw new UserNotExistsException();
|
||||
}
|
||||
|
||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.delete")));
|
||||
throw new UserDeleteException();
|
||||
}
|
||||
|
||||
if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark())));
|
||||
throw new UserBlockedException();
|
||||
}
|
||||
|
||||
passwordService.validate(user, password);
|
||||
// if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.delete")));
|
||||
// throw new UserDeleteException();
|
||||
// }
|
||||
//
|
||||
// if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark())));
|
||||
// throw new UserBlockedException();
|
||||
// }
|
||||
//
|
||||
// passwordService.validate(user, password);
|
||||
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||
recordLoginInfo(user);
|
||||
return user;
|
||||
// recordLoginInfo(user);
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -128,13 +136,13 @@ public class SysLoginService
|
|||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* 记录登录信息
|
||||
*/
|
||||
public void recordLoginInfo(SysUser user)
|
||||
{
|
||||
user.setLoginIp(ShiroUtils.getIp());
|
||||
user.setLoginDate(DateUtils.getNowDate());
|
||||
userService.updateUserInfo(user);
|
||||
}
|
||||
// /**
|
||||
// * 记录登录信息
|
||||
// */
|
||||
// public void recordLoginInfo(SysUser user)
|
||||
// {
|
||||
// user.setLoginIp(ShiroUtils.getIp());
|
||||
// user.setLoginDate(DateUtils.getNowDate());
|
||||
// userService.updateUserInfo(user);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,80 +1,80 @@
|
|||
package com.ruoyi.framework.shiro.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.ShiroConstants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.framework.manager.AsyncManager;
|
||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 注册校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class SysRegisterService
|
||||
{
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public String register(SysUser user)
|
||||
{
|
||||
String msg = "", username = user.getLoginName(), password = user.getPassword();
|
||||
|
||||
if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA)))
|
||||
{
|
||||
msg = "验证码错误";
|
||||
}
|
||||
else if (StringUtils.isEmpty(username))
|
||||
{
|
||||
msg = "用户名不能为空";
|
||||
}
|
||||
else if (StringUtils.isEmpty(password))
|
||||
{
|
||||
msg = "用户密码不能为空";
|
||||
}
|
||||
else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
{
|
||||
msg = "密码长度必须在5到20个字符之间";
|
||||
}
|
||||
else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
{
|
||||
msg = "账户长度必须在2到20个字符之间";
|
||||
}
|
||||
else if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(username)))
|
||||
{
|
||||
msg = "保存用户'" + username + "'失败,注册账号已存在";
|
||||
}
|
||||
else
|
||||
{
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
boolean regFlag = userService.registerUser(user);
|
||||
if (!regFlag)
|
||||
{
|
||||
msg = "注册失败,请联系系统管理人员";
|
||||
}
|
||||
else
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success")));
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
//package com.ruoyi.framework.shiro.service;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//import org.springframework.util.StringUtils;
|
||||
//import com.ruoyi.common.constant.Constants;
|
||||
//import com.ruoyi.common.constant.ShiroConstants;
|
||||
//import com.ruoyi.common.constant.UserConstants;
|
||||
//import com.ruoyi.common.utils.MessageUtils;
|
||||
//import com.ruoyi.common.utils.ServletUtils;
|
||||
//import com.ruoyi.framework.manager.AsyncManager;
|
||||
//import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||
//import com.ruoyi.framework.util.ShiroUtils;
|
||||
//import com.ruoyi.system.domain.SysUser;
|
||||
//import com.ruoyi.system.service.ISysUserService;
|
||||
//
|
||||
///**
|
||||
// * 注册校验方法
|
||||
// *
|
||||
// * @author ruoyi
|
||||
// */
|
||||
//@Component
|
||||
//public class SysRegisterService
|
||||
//{
|
||||
// @Autowired
|
||||
// private ISysUserService userService;
|
||||
//
|
||||
// @Autowired
|
||||
// private SysPasswordService passwordService;
|
||||
//
|
||||
// /**
|
||||
// * 注册
|
||||
// */
|
||||
// public String register(SysUser user)
|
||||
// {
|
||||
// String msg = "", username = user.getLoginName(), password = user.getPassword();
|
||||
//
|
||||
// if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA)))
|
||||
// {
|
||||
// msg = "验证码错误";
|
||||
// }
|
||||
// else if (StringUtils.isEmpty(username))
|
||||
// {
|
||||
// msg = "用户名不能为空";
|
||||
// }
|
||||
// else if (StringUtils.isEmpty(password))
|
||||
// {
|
||||
// msg = "用户密码不能为空";
|
||||
// }
|
||||
// else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
// || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
// {
|
||||
// msg = "密码长度必须在5到20个字符之间";
|
||||
// }
|
||||
// else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
// || username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
// {
|
||||
// msg = "账户长度必须在2到20个字符之间";
|
||||
// }
|
||||
// else if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(username)))
|
||||
// {
|
||||
// msg = "保存用户'" + username + "'失败,注册账号已存在";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// user.setSalt(ShiroUtils.randomSalt());
|
||||
// user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
// boolean regFlag = userService.registerUser(user);
|
||||
// if (!regFlag)
|
||||
// {
|
||||
// msg = "注册失败,请联系系统管理人员";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success")));
|
||||
// }
|
||||
// }
|
||||
// return msg;
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.framework.util;
|
||||
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
|
||||
import org.apache.shiro.mgt.RealmSecurityManager;
|
||||
|
|
@ -46,6 +47,18 @@ public class ShiroUtils
|
|||
return user;
|
||||
}
|
||||
|
||||
public static UserInfo getLoginUser()
|
||||
{
|
||||
UserInfo user = null;
|
||||
Object obj = getSubject().getPrincipal();
|
||||
if (StringUtils.isNotNull(obj))
|
||||
{
|
||||
user = new UserInfo();
|
||||
BeanUtils.copyBeanProp(user, obj);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
public static void setSysUser(SysUser user)
|
||||
{
|
||||
Subject subject = getSubject();
|
||||
|
|
|
|||
|
|
@ -11,4 +11,7 @@ public interface UserConstants {
|
|||
|
||||
int USER_STATUS_QIYONG = 0;
|
||||
int USER_STATUS_ZANTING = 1;
|
||||
|
||||
int MENU_LEVEL_0 = 0;
|
||||
int MENU_LEVEL_1 = 1;
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class FileDAO extends JdbcBaseDao{
|
||||
|
||||
|
|
@ -1,22 +1,15 @@
|
|||
package com.ruoyi.dfm.dao;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.ruoyi.framework.config.DruidConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.PreparedStatementCallback;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.jdbc.support.lob.LobHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class MenuDAO extends JdbcBaseDao {
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ import com.ruoyi.dfm.pojo.ProjectQueryBean;
|
|||
import com.ruoyi.dfm.pojo.ProjectStage;
|
||||
import com.ruoyi.dfm.util.PageUtil;
|
||||
import com.ruoyi.dfm.util.TimeUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class ProjectDAO extends JdbcBaseDao
|
||||
{
|
||||
|
|
@ -2,12 +2,9 @@ package com.ruoyi.dfm.dao;
|
|||
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 统计功能DAO
|
||||
|
|
@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class UserDAO extends JdbcBaseDao
|
||||
{
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class DataAnalysisBean {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DataAnalysisBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1499073053303362866L;
|
||||
private int dataId;
|
||||
private int projectId;
|
||||
private String projectName;
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class FileInfo {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1363196522567826008L;
|
||||
private int id;
|
||||
private String fileName;
|
||||
private String relaPath;
|
||||
|
|
@ -1,16 +1,28 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单类
|
||||
* @author Kfighter
|
||||
*
|
||||
*/
|
||||
public class MenuInfo {
|
||||
public class MenuInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1343486203321146073L;
|
||||
private int id;
|
||||
private String url;
|
||||
private String menuName;
|
||||
private int menuLevel;
|
||||
private int parentId;
|
||||
private String icon;
|
||||
private String target;
|
||||
|
||||
|
||||
/** 子菜单 */
|
||||
private List<MenuInfo> children = new ArrayList<>();
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
@ -42,7 +54,28 @@ public class MenuInfo {
|
|||
public void setParentId(int parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List<MenuInfo> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<MenuInfo> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,18 +3,21 @@ package com.ruoyi.dfm.pojo;
|
|||
|
||||
import com.ruoyi.dfm.util.PropertiesUtils;
|
||||
|
||||
public class Page {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Page implements Serializable {
|
||||
private static final long serialVersionUID = -4222587152137966045L;
|
||||
private int currentPage;
|
||||
private int pageSize;
|
||||
private int totalCount;
|
||||
private int totalPage;
|
||||
|
||||
private String orderCase;
|
||||
private static int PAGE_SIZE;
|
||||
private static int PAGE_SIZE = 10;
|
||||
// 获取系统文件根路径
|
||||
static {
|
||||
PAGE_SIZE = Integer.parseInt(PropertiesUtils.getProperties().getProperty("PAGE_SIZE"));
|
||||
}
|
||||
// static {
|
||||
// PAGE_SIZE = Integer.parseInt(PropertiesUtils.getProperties().getProperty("PAGE_SIZE"));
|
||||
// }
|
||||
public Page() {
|
||||
this.currentPage = 1;
|
||||
this.pageSize = PAGE_SIZE;
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class Project {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Project implements Serializable {
|
||||
private static final long serialVersionUID = 6352252350113283745L;
|
||||
private int id;
|
||||
private String projectName;
|
||||
private int version = 1;
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class ProjectQueryBean {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ProjectQueryBean implements Serializable {
|
||||
private static final long serialVersionUID = -599057777600930089L;
|
||||
private String projectName;
|
||||
private String username;
|
||||
private String state;
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class ProjectStage {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ProjectStage implements Serializable {
|
||||
private static final long serialVersionUID = -5089867653922923969L;
|
||||
private int id ;
|
||||
private String stageName;
|
||||
private int stageOrder;
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class Result {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Result implements Serializable {
|
||||
private static final long serialVersionUID = -8219578427197649446L;
|
||||
private boolean success;
|
||||
private String message;
|
||||
private Object data;
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class UserInfo {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UserInfo implements Serializable {
|
||||
private static final long serialVersionUID = -8601310432026069019L;
|
||||
private int id;
|
||||
private String name;
|
||||
private String username;
|
||||
|
|
@ -11,6 +14,16 @@ public class UserInfo {
|
|||
private String ccEmail;
|
||||
private int groupId;
|
||||
private int status;
|
||||
private String avatar;
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
package com.ruoyi.dfm.pojo;
|
||||
|
||||
public class UserQueryBean {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UserQueryBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2612773710283491830L;
|
||||
private String name;
|
||||
private String username;
|
||||
private String department;
|
||||
|
|
@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DataAnalysisService {
|
||||
@Autowired
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.dfm.service;
|
||||
|
||||
import com.ruoyi.dfm.constant.UserConstants;
|
||||
import com.ruoyi.dfm.dao.MenuDAO;
|
||||
import com.ruoyi.dfm.pojo.MenuInfo;
|
||||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class MenuService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MenuService.class);
|
||||
@Autowired
|
||||
private MenuDAO menuDAO;
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID获取该用户拥有的菜单列表
|
||||
* @return
|
||||
*/
|
||||
public List<MenuInfo> getMenuByUser(UserInfo user)
|
||||
{
|
||||
return menuDAO.getByGroup(user.getGroupId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID获取该用户拥有的菜单列表
|
||||
* @return
|
||||
*/
|
||||
public List<MenuInfo> getMenuByGroup(int groupId)
|
||||
{
|
||||
List<MenuInfo> menus = menuDAO.getByGroup(groupId);
|
||||
List<MenuInfo> result = new ArrayList<>();
|
||||
for (MenuInfo menuInfo : menus) {
|
||||
if(UserConstants.MENU_LEVEL_0 == menuInfo.getMenuLevel()) {
|
||||
//第一级菜单
|
||||
result.add(menuInfo);
|
||||
} else {
|
||||
MenuInfo parentMenu = getMenuById(menus, menuInfo.getParentId());
|
||||
if(null == parentMenu){
|
||||
result.add(menuInfo);
|
||||
}
|
||||
parentMenu.getChildren().add(menuInfo);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private MenuInfo getMenuById(List<MenuInfo> menus, int id) {
|
||||
for (MenuInfo menuInfo : menus) {
|
||||
if(menuInfo.getId() == id) {
|
||||
return menuInfo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ import com.ruoyi.dfm.pojo.Project;
|
|||
import com.ruoyi.dfm.pojo.UserInfo;
|
||||
import com.ruoyi.dfm.pojo.UserQueryBean;
|
||||
import com.ruoyi.dfm.util.Md5Util;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 参数配置表 sys_config
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 字典类型表 sys_dict_type
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 系统访问记录表 sys_logininfor
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import javax.validation.constraints.*;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单权限表 sys_menu
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 通知公告表 sys_notice
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 操作日志记录表 oper_log
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 岗位表 sys_post
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 角色表 sys_role
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.annotation.Excel.Type;
|
||||
import com.ruoyi.common.annotation.Excels;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.enums.OnlineStatus;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 当前在线会话 sys_user_online
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.SysDept;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统访问日志情况信息 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单表 数据层
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公告 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位信息 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysRoleDept;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色与部门关联表 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色表 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysRoleMenu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色与菜单关联表 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户表 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 在线用户 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与岗位关联表 数据层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与角色关联表 数据层
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.system.domain.SysDept;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 服务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统访问日志情况信息 服务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 菜单 业务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公告 服务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志 服务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位信息 服务层
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
||||
/**
|
||||
* 角色业务层
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
|
||||
/**
|
||||
* 在线用户 服务层
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户 业务层
|
||||
*
|
||||
|
|
@ -43,6 +44,7 @@ public interface ISysUserService
|
|||
*/
|
||||
public SysUser selectUserByLoginName(String userName);
|
||||
|
||||
|
||||
/**
|
||||
* 通过手机号码查询用户
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
|
@ -12,6 +8,11 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.mapper.SysConfigMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层实现
|
||||
|
|
|
|||
|
|
@ -1,12 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
|
|
@ -16,6 +9,14 @@ import com.ruoyi.system.domain.SysDept;
|
|||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层处理
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
|
@ -17,6 +11,13 @@ import com.ruoyi.system.mapper.SysDictDataMapper;
|
|||
import com.ruoyi.system.mapper.SysDictTypeMapper;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.system.utils.DictUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层处理
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
import com.ruoyi.system.mapper.SysLogininforMapper;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统访问日志情况信息 服务层处理
|
||||
|
|
|
|||
|
|
@ -1,16 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
|
@ -20,6 +9,11 @@ import com.ruoyi.system.domain.SysUser;
|
|||
import com.ruoyi.system.mapper.SysMenuMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 菜单 业务层处理
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.mapper.SysNoticeMapper;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公告 服务层实现
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
import com.ruoyi.system.mapper.SysOperLogMapper;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志 服务层处理
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
|
|
@ -11,6 +8,10 @@ import com.ruoyi.system.domain.SysPost;
|
|||
import com.ruoyi.system.mapper.SysPostMapper;
|
||||
import com.ruoyi.system.mapper.SysUserPostMapper;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 岗位信息 服务层处理
|
||||
|
|
|
|||
|
|
@ -1,13 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
|
@ -23,6 +15,11 @@ import com.ruoyi.system.mapper.SysRoleMapper;
|
|||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 角色 业务层处理
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
import org.apache.shiro.cache.Cache;
|
||||
import org.apache.shiro.cache.ehcache.EhCacheManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.ShiroConstants;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
import com.ruoyi.system.mapper.SysUserOnlineMapper;
|
||||
import com.ruoyi.system.service.ISysUserOnlineService;
|
||||
import org.apache.shiro.cache.Cache;
|
||||
import org.apache.shiro.cache.ehcache.EhCacheManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 在线用户 服务层处理
|
||||
|
|
|
|||
|
|
@ -1,30 +1,24 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.security.Md5Utils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.SysPostMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.SysUserPostMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.system.domain.*;
|
||||
import com.ruoyi.system.mapper.*;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户 业务层处理
|
||||
|
|
@ -54,6 +48,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
JdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
package com.ruoyi.system.utils;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.CacheUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典工具类
|
||||
|
|
|
|||
Loading…
Reference in New Issue