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 6aec1c803..f528e9e7f 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 + " 行:目前仅允许导入学生身份的用户,其他身份请手动导入"); }