|
|
@ -507,6 +507,7 @@ public class SysUserController { |
|
|
|
try { |
|
|
|
try { |
|
|
|
List<SysUser> listSysUsers = ExcelImportUtil.importExcel(file.getInputStream(), SysUser.class, params); |
|
|
|
List<SysUser> listSysUsers = ExcelImportUtil.importExcel(file.getInputStream(), SysUser.class, params); |
|
|
|
for (int i = 0; i < listSysUsers.size(); i++) { |
|
|
|
for (int i = 0; i < listSysUsers.size(); i++) { |
|
|
|
|
|
|
|
SysUserRole sysUserRole = new SysUserRole(); |
|
|
|
SysUser sysUserExcel = listSysUsers.get(i); |
|
|
|
SysUser sysUserExcel = listSysUsers.get(i); |
|
|
|
if (StringUtils.isBlank(sysUserExcel.getPassword())) { |
|
|
|
if (StringUtils.isBlank(sysUserExcel.getPassword())) { |
|
|
|
// 密码默认为 “123456”
|
|
|
|
// 密码默认为 “123456”
|
|
|
@ -523,6 +524,9 @@ public class SysUserController { |
|
|
|
if (sysUserExcel.getJuese().equals("学生")) { |
|
|
|
if (sysUserExcel.getJuese().equals("学生")) { |
|
|
|
sysUserExcel.setDelFlag(0); |
|
|
|
sysUserExcel.setDelFlag(0); |
|
|
|
sysUserService.save(sysUserExcel); |
|
|
|
sysUserService.save(sysUserExcel); |
|
|
|
|
|
|
|
sysUserRole.setUserId(sysUserExcel.getId()); |
|
|
|
|
|
|
|
sysUserRole.setRoleId("1724327596426760194"); |
|
|
|
|
|
|
|
sysUserRoleService.save(sysUserRole); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
errorMessage.add("第 " + i + 1 + " 行:目前仅允许导入学生身份的用户,其他身份请手动导入"); |
|
|
|
errorMessage.add("第 " + i + 1 + " 行:目前仅允许导入学生身份的用户,其他身份请手动导入"); |
|
|
|
} |
|
|
|
} |
|
|
|