|
|
@ -5,6 +5,7 @@ import com.win.framework.common.enums.CommonStatusEnum; |
|
|
|
import com.win.framework.common.pojo.CommonResult; |
|
|
|
import com.win.framework.common.pojo.PageResult; |
|
|
|
import com.win.framework.common.util.collection.MapUtils; |
|
|
|
import com.win.framework.excel.core.listener.ExcelListener; |
|
|
|
import com.win.framework.excel.core.util.ExcelUtils; |
|
|
|
import com.win.framework.operatelog.core.annotations.OperateLog; |
|
|
|
import com.win.module.system.controller.user.vo.user.*; |
|
|
@ -185,8 +186,10 @@ public class UserController { |
|
|
|
}) |
|
|
|
@PreAuthorize("@ss.hasPermission('system:user:import')") |
|
|
|
public CommonResult<UserImportRespVO> importExcel(@RequestParam("file") MultipartFile file, @RequestParam(value = "mode") Integer mode, @RequestParam(value = "updatePart") Boolean updatePart) throws Exception { |
|
|
|
List<UserImportExcelVO> list = ExcelUtils.read(file, UserImportExcelVO.class); |
|
|
|
return success(userService.importUserList(list, mode, updatePart)); |
|
|
|
ExcelListener<UserImportExcelVO> listener = new ExcelListener<>(); |
|
|
|
ExcelUtils.read(file, UserImportExcelVO.class, listener); |
|
|
|
List<UserImportExcelVO> dataList = listener.getDataList(); |
|
|
|
return success(userService.importUserList(dataList, mode, updatePart)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|