65 lines
1.7 KiB
Markdown
65 lines
1.7 KiB
Markdown
# 信安文件报错
|
|
|
|
## 截图及文件
|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|
## 接口位置
|
|
|
|
```java
|
|
/configManage/updateSecurity
|
|
```
|
|
|
|
## 代码流程
|
|
|
|
```java
|
|
com.cmcc.cdn.platform.common.util.ExcelUtil#analysisExcelFile(java.io.InputStream, java.util.List<java.lang.String>)
|
|
//421行
|
|
|
|
com.cmcc.cdn.platform.common.util.ExcelUtil#checkExcelFormat
|
|
//357行
|
|
|
|
com.cmcc.cdn.platform.common.util.ExcelUtil#getCellValue
|
|
//369行
|
|
```
|
|
|
|
## 问题代码
|
|
|
|
```java
|
|
if(cell.getCellType() == CellType.NUMERIC){
|
|
cell.setCellType(CellType.STRING);
|
|
}
|
|
|
|
if(CellType.NUMERIC == cell.getCellType()){
|
|
cellValue = String.valueOf(cell.getNumericCellValue());
|
|
}else if(CellType.STRING == cell.getCellType()){
|
|
cellValue = String.valueOf(cell.getStringCellValue());
|
|
}else if(CellType.BOOLEAN == cell.getCellType()){
|
|
cellValue = String.valueOf(cell.getBooleanCellValue());
|
|
}else if(CellType.FORMULA == cell.getCellType()){
|
|
cellValue = String.valueOf(cell.getCellFormula());
|
|
}else if(CellType.BLANK == cell.getCellType()){
|
|
cellValue = "";
|
|
}else if(CellType.ERROR == cell.getCellType()){
|
|
cellValue = "非法字符";
|
|
}else {
|
|
cellValue = "未知类型";
|
|
}
|
|
```
|
|
|
|
## 处理完效果
|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|
当天后续问题同上方情况。
|
|
|
|

|