Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
96ba768f
Commit
96ba768f
authored
Feb 21, 2023
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
1268637e
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
66 additions
and
83 deletions
+66
-83
SysUserOnlineController.java
...ruoyi/web/controller/monitor/SysUserOnlineController.java
+3
-12
SysConfigController.java
.../com/ruoyi/web/controller/system/SysConfigController.java
+2
-3
SysDeptController.java
...va/com/ruoyi/web/controller/system/SysDeptController.java
+2
-2
SysDictTypeController.java
...om/ruoyi/web/controller/system/SysDictTypeController.java
+2
-3
SysMenuController.java
...va/com/ruoyi/web/controller/system/SysMenuController.java
+2
-2
SysPostController.java
...va/com/ruoyi/web/controller/system/SysPostController.java
+4
-5
SysProfileController.java
...com/ruoyi/web/controller/system/SysProfileController.java
+2
-5
SysRoleController.java
...va/com/ruoyi/web/controller/system/SysRoleController.java
+4
-5
SysUserController.java
...va/com/ruoyi/web/controller/system/SysUserController.java
+6
-11
UserConstants.java
...rc/main/java/com/ruoyi/common/constant/UserConstants.java
+3
-3
DateUtils.java
...ommon/src/main/java/com/ruoyi/common/utils/DateUtils.java
+7
-3
ExcelUtil.java
...n/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+2
-2
Seq.java
...common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java
+1
-1
Jvm.java
.../main/java/com/ruoyi/framework/web/domain/server/Jvm.java
+1
-1
SysRegisterService.java
...a/com/ruoyi/framework/web/service/SysRegisterService.java
+1
-1
ISysConfigService.java
...main/java/com/ruoyi/system/service/ISysConfigService.java
+1
-1
ISysDeptService.java
...c/main/java/com/ruoyi/system/service/ISysDeptService.java
+1
-1
ISysDictTypeService.java
...in/java/com/ruoyi/system/service/ISysDictTypeService.java
+1
-1
ISysMenuService.java
...c/main/java/com/ruoyi/system/service/ISysMenuService.java
+1
-1
ISysPostService.java
...c/main/java/com/ruoyi/system/service/ISysPostService.java
+2
-2
ISysRoleService.java
...c/main/java/com/ruoyi/system/service/ISysRoleService.java
+2
-2
ISysUserService.java
...c/main/java/com/ruoyi/system/service/ISysUserService.java
+3
-3
SysConfigServiceImpl.java
...a/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
+1
-1
SysDeptServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+1
-1
SysDictTypeServiceImpl.java
...com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
+1
-1
SysMenuServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
+2
-2
SysPostServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysPostServiceImpl.java
+2
-2
SysRoleServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
+2
-2
SysUserServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+3
-3
index.vue
ruoyi-ui/src/views/system/config/index.vue
+1
-1
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
View file @
96ba768f
...
@@ -48,26 +48,17 @@ public class SysUserOnlineController extends BaseController
...
@@ -48,26 +48,17 @@ public class SysUserOnlineController extends BaseController
{
{
LoginUser
user
=
redisCache
.
getCacheObject
(
key
);
LoginUser
user
=
redisCache
.
getCacheObject
(
key
);
if
(
StringUtils
.
isNotEmpty
(
ipaddr
)
&&
StringUtils
.
isNotEmpty
(
userName
))
if
(
StringUtils
.
isNotEmpty
(
ipaddr
)
&&
StringUtils
.
isNotEmpty
(
userName
))
{
if
(
StringUtils
.
equals
(
ipaddr
,
user
.
getIpaddr
())
&&
StringUtils
.
equals
(
userName
,
user
.
getUsername
()))
{
{
userOnlineList
.
add
(
userOnlineService
.
selectOnlineByInfo
(
ipaddr
,
userName
,
user
));
userOnlineList
.
add
(
userOnlineService
.
selectOnlineByInfo
(
ipaddr
,
userName
,
user
));
}
}
}
else
if
(
StringUtils
.
isNotEmpty
(
ipaddr
))
else
if
(
StringUtils
.
isNotEmpty
(
ipaddr
))
{
if
(
StringUtils
.
equals
(
ipaddr
,
user
.
getIpaddr
()))
{
{
userOnlineList
.
add
(
userOnlineService
.
selectOnlineByIpaddr
(
ipaddr
,
user
));
userOnlineList
.
add
(
userOnlineService
.
selectOnlineByIpaddr
(
ipaddr
,
user
));
}
}
}
else
if
(
StringUtils
.
isNotEmpty
(
userName
)
&&
StringUtils
.
isNotNull
(
user
.
getUser
()))
else
if
(
StringUtils
.
isNotEmpty
(
userName
)
&&
StringUtils
.
isNotNull
(
user
.
getUser
()))
{
if
(
StringUtils
.
equals
(
userName
,
user
.
getUsername
()))
{
{
userOnlineList
.
add
(
userOnlineService
.
selectOnlineByUserName
(
userName
,
user
));
userOnlineList
.
add
(
userOnlineService
.
selectOnlineByUserName
(
userName
,
user
));
}
}
}
else
else
{
{
userOnlineList
.
add
(
userOnlineService
.
loginUserToUserOnline
(
user
));
userOnlineList
.
add
(
userOnlineService
.
loginUserToUserOnline
(
user
));
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
View file @
96ba768f
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.core.page.TableDataInfo
;
...
@@ -84,7 +83,7 @@ public class SysConfigController extends BaseController
...
@@ -84,7 +83,7 @@ public class SysConfigController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysConfig
config
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysConfig
config
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
configService
.
checkConfigKeyUnique
(
config
)
))
if
(
!
configService
.
checkConfigKeyUnique
(
config
))
{
{
return
error
(
"新增参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
return
error
(
"新增参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
}
}
...
@@ -100,7 +99,7 @@ public class SysConfigController extends BaseController
...
@@ -100,7 +99,7 @@ public class SysConfigController extends BaseController
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@Validated
@RequestBody
SysConfig
config
)
public
AjaxResult
edit
(
@Validated
@RequestBody
SysConfig
config
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
configService
.
checkConfigKeyUnique
(
config
)
))
if
(
!
configService
.
checkConfigKeyUnique
(
config
))
{
{
return
error
(
"修改参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
return
error
(
"修改参数'"
+
config
.
getConfigName
()
+
"'失败,参数键名已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
View file @
96ba768f
...
@@ -76,7 +76,7 @@ public class SysDeptController extends BaseController
...
@@ -76,7 +76,7 @@ public class SysDeptController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysDept
dept
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysDept
dept
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
deptService
.
checkDeptNameUnique
(
dept
)
))
if
(
!
deptService
.
checkDeptNameUnique
(
dept
))
{
{
return
error
(
"新增部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
return
error
(
"新增部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
}
}
...
@@ -94,7 +94,7 @@ public class SysDeptController extends BaseController
...
@@ -94,7 +94,7 @@ public class SysDeptController extends BaseController
{
{
Long
deptId
=
dept
.
getDeptId
();
Long
deptId
=
dept
.
getDeptId
();
deptService
.
checkDeptDataScope
(
deptId
);
deptService
.
checkDeptDataScope
(
deptId
);
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
deptService
.
checkDeptNameUnique
(
dept
)
))
if
(
!
deptService
.
checkDeptNameUnique
(
dept
))
{
{
return
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
return
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,部门名称已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
View file @
96ba768f
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysDictType
;
import
com.ruoyi.common.core.domain.entity.SysDictType
;
...
@@ -72,7 +71,7 @@ public class SysDictTypeController extends BaseController
...
@@ -72,7 +71,7 @@ public class SysDictTypeController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysDictType
dict
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysDictType
dict
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
dictTypeService
.
checkDictTypeUnique
(
dict
)
))
if
(
!
dictTypeService
.
checkDictTypeUnique
(
dict
))
{
{
return
error
(
"新增字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
return
error
(
"新增字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
}
}
...
@@ -88,7 +87,7 @@ public class SysDictTypeController extends BaseController
...
@@ -88,7 +87,7 @@ public class SysDictTypeController extends BaseController
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@Validated
@RequestBody
SysDictType
dict
)
public
AjaxResult
edit
(
@Validated
@RequestBody
SysDictType
dict
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
dictTypeService
.
checkDictTypeUnique
(
dict
)
))
if
(
!
dictTypeService
.
checkDictTypeUnique
(
dict
))
{
{
return
error
(
"修改字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
return
error
(
"修改字典'"
+
dict
.
getDictName
()
+
"'失败,字典类型已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
View file @
96ba768f
...
@@ -85,7 +85,7 @@ public class SysMenuController extends BaseController
...
@@ -85,7 +85,7 @@ public class SysMenuController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysMenu
menu
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysMenu
menu
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
menuService
.
checkMenuNameUnique
(
menu
)
))
if
(
!
menuService
.
checkMenuNameUnique
(
menu
))
{
{
return
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
return
error
(
"新增菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
}
}
...
@@ -105,7 +105,7 @@ public class SysMenuController extends BaseController
...
@@ -105,7 +105,7 @@ public class SysMenuController extends BaseController
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@Validated
@RequestBody
SysMenu
menu
)
public
AjaxResult
edit
(
@Validated
@RequestBody
SysMenu
menu
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
menuService
.
checkMenuNameUnique
(
menu
)
))
if
(
!
menuService
.
checkMenuNameUnique
(
menu
))
{
{
return
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
return
error
(
"修改菜单'"
+
menu
.
getMenuName
()
+
"'失败,菜单名称已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
View file @
96ba768f
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.core.page.TableDataInfo
;
...
@@ -75,11 +74,11 @@ public class SysPostController extends BaseController
...
@@ -75,11 +74,11 @@ public class SysPostController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysPost
post
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysPost
post
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostNameUnique
(
post
)
))
if
(
!
postService
.
checkPostNameUnique
(
post
))
{
{
return
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
return
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
}
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostCodeUnique
(
post
)
))
else
if
(
!
postService
.
checkPostCodeUnique
(
post
))
{
{
return
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
return
error
(
"新增岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
}
}
...
@@ -95,11 +94,11 @@ public class SysPostController extends BaseController
...
@@ -95,11 +94,11 @@ public class SysPostController extends BaseController
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@Validated
@RequestBody
SysPost
post
)
public
AjaxResult
edit
(
@Validated
@RequestBody
SysPost
post
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostNameUnique
(
post
)
))
if
(
!
postService
.
checkPostNameUnique
(
post
))
{
{
return
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
return
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位名称已存在"
);
}
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
postService
.
checkPostCodeUnique
(
post
)
))
else
if
(
!
postService
.
checkPostCodeUnique
(
post
))
{
{
return
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
return
error
(
"修改岗位'"
+
post
.
getPostName
()
+
"'失败,岗位编码已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
View file @
96ba768f
...
@@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.config.RuoYiConfig
;
import
com.ruoyi.common.config.RuoYiConfig
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
...
@@ -63,13 +62,11 @@ public class SysProfileController extends BaseController
...
@@ -63,13 +62,11 @@ public class SysProfileController extends BaseController
LoginUser
loginUser
=
getLoginUser
();
LoginUser
loginUser
=
getLoginUser
();
SysUser
sysUser
=
loginUser
.
getUser
();
SysUser
sysUser
=
loginUser
.
getUser
();
user
.
setUserName
(
sysUser
.
getUserName
());
user
.
setUserName
(
sysUser
.
getUserName
());
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
&&
!
userService
.
checkPhoneUnique
(
user
))
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkPhoneUnique
(
user
)))
{
{
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
}
}
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
&&
!
userService
.
checkEmailUnique
(
user
))
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkEmailUnique
(
user
)))
{
{
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
View file @
96ba768f
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
...
@@ -94,11 +93,11 @@ public class SysRoleController extends BaseController
...
@@ -94,11 +93,11 @@ public class SysRoleController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysRole
role
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysRole
role
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleNameUnique
(
role
)
))
if
(
!
roleService
.
checkRoleNameUnique
(
role
))
{
{
return
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
return
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
}
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleKeyUnique
(
role
)
))
else
if
(
!
roleService
.
checkRoleKeyUnique
(
role
))
{
{
return
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
return
error
(
"新增角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
}
}
...
@@ -117,11 +116,11 @@ public class SysRoleController extends BaseController
...
@@ -117,11 +116,11 @@ public class SysRoleController extends BaseController
{
{
roleService
.
checkRoleAllowed
(
role
);
roleService
.
checkRoleAllowed
(
role
);
roleService
.
checkRoleDataScope
(
role
.
getRoleId
());
roleService
.
checkRoleDataScope
(
role
.
getRoleId
());
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleNameUnique
(
role
)
))
if
(
!
roleService
.
checkRoleNameUnique
(
role
))
{
{
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色名称已存在"
);
}
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
roleService
.
checkRoleKeyUnique
(
role
)
))
else
if
(
!
roleService
.
checkRoleKeyUnique
(
role
))
{
{
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
return
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,角色权限已存在"
);
}
}
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
View file @
96ba768f
...
@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
...
@@ -125,17 +124,15 @@ public class SysUserController extends BaseController
...
@@ -125,17 +124,15 @@ public class SysUserController extends BaseController
@PostMapping
@PostMapping
public
AjaxResult
add
(
@Validated
@RequestBody
SysUser
user
)
public
AjaxResult
add
(
@Validated
@RequestBody
SysUser
user
)
{
{
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkUserNameUnique
(
user
)
))
if
(
!
userService
.
checkUserNameUnique
(
user
))
{
{
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
}
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
&&
!
userService
.
checkPhoneUnique
(
user
))
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkPhoneUnique
(
user
)))
{
{
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
}
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
&&
!
userService
.
checkEmailUnique
(
user
))
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkEmailUnique
(
user
)))
{
{
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
return
error
(
"新增用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
}
}
...
@@ -154,17 +151,15 @@ public class SysUserController extends BaseController
...
@@ -154,17 +151,15 @@ public class SysUserController extends BaseController
{
{
userService
.
checkUserAllowed
(
user
);
userService
.
checkUserAllowed
(
user
);
userService
.
checkUserDataScope
(
user
.
getUserId
());
userService
.
checkUserDataScope
(
user
.
getUserId
());
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkUserNameUnique
(
user
)
))
if
(
!
userService
.
checkUserNameUnique
(
user
))
{
{
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,登录账号已存在"
);
}
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getPhonenumber
())
&&
!
userService
.
checkPhoneUnique
(
user
))
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkPhoneUnique
(
user
)))
{
{
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,手机号码已存在"
);
}
}
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
else
if
(
StringUtils
.
isNotEmpty
(
user
.
getEmail
())
&&
!
userService
.
checkEmailUnique
(
user
))
&&
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkEmailUnique
(
user
)))
{
{
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
return
error
(
"修改用户'"
+
user
.
getUserName
()
+
"'失败,邮箱账号已存在"
);
}
}
...
...
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
View file @
96ba768f
...
@@ -60,9 +60,9 @@ public class UserConstants
...
@@ -60,9 +60,9 @@ public class UserConstants
/** InnerLink组件标识 */
/** InnerLink组件标识 */
public
final
static
String
INNER_LINK
=
"InnerLink"
;
public
final
static
String
INNER_LINK
=
"InnerLink"
;
/** 校验
返回结果码
*/
/** 校验
是否唯一的返回标识
*/
public
final
static
String
UNIQUE
=
"0"
;
public
final
static
boolean
UNIQUE
=
true
;
public
final
static
String
NOT_UNIQUE
=
"1"
;
public
final
static
boolean
NOT_UNIQUE
=
false
;
/**
/**
* 用户名长度限制
* 用户名长度限制
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
View file @
96ba768f
...
@@ -145,16 +145,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
...
@@ -145,16 +145,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
}
}
/**
/**
* 计算两个时间差
* 计算时间差(单位:分钟)
*
* @param endTime 最后时间
* @param startTime 开始时间
* @return 时间差(天/小时/分钟)
*/
*/
public
static
String
getDatePoor
(
Date
endDate
,
Date
nowDat
e
)
public
static
String
timeDistance
(
Date
endDate
,
Date
startTim
e
)
{
{
long
nd
=
1000
*
24
*
60
*
60
;
long
nd
=
1000
*
24
*
60
*
60
;
long
nh
=
1000
*
60
*
60
;
long
nh
=
1000
*
60
*
60
;
long
nm
=
1000
*
60
;
long
nm
=
1000
*
60
;
// long ns = 1000;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
// 获得两个时间的毫秒时间差异
long
diff
=
endDate
.
getTime
()
-
nowDat
e
.
getTime
();
long
diff
=
endDate
.
getTime
()
-
startTim
e
.
getTime
();
// 计算差多少天
// 计算差多少天
long
day
=
diff
/
nd
;
long
day
=
diff
/
nd
;
// 计算差多少小时
// 计算差多少小时
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
View file @
96ba768f
...
@@ -1321,7 +1321,7 @@ public class ExcelUtil<T>
...
@@ -1321,7 +1321,7 @@ public class ExcelUtil<T>
*/
*/
public
String
encodingFilename
(
String
filename
)
public
String
encodingFilename
(
String
filename
)
{
{
filename
=
UUID
.
randomUUID
()
.
toString
()
+
"_"
+
filename
+
".xlsx"
;
filename
=
UUID
.
randomUUID
()
+
"_"
+
filename
+
".xlsx"
;
return
filename
;
return
filename
;
}
}
...
@@ -1598,7 +1598,7 @@ public class ExcelUtil<T>
...
@@ -1598,7 +1598,7 @@ public class ExcelUtil<T>
HSSFPicture
pic
=
(
HSSFPicture
)
shape
;
HSSFPicture
pic
=
(
HSSFPicture
)
shape
;
int
pictureIndex
=
pic
.
getPictureIndex
()
-
1
;
int
pictureIndex
=
pic
.
getPictureIndex
()
-
1
;
HSSFPictureData
picData
=
pictures
.
get
(
pictureIndex
);
HSSFPictureData
picData
=
pictures
.
get
(
pictureIndex
);
String
picIndex
=
String
.
valueOf
(
anchor
.
getRow1
())
+
"_"
+
String
.
valueOf
(
anchor
.
getCol1
()
);
String
picIndex
=
anchor
.
getRow1
()
+
"_"
+
anchor
.
getCol1
(
);
sheetIndexPicMap
.
put
(
picIndex
,
picData
);
sheetIndexPicMap
.
put
(
picIndex
,
picData
);
}
}
}
}
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java
View file @
96ba768f
...
@@ -22,7 +22,7 @@ public class Seq
...
@@ -22,7 +22,7 @@ public class Seq
private
static
AtomicInteger
uploadSeq
=
new
AtomicInteger
(
1
);
private
static
AtomicInteger
uploadSeq
=
new
AtomicInteger
(
1
);
// 机器标识
// 机器标识
private
static
String
machineCode
=
"A"
;
private
static
final
String
machineCode
=
"A"
;
/**
/**
* 获取通用序列号
* 获取通用序列号
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java
View file @
96ba768f
...
@@ -117,7 +117,7 @@ public class Jvm
...
@@ -117,7 +117,7 @@ public class Jvm
*/
*/
public
String
getRunTime
()
public
String
getRunTime
()
{
{
return
DateUtils
.
getDatePoor
(
DateUtils
.
getNowDate
(),
DateUtils
.
getServerStartDate
());
return
DateUtils
.
timeDistance
(
DateUtils
.
getNowDate
(),
DateUtils
.
getServerStartDate
());
}
}
/**
/**
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
View file @
96ba768f
...
@@ -69,7 +69,7 @@ public class SysRegisterService
...
@@ -69,7 +69,7 @@ public class SysRegisterService
{
{
msg
=
"密码长度必须在5到20个字符之间"
;
msg
=
"密码长度必须在5到20个字符之间"
;
}
}
else
if
(
UserConstants
.
NOT_UNIQUE
.
equals
(
userService
.
checkUserNameUnique
(
sysUser
)
))
else
if
(
!
userService
.
checkUserNameUnique
(
sysUser
))
{
{
msg
=
"保存用户'"
+
username
+
"'失败,注册账号已存在"
;
msg
=
"保存用户'"
+
username
+
"'失败,注册账号已存在"
;
}
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java
View file @
96ba768f
...
@@ -85,5 +85,5 @@ public interface ISysConfigService
...
@@ -85,5 +85,5 @@ public interface ISysConfigService
* @param config 参数信息
* @param config 参数信息
* @return 结果
* @return 结果
*/
*/
public
String
checkConfigKeyUnique
(
SysConfig
config
);
public
boolean
checkConfigKeyUnique
(
SysConfig
config
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
View file @
96ba768f
...
@@ -89,7 +89,7 @@ public interface ISysDeptService
...
@@ -89,7 +89,7 @@ public interface ISysDeptService
* @param dept 部门信息
* @param dept 部门信息
* @return 结果
* @return 结果
*/
*/
public
String
checkDeptNameUnique
(
SysDept
dept
);
public
boolean
checkDeptNameUnique
(
SysDept
dept
);
/**
/**
* 校验部门是否有数据权限
* 校验部门是否有数据权限
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
View file @
96ba768f
...
@@ -94,5 +94,5 @@ public interface ISysDictTypeService
...
@@ -94,5 +94,5 @@ public interface ISysDictTypeService
* @param dictType 字典类型
* @param dictType 字典类型
* @return 结果
* @return 结果
*/
*/
public
String
checkDictTypeUnique
(
SysDictType
dictType
);
public
boolean
checkDictTypeUnique
(
SysDictType
dictType
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
View file @
96ba768f
...
@@ -140,5 +140,5 @@ public interface ISysMenuService
...
@@ -140,5 +140,5 @@ public interface ISysMenuService
* @param menu 菜单信息
* @param menu 菜单信息
* @return 结果
* @return 结果
*/
*/
public
String
checkMenuNameUnique
(
SysMenu
menu
);
public
boolean
checkMenuNameUnique
(
SysMenu
menu
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
View file @
96ba768f
...
@@ -47,7 +47,7 @@ public interface ISysPostService
...
@@ -47,7 +47,7 @@ public interface ISysPostService
* @param post 岗位信息
* @param post 岗位信息
* @return 结果
* @return 结果
*/
*/
public
String
checkPostNameUnique
(
SysPost
post
);
public
boolean
checkPostNameUnique
(
SysPost
post
);
/**
/**
* 校验岗位编码
* 校验岗位编码
...
@@ -55,7 +55,7 @@ public interface ISysPostService
...
@@ -55,7 +55,7 @@ public interface ISysPostService
* @param post 岗位信息
* @param post 岗位信息
* @return 结果
* @return 结果
*/
*/
public
String
checkPostCodeUnique
(
SysPost
post
);
public
boolean
checkPostCodeUnique
(
SysPost
post
);
/**
/**
* 通过岗位ID查询岗位使用数量
* 通过岗位ID查询岗位使用数量
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
View file @
96ba768f
...
@@ -65,7 +65,7 @@ public interface ISysRoleService
...
@@ -65,7 +65,7 @@ public interface ISysRoleService
* @param role 角色信息
* @param role 角色信息
* @return 结果
* @return 结果
*/
*/
public
String
checkRoleNameUnique
(
SysRole
role
);
public
boolean
checkRoleNameUnique
(
SysRole
role
);
/**
/**
* 校验角色权限是否唯一
* 校验角色权限是否唯一
...
@@ -73,7 +73,7 @@ public interface ISysRoleService
...
@@ -73,7 +73,7 @@ public interface ISysRoleService
* @param role 角色信息
* @param role 角色信息
* @return 结果
* @return 结果
*/
*/
public
String
checkRoleKeyUnique
(
SysRole
role
);
public
boolean
checkRoleKeyUnique
(
SysRole
role
);
/**
/**
* 校验角色是否允许操作
* 校验角色是否允许操作
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
View file @
96ba768f
...
@@ -72,7 +72,7 @@ public interface ISysUserService
...
@@ -72,7 +72,7 @@ public interface ISysUserService
* @param user 用户信息
* @param user 用户信息
* @return 结果
* @return 结果
*/
*/
public
String
checkUserNameUnique
(
SysUser
user
);
public
boolean
checkUserNameUnique
(
SysUser
user
);
/**
/**
* 校验手机号码是否唯一
* 校验手机号码是否唯一
...
@@ -80,7 +80,7 @@ public interface ISysUserService
...
@@ -80,7 +80,7 @@ public interface ISysUserService
* @param user 用户信息
* @param user 用户信息
* @return 结果
* @return 结果
*/
*/
public
String
checkPhoneUnique
(
SysUser
user
);
public
boolean
checkPhoneUnique
(
SysUser
user
);
/**
/**
* 校验email是否唯一
* 校验email是否唯一
...
@@ -88,7 +88,7 @@ public interface ISysUserService
...
@@ -88,7 +88,7 @@ public interface ISysUserService
* @param user 用户信息
* @param user 用户信息
* @return 结果
* @return 结果
*/
*/
public
String
checkEmailUnique
(
SysUser
user
);
public
boolean
checkEmailUnique
(
SysUser
user
);
/**
/**
* 校验用户是否允许操作
* 校验用户是否允许操作
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
View file @
96ba768f
...
@@ -208,7 +208,7 @@ public class SysConfigServiceImpl implements ISysConfigService
...
@@ -208,7 +208,7 @@ public class SysConfigServiceImpl implements ISysConfigService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkConfigKeyUnique
(
SysConfig
config
)
public
boolean
checkConfigKeyUnique
(
SysConfig
config
)
{
{
Long
configId
=
StringUtils
.
isNull
(
config
.
getConfigId
())
?
-
1L
:
config
.
getConfigId
();
Long
configId
=
StringUtils
.
isNull
(
config
.
getConfigId
())
?
-
1L
:
config
.
getConfigId
();
SysConfig
info
=
configMapper
.
checkConfigKeyUnique
(
config
.
getConfigKey
());
SysConfig
info
=
configMapper
.
checkConfigKeyUnique
(
config
.
getConfigKey
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
View file @
96ba768f
...
@@ -171,7 +171,7 @@ public class SysDeptServiceImpl implements ISysDeptService
...
@@ -171,7 +171,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkDeptNameUnique
(
SysDept
dept
)
public
boolean
checkDeptNameUnique
(
SysDept
dept
)
{
{
Long
deptId
=
StringUtils
.
isNull
(
dept
.
getDeptId
())
?
-
1L
:
dept
.
getDeptId
();
Long
deptId
=
StringUtils
.
isNull
(
dept
.
getDeptId
())
?
-
1L
:
dept
.
getDeptId
();
SysDept
info
=
deptMapper
.
checkDeptNameUnique
(
dept
.
getDeptName
(),
dept
.
getParentId
());
SysDept
info
=
deptMapper
.
checkDeptNameUnique
(
dept
.
getDeptName
(),
dept
.
getParentId
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
View file @
96ba768f
...
@@ -210,7 +210,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
...
@@ -210,7 +210,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkDictTypeUnique
(
SysDictType
dict
)
public
boolean
checkDictTypeUnique
(
SysDictType
dict
)
{
{
Long
dictId
=
StringUtils
.
isNull
(
dict
.
getDictId
())
?
-
1L
:
dict
.
getDictId
();
Long
dictId
=
StringUtils
.
isNull
(
dict
.
getDictId
())
?
-
1L
:
dict
.
getDictId
();
SysDictType
dictType
=
dictTypeMapper
.
checkDictTypeUnique
(
dict
.
getDictType
());
SysDictType
dictType
=
dictTypeMapper
.
checkDictTypeUnique
(
dict
.
getDictType
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
View file @
96ba768f
...
@@ -175,7 +175,7 @@ public class SysMenuServiceImpl implements ISysMenuService
...
@@ -175,7 +175,7 @@ public class SysMenuServiceImpl implements ISysMenuService
router
.
setQuery
(
menu
.
getQuery
());
router
.
setQuery
(
menu
.
getQuery
());
router
.
setMeta
(
new
MetaVo
(
menu
.
getMenuName
(),
menu
.
getIcon
(),
StringUtils
.
equals
(
"1"
,
menu
.
getIsCache
()),
menu
.
getPath
()));
router
.
setMeta
(
new
MetaVo
(
menu
.
getMenuName
(),
menu
.
getIcon
(),
StringUtils
.
equals
(
"1"
,
menu
.
getIsCache
()),
menu
.
getPath
()));
List
<
SysMenu
>
cMenus
=
menu
.
getChildren
();
List
<
SysMenu
>
cMenus
=
menu
.
getChildren
();
if
(
!
cMenus
.
isEmpty
()
&&
cMenus
.
size
()
>
0
&&
UserConstants
.
TYPE_DIR
.
equals
(
menu
.
getMenuType
()))
if
(
StringUtils
.
isNotEmpty
(
cMenus
)
&&
UserConstants
.
TYPE_DIR
.
equals
(
menu
.
getMenuType
()))
{
{
router
.
setAlwaysShow
(
true
);
router
.
setAlwaysShow
(
true
);
router
.
setRedirect
(
"noRedirect"
);
router
.
setRedirect
(
"noRedirect"
);
...
@@ -335,7 +335,7 @@ public class SysMenuServiceImpl implements ISysMenuService
...
@@ -335,7 +335,7 @@ public class SysMenuServiceImpl implements ISysMenuService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkMenuNameUnique
(
SysMenu
menu
)
public
boolean
checkMenuNameUnique
(
SysMenu
menu
)
{
{
Long
menuId
=
StringUtils
.
isNull
(
menu
.
getMenuId
())
?
-
1L
:
menu
.
getMenuId
();
Long
menuId
=
StringUtils
.
isNull
(
menu
.
getMenuId
())
?
-
1L
:
menu
.
getMenuId
();
SysMenu
info
=
menuMapper
.
checkMenuNameUnique
(
menu
.
getMenuName
(),
menu
.
getParentId
());
SysMenu
info
=
menuMapper
.
checkMenuNameUnique
(
menu
.
getMenuName
(),
menu
.
getParentId
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
View file @
96ba768f
...
@@ -79,7 +79,7 @@ public class SysPostServiceImpl implements ISysPostService
...
@@ -79,7 +79,7 @@ public class SysPostServiceImpl implements ISysPostService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkPostNameUnique
(
SysPost
post
)
public
boolean
checkPostNameUnique
(
SysPost
post
)
{
{
Long
postId
=
StringUtils
.
isNull
(
post
.
getPostId
())
?
-
1L
:
post
.
getPostId
();
Long
postId
=
StringUtils
.
isNull
(
post
.
getPostId
())
?
-
1L
:
post
.
getPostId
();
SysPost
info
=
postMapper
.
checkPostNameUnique
(
post
.
getPostName
());
SysPost
info
=
postMapper
.
checkPostNameUnique
(
post
.
getPostName
());
...
@@ -97,7 +97,7 @@ public class SysPostServiceImpl implements ISysPostService
...
@@ -97,7 +97,7 @@ public class SysPostServiceImpl implements ISysPostService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkPostCodeUnique
(
SysPost
post
)
public
boolean
checkPostCodeUnique
(
SysPost
post
)
{
{
Long
postId
=
StringUtils
.
isNull
(
post
.
getPostId
())
?
-
1L
:
post
.
getPostId
();
Long
postId
=
StringUtils
.
isNull
(
post
.
getPostId
())
?
-
1L
:
post
.
getPostId
();
SysPost
info
=
postMapper
.
checkPostCodeUnique
(
post
.
getPostCode
());
SysPost
info
=
postMapper
.
checkPostCodeUnique
(
post
.
getPostCode
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
View file @
96ba768f
...
@@ -146,7 +146,7 @@ public class SysRoleServiceImpl implements ISysRoleService
...
@@ -146,7 +146,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkRoleNameUnique
(
SysRole
role
)
public
boolean
checkRoleNameUnique
(
SysRole
role
)
{
{
Long
roleId
=
StringUtils
.
isNull
(
role
.
getRoleId
())
?
-
1L
:
role
.
getRoleId
();
Long
roleId
=
StringUtils
.
isNull
(
role
.
getRoleId
())
?
-
1L
:
role
.
getRoleId
();
SysRole
info
=
roleMapper
.
checkRoleNameUnique
(
role
.
getRoleName
());
SysRole
info
=
roleMapper
.
checkRoleNameUnique
(
role
.
getRoleName
());
...
@@ -164,7 +164,7 @@ public class SysRoleServiceImpl implements ISysRoleService
...
@@ -164,7 +164,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkRoleKeyUnique
(
SysRole
role
)
public
boolean
checkRoleKeyUnique
(
SysRole
role
)
{
{
Long
roleId
=
StringUtils
.
isNull
(
role
.
getRoleId
())
?
-
1L
:
role
.
getRoleId
();
Long
roleId
=
StringUtils
.
isNull
(
role
.
getRoleId
())
?
-
1L
:
role
.
getRoleId
();
SysRole
info
=
roleMapper
.
checkRoleKeyUnique
(
role
.
getRoleKey
());
SysRole
info
=
roleMapper
.
checkRoleKeyUnique
(
role
.
getRoleKey
());
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
View file @
96ba768f
...
@@ -165,7 +165,7 @@ public class SysUserServiceImpl implements ISysUserService
...
@@ -165,7 +165,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
String
checkUserNameUnique
(
SysUser
user
)
public
boolean
checkUserNameUnique
(
SysUser
user
)
{
{
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
SysUser
info
=
userMapper
.
checkUserNameUnique
(
user
.
getUserName
());
SysUser
info
=
userMapper
.
checkUserNameUnique
(
user
.
getUserName
());
...
@@ -183,7 +183,7 @@ public class SysUserServiceImpl implements ISysUserService
...
@@ -183,7 +183,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return
* @return
*/
*/
@Override
@Override
public
String
checkPhoneUnique
(
SysUser
user
)
public
boolean
checkPhoneUnique
(
SysUser
user
)
{
{
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
SysUser
info
=
userMapper
.
checkPhoneUnique
(
user
.
getPhonenumber
());
SysUser
info
=
userMapper
.
checkPhoneUnique
(
user
.
getPhonenumber
());
...
@@ -201,7 +201,7 @@ public class SysUserServiceImpl implements ISysUserService
...
@@ -201,7 +201,7 @@ public class SysUserServiceImpl implements ISysUserService
* @return
* @return
*/
*/
@Override
@Override
public
String
checkEmailUnique
(
SysUser
user
)
public
boolean
checkEmailUnique
(
SysUser
user
)
{
{
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
Long
userId
=
StringUtils
.
isNull
(
user
.
getUserId
())
?
-
1L
:
user
.
getUserId
();
SysUser
info
=
userMapper
.
checkEmailUnique
(
user
.
getEmail
());
SysUser
info
=
userMapper
.
checkEmailUnique
(
user
.
getEmail
());
...
...
ruoyi-ui/src/views/system/config/index.vue
View file @
96ba768f
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
<el-table-column
label=
"参数主键"
align=
"center"
prop=
"configId"
/>
<el-table-column
label=
"参数主键"
align=
"center"
prop=
"configId"
/>
<el-table-column
label=
"参数名称"
align=
"center"
prop=
"configName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"参数名称"
align=
"center"
prop=
"configName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"参数键名"
align=
"center"
prop=
"configKey"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"参数键名"
align=
"center"
prop=
"configKey"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"参数键值"
align=
"center"
prop=
"configValue"
/>
<el-table-column
label=
"参数键值"
align=
"center"
prop=
"configValue"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"系统内置"
align=
"center"
prop=
"configType"
>
<el-table-column
label=
"系统内置"
align=
"center"
prop=
"configType"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.sys_yes_no"
:value=
"scope.row.configType"
/>
<dict-tag
:options=
"dict.type.sys_yes_no"
:value=
"scope.row.configType"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment