Просмотр исходного кода

fix:确认单ocr解析时的逻辑优化

wangzaijun 1 неделя назад
Родитель
Сommit
bbe3186ae3
45 измененных файлов с 1008 добавлено и 987 удалено
  1. 71 71
      mo-daq/db/init.sql
  2. 1 1
      mo-daq/readme.md
  3. 40 41
      mo-daq/src/main/java/com/smppw/modaq/application/components/ReportParseUtils.java
  4. 95 101
      mo-daq/src/main/java/com/smppw/modaq/application/components/report/parser/pdf/AbstractPDReportParser.java
  5. 2 2
      mo-daq/src/main/java/com/smppw/modaq/application/task/ParseSchedulerTask.java
  6. 0 1
      mo-daq/src/main/java/com/smppw/modaq/application/util/EmailUtil.java
  7. 12 12
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/AnnuallyReportData.java
  8. 32 32
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/BaseReportLevelDTO.java
  9. 24 24
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/MonthlyReportData.java
  10. 35 35
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/QuarterlyReportData.java
  11. 62 62
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportAssetAllocationDTO.java
  12. 93 93
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportFinancialIndicatorsDTO.java
  13. 7 0
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportFundTransactionDTO.java
  14. 62 62
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportInvestmentIndustryDTO.java
  15. 7 0
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportInvestorInfoDTO.java
  16. 73 73
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportNetReportDTO.java
  17. 73 73
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportShareChangeDTO.java
  18. 12 12
      mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/WeeklyReportData.java
  19. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/EmailFieldMappingDO.java
  20. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/EmailFileInfoDO.java
  21. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/EmailParseInfoDO.java
  22. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/MailboxInfoDO.java
  23. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/TaskRecordDO.java
  24. 34 34
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportAssetAllocationDO.java
  25. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportBaseInfoDO.java
  26. 26 26
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportFinancialIndicatorsDO.java
  27. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportFundInfoDO.java
  28. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportFundTransactionDO.java
  29. 42 42
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportInvestmentIndustryDO.java
  30. 1 1
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportInvestorInfoDO.java
  31. 38 38
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportNetReportDO.java
  32. 42 42
      mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportShareChangeDO.java
  33. 9 9
      mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportAssetAllocationMapper.java
  34. 9 9
      mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportFinancialIndicatorMapper.java
  35. 9 9
      mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportInvestmentIndustryMapper.java
  36. 9 9
      mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportNetReportMapper.java
  37. 9 9
      mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportShareChangeMapper.java
  38. 28 13
      mo-daq/src/main/java/com/smppw/modaq/domain/service/EmailParseService.java
  39. 2 2
      mo-daq/src/main/java/com/smppw/modaq/infrastructure/util/PdfUtil.java
  40. 3 3
      mo-daq/src/main/resources/application.yml
  41. 1 1
      mo-daq/src/main/resources/mapper/EmailFieldMappingMapper.xml
  42. 22 22
      mo-daq/src/main/resources/mapper/EmailFileInfoMapper.xml
  43. 9 9
      mo-daq/src/main/resources/mapper/EmailParseInfoMapper.xml
  44. 5 5
      mo-daq/src/main/resources/mapper/MailBoxInfoMapper.xml
  45. 1 1
      mo-daq/src/test/java/com/smppw/modaq/MoDaqApplicationTests.java

Разница между файлами не показана из-за своего большого размера
+ 71 - 71
mo-daq/db/init.sql


+ 1 - 1
mo-daq/readme.md

@@ -1,6 +1,6 @@
 # 邮件采集+解析
 
-- 数据库初始化文件在 db/init.sql 中,记得调整 `mo_mailbox_info` 表的配置信息,其他不用改
+- 数据库初始化文件在 db/init.sql 中,记得调整 `daq_mailbox_info` 表的配置信息,其他不用改
 - 任务每天4点执行一次,往前找一天的邮件来解析
 - 解析规则是文件名必须包含“确认单”\“确认函” 才能进入到代码解析
 - 优先用Java来解析,当Java无法解析时调用openai上传文件并解析

+ 40 - 41
mo-daq/src/main/java/com/smppw/modaq/application/components/ReportParseUtils.java

@@ -8,7 +8,6 @@ import com.smppw.modaq.application.util.EmailUtil;
 import com.smppw.modaq.common.conts.EmailTypeConst;
 import com.smppw.modaq.common.conts.PatternConsts;
 import com.smppw.modaq.common.enums.ReportType;
-import com.smppw.modaq.domain.dto.report.ReportAssetAllocationDTO;
 import com.smppw.modaq.infrastructure.util.ConvertUtil;
 import jakarta.mail.internet.MimeUtility;
 
@@ -176,46 +175,46 @@ public final class ReportParseUtils {
         ASSET_ALLOCATION_TYPE_MAPPER.put("其他融资总额", "基金负债情况");
     }
 
-    /**
-     * 构建基金资产配置信息
-     *
-     * @param fileId      文件id
-     * @param detail      资产类型(清理过特殊字符的字符串)
-     * @param mvAndRemark 市值或备注
-     * @param dtos        结果数据
-     */
-    public static void buildAssetAllocation(Integer fileId,
-                                            String detail,
-                                            String mvAndRemark,
-                                            List<ReportAssetAllocationDTO> dtos) {
-        if (StrUtil.isBlank(mvAndRemark)) {
-            return;
-        }
-        // 资产大类
-        String assetType = ReportParseUtils.ASSET_ALLOCATION_TYPE_MAPPER.get(detail);
-        if (StrUtil.contains(mvAndRemark, "#")) {
-            // 有#表示有备注,而且可能有多个,多个用分号分隔的.
-            List<String> marketValueAndRemarks = StrUtil.split(mvAndRemark, ";");
-            for (String mr : marketValueAndRemarks) {
-                if (StrUtil.isBlank(mr)) {
-                    continue;
-                }
-                List<String> mrs = StrUtil.split(mr, "#");
-                ReportAssetAllocationDTO dto = new ReportAssetAllocationDTO(fileId);
-                dto.setAssetType(assetType);
-                dto.setAssetDetails(detail);
-                dto.setMarketValue(mrs.get(1));
-                dto.setRemark(mrs.get(0));
-                dtos.add(dto);
-            }
-        } else {
-            ReportAssetAllocationDTO dto = new ReportAssetAllocationDTO(fileId);
-            dto.setAssetType(assetType);
-            dto.setAssetDetails(detail);
-            dto.setMarketValue(mvAndRemark);
-            dtos.add(dto);
-        }
-    }
+//    /**
+//     * 构建基金资产配置信息
+//     *
+//     * @param fileId      文件id
+//     * @param detail      资产类型(清理过特殊字符的字符串)
+//     * @param mvAndRemark 市值或备注
+//     * @param dtos        结果数据
+//     */
+//    public static void buildAssetAllocation(Integer fileId,
+//                                            String detail,
+//                                            String mvAndRemark,
+//                                            List<ReportAssetAllocationDTO> dtos) {
+//        if (StrUtil.isBlank(mvAndRemark)) {
+//            return;
+//        }
+//        // 资产大类
+//        String assetType = ReportParseUtils.ASSET_ALLOCATION_TYPE_MAPPER.get(detail);
+//        if (StrUtil.contains(mvAndRemark, "#")) {
+//            // 有#表示有备注,而且可能有多个,多个用分号分隔的.
+//            List<String> marketValueAndRemarks = StrUtil.split(mvAndRemark, ";");
+//            for (String mr : marketValueAndRemarks) {
+//                if (StrUtil.isBlank(mr)) {
+//                    continue;
+//                }
+//                List<String> mrs = StrUtil.split(mr, "#");
+//                ReportAssetAllocationDTO dto = new ReportAssetAllocationDTO(fileId);
+//                dto.setAssetType(assetType);
+//                dto.setAssetDetails(detail);
+//                dto.setMarketValue(mrs.get(1));
+//                dto.setRemark(mrs.get(0));
+//                dtos.add(dto);
+//            }
+//        } else {
+//            ReportAssetAllocationDTO dto = new ReportAssetAllocationDTO(fileId);
+//            dto.setAssetType(assetType);
+//            dto.setAssetDetails(detail);
+//            dto.setMarketValue(mvAndRemark);
+//            dtos.add(dto);
+//        }
+//    }
 
     /**
      * 数据清洗,替换圆括号,包含中文或英文的圆括号

+ 95 - 101
mo-daq/src/main/java/com/smppw/modaq/application/components/report/parser/pdf/AbstractPDReportParser.java

@@ -1,15 +1,12 @@
 package com.smppw.modaq.application.components.report.parser.pdf;
 
 import cn.hutool.core.collection.ListUtil;
-import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.StrUtil;
 import com.smppw.modaq.application.components.CustomPDFTextStripper;
-import com.smppw.modaq.application.components.ReportParseUtils;
 import com.smppw.modaq.application.components.report.parser.AbstractReportParser;
 import com.smppw.modaq.common.enums.ReportParseStatus;
 import com.smppw.modaq.common.enums.ReportType;
 import com.smppw.modaq.common.exception.ReportParseException;
-import com.smppw.modaq.domain.dto.report.BaseReportLevelDTO;
 import com.smppw.modaq.domain.dto.report.ReportData;
 import com.smppw.modaq.domain.dto.report.ReportParserParams;
 import com.smppw.modaq.domain.mapper.EmailFieldMappingMapper;
@@ -23,10 +20,7 @@ import technology.tabula.Table;
 import technology.tabula.extractors.SpreadsheetExtractionAlgorithm;
 
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
 
 /**
  * @author wangzaijun
@@ -118,101 +112,101 @@ public abstract class AbstractPDReportParser<T extends ReportData> extends Abstr
         this.textList = null;
     }
 
-    /**
-     * 构建只有两列表格的dto数据对象,如果有分级基金时(并且一个表格可能跨页)
-     *
-     * @param <DTO>    泛型对象
-     * @param fileId   文件id
-     * @param tables   表格
-     * @param clazz    泛型对象
-     * @param function 表格转换的函数
-     * @return /
-     */
-    protected <DTO extends BaseReportLevelDTO<?>> List<DTO> buildLevelDto(Integer fileId,
-                                                                          List<Table> tables,
-                                                                          Class<DTO> clazz,
-                                                                          Function<Table, Map<String, Object>> function) {
-        List<DTO> dtos = ListUtil.list(true);
-        // 信息表格字段和值映射
-        List<Map<String, Object>> infos = ListUtil.list(true);
-        for (Table table : tables) {
-            Map<String, Object> infoMap = MapUtil.newHashMap(16);
-            Map<String, Object> temp = function.apply(table);
-            for (String key : temp.keySet()) {
-                // 如果infoMap中包含了该key时,先放infos中然后重新声明新map对象
-                if (infoMap.containsKey(key)) {
-                    infos.add(new HashMap<>(infoMap));
-                    infoMap = MapUtil.newHashMap(16);
-                } else {
-                    infoMap.put(key, temp.get(key));
-                }
-            }
-            infos.add(infoMap);
-        }
-        // 分级基金匹配
-        List<String> levels = ReportParseUtils.matchTieredFund(String.join(",", this.textList));
-        for (int i = 0; i < infos.size(); i++) {
-            DTO dto = this.buildDto(fileId, clazz, infos.get(i));
-            if (dto == null) {
-                continue;
-            }
-            if (levels.size() > i) {
-                dto.setLevel(levels.get(i));
-            }
-            dtos.add(dto);
-        }
-        return dtos;
-    }
+//    /**
+//     * 构建只有两列表格的dto数据对象,如果有分级基金时(并且一个表格可能跨页)
+//     *
+//     * @param <DTO>    泛型对象
+//     * @param fileId   文件id
+//     * @param tables   表格
+//     * @param clazz    泛型对象
+//     * @param function 表格转换的函数
+//     * @return /
+//     */
+//    protected <DTO extends BaseReportLevelDTO<?>> List<DTO> buildLevelDto(Integer fileId,
+//                                                                          List<Table> tables,
+//                                                                          Class<DTO> clazz,
+//                                                                          Function<Table, Map<String, Object>> function) {
+//        List<DTO> dtos = ListUtil.list(true);
+//        // 信息表格字段和值映射
+//        List<Map<String, Object>> infos = ListUtil.list(true);
+//        for (Table table : tables) {
+//            Map<String, Object> infoMap = MapUtil.newHashMap(16);
+//            Map<String, Object> temp = function.apply(table);
+//            for (String key : temp.keySet()) {
+//                // 如果infoMap中包含了该key时,先放infos中然后重新声明新map对象
+//                if (infoMap.containsKey(key)) {
+//                    infos.add(new HashMap<>(infoMap));
+//                    infoMap = MapUtil.newHashMap(16);
+//                } else {
+//                    infoMap.put(key, temp.get(key));
+//                }
+//            }
+//            infos.add(infoMap);
+//        }
+//        // 分级基金匹配
+//        List<String> levels = ReportParseUtils.matchTieredFund(String.join(",", this.textList));
+//        for (int i = 0; i < infos.size(); i++) {
+//            DTO dto = this.buildDto(fileId, clazz, infos.get(i));
+//            if (dto == null) {
+//                continue;
+//            }
+//            if (levels.size() > i) {
+//                dto.setLevel(levels.get(i));
+//            }
+//            dtos.add(dto);
+//        }
+//        return dtos;
+//    }
 
