|
@@ -23,10 +23,9 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.io.InputStream;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -135,12 +134,21 @@ public class ExcelServiceImpl implements IExcelService {
|
|
throw new BusinessException(ResultCode.FILE_TYPE_ERROR);
|
|
throw new BusinessException(ResultCode.FILE_TYPE_ERROR);
|
|
}
|
|
}
|
|
List<HashMap<Integer, String>> excelRowList = new ArrayList<>();
|
|
List<HashMap<Integer, String>> excelRowList = new ArrayList<>();
|
|
|
|
+ List<HashMap<Integer, String>> excelRowListTemplate = new ArrayList<>();
|
|
try {
|
|
try {
|
|
excelRowList = ExcelUtil.getExcelRowList(file);
|
|
excelRowList = ExcelUtil.getExcelRowList(file);
|
|
|
|
+ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("template/authModel.xlsx");
|
|
|
|
+ excelRowListTemplate = ExcelUtil.getExcelRowList(inputStream);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.info("uploadExcel-error:{}",e);
|
|
log.info("uploadExcel-error:{}",e);
|
|
throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
}
|
|
}
|
|
|
|
+ HashMap<Integer, String> mapt = excelRowListTemplate.get(0);
|
|
|
|
+ HashMap<Integer, String> map1 = excelRowList.get(0);
|
|
|
|
+ if(!mapt.equals(map1)){
|
|
|
|
+ throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
|
|
+ }
|
|
|
|
+
|
|
List<Integer> errorIndex = new ArrayList<>();
|
|
List<Integer> errorIndex = new ArrayList<>();
|
|
List<AuthModelingParam> params = new ArrayList();
|
|
List<AuthModelingParam> params = new ArrayList();
|
|
Integer index = 0;
|
|
Integer index = 0;
|