|
@@ -220,6 +220,9 @@ public class EmailParseService {
|
|
|
List<ParseResult<ReportData>> dataList = ListUtil.list(false);
|
|
|
for (Map.Entry<EmailContentInfoDTO, List<EmailZipFileDTO>> entry : emailZipFileMap.entrySet()) {
|
|
|
EmailContentInfoDTO emailContentInfoDTO = entry.getKey();
|
|
|
+ if (emailContentInfoDTO.getFileName() != null && emailContentInfoDTO.getFileName().endsWith(".html")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Integer emailId = emailContentInfoDTO.getEmailId();
|
|
|
EmailParseInfoDO emailParseInfoDO = buildEmailParseInfo(emailId, emailAddress, emailContentInfoDTO);
|
|
|
emailParseInfoDO.setEmailKey(emailKey);
|
|
@@ -227,9 +230,6 @@ public class EmailParseService {
|
|
|
if (emailId == null) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (emailContentInfoDTO.getFileName() != null && emailContentInfoDTO.getFileName().endsWith(".html")) {
|
|
|
- continue;
|
|
|
- }
|
|
|
|
|
|
List<EmailZipFileDTO> zipFiles = entry.getValue();
|
|
|
if (CollUtil.isNotEmpty(zipFiles)) {
|
|
@@ -275,10 +275,9 @@ public class EmailParseService {
|
|
|
private ParseResult<ReportData> parseReportAndHandleResult(int fileId, String fileName,
|
|
|
String filepath, Integer emailType, String aiFileId) {
|
|
|
ParseResult<ReportData> result = new ParseResult<>();
|
|
|
- if ((!Objects.equals(EmailTypeConst.REPORT_EMAIL_TYPE, emailType)
|
|
|
- && !Objects.equals(EmailTypeConst.REPORT_LETTER_EMAIL_TYPE, emailType))
|
|
|
- || StrUtil.isBlank(fileName)
|
|
|
- || fileName.endsWith(".html")) {
|
|
|
+ boolean reportFlag = !Objects.equals(EmailTypeConst.REPORT_EMAIL_TYPE, emailType)
|
|
|
+ && !Objects.equals(EmailTypeConst.REPORT_LETTER_EMAIL_TYPE, emailType);
|
|
|
+ if (reportFlag || StrUtil.isBlank(fileName) || fileName.endsWith(".html")) {
|
|
|
result.setStatus(ReportParseStatus.NOT_A_REPORT.getCode());
|
|
|
result.setMsg(StrUtil.format(ReportParseStatus.NOT_A_REPORT.getMsg(), fileName));
|
|
|
return result;
|
|
@@ -291,6 +290,9 @@ public class EmailParseService {
|
|
|
}
|
|
|
// 类型识别---先识别季度报告,没有季度再识别年度报告,最后识别月报
|
|
|
ReportType reportType = ReportParseUtils.matchReportType(fileName);
|
|
|
+ if (Objects.equals(EmailTypeConst.REPORT_LETTER_EMAIL_TYPE, emailType)) {
|
|
|
+ reportType = ReportType.LETTER;
|
|
|
+ }
|
|
|
// 解析器--如果开启python解析则直接调用python接口,否则根据文件后缀获取对应解析器
|
|
|
ReportParserFileType fileType;
|
|
|
String fileSuffix = StrUtil.subAfter(fileName, ".", true);
|