|
@@ -59,11 +59,17 @@ public class ValuationBusinessUtils {
|
|
|
try {
|
|
|
workbook = is2007ExcelFile ? new XSSFWorkbook(inputStream) : new HSSFWorkbook(inputStream);
|
|
|
} catch (Exception e) {
|
|
|
+ try{
|
|
|
+ workbook = is2007ExcelFile ? new HSSFWorkbook(inputStream): new XSSFWorkbook(inputStream);
|
|
|
+ }catch (Exception ex){
|
|
|
+ log.error(ERROR_MSG_NOT_EXCEL_FILE, ex);
|
|
|
+ }
|
|
|
log.error("excel first parse error: {}", ExceptionUtil.stacktraceToString(e));
|
|
|
}
|
|
|
|
|
|
// 非Excel,恶意篡改扩展名
|
|
|
if (null == workbook) {
|
|
|
+ log.error("解析文件失败,文件格式错误,文件路径为:"+file.getAbsolutePath());
|
|
|
error = preInfo.new Error().setCellNum(0).setRowNum(0).setMsg(ERROR_MSG_NOT_EXCEL_FILE);
|
|
|
error.setExcelName(valuationNeedParseParam.getOriginFileName());
|
|
|
preInfo.setError(error);
|
|
@@ -282,12 +288,14 @@ public class ValuationBusinessUtils {
|
|
|
}
|
|
|
// 校验数值
|
|
|
if (excelEntity.isNumerical() && isNotNumber(cellValue)) {
|
|
|
- error = preInfo.new Error();
|
|
|
- // 注意,row,cell均从0开始
|
|
|
- error.setRowNum(rowNum + 1).setCellNum(cellIndex + 1).setMsg(ERROR_MSG_NOT_NUMBER + ":" + cellValue);
|
|
|
- error.setExcelName(preInfo.getExcelOriginName());
|
|
|
- preInfo.setError(error);
|
|
|
- return;
|
|
|
+ log.error("数值型单元格,存在非数值型数据:"+cellValue+"================================");
|
|
|
+ cellValue="";
|
|
|
+// error = preInfo.new Error();
|
|
|
+// // 注意,row,cell均从0开始
|
|
|
+// error.setRowNum(rowNum + 1).setCellNum(cellIndex + 1).setMsg(ERROR_MSG_NOT_NUMBER + ":" + cellValue);
|
|
|
+// error.setExcelName(preInfo.getExcelOriginName());
|
|
|
+// preInfo.setError(error);
|
|
|
+// return;
|
|
|
}
|
|
|
|
|
|
List<Method> methodList = getMethods(instance.getClass());
|