|
@@ -54,7 +54,7 @@ public class PDMonthlyReportParser extends AbstractReportParser<MonthlyReportNav
|
|
|
List<String> textList = StrUtil.split(text, "\r\n");
|
|
|
if (CollUtil.isNotEmpty(textList)) {
|
|
|
List<String> wkList = this.watermarkListMap.get("report_name");
|
|
|
- String name = this.processString(wkList, textList.get(0));
|
|
|
+ String name = this.processString(wkList, textList.get(0) + textList.get(1));
|
|
|
this.reportName = this.matchReportName(name);
|
|
|
if (StrUtil.isBlank(this.reportName)) {
|
|
|
throw new APIException("未匹配到报告名称");
|
|
@@ -131,7 +131,9 @@ public class PDMonthlyReportParser extends AbstractReportParser<MonthlyReportNav
|
|
|
}
|
|
|
|
|
|
private void buildInfo(Map<String, Object> extInfoMap, Object info) {
|
|
|
- extInfoMap.forEach((k, v) -> {
|
|
|
+ for (Map.Entry<String, Object> entry : extInfoMap.entrySet()) {
|
|
|
+ String k = entry.getKey();
|
|
|
+ Object v = entry.getValue();
|
|
|
String fieldValue = StrUtil.toStringOrNull(v);
|
|
|
if (fieldValue.startsWith("-") || fieldValue.endsWith("-")) {
|
|
|
fieldValue = null;
|
|
@@ -143,17 +145,25 @@ public class PDMonthlyReportParser extends AbstractReportParser<MonthlyReportNav
|
|
|
String fieldName = vo.getValue();
|
|
|
List<String> labels = StrUtil.split(vo.getLabel(), ",");
|
|
|
if (labels.contains(k)) {
|
|
|
- ReflectUtil.setFieldValue(info, fieldName, fieldValue);
|
|
|
+ try {
|
|
|
+ ReflectUtil.setFieldValue(info, fieldName, fieldValue);
|
|
|
+ } catch (Exception e) {
|
|
|
+ this.logger.warn("{} 字段值设置错误:{}", fieldName, e.getMessage());
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
for (String label : labels) {
|
|
|
if (k.contains(label)) {
|
|
|
- ReflectUtil.setFieldValue(info, fieldName, fieldValue);
|
|
|
+ try {
|
|
|
+ ReflectUtil.setFieldValue(info, fieldName, fieldValue);
|
|
|
+ } catch (Exception e) {
|
|
|
+ this.logger.warn("{} 字段值设置错误:{}", fieldName, e.getMessage());
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -257,7 +267,7 @@ public class PDMonthlyReportParser extends AbstractReportParser<MonthlyReportNav
|
|
|
} else if (matcher3.find()) {
|
|
|
reportName = matcher3.group();
|
|
|
} else {
|
|
|
- return null;
|
|
|
+ reportName = text;
|
|
|
}
|
|
|
return reportName.replace("(", "(").replace(")", ")");
|
|
|
}
|