|
@@ -156,7 +156,13 @@ public class UserController extends BaseController {
|
|
public AjaxResult<Map<String,Object>> importData(MultipartFile file, String importNo) throws Exception
|
|
public AjaxResult<Map<String,Object>> importData(MultipartFile file, String importNo) throws Exception
|
|
{
|
|
{
|
|
ExcelUtil<UserImportAddBo> util = new ExcelUtil<UserImportAddBo>(UserImportAddBo.class);
|
|
ExcelUtil<UserImportAddBo> util = new ExcelUtil<UserImportAddBo>(UserImportAddBo.class);
|
|
- List<UserImportAddBo> userList = util.importExcel(file.getInputStream());
|
|
|
|
|
|
+ List<UserImportAddBo> userList = null;
|
|
|
|
+ try{
|
|
|
|
+ userList = util.importExcel(file.getInputStream());
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
|
|
|
|
+ }
|
|
Collections.reverse(userList);
|
|
Collections.reverse(userList);
|
|
if (userList.stream().allMatch(item -> ObjectUtils.isNull(item))){
|
|
if (userList.stream().allMatch(item -> ObjectUtils.isNull(item))){
|
|
throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
|
|
throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
|