|
@@ -42,15 +42,25 @@ public class PDLetterReportParser extends AbstractPDReportParser<LetterReportDat
|
|
}
|
|
}
|
|
int rowCount = table.getRowCount();
|
|
int rowCount = table.getRowCount();
|
|
int colCount = table.getColCount();
|
|
int colCount = table.getColCount();
|
|
- for (int i = 0; i < rowCount; i++) {
|
|
|
|
- int t = colCount / 2;
|
|
|
|
- for (int j = 0; j < t; j++) {
|
|
|
|
- String key = table.getCell(i, j * 2).getText().replaceAll("[a-zA-Z]", "");
|
|
|
|
- key = ReportParseUtils.cleaningValue(key);
|
|
|
|
|
|
+ if (rowCount == 2) {
|
|
|
|
+ for (int i = 0; i < colCount; i++) {
|
|
|
|
+ String key = ReportParseUtils.cleaningValue(table.getCell(0, i).getText());
|
|
if (StrUtil.isBlank(key)) {
|
|
if (StrUtil.isBlank(key)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- this.allInfoMap.put(key, ReportParseUtils.cleaningValue(table.getCell(i, j * 2 + 1).getText()));
|
|
|
|
|
|
+ this.allInfoMap.put(key, ReportParseUtils.cleaningValue(table.getCell(1, i).getText()));
|
|
|
|
+ }
|
|
|
|
+ } else if (colCount % 2 == 0) {
|
|
|
|
+ for (int i = 0; i < rowCount; i++) {
|
|
|
|
+ int t = colCount / 2;
|
|
|
|
+ for (int j = 0; j < t; j++) {
|
|
|
|
+ String key = table.getCell(i, j * 2).getText().replaceAll("[a-zA-Z]", "");
|
|
|
|
+ key = ReportParseUtils.cleaningValue(key);
|
|
|
|
+ if (StrUtil.isBlank(key)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ this.allInfoMap.put(key, ReportParseUtils.cleaningValue(table.getCell(i, j * 2 + 1).getText()));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -59,7 +69,14 @@ public class PDLetterReportParser extends AbstractPDReportParser<LetterReportDat
|
|
protected ReportFundInfoDTO buildFundInfo(ReportParserParams params) {
|
|
protected ReportFundInfoDTO buildFundInfo(ReportParserParams params) {
|
|
ReportFundInfoDTO fundInfo = this.buildDto(params.getFileId(), ReportFundInfoDTO.class, this.allInfoMap);
|
|
ReportFundInfoDTO fundInfo = this.buildDto(params.getFileId(), ReportFundInfoDTO.class, this.allInfoMap);
|
|
if (CollUtil.isNotEmpty(this.textList) && fundInfo.getFundName() == null) {
|
|
if (CollUtil.isNotEmpty(this.textList) && fundInfo.getFundName() == null) {
|
|
- fundInfo.setFundName(this.textList.get(0));
|
|
|
|
|
|
+ String fundName = this.textList.get(0);
|
|
|
|
+ if (fundName.contains("_")) {
|
|
|
|
+ fundInfo.setFundCode(fundName.substring(0, fundName.indexOf("_")));
|
|
|
|
+ fundName = StrUtil.split(fundName, "_").get(1);
|
|
|
|
+ this.allInfoMap.put("基金代码", fundInfo.getFundCode());
|
|
|
|
+ this.allInfoMap.put("基金名称", fundName);
|
|
|
|
+ }
|
|
|
|
+ fundInfo.setFundName(fundName);
|
|
}
|
|
}
|
|
return fundInfo;
|
|
return fundInfo;
|
|
}
|
|
}
|