diff --git a/README.md b/README.md index 4628df0..72c2521 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ 各位如果觉得好用请随手给个⭐ -#### 版本说明 -1. 当前已更新至ruoyi-vue最新版本(2022年9月8日) -2. 后续会尽量与ruoyi-vue的release版本保持同步 - #### 内置功能 1. 表单中心:表单设计、表单管理 diff --git a/pom.xml b/pom.xml index 550814c..27f198d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ com.ruoyi ruoyi - 3.8.3 + 3.8.4 ruoyi http://www.ruoyi.vip 若依管理系统 - 3.8.3 + 3.8.4 UTF-8 UTF-8 1.8 @@ -24,7 +24,7 @@ 2.3.2 2.2.2 1.4.3 - 2.0.12 + 2.0.14 6.2.2 2.11.0 1.4 diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 304c418..010d7e3 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 jar 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 42e2b2d..7d369b6 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 @@ -125,7 +125,7 @@ public class SysUserController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysUser user) { - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); } @@ -154,7 +154,11 @@ public class SysUserController extends BaseController { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) + { + return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); + } + else if (StringUtils.isNotEmpty(user.getPhonenumber()) && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 7444a05..e625d34 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://10.100.0.114:3306/nocode?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true + url: jdbc:mysql://10.100.0.114:3306/mycode?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true username: root password: root # 从库数据源 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index a5510b5..f467e26 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -3,7 +3,7 @@ ruoyi: # 名称 name: RuoYi # 版本 - version: 3.8.3 + version: 3.8.4 # 版权年份 copyrightYear: 2022 # 实例演示开关 @@ -95,7 +95,7 @@ spring: port: 27017 username: admin password: admin - database: nocode + database: mycode authentication-database: admin activiti: check-process-definitions: false diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index cb24015..0d4cc1c 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java index c3df6ae..ef15802 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -102,4 +102,14 @@ public class R implements Serializable { this.data = data; } + + public static Boolean isError(R ret) + { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) + { + return R.SUCCESS == ret.getCode(); + } } 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 8ea91a3..a7c0e20 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 @@ -694,12 +694,19 @@ public class ExcelUtil // 得到导出对象. T vo = (T) list.get(i); Collection subList = null; - if (isSubListValue(vo)) + if (isSubList()) { - subList = getListCellValue(vo); - subMergedLastRowNum = subMergedLastRowNum + subList.size(); + if (isSubListValue(vo)) + { + subList = getListCellValue(vo); + subMergedLastRowNum = subMergedLastRowNum + subList.size(); + } + else + { + subMergedFirstRowNum++; + subMergedLastRowNum++; + } } - int column = 0; for (Object[] os : fields) { @@ -808,7 +815,6 @@ public class ExcelUtil if (!headerStyles.containsKey(key)) { CellStyle style = wb.createCellStyle(); - style = wb.createCellStyle(); style.cloneStyleFrom(styles.get("data")); style.setAlignment(HorizontalAlignment.CENTER); style.setVerticalAlignment(VerticalAlignment.CENTER); @@ -842,7 +848,6 @@ public class ExcelUtil if (!styles.containsKey(key)) { CellStyle style = wb.createCellStyle(); - style = wb.createCellStyle(); style.setAlignment(excel.align()); style.setVerticalAlignment(VerticalAlignment.CENTER); style.setBorderRight(BorderStyle.THIN); diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index 6c6de57..adcadcb 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index 912684d..b24eed6 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -78,7 +78,7 @@ public class LogAspect // 请求的地址 String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); operLog.setOperIp(ip); - operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); + operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); if (loginUser != null) { operLog.setOperName(loginUser.getUsername()); diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java index 0d1b62f..69811bc 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java @@ -50,7 +50,6 @@ public class RateLimiterAspect @Before("@annotation(rateLimiter)") public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable { - String key = rateLimiter.key(); int time = rateLimiter.time(); int count = rateLimiter.count(); @@ -63,7 +62,7 @@ public class RateLimiterAspect { throw new ServiceException("访问过于频繁,请稍候再试"); } - log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), key); + log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), combineKey); } catch (ServiceException e) { 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 a3b273b..974580e 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 @@ -41,9 +41,11 @@ public class SysRegisterService public String register(RegisterBody registerBody) { String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword(); + SysUser sysUser = new SysUser(); + sysUser.setUserName(username); - boolean captchaEnabled = configService.selectCaptchaEnabled(); // 验证码开关 + boolean captchaEnabled = configService.selectCaptchaEnabled(); if (captchaEnabled) { validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); @@ -67,16 +69,14 @@ public class SysRegisterService { msg = "密码长度必须在5到20个字符之间"; } - else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username))) + else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(sysUser))) { msg = "保存用户'" + username + "'失败,注册账号已存在"; } else { - SysUser sysUser = new SysUser(); - sysUser.setUserName(username); sysUser.setNickName(username); - sysUser.setPassword(SecurityUtils.encryptPassword(registerBody.getPassword())); + sysUser.setPassword(SecurityUtils.encryptPassword(password)); boolean regFlag = userService.registerUser(sysUser); if (!regFlag) { @@ -84,8 +84,7 @@ public class SysRegisterService } else { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, - MessageUtils.message("user.register.success"))); + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success"))); } } return msg; diff --git a/ruoyi-generator/pom.xml b/ruoyi-generator/pom.xml index b065d91..eeafd13 100644 --- a/ruoyi-generator/pom.xml +++ b/ruoyi-generator/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml index 5fa790f..11b2b96 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -92,19 +92,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update gen_table_column - column_comment = #{columnComment}, - java_type = #{javaType}, - java_field = #{javaField}, - is_insert = #{isInsert}, - is_edit = #{isEdit}, - is_list = #{isList}, - is_query = #{isQuery}, - is_required = #{isRequired}, - query_type = #{queryType}, - html_type = #{htmlType}, - dict_type = #{dictType}, - sort = #{sort}, - update_by = #{updateBy}, + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, update_time = sysdate() where column_id = #{columnId} diff --git a/ruoyi-nocode/pom.xml b/ruoyi-nocode/pom.xml index 4325cb4..2e53288 100644 --- a/ruoyi-nocode/pom.xml +++ b/ruoyi-nocode/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml index 090c0e2..2dcfa25 100644 --- a/ruoyi-quartz/pom.xml +++ b/ruoyi-quartz/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 7cd8dd0..f5a2114 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.3 + 3.8.4 4.0.0 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index b42ac52..76e1c79 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -107,7 +107,7 @@ public interface SysUserMapper * @param userName 用户名称 * @return 结果 */ - public int checkUserNameUnique(String userName); + public SysUser checkUserNameUnique(String userName); /** * 校验手机号码是否唯一 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 59a41a1..d14e7fa 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 @@ -69,10 +69,10 @@ public interface ISysUserService /** * 校验用户名称是否唯一 * - * @param userName 用户名称 + * @param user 用户信息 * @return 结果 */ - public String checkUserNameUnique(String userName); + public String checkUserNameUnique(SysUser user); /** * 校验手机号码是否唯一 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 aec7cb4..c312d89 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 @@ -161,14 +161,15 @@ public class SysUserServiceImpl implements ISysUserService /** * 校验用户名称是否唯一 * - * @param userName 用户名称 + * @param user 用户信息 * @return 结果 */ @Override - public String checkUserNameUnique(String userName) + public String checkUserNameUnique(SysUser user) { - int count = userMapper.checkUserNameUnique(userName); - if (count > 0) + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + SysUser info = userMapper.checkUserNameUnique(user.getUserName()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { return UserConstants.NOT_UNIQUE; } @@ -507,6 +508,8 @@ public class SysUserServiceImpl implements ISysUserService else if (isUpdateSupport) { BeanValidators.validateWithException(validator, user); + checkUserAllowed(user); + checkUserDataScope(user.getUserId()); user.setUpdateBy(operName); this.updateUser(user); successNum++; diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 058bf13..cf439f6 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -59,8 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1