-    /**
-     * 判断表格是否需要合并并且把需要合并的表格放在一个索引对应的map中(主要处理有分级基金数据表格,不处理可能会把数据绑定到错误的分级基金中)
-     *
-     * @param table                待判断的表格
-     * @param rowCount             判断依据(一个完整的表格有多少行)
-     * @param index                当前完整表格所在的索引位置
-     * @param tables               不需要合并的表格集合
-     * @param spanningPageTableMap 需要合并的表格数据
-     * @return /
-     */
-    protected int splitTables(Table table, int rowCount, int index,
-                              List<Table> tables, Map<Integer, List<Table>> spanningPageTableMap) {
-        if (table.getRowCount() == rowCount) {
-            index++;
-            tables.add(table);
-        } else {
-            List<Table> tempList = spanningPageTableMap.getOrDefault(index, ListUtil.list(true));
-            tempList.add(table);
-            spanningPageTableMap.putIfAbsent(index, tempList);
-            // 一个表格最多跨两页,所以一个表格最多被分成2部分
-            if (tempList.size() == 2) {
-                index++;
-            }
-        }
-        return index;
-    }
+//    /**
+//     * 判断表格是否需要合并并且把需要合并的表格放在一个索引对应的map中(主要处理有分级基金数据表格,不处理可能会把数据绑定到错误的分级基金中)
+//     *
+//     * @param table                待判断的表格
+//     * @param rowCount             判断依据(一个完整的表格有多少行)
+//     * @param index                当前完整表格所在的索引位置
+//     * @param tables               不需要合并的表格集合
+//     * @param spanningPageTableMap 需要合并的表格数据
+//     * @return /
+//     */
+//    protected int splitTables(Table table, int rowCount, int index,
+//                              List<Table> tables, Map<Integer, List<Table>> spanningPageTableMap) {
+//        if (table.getRowCount() == rowCount) {
+//            index++;
+//            tables.add(table);
+//        } else {
+//            List<Table> tempList = spanningPageTableMap.getOrDefault(index, ListUtil.list(true));
+//            tempList.add(table);
+//            spanningPageTableMap.putIfAbsent(index, tempList);
+//            // 一个表格最多跨两页,所以一个表格最多被分成2部分
+//            if (tempList.size() == 2) {
+//                index++;
+//            }
+//        }
+//        return index;
+//    }
 
-    /**
-     * 把跨页的表格合并为一个并且插入到数据集合中的特定位置
-     *
-     * @param tables               数据集合
-     * @param spanningPageTableMap 跨页的表格对象
-     */
-    protected void handleSpanningPageTables(List<Table> tables,
-                                            Map<Integer, List<Table>> spanningPageTableMap) {
-        // 跨页的表格数据处理
-        for (Map.Entry<Integer, List<Table>> entry : spanningPageTableMap.entrySet()) {
-            List<Table> spanningPageShareChangeTables = entry.getValue();
-            Table master = spanningPageShareChangeTables.get(0);
-            if (spanningPageShareChangeTables.size() == 2) {
-                Table slave = spanningPageShareChangeTables.get(1);
-                int rowCount = master.getRowCount();
-                for (int j = 0; j < slave.getRowCount(); j++) {
-                    for (int k = 0; k < slave.getColCount(); k++) {
-                        master.add(slave.getCell(j, k), rowCount + j, k);
-                    }
-                }
-            }
-            tables.add(entry.getKey(), master);
-        }
-    }
+//    /**
+//     * 把跨页的表格合并为一个并且插入到数据集合中的特定位置
+//     *
+//     * @param tables               数据集合
+//     * @param spanningPageTableMap 跨页的表格对象
+//     */
+//    protected void handleSpanningPageTables(List<Table> tables,
+//                                            Map<Integer, List<Table>> spanningPageTableMap) {
+//        // 跨页的表格数据处理
+//        for (Map.Entry<Integer, List<Table>> entry : spanningPageTableMap.entrySet()) {
+//            List<Table> spanningPageShareChangeTables = entry.getValue();
+//            Table master = spanningPageShareChangeTables.get(0);
+//            if (spanningPageShareChangeTables.size() == 2) {
+//                Table slave = spanningPageShareChangeTables.get(1);
+//                int rowCount = master.getRowCount();
+//                for (int j = 0; j < slave.getRowCount(); j++) {
+//                    for (int k = 0; k < slave.getColCount(); k++) {
+//                        master.add(slave.getCell(j, k), rowCount + j, k);
+//                    }
+//                }
+//            }
+//            tables.add(entry.getKey(), master);
+//        }
+//    }
 }

+ 2 - 2
mo-daq/src/main/java/com/smppw/modaq/application/task/ParseSchedulerTask.java

