|
@@ -34,6 +34,7 @@ public class SaxDataBatchHandler extends DefaultHandler {
|
|
|
private final List<String> currentRowCells = new ArrayList<>();
|
|
private final List<String> currentRowCells = new ArrayList<>();
|
|
|
private String tempCellText;
|
|
private String tempCellText;
|
|
|
private boolean readCellContent;
|
|
private boolean readCellContent;
|
|
|
|
|
+ private String currentCellType;
|
|
|
|
|
|
|
|
public SaxDataBatchHandler(JdbcTemplate jdbcTemplate, String waferId, String tableName, String dbLinkSuffix, String dynamicItemColumns,
|
|
public SaxDataBatchHandler(JdbcTemplate jdbcTemplate, String waferId, String tableName, String dbLinkSuffix, String dynamicItemColumns,
|
|
|
int maxCellSize,
|
|
int maxCellSize,
|
|
@@ -71,6 +72,7 @@ public class SaxDataBatchHandler extends DefaultHandler {
|
|
|
if ("c".equals(qName) && currentRowNum >= dataStartRow) {
|
|
if ("c".equals(qName) && currentRowNum >= dataStartRow) {
|
|
|
tempCellText = "";
|
|
tempCellText = "";
|
|
|
readCellContent = true;
|
|
readCellContent = true;
|
|
|
|
|
+ currentCellType = attributes.getValue("t");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -85,9 +87,14 @@ public class SaxDataBatchHandler extends DefaultHandler {
|
|
|
public void endElement(String uri, String localName, String qName) {
|
|
public void endElement(String uri, String localName, String qName) {
|
|
|
// 单元格结束,收集值
|
|
// 单元格结束,收集值
|
|
|
if ("c".equals(qName) && currentRowNum >= dataStartRow) {
|
|
if ("c".equals(qName) && currentRowNum >= dataStartRow) {
|
|
|
- String cellVal = PoiSaxUtil.parseCellValue(tempCellText, sharedStrings);
|
|
|
|
|
|
|
+ String cellVal = PoiSaxUtil.parseCellValue(tempCellText, currentCellType,sharedStrings);
|
|
|
currentRowCells.add(cellVal);
|
|
currentRowCells.add(cellVal);
|
|
|
|
|
+ /*if(currentRowNum ==24) {
|
|
|
|
|
+ System.out.println("aaa:"+tempCellText+": currentCellType:"+currentCellType);
|
|
|
|
|
+ System.out.println("bbb:"+cellVal);
|
|
|
|
|
+ }*/
|
|
|
readCellContent = false;
|
|
readCellContent = false;
|
|
|
|
|
+ currentCellType = null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 单行解析完成,拼接INSERT语句
|
|
// 单行解析完成,拼接INSERT语句
|
|
@@ -109,7 +116,8 @@ public class SaxDataBatchHandler extends DefaultHandler {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
batchSqlBuffer.append("INSERT INTO ")
|
|
batchSqlBuffer.append("INSERT INTO ")
|
|
|
- .append(tableName).append(dbLinkSuffix)
|
|
|
|
|
|
|
+ .append(tableName)
|
|
|
|
|
+ .append(dbLinkSuffix)
|
|
|
.append(" (WAFER_ID,DETNO_,DATATYPE_,FLAG_,").append(dynamicItemColumns).append(") VALUES ('")
|
|
.append(" (WAFER_ID,DETNO_,DATATYPE_,FLAG_,").append(dynamicItemColumns).append(") VALUES ('")
|
|
|
.append(waferId).append("',")
|
|
.append(waferId).append("',")
|
|
|
.append(detNo).append(",")
|
|
.append(detNo).append(",")
|