bug51151,51153
This commit is contained in:
+13
-3
@@ -83,6 +83,7 @@ import java.io.*;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.nio.file.StandardOpenOption;
|
import java.nio.file.StandardOpenOption;
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -917,6 +918,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
itemsMap.put(dbFieldName+"_id", itemsMap.get(dbFieldName).toString());
|
itemsMap.put(dbFieldName+"_id", itemsMap.get(dbFieldName).toString());
|
||||||
itemsMap.put(dbFieldName, StringUtils.join(names,","));
|
itemsMap.put(dbFieldName, StringUtils.join(names,","));
|
||||||
|
|
||||||
|
} else { // TODO 可能是只有机构id, 也可能是错误数据
|
||||||
|
itemsMap.put(dbFieldName+"_id", itemsMap.get(dbFieldName).toString());
|
||||||
|
itemsMap.put(dbFieldName, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1731,12 +1735,18 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
}
|
}
|
||||||
String cellValue = null;
|
String cellValue = null;
|
||||||
|
|
||||||
if (cell.getCellTypeEnum().equals("NUMERIC") && HSSFDateUtil.isCellDateFormatted(cell)) {
|
if (HSSFCell.CELL_TYPE_NUMERIC == cell.getCellType() && HSSFDateUtil.isCellDateFormatted(cell)) {
|
||||||
// 获取日期类型的单元格的值
|
// 获取日期类型的单元格的值
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
// 进行格式转换
|
// 进行格式转换
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
cellValue = formatter.format(d);
|
cellValue = df.format(d);
|
||||||
|
map.put(dbfieldList.get(y), cellValue);
|
||||||
|
if (map.get(dbfieldList.get(y)) == null || "".equals(map.get(dbfieldList.get(y)))) {
|
||||||
|
a++;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//设置单元格类型
|
//设置单元格类型
|
||||||
cell.setCellType(CellType.STRING);
|
cell.setCellType(CellType.STRING);
|
||||||
|
|||||||
Reference in New Issue
Block a user