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