|
@@ -2,14 +2,13 @@ package com.simuwang.daq.components.report.parser.pdf;
|
|
|
|
|
|
import cn.hutool.core.collection.ListUtil;
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
-import cn.hutool.core.util.ReflectUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
-import com.simuwang.base.common.conts.Constants;
|
|
|
import com.simuwang.base.common.exception.APIException;
|
|
|
import com.simuwang.base.mapper.EmailFieldMappingMapper;
|
|
|
-import com.simuwang.base.pojo.dto.report.*;
|
|
|
+import com.simuwang.base.pojo.dto.report.MonthlyReportData;
|
|
|
+import com.simuwang.base.pojo.dto.report.ReportFundInfoDTO;
|
|
|
+import com.simuwang.base.pojo.dto.report.ReportNetReportDTO;
|
|
|
+import com.simuwang.base.pojo.dto.report.ReportParserParams;
|
|
|
import com.simuwang.daq.components.report.parser.ReportParserConstant;
|
|
|
-import com.smppw.common.pojo.ValueLabelVO;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import technology.tabula.RectangularTextContainer;
|
|
|
import technology.tabula.Table;
|
|
@@ -56,6 +55,7 @@ public class PDMonthlyReportParser extends AbstractPDReportParser<MonthlyReportD
|
|
|
}
|
|
|
Map<String, Object> baseInfoMap = MapUtil.newHashMap(32);
|
|
|
for (int i = 0; i < fundInfoTable.getRows().size(); i++) {
|
|
|
+ @SuppressWarnings("all")
|
|
|
List<RectangularTextContainer> cols = fundInfoTable.getRows().get(i);
|
|
|
for (int j = 0; j < 2; j++) {
|
|
|
baseInfoMap.put(cols.get(j * 2).getText(), cols.get(j * 2 + 1).getText());
|
|
@@ -89,40 +89,4 @@ public class PDMonthlyReportParser extends AbstractPDReportParser<MonthlyReportD
|
|
|
reportData.setNetReport(exts);
|
|
|
return reportData;
|
|
|
}
|
|
|
-
|
|
|
- private void buildInfo(Map<String, Object> extInfoMap, Object info) {
|
|
|
- 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;
|
|
|
- }
|
|
|
- if (fieldValue != null) {
|
|
|
- fieldValue = fieldValue.replace("\r", Constants.EMPTY);
|
|
|
- }
|
|
|
- for (ValueLabelVO vo : this.fieldMapper) {
|
|
|
- String fieldName = vo.getValue();
|
|
|
- List<String> labels = StrUtil.split(vo.getLabel(), ",");
|
|
|
- if (labels.contains(k)) {
|
|
|
- try {
|
|
|
- ReflectUtil.setFieldValue(info, fieldName, fieldValue);
|
|
|
- } catch (Exception e) {
|
|
|
- this.logger.warn("{} 字段值设置错误:{}", fieldName, e.getMessage());
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- for (String label : labels) {
|
|
|
- if (k.contains(label)) {
|
|
|
- try {
|
|
|
- ReflectUtil.setFieldValue(info, fieldName, fieldValue);
|
|
|
- } catch (Exception e) {
|
|
|
- this.logger.warn("{} 字段值设置错误:{}", fieldName, e.getMessage());
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|