From 96ba768f50bf75bd8de7ee4cd260d3321b37858b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 21 Feb 2023 18:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitor/SysUserOnlineController.java | 15 +++------------ .../controller/system/SysConfigController.java | 5 ++--- .../controller/system/SysDeptController.java | 4 ++-- .../system/SysDictTypeController.java | 5 ++--- .../controller/system/SysMenuController.java | 4 ++-- .../controller/system/SysPostController.java | 9 ++++----- .../controller/system/SysProfileController.java | 7 ++----- .../controller/system/SysRoleController.java | 9 ++++----- .../controller/system/SysUserController.java | 17 ++++++----------- .../ruoyi/common/constant/UserConstants.java | 6 +++--- .../java/com/ruoyi/common/utils/DateUtils.java | 10 +++++++--- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 4 ++-- .../java/com/ruoyi/common/utils/uuid/Seq.java | 2 +- .../ruoyi/framework/web/domain/server/Jvm.java | 2 +- .../web/service/SysRegisterService.java | 2 +- .../ruoyi/system/service/ISysConfigService.java | 2 +- .../ruoyi/system/service/ISysDeptService.java | 2 +- .../system/service/ISysDictTypeService.java | 2 +- .../ruoyi/system/service/ISysMenuService.java | 2 +- .../ruoyi/system/service/ISysPostService.java | 4 ++-- .../ruoyi/system/service/ISysRoleService.java | 4 ++-- .../ruoyi/system/service/ISysUserService.java | 6 +++--- .../service/impl/SysConfigServiceImpl.java | 2 +- .../system/service/impl/SysDeptServiceImpl.java | 2 +- .../service/impl/SysDictTypeServiceImpl.java | 2 +- .../system/service/impl/SysMenuServiceImpl.java | 4 ++-- .../system/service/impl/SysPostServiceImpl.java | 4 ++-- .../system/service/impl/SysRoleServiceImpl.java | 4 ++-- .../system/service/impl/SysUserServiceImpl.java | 6 +++--- ruoyi-ui/src/views/system/config/index.vue | 2 +- 30 files changed, 66 insertions(+), 83 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java index 22e3962c..7c343e21 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java @@ -49,24 +49,15 @@ public class SysUserOnlineController extends BaseController LoginUser user = redisCache.getCacheObject(key); 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)) { - 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())) { - if (StringUtils.equals(userName, user.getUsername())) - { - userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); - } + userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); } else { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index 93275e98..95bcaece 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; @@ -84,7 +83,7 @@ public class SysConfigController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysConfig config) { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + if (!configService.checkConfigKeyUnique(config)) { return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); } @@ -100,7 +99,7 @@ public class SysConfigController extends BaseController @PutMapping public AjaxResult edit(@Validated @RequestBody SysConfig config) { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + if (!configService.checkConfigKeyUnique(config)) { return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index a873066b..4d70b655 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -76,7 +76,7 @@ public class SysDeptController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysDept dept) { - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + if (!deptService.checkDeptNameUnique(dept)) { return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } @@ -94,7 +94,7 @@ public class SysDeptController extends BaseController { Long deptId = dept.getDeptId(); deptService.checkDeptDataScope(deptId); - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + if (!deptService.checkDeptNameUnique(dept)) { return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java index bfd467e2..98088424 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDictType; @@ -72,7 +71,7 @@ public class SysDictTypeController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysDictType dict) { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + if (!dictTypeService.checkDictTypeUnique(dict)) { return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } @@ -88,7 +87,7 @@ public class SysDictTypeController extends BaseController @PutMapping public AjaxResult edit(@Validated @RequestBody SysDictType dict) { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + if (!dictTypeService.checkDictTypeUnique(dict)) { return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index a360512f..eaaebd3e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -85,7 +85,7 @@ public class SysMenuController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysMenu menu) { - if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + if (!menuService.checkMenuNameUnique(menu)) { return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } @@ -105,7 +105,7 @@ public class SysMenuController extends BaseController @PutMapping public AjaxResult edit(@Validated @RequestBody SysMenu menu) { - if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + if (!menuService.checkMenuNameUnique(menu)) { return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java index 6a206cc9..a5b96c87 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; @@ -75,11 +74,11 @@ public class SysPostController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysPost post) { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + if (!postService.checkPostNameUnique(post)) { return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } - else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + else if (!postService.checkPostCodeUnique(post)) { return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } @@ -95,11 +94,11 @@ public class SysPostController extends BaseController @PutMapping public AjaxResult edit(@Validated @RequestBody SysPost post) { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + if (!postService.checkPostNameUnique(post)) { return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); } - else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + else if (!postService.checkPostCodeUnique(post)) { return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index 784768b6..0ffb7e8f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysUser; @@ -63,13 +62,11 @@ public class SysProfileController extends BaseController LoginUser loginUser = getLoginUser(); SysUser sysUser = loginUser.getUser(); user.setUserName(sysUser.getUserName()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); } - if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index 7aaf8059..ebe7460e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDept; @@ -94,11 +93,11 @@ public class SysRoleController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysRole role) { - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + if (!roleService.checkRoleNameUnique(role)) { return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); } - else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + else if (!roleService.checkRoleKeyUnique(role)) { return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); } @@ -117,11 +116,11 @@ public class SysRoleController extends BaseController { roleService.checkRoleAllowed(role); roleService.checkRoleDataScope(role.getRoleId()); - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + if (!roleService.checkRoleNameUnique(role)) { return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); } - else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + else if (!roleService.checkRoleKeyUnique(role)) { return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index f40f8b25..dc29d498 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDept; @@ -125,17 +124,15 @@ public class SysUserController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysUser user) { - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) + if (!userService.checkUserNameUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } @@ -154,17 +151,15 @@ public class SysUserController extends BaseController { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) + if (!userService.checkUserNameUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java index c6c7797b..b09b6f3d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java @@ -60,9 +60,9 @@ public class UserConstants /** InnerLink组件标识 */ public final static String INNER_LINK = "InnerLink"; - /** 校验返回结果码 */ - public final static String UNIQUE = "0"; - public final static String NOT_UNIQUE = "1"; + /** 校验是否唯一的返回标识 */ + public final static boolean UNIQUE = true; + public final static boolean NOT_UNIQUE = false; /** * 用户名长度限制 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java index a2cb78d9..4394f03b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -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 nowDate) + public static String timeDistance(Date endDate, Date startTime) { long nd = 1000 * 24 * 60 * 60; long nh = 1000 * 60 * 60; long nm = 1000 * 60; // long ns = 1000; // 获得两个时间的毫秒时间差异 - long diff = endDate.getTime() - nowDate.getTime(); + long diff = endDate.getTime() - startTime.getTime(); // 计算差多少天 long day = diff / nd; // 计算差多少小时 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index dcc4d1e5..1d4bfa35 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -1321,7 +1321,7 @@ public class ExcelUtil */ public String encodingFilename(String filename) { - filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; + filename = UUID.randomUUID() + "_" + filename + ".xlsx"; return filename; } @@ -1598,7 +1598,7 @@ public class ExcelUtil HSSFPicture pic = (HSSFPicture) shape; int pictureIndex = pic.getPictureIndex() - 1; 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); } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java index fd88245c..3f621d5d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java @@ -22,7 +22,7 @@ public class Seq private static AtomicInteger uploadSeq = new AtomicInteger(1); // 机器标识 - private static String machineCode = "A"; + private static final String machineCode = "A"; /** * 获取通用序列号 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java index 604ca020..8e142ac5 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java @@ -117,7 +117,7 @@ public class Jvm */ public String getRunTime() { - return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); + return DateUtils.timeDistance(DateUtils.getNowDate(), DateUtils.getServerStartDate()); } /** diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java index 5e290b42..6093515a 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java @@ -69,7 +69,7 @@ public class SysRegisterService { msg = "密码长度必须在5到20个字符之间"; } - else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(sysUser))) + else if (!userService.checkUserNameUnique(sysUser)) { msg = "保存用户'" + username + "'失败,注册账号已存在"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java index 6e095dad..20961378 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -85,5 +85,5 @@ public interface ISysConfigService * @param config 参数信息 * @return 结果 */ - public String checkConfigKeyUnique(SysConfig config); + public boolean checkConfigKeyUnique(SysConfig config); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java index f131ee38..302d7a1f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -89,7 +89,7 @@ public interface ISysDeptService * @param dept 部门信息 * @return 结果 */ - public String checkDeptNameUnique(SysDept dept); + public boolean checkDeptNameUnique(SysDept dept); /** * 校验部门是否有数据权限 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index f9ea41f4..f01a3584 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -94,5 +94,5 @@ public interface ISysDictTypeService * @param dictType 字典类型 * @return 结果 */ - public String checkDictTypeUnique(SysDictType dictType); + public boolean checkDictTypeUnique(SysDictType dictType); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index 8b77dae8..134b9ebd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -140,5 +140,5 @@ public interface ISysMenuService * @param menu 菜单信息 * @return 结果 */ - public String checkMenuNameUnique(SysMenu menu); + public boolean checkMenuNameUnique(SysMenu menu); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java index d21568bf..590634b9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -47,7 +47,7 @@ public interface ISysPostService * @param post 岗位信息 * @return 结果 */ - public String checkPostNameUnique(SysPost post); + public boolean checkPostNameUnique(SysPost post); /** * 校验岗位编码 @@ -55,7 +55,7 @@ public interface ISysPostService * @param post 岗位信息 * @return 结果 */ - public String checkPostCodeUnique(SysPost post); + public boolean checkPostCodeUnique(SysPost post); /** * 通过岗位ID查询岗位使用数量 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java index bf1f7b3d..ba79ed5d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -65,7 +65,7 @@ public interface ISysRoleService * @param role 角色信息 * @return 结果 */ - public String checkRoleNameUnique(SysRole role); + public boolean checkRoleNameUnique(SysRole role); /** * 校验角色权限是否唯一 @@ -73,7 +73,7 @@ public interface ISysRoleService * @param role 角色信息 * @return 结果 */ - public String checkRoleKeyUnique(SysRole role); + public boolean checkRoleKeyUnique(SysRole role); /** * 校验角色是否允许操作 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index 54ed035c..e438b577 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -72,7 +72,7 @@ public interface ISysUserService * @param user 用户信息 * @return 结果 */ - public String checkUserNameUnique(SysUser user); + public boolean checkUserNameUnique(SysUser user); /** * 校验手机号码是否唯一 @@ -80,7 +80,7 @@ public interface ISysUserService * @param user 用户信息 * @return 结果 */ - public String checkPhoneUnique(SysUser user); + public boolean checkPhoneUnique(SysUser user); /** * 校验email是否唯一 @@ -88,7 +88,7 @@ public interface ISysUserService * @param user 用户信息 * @return 结果 */ - public String checkEmailUnique(SysUser user); + public boolean checkEmailUnique(SysUser user); /** * 校验用户是否允许操作 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index 091aba7e..3615b88f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -208,7 +208,7 @@ public class SysConfigServiceImpl implements ISysConfigService * @return 结果 */ @Override - public String checkConfigKeyUnique(SysConfig config) + public boolean checkConfigKeyUnique(SysConfig config) { Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 41423884..c5f3ce6e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -171,7 +171,7 @@ public class SysDeptServiceImpl implements ISysDeptService * @return 结果 */ @Override - public String checkDeptNameUnique(SysDept dept) + public boolean checkDeptNameUnique(SysDept dept) { Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index 9056edad..b6c4c565 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -210,7 +210,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * @return 结果 */ @Override - public String checkDictTypeUnique(SysDictType dict) + public boolean checkDictTypeUnique(SysDictType dict) { Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index a85c3506..225c2809 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -175,7 +175,7 @@ public class SysMenuServiceImpl implements ISysMenuService router.setQuery(menu.getQuery()); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); List 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.setRedirect("noRedirect"); @@ -335,7 +335,7 @@ public class SysMenuServiceImpl implements ISysMenuService * @return 结果 */ @Override - public String checkMenuNameUnique(SysMenu menu) + public boolean checkMenuNameUnique(SysMenu menu) { Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index dc8270f5..57995eb0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -79,7 +79,7 @@ public class SysPostServiceImpl implements ISysPostService * @return 结果 */ @Override - public String checkPostNameUnique(SysPost post) + public boolean checkPostNameUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = postMapper.checkPostNameUnique(post.getPostName()); @@ -97,7 +97,7 @@ public class SysPostServiceImpl implements ISysPostService * @return 结果 */ @Override - public String checkPostCodeUnique(SysPost post) + public boolean checkPostCodeUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index 6ade2680..5e0a02da 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -146,7 +146,7 @@ public class SysRoleServiceImpl implements ISysRoleService * @return 结果 */ @Override - public String checkRoleNameUnique(SysRole role) + public boolean checkRoleNameUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); @@ -164,7 +164,7 @@ public class SysRoleServiceImpl implements ISysRoleService * @return 结果 */ @Override - public String checkRoleKeyUnique(SysRole role) + public boolean checkRoleKeyUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 29e37955..41def8be 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -165,7 +165,7 @@ public class SysUserServiceImpl implements ISysUserService * @return 结果 */ @Override - public String checkUserNameUnique(SysUser user) + public boolean checkUserNameUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkUserNameUnique(user.getUserName()); @@ -183,7 +183,7 @@ public class SysUserServiceImpl implements ISysUserService * @return */ @Override - public String checkPhoneUnique(SysUser user) + public boolean checkPhoneUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); @@ -201,7 +201,7 @@ public class SysUserServiceImpl implements ISysUserService * @return */ @Override - public String checkEmailUnique(SysUser user) + public boolean checkEmailUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkEmailUnique(user.getEmail()); diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue index f580b983..3ab81fc2 100644 --- a/ruoyi-ui/src/views/system/config/index.vue +++ b/ruoyi-ui/src/views/system/config/index.vue @@ -107,7 +107,7 @@ - +