back_recharge
parent
d93064f353
commit
713ecb6902
|
@ -33,29 +33,6 @@ public class ExcelUtils {
|
|||
|
||||
|
||||
}
|
||||
public static void readExcelData() throws IOException {
|
||||
File file = new File(excelPath);
|
||||
if (file.exists()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File file1 : files) {
|
||||
if (file1.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
String extString = file1.getName().substring(file1.getName().lastIndexOf("."));
|
||||
if (!".xlsx".equals(extString)) {
|
||||
continue;
|
||||
}
|
||||
String filePath = excelPath + file1.getName();
|
||||
Workbook wb = readExcel(filePath);
|
||||
if(file1.getName().contains("1.Map_")){
|
||||
bulidMapInfo(wb);
|
||||
}else{
|
||||
buildDataInfo(wb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void genJavaFile(String fileName){
|
||||
|
||||
Map<String,String> fieldInfo = new HashMap<>();
|
||||
|
@ -119,6 +96,29 @@ public class ExcelUtils {
|
|||
System.out.println(getInfos);
|
||||
}
|
||||
|
||||
public static void readExcelData() throws IOException {
|
||||
File file = new File(excelPath);
|
||||
if (file.exists()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File file1 : files) {
|
||||
if (file1.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
String extString = file1.getName().substring(file1.getName().lastIndexOf("."));
|
||||
if (!".xlsx".equals(extString)) {
|
||||
continue;
|
||||
}
|
||||
String filePath = excelPath + file1.getName();
|
||||
Workbook wb = readExcel(filePath);
|
||||
if(file1.getName().contains("1.Map_")){
|
||||
bulidMapInfo(wb);
|
||||
}else{
|
||||
buildDataInfo(wb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String typeInfo(String fieldInfo){
|
||||
//mut,int#int,2
|
||||
if(fieldInfo.contains("mut")){
|
||||
|
@ -167,7 +167,7 @@ public class ExcelUtils {
|
|||
// }
|
||||
if (row != null) {
|
||||
StringBuilder info = new StringBuilder();
|
||||
int colnum = row2.getLastCellNum();
|
||||
int colnum = row1.getLastCellNum();
|
||||
for (int j = 1; j < colnum; j++) {
|
||||
int cellFormatValue = (int) getCellFormatValue(row1.getCell(j));
|
||||
if (cellFormatValue == 3){
|
||||
|
|
Loading…
Reference in New Issue