|
@@ -29,32 +29,35 @@ public abstract class AbstractReportWriter<T extends ReportData> implements Repo
|
|
|
public void write(T reportData) {
|
|
|
StopWatch stopWatch = new StopWatch();
|
|
|
stopWatch.start();
|
|
|
+ // 基本信息+基金信息保存
|
|
|
try {
|
|
|
- // 基本信息+基金信息保存
|
|
|
ReportBaseInfoDTO baseInfo = reportData.getBaseInfo();
|
|
|
if (baseInfo != null) {
|
|
|
ReportBaseInfoDO entity = baseInfo.toEntity();
|
|
|
this.baseInfoMapper.insert(entity);
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ this.logger.error("报告解析结果只报告基本信息保存报错\n{}", ExceptionUtil.stacktraceToString(e));
|
|
|
+ }
|
|
|
+ try {
|
|
|
ReportFundInfoDTO fundInfo = reportData.getFundInfo();
|
|
|
if (fundInfo != null) {
|
|
|
ReportFundInfoDO entity = fundInfo.toEntity();
|
|
|
this.fundInfoMapper.insert(entity);
|
|
|
}
|
|
|
- try {
|
|
|
- // 其他信息保存
|
|
|
- this.writeExtData(reportData);
|
|
|
- } catch (Exception e) {
|
|
|
- this.logger.warn("报告解析结果之类型特有数据保存报错\n{}", ExceptionUtil.stacktraceToString(e));
|
|
|
- }
|
|
|
} catch (Exception e) {
|
|
|
- this.logger.error("报告解析结果保存错误\n{}", ExceptionUtil.stacktraceToString(e));
|
|
|
- } finally {
|
|
|
- stopWatch.stop();
|
|
|
- long totalTimeMillis = stopWatch.getTotalTimeMillis();
|
|
|
- if (this.logger.isInfoEnabled()) {
|
|
|
- this.logger.info("报告解析结果保存成功,耗时:{}ms", totalTimeMillis);
|
|
|
- }
|
|
|
+ this.logger.error("报告解析结果只基金信息保存报错\n{}", ExceptionUtil.stacktraceToString(e));
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ // 其他信息保存
|
|
|
+ this.writeExtData(reportData);
|
|
|
+ } catch (Exception e) {
|
|
|
+ this.logger.error("报告解析结果之类型特有数据保存报错\n{}", ExceptionUtil.stacktraceToString(e));
|
|
|
+ }
|
|
|
+ stopWatch.stop();
|
|
|
+ long totalTimeMillis = stopWatch.getTotalTimeMillis();
|
|
|
+ if (this.logger.isInfoEnabled()) {
|
|
|
+ this.logger.info("报告解析结果保存成功,耗时:{}ms", totalTimeMillis);
|
|
|
}
|
|
|
}
|
|
|
|