From c824e6cefa38c27b979a26e21049da5dfc3f1646 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 11 Jan 2019 10:34:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=9D=E5=A7=8B=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/system/SysUserController.java | 7 +------ .../java/com/ruoyi/system/service/ISysUserService.java | 3 +-- .../com/ruoyi/system/service/impl/SysUserServiceImpl.java | 7 ++++++- 3 files changed, 8 insertions(+), 9 deletions(-) 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 7b8fc2c1..9be5f248 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 @@ -22,7 +22,6 @@ import com.ruoyi.framework.shiro.service.SysPasswordService; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.framework.web.base.BaseController; import com.ruoyi.system.domain.SysUser; -import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; @@ -47,9 +46,6 @@ public class SysUserController extends BaseController @Autowired private ISysPostService postService; - @Autowired - private ISysConfigService configService; - @Autowired private SysPasswordService passwordService; @@ -90,8 +86,7 @@ public class SysUserController extends BaseController ExcelUtil util = new ExcelUtil(SysUser.class); List userList = util.importExcel(file.getInputStream()); String operName = getSysUser().getLoginName(); - String password = configService.selectConfigByKey("sys.user.initPassword"); - String message = userService.importUser(userList, updateSupport, operName, password); + String message = userService.importUser(userList, updateSupport, operName); return AjaxResult.success(message); } 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 80245470..95679f5c 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 @@ -145,8 +145,7 @@ public interface ISysUserService * @param userList 用户数据列表 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 * @param operName 操作用户 - * @param password 初始密码 * @return 结果 */ - public String importUser(List userList, Boolean isUpdateSupport, String operName, String password); + public String importUser(List userList, Boolean isUpdateSupport, String operName); } 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 89d4ebf8..92340f2f 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 @@ -22,6 +22,7 @@ import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserPostMapper; import com.ruoyi.system.mapper.SysUserRoleMapper; +import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysUserService; /** @@ -48,6 +49,9 @@ public class SysUserServiceImpl implements ISysUserService @Autowired private SysUserRoleMapper userRoleMapper; + + @Autowired + private ISysConfigService configService; /** * 根据条件分页查询用户对象 @@ -368,7 +372,7 @@ public class SysUserServiceImpl implements ISysUserService * @param password 初始密码 * @return 结果 */ - public String importUser(List userList, Boolean isUpdateSupport, String operName, String password) + public String importUser(List userList, Boolean isUpdateSupport, String operName) { if (StringUtils.isNull(userList) || userList.size() == 0) { @@ -378,6 +382,7 @@ public class SysUserServiceImpl implements ISysUserService int failureNum = 0; StringBuilder successMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder(); + String password = configService.selectConfigByKey("sys.user.initPassword"); for (SysUser user : userList) { try