@@ -55,7 +55,7 @@ public class ParseSchedulerTask {
      */
     @Scheduled(cron = "0 */11 * * * ?")
     public void letter() {
-        String taskKey = "mo_email_parse_letter_task";
+        String taskKey = "daq_email_parse_letter_task";
         TaskRecordDO task = this.taskRecordService.getTaskRecord(taskKey, 11 * 2 * 60);
         if (task == null) {
             return;
@@ -87,7 +87,7 @@ public class ParseSchedulerTask {
 //     */
 //    @Scheduled(cron = "0 15,45 * * * ?")
 //    public void report() {
-//        String taskKey = "mo_email_parser_report_task";
+//        String taskKey = "daq_email_parser_report_task";
 //        TaskRecordDO task = this.taskRecordService.getTaskRecord(taskKey, 60 * 2 * 60);
 //        if (task == null) {
 //            return;

+ 0 - 1
mo-daq/src/main/java/com/smppw/modaq/application/util/EmailUtil.java

@@ -1,6 +1,5 @@
 package com.smppw.modaq.application.util;
 
-import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.exceptions.ExceptionUtil;
 import cn.hutool.core.map.MapUtil;

+ 12 - 12
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/AnnuallyReportData.java

@@ -1,12 +1,12 @@
-package com.smppw.modaq.domain.dto.report;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Setter
-@Getter
-public class AnnuallyReportData extends QuarterlyReportData {
-    public AnnuallyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
-        super(baseInfo, fundInfo);
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//@Setter
+//@Getter
+//public class AnnuallyReportData extends QuarterlyReportData {
+//    public AnnuallyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
+//        super(baseInfo, fundInfo);
+//    }
+//}

+ 32 - 32
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/BaseReportLevelDTO.java

@@ -1,32 +1,32 @@
-package com.smppw.modaq.domain.dto.report;
-
-import com.smppw.modaq.domain.entity.report.BaseReportDO;
-import lombok.Getter;
-import lombok.Setter;
-
-@Setter
-@Getter
-public abstract class BaseReportLevelDTO<T extends BaseReportDO> extends BaseReportDTO<T> {
-    /**
-     * 基金分级
-     */
-    private String level;
-
-    public BaseReportLevelDTO() {
-        super();
-    }
-
-    public BaseReportLevelDTO(Integer fileId) {
-        super(fileId);
-    }
-
-    public BaseReportLevelDTO(Integer fileId, String level) {
-        super(fileId);
-        this.level = level;
-    }
-
-    @Override
-    public String toString() {
-        return super.toString() + ", level='" + this.level + "'";
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import com.smppw.modaq.domain.entity.report.BaseReportDO;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//@Setter
+//@Getter
+//public abstract class BaseReportLevelDTO<T extends BaseReportDO> extends BaseReportDTO<T> {
+//    /**
+//     * 基金分级
+//     */
+//    private String level;
+//
+//    public BaseReportLevelDTO() {
+//        super();
+//    }
+//
+//    public BaseReportLevelDTO(Integer fileId) {
+//        super(fileId);
+//    }
+//
+//    public BaseReportLevelDTO(Integer fileId, String level) {
+//        super(fileId);
+//        this.level = level;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return super.toString() + ", level='" + this.level + "'";
+//    }
+//}

+ 24 - 24
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/MonthlyReportData.java

@@ -1,24 +1,24 @@
-package com.smppw.modaq.domain.dto.report;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-@Setter
-@Getter
-public class MonthlyReportData extends ReportData {
-    private List<ReportNetReportDTO> netReport;
-
-    public MonthlyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
-        super(baseInfo, fundInfo);
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", netReport=" + netReport +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.util.List;
+//
+//@Setter
+//@Getter
+//public class MonthlyReportData extends ReportData {
+//    private List<ReportNetReportDTO> netReport;
+//
+//    public MonthlyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
+//        super(baseInfo, fundInfo);
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", netReport=" + netReport +
+//                '}';
+//    }
+//}

+ 35 - 35
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/QuarterlyReportData.java

@@ -1,35 +1,35 @@
-package com.smppw.modaq.domain.dto.report;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 17:24
- * @description 季报
- */
-@Setter
-@Getter
-public class QuarterlyReportData extends ReportData {
-    private List<ReportAssetAllocationDTO> assetAllocation;
-    private List<ReportFinancialIndicatorsDTO> financialIndicators;
-    private List<ReportInvestmentIndustryDTO> investmentIndustry;
-    private List<ReportShareChangeDTO> shareChange;
-
-    public QuarterlyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
-        super(baseInfo, fundInfo);
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", assetAllocation=" + assetAllocation +
-                ", financialIndicators=" + financialIndicators +
-                ", investmentIndustry=" + investmentIndustry +
-                ", shareChange=" + shareChange +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.util.List;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 17:24
+// * @description 季报
+// */
+//@Setter
+//@Getter
+//public class QuarterlyReportData extends ReportData {
+//    private List<ReportAssetAllocationDTO> assetAllocation;
+//    private List<ReportFinancialIndicatorsDTO> financialIndicators;
+//    private List<ReportInvestmentIndustryDTO> investmentIndustry;
+//    private List<ReportShareChangeDTO> shareChange;
+//
+//    public QuarterlyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
+//        super(baseInfo, fundInfo);
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", assetAllocation=" + assetAllocation +
+//                ", financialIndicators=" + financialIndicators +
+//                ", investmentIndustry=" + investmentIndustry +
+//                ", shareChange=" + shareChange +
+//                '}';
+//    }
+//}

+ 62 - 62
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportAssetAllocationDTO.java

@@ -1,62 +1,62 @@
-package com.smppw.modaq.domain.dto.report;
-
-import com.smppw.modaq.domain.entity.report.ReportAssetAllocationDO;
-import com.smppw.modaq.infrastructure.util.ConvertUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:43
- * @description 基金资产组合情况
- */
-@Setter
-@Getter
-public class ReportAssetAllocationDTO extends BaseReportDTO<ReportAssetAllocationDO> {
-    /**
-     * 资产大类
-     */
-    private String assetType;
-    /**
-     * 资产明细
-     */
-    private String assetDetails;
-    /**
-     * 市值
-     */
-    private String marketValue;
-    /**
-     * 备注
-     */
-    private String remark;
-
-    public ReportAssetAllocationDTO() {
-        super();
-    }
-
-    public ReportAssetAllocationDTO(Integer fileId) {
-        super(fileId);
-    }
-
-    @Override
-    public ReportAssetAllocationDO toEntity() {
-        ReportAssetAllocationDO entity = new ReportAssetAllocationDO();
-        entity.setFileId(this.getFileId());
-        entity.setAssetType(this.assetType);
-        entity.setColumnName(this.assetDetails);
-        entity.setMarketValue(ConvertUtil.toBigDecimal(this.marketValue));
-        entity.setRemark(this.remark);
-        return entity;
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", assetType='" + assetType + '\'' +
-                ", assetDetails='" + assetDetails + '\'' +
-                ", marketValue=" + marketValue +
-                ", remark='" + remark + '\'' +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import com.smppw.modaq.domain.entity.report.ReportAssetAllocationDO;
+//import com.smppw.modaq.infrastructure.util.ConvertUtil;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:43
+// * @description 基金资产组合情况
+// */
+//@Setter
+//@Getter
+//public class ReportAssetAllocationDTO extends BaseReportDTO<ReportAssetAllocationDO> {
+//    /**
+//     * 资产大类
+//     */
+//    private String assetType;
+//    /**
+//     * 资产明细
+//     */
+//    private String assetDetails;
+//    /**
+//     * 市值
+//     */
+//    private String marketValue;
+//    /**
+//     * 备注
+//     */
+//    private String remark;
+//
+//    public ReportAssetAllocationDTO() {
+//        super();
+//    }
+//
+//    public ReportAssetAllocationDTO(Integer fileId) {
+//        super(fileId);
+//    }
+//
+//    @Override
+//    public ReportAssetAllocationDO toEntity() {
+//        ReportAssetAllocationDO entity = new ReportAssetAllocationDO();
+//        entity.setFileId(this.getFileId());
+//        entity.setAssetType(this.assetType);
+//        entity.setColumnName(this.assetDetails);
+//        entity.setMarketValue(ConvertUtil.toBigDecimal(this.marketValue));
+//        entity.setRemark(this.remark);
+//        return entity;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", assetType='" + assetType + '\'' +
+//                ", assetDetails='" + assetDetails + '\'' +
+//                ", marketValue=" + marketValue +
+//                ", remark='" + remark + '\'' +
+//                '}';
+//    }
+//}

+ 93 - 93
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportFinancialIndicatorsDTO.java

@@ -1,93 +1,93 @@
-package com.smppw.modaq.domain.dto.report;
-
-import cn.hutool.core.util.StrUtil;
-import com.smppw.modaq.domain.entity.report.ReportFinancialIndicatorsDO;
-import com.smppw.modaq.infrastructure.util.ConvertUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-@Setter
-@Getter
-public class ReportFinancialIndicatorsDTO extends BaseReportLevelDTO<ReportFinancialIndicatorsDO> {
-    /**
-     * 年度
-     */
-    private String yearly;
-    /**
-     * 期末基金净资产
-     */
-    private String assetNet;
-    /**
-     * 报告期期末单位净值
-     */
-    private String nav;
-    /**
-     * 本期利润
-     */
-    private String profit;
-    /**
-     * 本期已实现收益
-     */
-    private String realizedIncome;
-    /**
-     * 期末可供分配利润
-     */
-    private String undistributedProfit;
-    /**
-     * 期末可供分配基金份额利润
-     */
-    private String undistributedShareProfit;
-    /**
-     * 基金份额累计净值增长率
-     */
-    private String shareNavRet;
-
-    public ReportFinancialIndicatorsDTO() {
-        super();
-    }
-
-    public ReportFinancialIndicatorsDTO(Integer fileId) {
-        super(fileId);
-    }
-
-    public ReportFinancialIndicatorsDTO(Integer fileId, String level) {
-        super(fileId, level);
-    }
-
-    @Override
-    public ReportFinancialIndicatorsDO toEntity() {
-        ReportFinancialIndicatorsDO entity = new ReportFinancialIndicatorsDO();
-        entity.setFileId(this.getFileId());
-        entity.setLevel(this.getLevel());
-        entity.setFundAssetSize(ConvertUtil.toBigDecimal(this.assetNet));
-        entity.setNav(ConvertUtil.toBigDecimal(this.nav));
-        entity.setProfit(ConvertUtil.toBigDecimal(this.profit));
-        entity.setRealizedIncome(ConvertUtil.toBigDecimal(this.realizedIncome));
-        entity.setUndistributedProfit(ConvertUtil.toBigDecimal(this.undistributedProfit));
-        if (StrUtil.isNotBlank(this.yearly)) {
-            Matcher matcher = Pattern.compile("\\d+").matcher(this.yearly);
-            if (matcher.find()) {
-                entity.setEndDate(Integer.parseInt(matcher.group()));
-            }
-        }
-        return entity;
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", yearly=" + yearly +
-                ", assetNet=" + assetNet +
-                ", nav=" + nav +
-                ", profit=" + profit +
-                ", undistributedProfit=" + undistributedProfit +
-                ", realizedIncome=" + realizedIncome +
-                ", undistributedShareProfit=" + undistributedShareProfit +
-                ", shareNavRet=" + shareNavRet +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import cn.hutool.core.util.StrUtil;
+//import com.smppw.modaq.domain.entity.report.ReportFinancialIndicatorsDO;
+//import com.smppw.modaq.infrastructure.util.ConvertUtil;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.util.regex.Matcher;
+//import java.util.regex.Pattern;
+//
+//@Setter
+//@Getter
+//public class ReportFinancialIndicatorsDTO extends BaseReportLevelDTO<ReportFinancialIndicatorsDO> {
+//    /**
+//     * 年度
+//     */
+//    private String yearly;
+//    /**
+//     * 期末基金净资产
+//     */
+//    private String assetNet;
+//    /**
+//     * 报告期期末单位净值
+//     */
+//    private String nav;
+//    /**
+//     * 本期利润
+//     */
+//    private String profit;
+//    /**
+//     * 本期已实现收益
+//     */
+//    private String realizedIncome;
+//    /**
+//     * 期末可供分配利润
+//     */
+//    private String undistributedProfit;
+//    /**
+//     * 期末可供分配基金份额利润
+//     */
+//    private String undistributedShareProfit;
+//    /**
+//     * 基金份额累计净值增长率
+//     */
+//    private String shareNavRet;
+//
+//    public ReportFinancialIndicatorsDTO() {
+//        super();
+//    }
+//
+//    public ReportFinancialIndicatorsDTO(Integer fileId) {
+//        super(fileId);
+//    }
+//
+//    public ReportFinancialIndicatorsDTO(Integer fileId, String level) {
+//        super(fileId, level);
+//    }
+//
+//    @Override
+//    public ReportFinancialIndicatorsDO toEntity() {
+//        ReportFinancialIndicatorsDO entity = new ReportFinancialIndicatorsDO();
+//        entity.setFileId(this.getFileId());
+//        entity.setLevel(this.getLevel());
+//        entity.setFundAssetSize(ConvertUtil.toBigDecimal(this.assetNet));
+//        entity.setNav(ConvertUtil.toBigDecimal(this.nav));
+//        entity.setProfit(ConvertUtil.toBigDecimal(this.profit));
+//        entity.setRealizedIncome(ConvertUtil.toBigDecimal(this.realizedIncome));
+//        entity.setUndistributedProfit(ConvertUtil.toBigDecimal(this.undistributedProfit));
+//        if (StrUtil.isNotBlank(this.yearly)) {
+//            Matcher matcher = Pattern.compile("\\d+").matcher(this.yearly);
+//            if (matcher.find()) {
+//                entity.setEndDate(Integer.parseInt(matcher.group()));
+//            }
+//        }
+//        return entity;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", yearly=" + yearly +
+//                ", assetNet=" + assetNet +
+//                ", nav=" + nav +
+//                ", profit=" + profit +
+//                ", undistributedProfit=" + undistributedProfit +
+//                ", realizedIncome=" + realizedIncome +
+//                ", undistributedShareProfit=" + undistributedShareProfit +
+//                ", shareNavRet=" + shareNavRet +
+//                '}';
+//    }
+//}

+ 7 - 0
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportFundTransactionDTO.java

@@ -239,6 +239,13 @@ public class ReportFundTransactionDTO extends BaseReportDTO<ReportFundTransactio
      */
     private String actualPerformanceShare;
 
+    public ReportFundTransactionDTO() {
+    }
+
+    public ReportFundTransactionDTO(Integer fileId) {
+        super(fileId);
+    }
+
     @Override
     public ReportFundTransactionDO toEntity() {
         ReportFundTransactionDO entity = new ReportFundTransactionDO();

+ 62 - 62
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportInvestmentIndustryDTO.java

@@ -1,62 +1,62 @@
-package com.smppw.modaq.domain.dto.report;
-
-import com.smppw.modaq.domain.entity.report.ReportInvestmentIndustryDO;
-import com.smppw.modaq.infrastructure.util.ConvertUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:49
- * @description 按行业分类的股票投资组合
- */
-@Setter
-@Getter
-public class ReportInvestmentIndustryDTO extends BaseReportDTO<ReportInvestmentIndustryDO> {
-    /**
-     * 行业分类名称
-     */
-    private String industryName;
-    /**
-     * 投资地区: 1-境内, 2-港股通
-     */
-    private Integer investType;
-    /**
-     * 公允价值,市值
-     */
-    private String marketValue;
-    /**
-     * 占基金资产净值的比例,占净值比,权重
-     */
-    private String ratio;
-
-    public ReportInvestmentIndustryDTO() {
-        super();
-    }
-
-    public ReportInvestmentIndustryDTO(Integer fileId) {
-        super(fileId);
-    }
-
-    @Override
-    public ReportInvestmentIndustryDO toEntity() {
-        ReportInvestmentIndustryDO entity = new ReportInvestmentIndustryDO();
-        entity.setFileId(this.getFileId());
-        entity.setIndustryName(this.industryName);
-        entity.setInvestType(this.investType);
-        entity.setMarketValue(ConvertUtil.toBigDecimal(this.marketValue));
-        entity.setRatio(ConvertUtil.toBigDecimal(this.ratio));
-        return entity;
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", industryName='" + industryName + '\'' +
-                ", investType=" + investType +
-                ", marketValue=" + marketValue +
-                ", ratio=" + ratio +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import com.smppw.modaq.domain.entity.report.ReportInvestmentIndustryDO;
+//import com.smppw.modaq.infrastructure.util.ConvertUtil;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:49
+// * @description 按行业分类的股票投资组合
+// */
+//@Setter
+//@Getter
+//public class ReportInvestmentIndustryDTO extends BaseReportDTO<ReportInvestmentIndustryDO> {
+//    /**
+//     * 行业分类名称
+//     */
+//    private String industryName;
+//    /**
+//     * 投资地区: 1-境内, 2-港股通
+//     */
+//    private Integer investType;
+//    /**
+//     * 公允价值,市值
+//     */
+//    private String marketValue;
+//    /**
+//     * 占基金资产净值的比例,占净值比,权重
+//     */
+//    private String ratio;
+//
+//    public ReportInvestmentIndustryDTO() {
+//        super();
+//    }
+//
+//    public ReportInvestmentIndustryDTO(Integer fileId) {
+//        super(fileId);
+//    }
+//
+//    @Override
+//    public ReportInvestmentIndustryDO toEntity() {
+//        ReportInvestmentIndustryDO entity = new ReportInvestmentIndustryDO();
+//        entity.setFileId(this.getFileId());
+//        entity.setIndustryName(this.industryName);
+//        entity.setInvestType(this.investType);
+//        entity.setMarketValue(ConvertUtil.toBigDecimal(this.marketValue));
+//        entity.setRatio(ConvertUtil.toBigDecimal(this.ratio));
+//        return entity;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", industryName='" + industryName + '\'' +
+//                ", investType=" + investType +
+//                ", marketValue=" + marketValue +
+//                ", ratio=" + ratio +
+//                '}';
+//    }
+//}

+ 7 - 0
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportInvestorInfoDTO.java

@@ -37,6 +37,13 @@ public class ReportInvestorInfoDTO extends BaseReportDTO<ReportInvestorInfoDO> {
      */
     private String tradingAccount;
 
+    public ReportInvestorInfoDTO() {
+    }
+
+    public ReportInvestorInfoDTO(Integer fileId) {
+        super(fileId);
+    }
+
     @Override
     public ReportInvestorInfoDO toEntity() {
         ReportInvestorInfoDO entity = new ReportInvestorInfoDO();

+ 73 - 73
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportNetReportDTO.java

@@ -1,73 +1,73 @@
-package com.smppw.modaq.domain.dto.report;
-
-import com.smppw.modaq.domain.entity.report.ReportNetReportDO;
-import com.smppw.modaq.infrastructure.util.ConvertUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:53
- * @description 基协报告净值月报
- */
-@Setter
-@Getter
-public class ReportNetReportDTO extends BaseReportLevelDTO<ReportNetReportDO> {
-    /**
-     * 估值日期
-     */
-    private String valuationDate;
-    /**
-     * 累计净值
-     */
-    private String cumulativeNavWithdrawal;
-    /**
-     * 基金份额总额
-     */
-    private String assetShare;
-    /**
-     * 基金资产净值
-     */
-    private String assetNet;
-    /**
-     * 单位净值
-     */
-    private String nav;
-
-    public ReportNetReportDTO() {
-        super();
-    }
-
-    public ReportNetReportDTO(Integer fileId) {
-        super(fileId);
-    }
-
-    public ReportNetReportDTO(Integer fileId, String level) {
-        super(fileId, level);
-    }
-
-    @Override
-    public ReportNetReportDO toEntity() {
-        ReportNetReportDO entity = new ReportNetReportDO();
-        entity.setFileId(this.getFileId());
-        entity.setLevel(this.getLevel());
-        entity.setValuationDate(ConvertUtil.toDate(this.valuationDate));
-        entity.setCumulativeNav(ConvertUtil.toBigDecimal(this.cumulativeNavWithdrawal));
-        entity.setEndTotalShares(ConvertUtil.toBigDecimal(this.assetShare));
-        entity.setFundAssetSize(ConvertUtil.toBigDecimal(this.assetNet));
-        entity.setNav(ConvertUtil.toBigDecimal(this.nav));
-        return entity;
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", valuationDate='" + valuationDate + '\'' +
-                ", cumulativeNavWithdrawal=" + cumulativeNavWithdrawal +
-                ", assetShare=" + assetShare +
-                ", fundAssetSize=" + assetNet +
-                ", nav=" + nav +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import com.smppw.modaq.domain.entity.report.ReportNetReportDO;
+//import com.smppw.modaq.infrastructure.util.ConvertUtil;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:53
+// * @description 基协报告净值月报
+// */
+//@Setter
+//@Getter
+//public class ReportNetReportDTO extends BaseReportLevelDTO<ReportNetReportDO> {
+//    /**
+//     * 估值日期
+//     */
+//    private String valuationDate;
+//    /**
+//     * 累计净值
+//     */
+//    private String cumulativeNavWithdrawal;
+//    /**
+//     * 基金份额总额
+//     */
+//    private String assetShare;
+//    /**
+//     * 基金资产净值
+//     */
+//    private String assetNet;
+//    /**
+//     * 单位净值
+//     */
+//    private String nav;
+//
+//    public ReportNetReportDTO() {
+//        super();
+//    }
+//
+//    public ReportNetReportDTO(Integer fileId) {
+//        super(fileId);
+//    }
+//
+//    public ReportNetReportDTO(Integer fileId, String level) {
+//        super(fileId, level);
+//    }
+//
+//    @Override
+//    public ReportNetReportDO toEntity() {
+//        ReportNetReportDO entity = new ReportNetReportDO();
+//        entity.setFileId(this.getFileId());
+//        entity.setLevel(this.getLevel());
+//        entity.setValuationDate(ConvertUtil.toDate(this.valuationDate));
+//        entity.setCumulativeNav(ConvertUtil.toBigDecimal(this.cumulativeNavWithdrawal));
+//        entity.setEndTotalShares(ConvertUtil.toBigDecimal(this.assetShare));
+//        entity.setFundAssetSize(ConvertUtil.toBigDecimal(this.assetNet));
+//        entity.setNav(ConvertUtil.toBigDecimal(this.nav));
+//        return entity;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", valuationDate='" + valuationDate + '\'' +
+//                ", cumulativeNavWithdrawal=" + cumulativeNavWithdrawal +
+//                ", assetShare=" + assetShare +
+//                ", fundAssetSize=" + assetNet +
+//                ", nav=" + nav +
+//                '}';
+//    }
+//}

+ 73 - 73
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportShareChangeDTO.java

@@ -1,73 +1,73 @@
-package com.smppw.modaq.domain.dto.report;
-
-import com.smppw.modaq.domain.entity.report.ReportShareChangeDO;
-import com.smppw.modaq.infrastructure.util.ConvertUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:40
- * @description 基金份额变动情况
- */
-@Setter
-@Getter
-public class ReportShareChangeDTO extends BaseReportLevelDTO<ReportShareChangeDO> {
-    /**
-     * 报告期期初基金份额总额
-     */
-    private String initTotalShares;
-    /**
-     * 减: 报告期期间基金总赎回份额
-     */
-    private String redemption;
-    /**
-     * 期末基金总份额/期末基金实缴总额
-     */
-    private String sharePerAsset;
-    /**
-     * 报告期期间基金拆分变动份额
-     */
-    private String splitChangeShare;
-    /**
-     * 报告期期间基金总申购份额
-     */
-    private String subscription;
-
-    public ReportShareChangeDTO() {
-        super();
-    }
-
-    public ReportShareChangeDTO(Integer fileId) {
-        super(fileId);
-    }
-
-    public ReportShareChangeDTO(Integer fileId, String level) {
-        super(fileId, level);
-    }
-
-    @Override
-    public ReportShareChangeDO toEntity() {
-        ReportShareChangeDO entity = new ReportShareChangeDO();
-        entity.setFileId(this.getFileId());
-        entity.setLevel(this.getLevel());
-        entity.setRedemption(ConvertUtil.toBigDecimal(this.redemption));
-        entity.setInitTotalShares(ConvertUtil.toBigDecimal(this.initTotalShares));
-        entity.setSharePerAsset(ConvertUtil.toBigDecimal(this.sharePerAsset));
-        entity.setSplit(ConvertUtil.toBigDecimal(this.splitChangeShare));
-        entity.setSubscription(ConvertUtil.toBigDecimal(this.subscription));
-        return entity;
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                super.toString() +
-                ", initTotalShares=" + initTotalShares +
-                ", redemption=" + redemption +
-                ", sharePerAsset=" + sharePerAsset +
-                ", splitChangeShare=" + splitChangeShare +
-                ", subscription=" + subscription +
-                '}';
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//import com.smppw.modaq.domain.entity.report.ReportShareChangeDO;
+//import com.smppw.modaq.infrastructure.util.ConvertUtil;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:40
+// * @description 基金份额变动情况
+// */
+//@Setter
+//@Getter
+//public class ReportShareChangeDTO extends BaseReportLevelDTO<ReportShareChangeDO> {
+//    /**
+//     * 报告期期初基金份额总额
+//     */
+//    private String initTotalShares;
+//    /**
+//     * 减: 报告期期间基金总赎回份额
+//     */
+//    private String redemption;
+//    /**
+//     * 期末基金总份额/期末基金实缴总额
+//     */
+//    private String sharePerAsset;
+//    /**
+//     * 报告期期间基金拆分变动份额
+//     */
+//    private String splitChangeShare;
+//    /**
+//     * 报告期期间基金总申购份额
+//     */
+//    private String subscription;
+//
+//    public ReportShareChangeDTO() {
+//        super();
+//    }
+//
+//    public ReportShareChangeDTO(Integer fileId) {
+//        super(fileId);
+//    }
+//
+//    public ReportShareChangeDTO(Integer fileId, String level) {
+//        super(fileId, level);
+//    }
+//
+//    @Override
+//    public ReportShareChangeDO toEntity() {
+//        ReportShareChangeDO entity = new ReportShareChangeDO();
+//        entity.setFileId(this.getFileId());
+//        entity.setLevel(this.getLevel());
+//        entity.setRedemption(ConvertUtil.toBigDecimal(this.redemption));
+//        entity.setInitTotalShares(ConvertUtil.toBigDecimal(this.initTotalShares));
+//        entity.setSharePerAsset(ConvertUtil.toBigDecimal(this.sharePerAsset));
+//        entity.setSplit(ConvertUtil.toBigDecimal(this.splitChangeShare));
+//        entity.setSubscription(ConvertUtil.toBigDecimal(this.subscription));
+//        return entity;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return "{" +
+//                super.toString() +
+//                ", initTotalShares=" + initTotalShares +
+//                ", redemption=" + redemption +
+//                ", sharePerAsset=" + sharePerAsset +
+//                ", splitChangeShare=" + splitChangeShare +
+//                ", subscription=" + subscription +
+//                '}';
+//    }
+//}

+ 12 - 12
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/WeeklyReportData.java

@@ -1,12 +1,12 @@
-package com.smppw.modaq.domain.dto.report;
-
-public class WeeklyReportData extends ReportData {
-    public WeeklyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
-        super(baseInfo, fundInfo);
-    }
-
-    @Override
-    public String toString() {
-        return super.toString();
-    }
-}
+//package com.smppw.modaq.domain.dto.report;
+//
+//public class WeeklyReportData extends ReportData {
+//    public WeeklyReportData(ReportBaseInfoDTO baseInfo, ReportFundInfoDTO fundInfo) {
+//        super(baseInfo, fundInfo);
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return super.toString();
+//    }
+//}

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/EmailFieldMappingDO.java

@@ -8,7 +8,7 @@ import lombok.Data;
 import java.util.Date;
 
 @Data
-@TableName("mo_email_field_mapping")
+@TableName("daq_email_field_mapping")
 public class EmailFieldMappingDO {
     /**
      * 主键Id

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/EmailFileInfoDO.java

@@ -6,7 +6,7 @@ import lombok.Data;
 import java.util.Date;
 
 @Data
-@TableName("mo_email_file_info")
+@TableName("daq_email_file_info")
 public class EmailFileInfoDO {
     /**
      * 主键Id

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/EmailParseInfoDO.java

@@ -8,7 +8,7 @@ import lombok.Data;
 import java.util.Date;
 
 @Data
-@TableName("mo_email_parse_info")
+@TableName("daq_email_parse_info")
 public class EmailParseInfoDO {
     /**
      * 主键Id

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/MailboxInfoDO.java

@@ -8,7 +8,7 @@ import lombok.Data;
 import java.util.Date;
 
 @Data
-@TableName("mo_mailbox_info")
+@TableName("daq_mailbox_info")
 public class MailboxInfoDO {
     /**
      * 主键Id

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/TaskRecordDO.java

@@ -8,7 +8,7 @@ import java.util.Date;
 
 @Setter
 @Getter
-@TableName("mo_task_record")
+@TableName("daq_task_record")
 public class TaskRecordDO {
     @TableId(type = IdType.AUTO)
     private Long id;

+ 34 - 34
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportAssetAllocationDO.java

@@ -1,34 +1,34 @@
-package com.smppw.modaq.domain.entity.report;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:43
- * @description 基金资产组合情况
- */
-@Setter
-@Getter
-@TableName("mo_report_asset_allocation")
-public class ReportAssetAllocationDO extends BaseReportDO {
-    /**
-     * 资产大类
-     */
-    private String assetType;
-    /**
-     * 资产明细
-     */
-    private String columnName;
-    /**
-     * 市值
-     */
-    private BigDecimal marketValue;
-    /**
-     * 备注
-     */
-    private String remark;
-}
+//package com.smppw.modaq.domain.entity.report;
+//
+//import com.baomidou.mybatisplus.annotation.TableName;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.math.BigDecimal;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:43
+// * @description 基金资产组合情况
+// */
+//@Setter
+//@Getter
+//@TableName("daq_report_asset_allocation")
+//public class ReportAssetAllocationDO extends BaseReportDO {
+//    /**
+//     * 资产大类
+//     */
+//    private String assetType;
+//    /**
+//     * 资产明细
+//     */
+//    private String columnName;
+//    /**
+//     * 市值
+//     */
+//    private BigDecimal marketValue;
+//    /**
+//     * 备注
+//     */
+//    private String remark;
+//}

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportBaseInfoDO.java

@@ -13,7 +13,7 @@ import java.util.Date;
  */
 @Setter
 @Getter
-@TableName("mo_report_base_info")
+@TableName("daq_report_base_info")
 public class ReportBaseInfoDO extends BaseReportDO {
     /**
      * 报告日期

+ 26 - 26
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportFinancialIndicatorsDO.java

@@ -1,26 +1,26 @@
-package com.smppw.modaq.domain.entity.report;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-
-@Setter
-@Getter
-@TableName("mo_report_financial_indicators")
-public class ReportFinancialIndicatorsDO extends BaseReportDO {
-    private String level;
-    /**
-     * 年度
-     */
-    private Integer endDate;
-    private BigDecimal fundAssetSize;
-    private BigDecimal nav;
-    private BigDecimal profit;
-    private BigDecimal realizedIncome;
-    /**
-     * 期末可供分配利润
-     */
-    private BigDecimal undistributedProfit;
-}
+//package com.smppw.modaq.domain.entity.report;
+//
+//import com.baomidou.mybatisplus.annotation.TableName;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.math.BigDecimal;
+//
+//@Setter
+//@Getter
+//@TableName("daq_report_financial_indicators")
+//public class ReportFinancialIndicatorsDO extends BaseReportDO {
+//    private String level;
+//    /**
+//     * 年度
+//     */
+//    private Integer endDate;
+//    private BigDecimal fundAssetSize;
+//    private BigDecimal nav;
+//    private BigDecimal profit;
+//    private BigDecimal realizedIncome;
+//    /**
+//     * 期末可供分配利润
+//     */
+//    private BigDecimal undistributedProfit;
+//}

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportFundInfoDO.java

@@ -15,7 +15,7 @@ import java.util.Date;
  */
 @Setter
 @Getter
-@TableName("mo_report_fund_info")
+@TableName("daq_report_fund_info")
 public class ReportFundInfoDO extends BaseReportDO {
     /**
      * 基金的名称

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportFundTransactionDO.java

@@ -9,7 +9,7 @@ import java.util.Date;
 
 @Setter
 @Getter
-@TableName("mo_report_fund_transaction")
+@TableName("daq_report_fund_transaction")
 public class ReportFundTransactionDO extends BaseReportDO {
     /**
      * 基金账户编号

+ 42 - 42
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportInvestmentIndustryDO.java

@@ -1,42 +1,42 @@
-package com.smppw.modaq.domain.entity.report;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:49
- * @description 按行业分类的股票投资组合
- */
-@Setter
-@Getter
-@TableName("mo_report_invest_industry")
-public class ReportInvestmentIndustryDO extends BaseReportDO {
-    /**
-     * 行业分类编码
-     */
-    private String industryCode;
-    /**
-     * 行业分类名称
-     */
-    private String industryName;
-    /**
-     * 投资地区: 1-境内, 2-港股通
-     */
-    private Integer investType;
-    /**
-     * 行业标准编码
-     */
-    private String isbCode;
-    /**
-     * 公允价值
-     */
-    private BigDecimal marketValue;
-    /**
-     * 占基金资产净值的比例
-     */
-    private BigDecimal ratio;
-}
+//package com.smppw.modaq.domain.entity.report;
+//
+//import com.baomidou.mybatisplus.annotation.TableName;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.math.BigDecimal;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:49
+// * @description 按行业分类的股票投资组合
+// */
+//@Setter
+//@Getter
+//@TableName("daq_report_invest_industry")
+//public class ReportInvestmentIndustryDO extends BaseReportDO {
+//    /**
+//     * 行业分类编码
+//     */
+//    private String industryCode;
+//    /**
+//     * 行业分类名称
+//     */
+//    private String industryName;
+//    /**
+//     * 投资地区: 1-境内, 2-港股通
+//     */
+//    private Integer investType;
+//    /**
+//     * 行业标准编码
+//     */
+//    private String isbCode;
+//    /**
+//     * 公允价值
+//     */
+//    private BigDecimal marketValue;
+//    /**
+//     * 占基金资产净值的比例
+//     */
+//    private BigDecimal ratio;
+//}

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportInvestorInfoDO.java

@@ -6,7 +6,7 @@ import lombok.Setter;
 
 @Setter
 @Getter
-@TableName("mo_report_investor_info")
+@TableName("daq_report_investor_info")
 public class ReportInvestorInfoDO extends BaseReportDO {
     /**
      * 投资人的姓名

+ 38 - 38
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportNetReportDO.java

@@ -1,38 +1,38 @@
-package com.smppw.modaq.domain.entity.report;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:53
- * @description 基协报告净值月报
- */
-@Setter
-@Getter
-@TableName("mo_report_net_report")
-public class ReportNetReportDO extends BaseReportDO {
-    private String level;
-    private Date valuationDate;
-
-    /**
-     * 累计净值
-     */
-    private BigDecimal cumulativeNav;
-    /**
-     * 基金份额总额
-     */
-    private BigDecimal endTotalShares;
-    /**
-     * 基金资产净值
-     */
-    private BigDecimal fundAssetSize;
-    /**
-     * 单位净值
-     */
-    private BigDecimal nav;
-}
+//package com.smppw.modaq.domain.entity.report;
+//
+//import com.baomidou.mybatisplus.annotation.TableName;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.math.BigDecimal;
+//import java.util.Date;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:53
+// * @description 基协报告净值月报
+// */
+//@Setter
+//@Getter
+//@TableName("daq_report_net_report")
+//public class ReportNetReportDO extends BaseReportDO {
+//    private String level;
+//    private Date valuationDate;
+//
+//    /**
+//     * 累计净值
+//     */
+//    private BigDecimal cumulativeNav;
+//    /**
+//     * 基金份额总额
+//     */
+//    private BigDecimal endTotalShares;
+//    /**
+//     * 基金资产净值
+//     */
+//    private BigDecimal fundAssetSize;
+//    /**
+//     * 单位净值
+//     */
+//    private BigDecimal nav;
+//}

+ 42 - 42
mo-daq/src/main/java/com/smppw/modaq/domain/entity/report/ReportShareChangeDO.java

@@ -1,42 +1,42 @@
-package com.smppw.modaq.domain.entity.report;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-
-/**
- * @author wangzaijun
- * @date 2024/9/26 16:40
- * @description 基金份额变动情况
- */
-@Setter
-@Getter
-@TableName("mo_report_share_change")
-public class ReportShareChangeDO extends BaseReportDO {
-    /**
-     * 报告期期初基金份额总额
-     */
-    private BigDecimal initTotalShares;
-    /**
-     * 基金分级
-     */
-    private String level;
-    /**
-     * 减: 报告期期间基金总赎回份额
-     */
-    private BigDecimal redemption;
-    /**
-     * 期末基金总份额/期末基金实缴总额
-     */
-    private BigDecimal sharePerAsset;
-    /**
-     * 报告期期间基金拆分变动份额
-     */
-    private BigDecimal split;
-    /**
-     * 报告期期间基金总申购份额
-     */
-    private BigDecimal subscription;
-}
+//package com.smppw.modaq.domain.entity.report;
+//
+//import com.baomidou.mybatisplus.annotation.TableName;
+//import lombok.Getter;
+//import lombok.Setter;
+//
+//import java.math.BigDecimal;
+//
+///**
+// * @author wangzaijun
+// * @date 2024/9/26 16:40
+// * @description 基金份额变动情况
+// */
+//@Setter
+//@Getter
+//@TableName("daq_report_share_change")
+//public class ReportShareChangeDO extends BaseReportDO {
+//    /**
+//     * 报告期期初基金份额总额
+//     */
+//    private BigDecimal initTotalShares;
+//    /**
+//     * 基金分级
+//     */
+//    private String level;
+//    /**
+//     * 减: 报告期期间基金总赎回份额
+//     */
+//    private BigDecimal redemption;
+//    /**
+//     * 期末基金总份额/期末基金实缴总额
+//     */
+//    private BigDecimal sharePerAsset;
+//    /**
+//     * 报告期期间基金拆分变动份额
+//     */
+//    private BigDecimal split;
+//    /**
+//     * 报告期期间基金总申购份额
+//     */
+//    private BigDecimal subscription;
+//}

+ 9 - 9
mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportAssetAllocationMapper.java

@@ -1,9 +1,9 @@
-package com.smppw.modaq.domain.mapper.report;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.smppw.modaq.domain.entity.report.ReportAssetAllocationDO;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface ReportAssetAllocationMapper extends BaseMapper<ReportAssetAllocationDO> {
-}
+//package com.smppw.modaq.domain.mapper.report;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.smppw.modaq.domain.entity.report.ReportAssetAllocationDO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//@Mapper
+//public interface ReportAssetAllocationMapper extends BaseMapper<ReportAssetAllocationDO> {
+//}

+ 9 - 9
mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportFinancialIndicatorMapper.java

@@ -1,9 +1,9 @@
-package com.smppw.modaq.domain.mapper.report;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.smppw.modaq.domain.entity.report.ReportFinancialIndicatorsDO;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface ReportFinancialIndicatorMapper extends BaseMapper<ReportFinancialIndicatorsDO> {
-}
+//package com.smppw.modaq.domain.mapper.report;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.smppw.modaq.domain.entity.report.ReportFinancialIndicatorsDO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//@Mapper
+//public interface ReportFinancialIndicatorMapper extends BaseMapper<ReportFinancialIndicatorsDO> {
+//}

+ 9 - 9
mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportInvestmentIndustryMapper.java

@@ -1,9 +1,9 @@
-package com.smppw.modaq.domain.mapper.report;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.smppw.modaq.domain.entity.report.ReportInvestmentIndustryDO;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface ReportInvestmentIndustryMapper extends BaseMapper<ReportInvestmentIndustryDO> {
-}
+//package com.smppw.modaq.domain.mapper.report;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.smppw.modaq.domain.entity.report.ReportInvestmentIndustryDO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//@Mapper
+//public interface ReportInvestmentIndustryMapper extends BaseMapper<ReportInvestmentIndustryDO> {
+//}

+ 9 - 9
mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportNetReportMapper.java

@@ -1,9 +1,9 @@
-package com.smppw.modaq.domain.mapper.report;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.smppw.modaq.domain.entity.report.ReportNetReportDO;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface ReportNetReportMapper extends BaseMapper<ReportNetReportDO> {
-}
+//package com.smppw.modaq.domain.mapper.report;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.smppw.modaq.domain.entity.report.ReportNetReportDO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//@Mapper
+//public interface ReportNetReportMapper extends BaseMapper<ReportNetReportDO> {
+//}

+ 9 - 9
mo-daq/src/main/java/com/smppw/modaq/domain/mapper/report/ReportShareChangeMapper.java

@@ -1,9 +1,9 @@
-package com.smppw.modaq.domain.mapper.report;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.smppw.modaq.domain.entity.report.ReportShareChangeDO;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface ReportShareChangeMapper extends BaseMapper<ReportShareChangeDO> {
-}
+//package com.smppw.modaq.domain.mapper.report;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.smppw.modaq.domain.entity.report.ReportShareChangeDO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//@Mapper
+//public interface ReportShareChangeMapper extends BaseMapper<ReportShareChangeDO> {
+//}

+ 28 - 13
mo-daq/src/main/java/com/smppw/modaq/domain/service/EmailParseService.java

@@ -31,6 +31,7 @@ import com.smppw.modaq.domain.entity.EmailParseInfoDO;
 import com.smppw.modaq.domain.mapper.EmailFileInfoMapper;
 import com.smppw.modaq.domain.mapper.EmailParseInfoMapper;
 import com.smppw.modaq.infrastructure.util.ArchiveUtil;
+import com.smppw.modaq.infrastructure.util.ConvertUtil;
 import com.smppw.modaq.infrastructure.util.PdfUtil;
 import jakarta.mail.*;
 import jakarta.mail.internet.MimeUtility;
@@ -599,13 +600,13 @@ public class EmailParseService {
 //                }
 //            }
             // ocr信息提取(印章、联系人、基金名称和产品代码)
-            this.ocrReportData(reportType, reportData, fileName, images);
-//            // 设置月报类型
-//            if (reportData != null && reportData.getBaseInfo() != null) {
-//                reportData.getBaseInfo().setMonthlyType(monthlyType.getType());
-//            }
+            reportData = this.ocrReportData(fileId, reportType, reportData, fileName, images);
+            // 设置报告日期
+            if (reportData != null && reportData.getBaseInfo() != null && reportData.getBaseInfo().getReportDate() == null) {
+                reportData.getBaseInfo().setReportDate(DateUtil.offsetDay(new Date(), -1));
+            }
             if (log.isInfoEnabled()) {
-                log.info("报告{} 解析耗时{}ms,结果是:\n{}", fileName, (System.currentTimeMillis() - start), reportData);
+                log.info("报告{} 解析耗时{}ms,结果是:{}", fileName, (System.currentTimeMillis() - start), reportData);
             }
         }
         // 保存报告解析结果
@@ -671,15 +672,16 @@ public class EmailParseService {
      * @param fileName   报告名称
      * @param images     报告的收益和尾页png图片
      */
-    private void ocrReportData(ReportType reportType,
+    private ReportData ocrReportData(Integer fileId,
+                               ReportType reportType,
                                ReportData reportData,
                                String fileName,
                                List<String> images) {
-        if (reportData == null || CollUtil.isEmpty(images)) {
-            return;
+        if (CollUtil.isEmpty(images)) {
+            return reportData;
         }
         if (log.isInfoEnabled()) {
-            log.info("报告{} 用ocr补充解析结果。补充前的结果是:\n{}", fileName, reportData);
+            log.info("报告{} 用ocr补充解析结果。补充前的结果是:{}", fileName, reportData);
         }
         // 报告才识别尾页的印章和联系人,确认单不识别尾页
         if (ReportType.LETTER != reportType) {
@@ -723,6 +725,16 @@ public class EmailParseService {
 //                }
 //            }
         } else {
+            if (reportData == null) {
+                ReportBaseInfoDTO baseInfo = new ReportBaseInfoDTO(fileId);
+                baseInfo.setReportName(fileName);
+                baseInfo.setReportType(reportType.name());
+                String reportDate = ReportParseUtils.matchReportDate(reportType, fileName);
+                baseInfo.setReportDate(ConvertUtil.toDate(reportDate));
+                ReportFundInfoDTO fundInfo = new ReportFundInfoDTO(fileId);
+                reportData = new LetterReportData(baseInfo, fundInfo);
+                reportData.setAiParse(true);
+            }
             // 确认单AI解析失败时重新用OCR识别
             LetterReportData letterReportData = (LetterReportData) reportData;
             if (letterReportData.wasFailed()) {
@@ -733,22 +745,24 @@ public class EmailParseService {
                     log.error("报告{} OCR提取确认单关键信息出错:{}", fileName, e.getMessage());
                 }
                 if (parseRes == null) {
-                    return;
+                    return reportData;
                 }
                 if (letterReportData.getFundInfo() != null) {
                     letterReportData.getFundInfo().setFundName(parseRes.getFundName());
                     letterReportData.getFundInfo().setFundCode(parseRes.getFundCode());
                 }
+                // 投资人信息
                 if (letterReportData.getInvestorInfo() == null) {
-                    letterReportData.setInvestorInfo(new ReportInvestorInfoDTO());
+                    letterReportData.setInvestorInfo(new ReportInvestorInfoDTO(fileId));
                 }
                 letterReportData.getInvestorInfo().setInvestorName(parseRes.getInvestorName());
                 letterReportData.getInvestorInfo().setCertificateNumber(parseRes.getCertificateNumber());
                 letterReportData.getInvestorInfo().setTradingAccount(parseRes.getTradingAccount());
                 letterReportData.getInvestorInfo().setFundAccount(parseRes.getFundAccount());
                 letterReportData.getInvestorInfo().setCertificateType(parseRes.getCertificateType());
+                // 交易流水
                 if (letterReportData.getFundTransaction() == null) {
-                    letterReportData.setFundTransaction(new ReportFundTransactionDTO());
+                    letterReportData.setFundTransaction(new ReportFundTransactionDTO(fileId));
                 }
                 letterReportData.getFundTransaction().setTransactionType(parseRes.getTransactionType());
                 letterReportData.getFundTransaction().setApplyDate(parseRes.getApplyDate());
@@ -760,6 +774,7 @@ public class EmailParseService {
                 letterReportData.getFundTransaction().setNav(parseRes.getNav());
             }
         }
+        return reportData;
     }
 
     /**

+ 2 - 2
mo-daq/src/main/java/com/smppw/modaq/infrastructure/util/PdfUtil.java

@@ -224,7 +224,7 @@ public class PdfUtil {
     public static void main(String[] args) {
         try {
             // 示例用法
-            File inputFile = new File("D:\\home\\wwwroot\\mo_report_file\\wangzaijun@simuwang.com\\20250605\\image\\泓湖泓福积极配置2期私募证券投资基金-周报-20250530.png");
+            File inputFile = new File("D:\\home\\wwwroot\\daq_report_file\\wangzaijun@simuwang.com\\20250605\\image\\泓湖泓福积极配置2期私募证券投资基金-周报-20250530.png");
             int maxSize = 8192; // OpenAI限制
 
             // 1. 检查图片是否超出限制
@@ -239,7 +239,7 @@ public class PdfUtil {
 //                System.out.println("Base64 前缀: " + base64Image.substring(0, 50) + "...");
 
                 // 3. 压缩并保存到文件
-                File outputFile = new File("D:\\home\\wwwroot\\mo_report_file\\wangzaijun@simuwang.com\\20250605\\image\\泓湖泓福积极配置2期私募证券投资基金-周报-20250530.png");
+                File outputFile = new File("D:\\home\\wwwroot\\daq_report_file\\wangzaijun@simuwang.com\\20250605\\image\\泓湖泓福积极配置2期私募证券投资基金-周报-20250530.png");
                 String output = compressAndSave(inputFile, outputFile, maxSize, "png");
                 System.out.println("图片已压缩保存到: " + output);
 

+ 3 - 3
mo-daq/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 server:
-  port: 9933
+  port: 9966
   undertow:
     threads:
       # io线程数,主要执行费阻塞的任务
@@ -22,7 +22,7 @@ logging:
 
 spring:
   application:
-    name: mo-daq
+    name: daq
   datasource:
     # 指定为HikariDataSource
     type: com.zaxxer.hikari.HikariDataSource
@@ -53,7 +53,7 @@ spring:
 
 email:
   file:
-    path: /home/wwwroot/mo_report_file
+    path: /home/wwwroot/daq_report_file
 #  report:
 #    # ai解析远程地址
 #    ai-parser-url: http://localhost:8088/upload-filepath

+ 1 - 1
mo-daq/src/main/resources/mapper/EmailFieldMappingMapper.xml

@@ -15,7 +15,7 @@
 
     <select id="getEmailFieldMapping" resultMap="BaseResultMap">
         select *
-        from mo_email_field_mapping
+        from daq_email_field_mapping
         where isvalid = 1
         <if test="types != null and !types.isEmpty()">
             and type in

+ 22 - 22
mo-daq/src/main/resources/mapper/EmailFileInfoMapper.xml

@@ -17,7 +17,7 @@
 
     <insert id="insert" parameterType="com.smppw.modaq.domain.entity.EmailFileInfoDO" useGeneratedKeys="true"
             keyProperty="id" keyColumn="id">
-        insert into mo_email_file_info(email_id, file_name, file_path,
+        insert into daq_email_file_info(email_id, file_name, file_path,
                                               isvalid, creatorid, createtime, updaterid, updatetime)
         values (#{itemDo.emailId}, #{itemDo.fileName}, #{itemDo.filePath},
                 #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
@@ -27,19 +27,19 @@
 <!--            parameterType="java.lang.Integer">-->
 <!--        select id ,email_id, file_name, file_path,ai_parse,ai_file_id,-->
 <!--               isvalid, creatorid, createtime, updaterid, updatetime-->
-<!--        from mo_email_file_info where id=#{id} and isvalid=1-->
+<!--        from daq_email_file_info where id=#{id} and isvalid=1-->
 <!--    </select>-->
 
 <!--    <select id="getEmailFileByEmailId" resultMap="BaseResultMap"-->
 <!--            parameterType="java.lang.Integer">-->
 <!--        select id ,email_id, file_name, file_path,ai_parse,ai_file_id,-->
 <!--               isvalid, creatorid, createtime, updaterid, updatetime-->
-<!--        from mo_email_file_info where email_id=#{emailId} and isvalid=1-->
+<!--        from daq_email_file_info where email_id=#{emailId} and isvalid=1-->
 <!--    </select>-->
 
     <select id="queryByEmailId" resultMap="BaseResultMap">
         select id, file_name, file_path,ai_parse,ai_file_id
-        from mo_email_file_info
+        from daq_email_file_info
         where email_id = #{emailId}
           and isvalid = 1
     </select>
@@ -220,14 +220,14 @@
 <!--    </select>-->
 
     <update id="updateTimeById">
-        update mo_email_file_info
+        update daq_email_file_info
         set updatetime = #{parseDate}
         where isvalid = 1
           and id = #{id}
     </update>
 
     <update id="updateAiParseByFileId">
-        update mo_email_file_info
+        update daq_email_file_info
         set updatetime = now(),
             ai_parse = #{aiParse},
             ai_file_id = #{aiFileId}
@@ -237,37 +237,37 @@
 
     <select id="getLetterFilenameSuccessCount" resultType="int">
         select count(1)
-        from mo_email_file_info a
-                 join mo_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle}
-                 join mo_report_base_info b on b.file_id = a.id and b.report_type = 'LETTER'
-                 join mo_report_fund_transaction c on a.id = c.file_id and c.fund_name is not null
-                 join mo_report_investor_info d on a.id = d.file_id and d.investor_name is not null
+        from daq_email_file_info a
+                 join daq_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle}
+                 join daq_report_base_info b on b.file_id = a.id and b.report_type = 'LETTER'
+                 join daq_report_fund_transaction c on a.id = c.file_id and c.fund_name is not null
+                 join daq_report_investor_info d on a.id = d.file_id and d.investor_name is not null
         where a.file_name = #{filename} and a.isvalid = 1
     </select>
 
     <select id="getAmacFilenameSuccessCount" resultType="int">
         select count(1)
-        from mo_email_file_info a
-                 join mo_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle} and e.attr_size = #{fileSize}
-                 join mo_report_base_info b on b.file_id = a.id and b.report_type in ('MONTHLY', 'QUARTERLY', 'ANNUALLY')
-                 join mo_report_fund_info c on a.id = c.file_id and (c.fund_name is not null or c.fund_code is not null)
+        from daq_email_file_info a
+                 join daq_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle} and e.attr_size = #{fileSize}
+                 join daq_report_base_info b on b.file_id = a.id and b.report_type in ('MONTHLY', 'QUARTERLY', 'ANNUALLY')
+                 join daq_report_fund_info c on a.id = c.file_id and (c.fund_name is not null or c.fund_code is not null)
         where a.file_name = #{filename} and a.isvalid = 1
     </select>
 
     <select id="getWeeklyFilenameSuccessCount" resultType="int">
         select count(1)
-        from mo_email_file_info a
-                 join mo_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle} and e.attr_size = #{fileSize}
-                 join mo_report_base_info b on b.file_id = a.id and b.report_type = 'WEEKLY'
-                 join mo_report_fund_info c on a.id = c.file_id and (c.fund_name is not null or c.fund_code is not null)
+        from daq_email_file_info a
+                 join daq_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle} and e.attr_size = #{fileSize}
+                 join daq_report_base_info b on b.file_id = a.id and b.report_type = 'WEEKLY'
+                 join daq_report_fund_info c on a.id = c.file_id and (c.fund_name is not null or c.fund_code is not null)
         where a.file_name = #{filename} and a.isvalid = 1
     </select>
 
     <select id="getOtherFilenameSuccessCount" resultType="int">
         select count(1)
-        from mo_email_file_info a
-                 join mo_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle} and e.attr_size = #{fileSize}
-                 join mo_report_base_info b on b.file_id = a.id and b.report_type = 'OTHER'
+        from daq_email_file_info a
+                 join daq_email_parse_info e on e.id = a.email_id and e.email_title = #{emailTitle} and e.attr_size = #{fileSize}
+                 join daq_report_base_info b on b.file_id = a.id and b.report_type = 'OTHER'
         where a.file_name = #{filename} and a.isvalid = 1
     </select>
 </mapper>

+ 9 - 9
mo-daq/src/main/resources/mapper/EmailParseInfoMapper.xml

@@ -23,14 +23,14 @@
 
 
     <insert id="insert" parameterType="com.smppw.modaq.domain.entity.EmailParseInfoDO" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
-        insert into mo_email_parse_info(email,email_key, sender_email, email_date, parse_date, email_title, email_type, parse_status, fail_reason,
+        insert into daq_email_parse_info(email,email_key, sender_email, email_date, parse_date, email_title, email_type, parse_status, fail_reason,
                                         attr_size,isvalid, creatorid, createtime, updaterid, updatetime)
         values (#{itemDo.email}, #{itemDo.emailKey}, #{itemDo.senderEmail}, #{itemDo.emailDate}, #{itemDo.parseDate}, #{itemDo.emailTitle}, #{itemDo.emailType}, #{itemDo.parseStatus},
                 #{itemDo.failReason}, #{itemDo.attrSize}, #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
     </insert>
 
     <update id="updateParseStatus">
-        update mo_email_parse_info
+        update daq_email_parse_info
         set parse_status = #{parseStatus},
             fail_reason = #{failReason}
         where isvalid = 1
@@ -55,7 +55,7 @@
             epi.updaterid,
             epi.sender_email
         FROM
-            mo_email_parse_info epi
+            daq_email_parse_info epi
     </sql>
     <!-- 查询条件 -->
 <!--    <sql id="sqlwhereSearch">-->
@@ -115,7 +115,7 @@
 <!--    </select>-->
 
 <!--    <select id="searchEmailCount" resultType="java.lang.Integer">-->
-<!--        select count(1) from mo_email_parse_info where isvalid=1-->
+<!--        select count(1) from daq_email_parse_info where isvalid=1-->
 <!--        <if test="parseStatus != null and parseStatus != -1">-->
 <!--            and parse_status=#{parseStatus}-->
 <!--        </if>-->
@@ -132,7 +132,7 @@
 
 <!--    <select id="queryById" resultMap="BaseResultMap">-->
 <!--        select id, email,email_key, email_date, parse_date, email_title, email_type, sender_email,parse_status,attr_size-->
-<!--        from mo_email_parse_info-->
+<!--        from daq_email_parse_info-->
 <!--        where isvalid = 1-->
 <!--          and id = #{id}-->
 <!--    </select>-->
@@ -143,7 +143,7 @@
 <!--    </select>-->
 
     <update id="updateParseTime">
-        update mo_email_parse_info
+        update daq_email_parse_info
         set updatetime = #{parseDate},
             parse_date = #{parseDate}
         where isvalid = 1
@@ -232,7 +232,7 @@
 <!--        </if>-->
 <!--    </select>-->
 <!--    <select id="countEmailTotal" resultType="java.lang.Long">-->
-<!--        select count(1) from mo_email_parse_info where isvalid=1-->
+<!--        select count(1) from daq_email_parse_info where isvalid=1-->
 <!--        <if test="emailType !=null">-->
 <!--            and email_type = #{emailType}-->
 <!--        </if>-->
@@ -240,7 +240,7 @@
 
 <!--    <select id="searchEmail" parameterType="com.smppw.modaq.domain.entity.EmailParseInfoDO" resultMap="BaseResultMap">-->
 <!--        select *-->
-<!--        from mo_email_parse_info where isvalid = 1-->
+<!--        from daq_email_parse_info where isvalid = 1-->
 <!--        <if test="senderEmail !=null and senderEmail != ''">-->
 <!--            and sender_email = #{senderEmail}-->
 <!--        </if>-->
@@ -258,7 +258,7 @@
 
     <select id="countEmailByInfoAndStatus" resultType="java.lang.Integer">
         select count(1)
-        from mo_email_parse_info t
+        from daq_email_parse_info t
         where t.sender_email = #{senderAddress}
           and t.email = #{emailAddress}
           and t.email_date = #{emailDate}

+ 5 - 5
mo-daq/src/main/resources/mapper/MailBoxInfoMapper.xml

@@ -19,7 +19,7 @@
         <result column="isvalid" property="isvalid"/>
     </resultMap>
     <update id="deleteEmailConfigByIds">
-        update mo_mailbox_info set isvalid =0,updatetime=sysdate(),updaterid=#{updaterId} where id in
+        update daq_mailbox_info set isvalid =0,updatetime=sysdate(),updaterid=#{updaterId} where id in
         <foreach item="id" collection="ids" open="(" separator="," close=")">
             #{id}
         </foreach>
@@ -27,12 +27,12 @@
 
     <select id="listMailboxInfo" resultMap="BaseResultMap">
         select *
-        from mo_mailbox_info
+        from daq_mailbox_info
         where isvalid = 1
           and open_status = 1
     </select>
 <!--    <select id="searchEmailConfigList" resultMap="BaseResultMap">-->
-<!--        select id, type, email, password, protocol, server, port, cron, open_status,description,isvalid,creatorid,createtime,updaterid,updatetime from PPW_EMAIL.mo_mailbox_info-->
+<!--        select id, type, email, password, protocol, server, port, cron, open_status,description,isvalid,creatorid,createtime,updaterid,updatetime from PPW_EMAIL.daq_mailbox_info-->
 <!--        where isvalid = 1-->
 <!--        <if test="email != null and email != ''">-->
 <!--            and email like concat('%',#{email},'%')-->
@@ -41,7 +41,7 @@
 <!--    </select>-->
     <sql id="selectConfigVo">
         select id, type, email, password, protocol, server, port, cron, open_status,description,isvalid,creatorid,createtime,updaterid,updatetime
-        from mo_mailbox_info
+        from daq_mailbox_info
     </sql>
     <select id="selectEmailConfigByEmail" resultType="com.smppw.modaq.domain.entity.MailboxInfoDO">
         <include refid="selectConfigVo"/>
@@ -49,7 +49,7 @@
     </select>
 <!--    <select id="countEmailConfig" resultType="java.lang.Long"-->
 <!--            parameterType="com.simuwang.base.pojo.dto.query.EmailPageQuery">-->
-<!--        select count(1) from PPW_EMAIL.mo_mailbox_info-->
+<!--        select count(1) from PPW_EMAIL.daq_mailbox_info-->
 <!--        where isvalid = 1-->
 <!--        <if test="email != null and email != ''">-->
 <!--            and email like concat('%',#{email},'%')-->

+ 1 - 1
mo-daq/src/test/java/com/smppw/modaq/MoDaqApplicationTests.java

@@ -26,7 +26,7 @@ public class MoDaqApplicationTests {
     @Test
     public void letterTest() {
         MailboxInfoDTO emailInfoDTO = this.buildMailbox("**@simuwang.com", "**");
-        Date startDate = DateUtil.parse("2025-06-18 08:47:00", DateConst.YYYY_MM_DD_HH_MM_SS);
+        Date startDate = DateUtil.parse("2025-06-18 17:00:00", DateConst.YYYY_MM_DD_HH_MM_SS);
         Date endDate = DateUtil.parse("2025-06-18 18:56:00", DateConst.YYYY_MM_DD_HH_MM_SS);
         try {
             List<String> folderNames = ListUtil.list(false);