Skip to content

Commit

Permalink
用户导入
Browse files Browse the repository at this point in the history
  • Loading branch information
twelvet-s committed Aug 5, 2023
1 parent 10d151b commit 86bf688
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void export(HttpServletResponse response, @RequestBody SysUser user) {

/**
* 用户数据导入
* @param files MultipartFile[]
* @param file MultipartFile
* @param cover 是否允许覆盖
* @return JsonResult<String>
* @throws Exception Exception
Expand All @@ -95,14 +95,11 @@ public void export(HttpServletResponse response, @RequestBody SysUser user) {
@PostMapping("/importData")
@Log(service = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@role.hasPermi('system:user:import')")
public JsonResult<String> importData(MultipartFile[] files, boolean cover) throws Exception {
public JsonResult<String> importData(MultipartFile file, boolean cover) throws Exception {
ExcelUtils<SysUser> excelUtils = new ExcelUtils<>(SysUser.class);
// 支持多数据源导入
for (MultipartFile file : files) {
List<SysUser> userList = excelUtils.importExcel(file.getInputStream());
String operName = SecurityUtils.getUsername();
iSysUserService.importUser(userList, cover, operName);
}
List<SysUser> userList = excelUtils.importExcel(file.getInputStream());
String operName = SecurityUtils.getUsername();
iSysUserService.importUser(userList, cover, operName);
return JsonResult.success();
}

Expand Down

0 comments on commit 86bf688

Please sign in to comment.