生成txt文件

back_recharge
gaojie 2019-04-01 11:16:21 +08:00
parent f9249bef01
commit 77b9db852b
2 changed files with 20 additions and 18 deletions

View File

@ -252,8 +252,8 @@ int mut,int#int,1
101218 101307
101219 101308
101220 101309#101310
101221 101311
101222 101312#101313#101319
101221 101311#101318
101222 101312#101313
101223 101314
101224 101315
101225 101316

View File

@ -1,5 +1,6 @@
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.*;
@ -374,22 +375,23 @@ public class ExcelUtils {
}
case Cell.CELL_TYPE_FORMULA: {
//判断cell是否为日期格式
if (DateUtil.isCellDateFormatted(cell)) {
//转换为日期格式YYYY-mm-dd
cellValue = cell.getDateCellValue();
} else {
//数字
cellValue = String.valueOf(cell.getNumericCellValue());
if (cellType != null && cellType.toString().equals("float")){
}else{
if (cellType.toString().equals("string")){
cellValue = "";
}else{
cellValue = (int) cell.getNumericCellValue();
}
}
}
cellValue = ((XSSFCell) cell).getRawValue();
// if (DateUtil.isCellDateFormatted(cell)) {
// //转换为日期格式YYYY-mm-dd
// cellValue = cell.getDateCellValue();
// } else {
// //数字
// cellValue = String.valueOf(cell.getNumericCellValue());
// if (cellType != null && cellType.toString().equals("float")){
//
// }else{
// if (cellType.toString().equals("string")){
// cellValue = "";
// }else{
// cellValue = (int) cell.getNumericCellValue();
// }
// }
// }
break;
}
case Cell.CELL_TYPE_BOOLEAN:{