|
@@ -2,7 +2,6 @@ package com.smppw.modaq.application.components.report.parser.ai;
|
|
|
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
|
import com.smppw.modaq.application.components.report.parser.ReportParserConstant;
|
|
|
-import com.smppw.modaq.common.enums.ReportParseStatus;
|
|
|
import com.smppw.modaq.common.exception.ReportParseException;
|
|
|
import com.smppw.modaq.domain.dto.report.MonthlyReportData;
|
|
|
import com.smppw.modaq.domain.dto.report.ReportBaseInfoDTO;
|
|
@@ -11,8 +10,6 @@ import com.smppw.modaq.domain.dto.report.ReportParserParams;
|
|
|
import com.smppw.modaq.domain.mapper.EmailFieldMappingMapper;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
@Component(ReportParserConstant.PARSER_AI_MONTHLY)
|
|
|
public class AIMonthlyReportParser extends AbstractAIReportParser<MonthlyReportData> {
|
|
|
public AIMonthlyReportParser(EmailFieldMappingMapper fieldMappingMapper) {
|
|
@@ -27,8 +24,8 @@ public class AIMonthlyReportParser extends AbstractAIReportParser<MonthlyReportD
|
|
|
@Override
|
|
|
protected String prompt() {
|
|
|
return """
|
|
|
- 识别文件中的基金概况,并且解析文件中的联系人等信息,
|
|
|
- 要求准确识别金额等小数的位数,去掉金额单位、英文和多余的空格,结果用json返回
|
|
|
+ 识别报告中的基金名称、基金编码和联系人信息,基金编码的正则表达式是`S[A-Z0-9]{5}`,如果没有联系人信息则返回空字符串,
|
|
|
+ 结果用json返回
|
|
|
""";
|
|
|
}
|
|
|
|
|
@@ -61,14 +58,13 @@ public class AIMonthlyReportParser extends AbstractAIReportParser<MonthlyReportD
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
protected ReportFundInfoDTO buildFundInfo(ReportParserParams params) {
|
|
|
- // 获取并移除基金概况信息
|
|
|
- Object fundInfo = this.allInfoMap.remove("基金概况");
|
|
|
- if (fundInfo == null) {
|
|
|
- throw new ReportParseException(ReportParseStatus.PARSE_FUND_INFO_FAIL, params.getFilename());
|
|
|
- }
|
|
|
- Map<String, Object> fundInfoMap = (Map<String, Object>) fundInfo;
|
|
|
- return this.buildDto(params.getFileId(), ReportFundInfoDTO.class, fundInfoMap);
|
|
|
+// // 获取并移除基金概况信息
|
|
|
+// Object fundInfo = this.allInfoMap.get("基金概况");
|
|
|
+// if (fundInfo == null) {
|
|
|
+// throw new ReportParseException(ReportParseStatus.PARSE_FUND_INFO_FAIL, params.getFilename());
|
|
|
+// }
|
|
|
+// Map<String, Object> fundInfoMap = (Map<String, Object>) fundInfo;
|
|
|
+ return this.buildDto(params.getFileId(), ReportFundInfoDTO.class, this.allInfoMap);
|
|
|
}
|
|
|
}
|