|
@@ -34,8 +34,8 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Component("monthly-report:pdf")
|
|
|
public class PDMonthlyReportParser extends AbstractReportParser<MonthlyReportNavInfo> {
|
|
|
- private final EmailFieldMappingMapper fieldMappingMapper;
|
|
|
private final List<Table> extNavTables = ListUtil.list(true);
|
|
|
+ private final EmailFieldMappingMapper fieldMappingMapper;
|
|
|
private String reportName = null;
|
|
|
private Table baseInfoTable = null;
|
|
|
private List<ValueLabelVO> fieldMapper = null;
|
|
@@ -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(")", ")");
|
|
|
}
|