【fix sonar】ImportExcelUtil文件
This commit is contained in:
+6
-2
@@ -2,6 +2,7 @@ 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;
|
||||
@@ -16,6 +17,9 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
public class ImportExcelUtil {
|
||||
private ImportExcelUtil(){
|
||||
|
||||
}
|
||||
|
||||
public static Result<T> imporReturnRes(int errorLines, int successLines, List<String> errorMessage) throws IOException {
|
||||
if (errorLines == 0) {
|
||||
@@ -45,7 +49,7 @@ public class ImportExcelUtil {
|
||||
try {
|
||||
boolean save = bean.save(list.get(i));
|
||||
if(!save){
|
||||
throw new Exception(errorFlag);
|
||||
throw new JeroBootException(errorFlag);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String message = e.getMessage().toLowerCase();
|
||||
@@ -73,7 +77,7 @@ public class ImportExcelUtil {
|
||||
try {
|
||||
boolean save = bean.save(obj);
|
||||
if(!save){
|
||||
throw new Exception(errorFlag);
|
||||
throw new JeroBootException(errorFlag);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String message = e.getMessage().toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user