update 系统管理导入数据报错提示信息

This commit is contained in:
lijiarao
2021-09-28 13:55:07 +08:00
parent 03ac1817f7
commit 56b7035bc4
4 changed files with 7 additions and 3 deletions
@@ -2,10 +2,12 @@ package com.jero.common.util;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.exception.JeroBootException;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.api.vo.Result;
import com.jero.common.constant.CommonConstant;
import javax.management.remote.JMXProviderException;
import java.io.File;
import java.io.IOException;
import java.util.List;
@@ -31,9 +33,7 @@ public class ImportExcelUtil {
//String fileName = fileUrl.substring(lastIndex + 1);
//result.put("fileUrl", "/sys/common/static/" + fileUrl);
//result.put("fileName", fileName);
Result<JSONObject> res = Result.OK(result);
res.setMessage("文件导入成功,但有错误。\n"+"总上传行数:" + totalCount + ",已导入行数:" + successLines + ",错误次数:" + errorLines +",错误信息:" +errorMessage);
return res;
throw new JeroBootException("文件导入失败:"+errorMessage);
}
}
@@ -42,6 +42,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -66,6 +67,7 @@ import java.util.stream.Collectors;
@Slf4j
@RestController
@RequestMapping("/sys/user")
@Transactional(rollbackFor = Exception.class)
public class SysUserController {
@Autowired
private ISysBaseAPI sysBaseAPI;
@@ -117,6 +117,7 @@ public class SysUser implements Serializable {
/**
* 状态(1:正常 2:冻结 )
*/
@Excel(name = "状态", width = 15,dicCode = "user_status")
@Dict(dicCode = "user_status")
private Integer status;
@@ -33,6 +33,7 @@ import java.util.List;
* @since 2018-12-19
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
@Autowired
SysRoleMapper sysRoleMapper;