From 8e2ef5a677b3c14d90592aeb6b733a499cb66252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Fri, 17 Nov 2023 11:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/modules/system/controller/SysUserController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 6aec1c80..f528e9e7 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -507,6 +507,7 @@ public class SysUserController { try { List listSysUsers = ExcelImportUtil.importExcel(file.getInputStream(), SysUser.class, params); for (int i = 0; i < listSysUsers.size(); i++) { + SysUserRole sysUserRole = new SysUserRole(); SysUser sysUserExcel = listSysUsers.get(i); if (StringUtils.isBlank(sysUserExcel.getPassword())) { // 密码默认为 “123456” @@ -523,6 +524,9 @@ public class SysUserController { if (sysUserExcel.getJuese().equals("学生")) { sysUserExcel.setDelFlag(0); sysUserService.save(sysUserExcel); + sysUserRole.setUserId(sysUserExcel.getId()); + sysUserRole.setRoleId("1724327596426760194"); + sysUserRoleService.save(sysUserRole); } else { errorMessage.add("第 " + i + 1 + " 行:目前仅允许导入学生身份的用户,其他身份请手动导入"); }