rouyi,second commit
This commit is contained in:
parent
e02b08aff1
commit
6dcb1dc5ec
|
|
@ -70,4 +70,4 @@
|
|||
|
||||
## 若依交流群
|
||||
|
||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) 点击按钮入群。
|
||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) 点击按钮入群。
|
||||
2
pom.xml
2
pom.xml
|
|
@ -33,7 +33,7 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.0.5.RELEASE</version>
|
||||
<version>2.1.1.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -5,13 +5,17 @@ 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.*;
|
||||
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 com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.quartz.domain.SysJob;
|
||||
import com.ruoyi.quartz.service.ISysJobService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
@ -21,19 +25,14 @@ import com.ruoyi.framework.web.base.BaseController;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
//@Controller
|
||||
@RestController
|
||||
@Controller
|
||||
@RequestMapping("/monitor/job")
|
||||
public class SysJobController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/job";
|
||||
|
||||
|
||||
private final ISysJobService jobService;
|
||||
|
||||
public SysJobController(ISysJobService jobService) {
|
||||
this.jobService = jobService;
|
||||
}
|
||||
@Autowired
|
||||
private ISysJobService jobService;
|
||||
|
||||
@RequiresPermissions("monitor:job:view")
|
||||
@GetMapping()
|
||||
|
|
@ -87,7 +86,6 @@ public class SysJobController extends BaseController
|
|||
{
|
||||
mmap.put("name", "job");
|
||||
mmap.put("job", jobService.selectJobById(jobId));
|
||||
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.quartz.domain.SysJobLog;
|
||||
import com.ruoyi.quartz.service.ISysJobLogService;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ import com.ruoyi.common.annotation.Log;
|
|||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.enums.OnlineStatus;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.framework.shiro.session.OnlineSession;
|
||||
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
import com.ruoyi.system.service.impl.SysUserOnlineServiceImpl;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.support.Convert;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.generator.domain.TableInfo;
|
||||
import com.ruoyi.generator.service.IGenService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.jdbc.Driver
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: root
|
||||
password: password
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ server:
|
|||
port: 80
|
||||
servlet:
|
||||
# 项目contextPath
|
||||
context-path: /ruoyi
|
||||
context-path: /
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ehcache name="ruoyi">
|
||||
<ehcache name="ruoyi" updateCheck="false">
|
||||
|
||||
<!-- 磁盘缓存位置 -->
|
||||
<diskStore path="java.io.tmpdir"/>
|
||||
|
|
|
|||
|
|
@ -84,3 +84,65 @@ body.signin {
|
|||
width:auto
|
||||
}
|
||||
}
|
||||
/*
|
||||
登录界面check样式
|
||||
*/
|
||||
.checkbox-custom {
|
||||
position: relative;
|
||||
padding: 0 15px 0 25px;
|
||||
margin-bottom: 7px;
|
||||
margin-top: 0;
|
||||
display: inline-block;
|
||||
}
|
||||
/*
|
||||
将初始的checkbox的样式改变
|
||||
*/
|
||||
.checkbox-custom input[type="checkbox"] {
|
||||
opacity: 0;/*将初始的checkbox隐藏起来*/
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
z-index: 2;
|
||||
margin: -6px 0 0 0;
|
||||
top: 50%;
|
||||
left: 3px;
|
||||
}
|
||||
/*
|
||||
设计新的checkbox,位置
|
||||
*/
|
||||
.checkbox-custom label:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
margin-top: -9px;
|
||||
width: 18px;
|
||||
height: 17px;
|
||||
display: inline-block;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #bbb;
|
||||
background: #fff;
|
||||
}
|
||||
/*
|
||||
点击初始的checkbox,将新的checkbox关联起来
|
||||
*/
|
||||
.checkbox-custom input[type="checkbox"]:checked +label:after {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
font-family: 'Glyphicons Halflings';
|
||||
content: "\e013";
|
||||
top: 42%;
|
||||
left: 3px;
|
||||
margin-top: -5px;
|
||||
font-size: 11px;
|
||||
line-height: 1;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: #333;
|
||||
}
|
||||
.checkbox-custom label {
|
||||
cursor: pointer;
|
||||
line-height: 1.2;
|
||||
font-weight: normal;/*改变了rememberme的字体*/
|
||||
margin-bottom: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0 0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}
|
||||
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;margin-top:0;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
$(function() {
|
||||
validateRule();
|
||||
$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green-login"});
|
||||
$('.imgcode').click(function() {
|
||||
var url = ctx + "captcha/captchaImage?type=" + captchaType + "&s=" + Math.random();
|
||||
$(".imgcode").attr("src", url);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
<link href="../static/css/font-awesome.min.css" th:href="@{css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.css" th:href="@{css/style.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/login.min.css" th:href="@{css/login.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=3.1.0}" rel="stylesheet"/>
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="refresh" content="0;ie.html" />
|
||||
|
|
@ -49,8 +48,8 @@
|
|||
<h4 class="no-margins">登录:</h4>
|
||||
<p class="m-t-md">你若不离不弃,我必生死相依</p>
|
||||
<input type="text" name="username" class="form-control uname" placeholder="用户名" value="admin" />
|
||||
<input type="password" name="password" class="form-control pword m-b" placeholder="密码" value="admin123" />
|
||||
<div class="row" th:if="${captchaEnabled==true}">
|
||||
<input type="password" name="password" class="form-control pword" placeholder="密码" value="admin123" />
|
||||
<div class="row m-t" th:if="${captchaEnabled==true}">
|
||||
<div class="col-xs-6">
|
||||
<input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5">
|
||||
</div>
|
||||
|
|
@ -60,7 +59,9 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<input class="i-checks" type="checkbox" name="rememberme" /> 记住我
|
||||
<div class="checkbox-custom">
|
||||
<input type="checkbox" id="rememberme" name="rememberme"> <label for="rememberme">记住我</label>
|
||||
</div>
|
||||
<button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证登录,请稍后...">登录</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -80,7 +81,6 @@
|
|||
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
|
||||
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ajax/libs/iCheck/icheck.min.js" th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
|
||||
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script src="http://tajs.qq.com/stats?sId=62048022"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=3.1.0}"></script>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
<div class="ibox-content">
|
||||
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
||||
</p>
|
||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <a href="https://jq.qq.com/?_wv=1027&k=5cHeRVW" target="_blank">1679294</a>
|
||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <a href="https://jq.qq.com/?_wv=1027&k=5YW0wjE" target="_blank">1529866</a>
|
||||
</p>
|
||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
|
||||
<a class="btn btn-success" th:onclick="'javascript:$.operate.add(\''+${dict.dictType}+'\')'" shiro:hasPermission="system:dict:add">
|
||||
<a class="btn btn-success" th:onclick="$.operate.add([[${dict.dictType}]])" shiro:hasPermission="system:dict:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:dict:edit">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.common.exception;
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class BusinessException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected final String message;
|
||||
|
||||
public BusinessException(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.ruoyi.common.page;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PageDomain
|
||||
{
|
||||
/** 当前记录起始索引 */
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页显示记录数 */
|
||||
private Integer pageSize;
|
||||
|
||||
/** 排序列 */
|
||||
private String orderByColumn;
|
||||
/** 排序的方向 "desc" 或者 "asc". */
|
||||
|
||||
private String isAsc;
|
||||
|
||||
public String getOrderBy()
|
||||
{
|
||||
if (StringUtils.isEmpty(orderByColumn))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||
}
|
||||
|
||||
public Integer getPageNum()
|
||||
{
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum)
|
||||
{
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize()
|
||||
{
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize)
|
||||
{
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getOrderByColumn()
|
||||
{
|
||||
return orderByColumn;
|
||||
}
|
||||
|
||||
public void setOrderByColumn(String orderByColumn)
|
||||
{
|
||||
this.orderByColumn = orderByColumn;
|
||||
}
|
||||
|
||||
public String getIsAsc()
|
||||
{
|
||||
return isAsc;
|
||||
}
|
||||
|
||||
public void setIsAsc(String isAsc)
|
||||
{
|
||||
this.isAsc = isAsc;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ruoyi.common.page;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 表格分页数据对象
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TableDataInfo implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 总记录数 */
|
||||
private long total;
|
||||
/** 列表数据 */
|
||||
private List<?> rows;
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 表格数据对象
|
||||
*/
|
||||
public TableDataInfo()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param list 列表数据
|
||||
* @param total 总记录数
|
||||
*/
|
||||
public TableDataInfo(List<?> list, int total)
|
||||
{
|
||||
this.rows = list;
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public long getTotal()
|
||||
{
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total)
|
||||
{
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<?> getRows()
|
||||
{
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<?> rows)
|
||||
{
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
|
||||
/**
|
||||
* Excel相关处理
|
||||
|
|
@ -376,7 +377,7 @@ public class ExcelUtil<T>
|
|||
catch (Exception e)
|
||||
{
|
||||
log.error("导出Excel异常{}", e.getMessage());
|
||||
return AjaxResult.error("导出Excel失败,请联系网站管理员!");
|
||||
throw new BusinessException("导出Excel失败,请联系网站管理员!");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,16 +19,27 @@ public class CaptchaConfig
|
|||
{
|
||||
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
|
||||
Properties properties = new Properties();
|
||||
// 是否有边框 默认为true 我们可以自己设置yes,no
|
||||
properties.setProperty("kaptcha.border", "yes");
|
||||
// 边框颜色 默认为Color.BLACK
|
||||
properties.setProperty("kaptcha.border.color", "105,179,90");
|
||||
// 验证码文本字符颜色 默认为Color.BLACK
|
||||
properties.setProperty("kaptcha.textproducer.font.color", "blue");
|
||||
// 验证码图片宽度 默认为200
|
||||
properties.setProperty("kaptcha.image.width", "160");
|
||||
// 验证码图片高度 默认为50
|
||||
properties.setProperty("kaptcha.image.height", "60");
|
||||
properties.setProperty("kaptcha.textproducer.font.size", "28");
|
||||
// 验证码文本字符大小 默认为40
|
||||
properties.setProperty("kaptcha.textproducer.font.size", "30");
|
||||
// KAPTCHA_SESSION_KEY
|
||||
properties.setProperty("kaptcha.session.key", "kaptchaCode");
|
||||
properties.setProperty("kaptcha.textproducer.char.spac", "35");
|
||||
// 验证码文本字符间距 默认为2
|
||||
properties.setProperty("kaptcha.textproducer.char.space", "3");
|
||||
// 验证码文本字符长度 默认为5
|
||||
properties.setProperty("kaptcha.textproducer.char.length", "5");
|
||||
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
|
||||
properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
|
||||
// 验证码噪点颜色 默认为Color.BLACK
|
||||
properties.setProperty("kaptcha.noise.color", "white");
|
||||
Config config = new Config(properties);
|
||||
defaultKaptcha.setConfig(config);
|
||||
|
|
@ -40,19 +51,33 @@ public class CaptchaConfig
|
|||
{
|
||||
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
|
||||
Properties properties = new Properties();
|
||||
// 是否有边框 默认为true 我们可以自己设置yes,no
|
||||
properties.setProperty("kaptcha.border", "yes");
|
||||
// 边框颜色 默认为Color.BLACK
|
||||
properties.setProperty("kaptcha.border.color", "105,179,90");
|
||||
// 验证码文本字符颜色 默认为Color.BLACK
|
||||
properties.setProperty("kaptcha.textproducer.font.color", "blue");
|
||||
// 验证码图片宽度 默认为200
|
||||
properties.setProperty("kaptcha.image.width", "160");
|
||||
// 验证码图片高度 默认为50
|
||||
properties.setProperty("kaptcha.image.height", "60");
|
||||
properties.setProperty("kaptcha.textproducer.font.size", "38");
|
||||
// 验证码文本字符大小 默认为40
|
||||
properties.setProperty("kaptcha.textproducer.font.size", "35");
|
||||
// KAPTCHA_SESSION_KEY
|
||||
properties.setProperty("kaptcha.session.key", "kaptchaCodeMath");
|
||||
// 验证码文本生成器
|
||||
properties.setProperty("kaptcha.textproducer.impl", "com.ruoyi.framework.config.KaptchaTextCreator");
|
||||
properties.setProperty("kaptcha.textproducer.char.spac", "5");
|
||||
// 验证码文本字符间距 默认为2
|
||||
properties.setProperty("kaptcha.textproducer.char.space", "3");
|
||||
// 验证码文本字符长度 默认为5
|
||||
properties.setProperty("kaptcha.textproducer.char.length", "6");
|
||||
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
|
||||
properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
|
||||
// 验证码噪点颜色 默认为Color.BLACK
|
||||
properties.setProperty("kaptcha.noise.color", "white");
|
||||
// 干扰实现类
|
||||
properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise");
|
||||
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
|
||||
properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy");
|
||||
Config config = new Config(properties);
|
||||
defaultKaptcha.setConfig(config);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class OnlineSessionFilter extends AccessControlFilter
|
|||
subject.logout();
|
||||
}
|
||||
saveRequestAndRedirectToLogin(request, response);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// 跳转到登录页
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import com.ruoyi.system.domain.SysUser;
|
|||
*/
|
||||
public class ShiroUtils
|
||||
{
|
||||
public static Subject getSubjct()
|
||||
public static Subject getSubject()
|
||||
{
|
||||
return SecurityUtils.getSubject();
|
||||
}
|
||||
|
|
@ -31,13 +31,13 @@ public class ShiroUtils
|
|||
|
||||
public static void logout()
|
||||
{
|
||||
getSubjct().logout();
|
||||
getSubject().logout();
|
||||
}
|
||||
|
||||
public static SysUser getSysUser()
|
||||
{
|
||||
SysUser user = null;
|
||||
Object obj = getSubjct().getPrincipal();
|
||||
Object obj = getSubject().getPrincipal();
|
||||
if (StringUtils.isNotNull(obj))
|
||||
{
|
||||
user = new SysUser();
|
||||
|
|
@ -48,7 +48,7 @@ public class ShiroUtils
|
|||
|
||||
public static void setSysUser(SysUser user)
|
||||
{
|
||||
Subject subject = getSubjct();
|
||||
Subject subject = getSubject();
|
||||
PrincipalCollection principalCollection = subject.getPrincipals();
|
||||
String realmName = principalCollection.getRealmNames().iterator().next();
|
||||
PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName);
|
||||
|
|
@ -75,12 +75,12 @@ public class ShiroUtils
|
|||
|
||||
public static String getIp()
|
||||
{
|
||||
return getSubjct().getSession().getHost();
|
||||
return getSubject().getSession().getHost();
|
||||
}
|
||||
|
||||
public static String getSessionId()
|
||||
{
|
||||
return String.valueOf(getSubjct().getSession().getId());
|
||||
return String.valueOf(getSubject().getSession().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import org.springframework.web.bind.annotation.InitBinder;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.page.PageDomain;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.page.PageDomain;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.page.TableSupport;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
|
||||
|
|
@ -79,6 +79,17 @@ public class BaseController
|
|||
return rows > 0 ? success() : error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
* @param result 结果
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(boolean result)
|
||||
{
|
||||
return result ? success() : error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
|
|||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.exception.DemoModeException;
|
||||
import com.ruoyi.framework.util.PermissionUtils;
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ import com.ruoyi.framework.util.PermissionUtils;
|
|||
public class DefaultExceptionHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(DefaultExceptionHandler.class);
|
||||
|
||||
|
||||
/**
|
||||
* 权限校验失败
|
||||
*/
|
||||
|
|
@ -59,7 +60,17 @@ public class DefaultExceptionHandler
|
|||
log.error(e.getMessage(), e);
|
||||
return AjaxResult.error("服务器错误,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*/
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public AjaxResult businessException(BusinessException e)
|
||||
{
|
||||
log.error(e.getMessage(), e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 演示模式异常
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.framework.web.page;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.page.PageDomain;
|
||||
import com.ruoyi.framework.util.ServletUtils;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import com.ruoyi.common.enums.BusinessType;
|
|||
import ${package}.domain.${className};
|
||||
import ${package}.service.I${className}Service;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.utils.ExcelUtil;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="jobName != null and jobName != ''">job_name = #{jobName},</if>
|
||||
<if test="jobGroup != null and jobGroup != ''">job_group = #{jobGroup},</if>
|
||||
<if test="methodName != null and methodName != ''">method_name = #{methodName},</if>
|
||||
method_params = #{methodParams},
|
||||
<if test="methodParams != null">method_params = #{methodParams},</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">cron_expression = #{cronExpression},</if>
|
||||
<if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy = #{misfirePolicy},</if>
|
||||
<if test="status !=null">status = #{status},</if>
|
||||
|
|
|
|||
|
|
@ -91,4 +91,11 @@ public interface SysDeptMapper
|
|||
* @return 部门列表
|
||||
*/
|
||||
public List<String> selectRoleDeptTree(Long roleId);
|
||||
|
||||
/**
|
||||
* 修改所在部门的父级部门状态
|
||||
*
|
||||
* @param dept 部门
|
||||
*/
|
||||
public void updateDeptStatus(SysDept dept);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ public interface SysLogininforMapper
|
|||
* 批量删除系统登录日志
|
||||
*
|
||||
* @param ids 需要删除的数据
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteLogininforByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 清空系统登录日志
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public int cleanLogininfor();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysDept;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
|
|
@ -162,6 +163,11 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
public int insertDept(SysDept dept)
|
||||
{
|
||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||
// 如果父节点不为"正常"状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
||||
{
|
||||
throw new BusinessException("部门停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
return deptMapper.insertDept(dept);
|
||||
}
|
||||
|
|
@ -178,11 +184,30 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||
if (StringUtils.isNotNull(info))
|
||||
{
|
||||
String ancestors = info.getAncestors() + "," + dept.getParentId();
|
||||
String ancestors = info.getAncestors() + "," + info.getDeptId();
|
||||
dept.setAncestors(ancestors);
|
||||
updateDeptChildren(dept.getDeptId(), ancestors);
|
||||
}
|
||||
return deptMapper.updateDept(dept);
|
||||
int result = deptMapper.updateDept(dept);
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
||||
{
|
||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
updateParentDeptStatus(dept);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改该部门的父级部门状态
|
||||
*
|
||||
* @param dept 当前部门
|
||||
*/
|
||||
private void updateParentDeptStatus(SysDept dept)
|
||||
{
|
||||
String updateBy = dept.getUpdateBy();
|
||||
dept = deptMapper.selectDeptById(dept.getDeptId());
|
||||
dept.setUpdateBy(updateBy);
|
||||
deptMapper.updateDeptStatus(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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.exception.BusinessException;
|
||||
import com.ruoyi.common.support.Convert;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
|
|
@ -79,7 +80,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictTypeByIds(String ids) throws Exception
|
||||
public int deleteDictTypeByIds(String ids) throws BusinessException
|
||||
{
|
||||
Long[] dictIds = Convert.toLongArray(ids);
|
||||
for (Long dictId : dictIds)
|
||||
|
|
@ -87,7 +88,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
SysDictType dictType = selectDictTypeById(dictId);
|
||||
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
|
||||
{
|
||||
throw new Exception(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||
throw new BusinessException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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.exception.BusinessException;
|
||||
import com.ruoyi.common.support.Convert;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
|
|
@ -92,7 +93,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int deletePostByIds(String ids) throws Exception
|
||||
public int deletePostByIds(String ids) throws BusinessException
|
||||
{
|
||||
Long[] postIds = Convert.toLongArray(ids);
|
||||
for (Long postId : postIds)
|
||||
|
|
@ -100,7 +101,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
SysPost post = selectPostById(postId);
|
||||
if (countUserPostById(postId) > 0)
|
||||
{
|
||||
throw new Exception(String.format("%1$s已分配,不能删除", post.getPostName()));
|
||||
throw new BusinessException(String.format("%1$s已分配,不能删除", post.getPostName()));
|
||||
}
|
||||
}
|
||||
return postMapper.deletePostByIds(postIds);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.support.Convert;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
|
|
@ -141,7 +142,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int deleteRoleByIds(String ids) throws Exception
|
||||
public int deleteRoleByIds(String ids) throws BusinessException
|
||||
{
|
||||
Long[] roleIds = Convert.toLongArray(ids);
|
||||
for (Long roleId : roleIds)
|
||||
|
|
@ -149,7 +150,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
SysRole role = selectRoleById(roleId);
|
||||
if (countUserRoleByRoleId(roleId) > 0)
|
||||
{
|
||||
throw new Exception(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||
throw new BusinessException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||
}
|
||||
}
|
||||
return roleMapper.deleteRoleByIds(roleIds);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.support.Convert;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
|
|
@ -128,14 +129,14 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserByIds(String ids) throws Exception
|
||||
public int deleteUserByIds(String ids) throws BusinessException
|
||||
{
|
||||
Long[] userIds = Convert.toLongArray(ids);
|
||||
for (Long userId : userIds)
|
||||
{
|
||||
if (SysUser.isAdmin(userId))
|
||||
{
|
||||
throw new Exception("不允许删除超级管理员用户");
|
||||
throw new BusinessException("不允许删除超级管理员用户");
|
||||
}
|
||||
}
|
||||
return userMapper.deleteUserByIds(userIds);
|
||||
|
|
|
|||
|
|
@ -136,5 +136,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
<update id="updateDeptStatus" parameterType="SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dept_id in (${ancestors})
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -588,7 +588,7 @@ create table sys_job_log (
|
|||
job_name varchar(64) not null comment '任务名称',
|
||||
job_group varchar(64) not null comment '任务组名',
|
||||
method_name varchar(500) comment '任务方法',
|
||||
method_params varchar(200) default '' comment '方法参数',
|
||||
method_params varchar(50) default null comment '方法参数',
|
||||
job_message varchar(500) comment '日志信息',
|
||||
status char(1) default '0' comment '执行状态(0正常 1失败)',
|
||||
exception_info varchar(2000) default '' comment '异常信息',
|
||||
|
|
|
|||
Loading…
Reference in New Issue