浏览代码

feat:修改基金净值缺失明细表和基金净值采集明细表输出字段

mozuwen 5 月之前
父节点
当前提交
f3706db289

+ 1 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/FundAndCompanyInfoDO.java

@@ -12,4 +12,5 @@ public class FundAndCompanyInfoDO {
     private String registerNumber;
     private String companyId;
     private String companyName;
+    private String companyRegisterNumber;
 }

+ 22 - 1
service-base/src/main/java/com/simuwang/base/pojo/dto/FundNavDataDTO.java

@@ -9,10 +9,31 @@ import lombok.Data;
 public class FundNavDataDTO {
 
     /**
-     * 基金名称
+     * 管理人名称
      */
     @HeadFontStyle(fontHeightInPoints = 10)
     @ColumnWidth(25)
+    @ExcelProperty("管理人名称")
+    private String trustName;
+
+    /**
+     * 管理人备案编码
+     */
+    @ColumnWidth(15)
+    @ExcelProperty("管理人备案编码")
+    private String trustRegisterNumber;
+
+    /**
+     * 基金ID
+     */
+    @ColumnWidth(15)
+    @ExcelProperty("基金ID")
+    private String fundId;
+
+    /**
+     * 基金名称
+     */
+    @ColumnWidth(25)
     @ExcelProperty("基金名称")
     private String fundName;
 

+ 14 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/FundNavDeletionDTO.java

@@ -17,6 +17,20 @@ public class FundNavDeletionDTO {
     private String trustName;
 
     /**
+     * 管理人备案编码
+     */
+    @ColumnWidth(15)
+    @ExcelProperty("管理人备案编码")
+    private String trustRegisterNumber;
+
+    /**
+     * 基金ID
+     */
+    @ColumnWidth(15)
+    @ExcelProperty("基金ID")
+    private String fundId;
+
+    /**
      * 基金名称
      */
     @ColumnWidth(25)

+ 2 - 1
service-base/src/main/resources/mapper/FundInfoMapper.xml

@@ -236,7 +236,8 @@
                t.fund_name       as fundName,
                t.register_number as registerNumber,
                t1.company_id as companyId,
-               t1.company_name as companyName
+               t1.company_name as companyName,
+               t1.register_number as companyRegisterNumber
         from pvn_fund_info t
                  left join pvn_company_info t1 on t1.isvalid = 1 and t1.company_id = t.trust_id
         where t.isvalid = 1

+ 12 - 4
service-manage/src/main/java/com/simuwang/manage/service/impl/FundNavServiceImpl.java

@@ -45,8 +45,8 @@ public class FundNavServiceImpl implements FundNavService {
             return navDataDTOList;
         }
         List<String> fundIdList = navDOList.stream().map(NavDO::getFundId).distinct().toList();
-        List<FundInfoDO> fundInfoDOList = fundInfoMapper.queryFundInfoByFundId(fundIdList);
-        Map<String, FundInfoDO> fundIdInfoMap = fundInfoDOList.stream().collect(Collectors.toMap(FundInfoDO::getFundId, v -> v, (oldValue, newValue) -> oldValue));
+        List<FundAndCompanyInfoDO> fundInfoCompanyNameList = fundInfoMapper.queryFundAndTrustByFundId(fundIdList);
+        Map<String, FundAndCompanyInfoDO> fundIdCompanyNameMap = fundInfoCompanyNameList.stream().collect(Collectors.toMap(FundAndCompanyInfoDO::getFundId, v -> v));
 
         List<AssetDO> assetDOList = assetMapper.queryAssetByFundId(fundIdList);
         Map<String, List<AssetDO>> fundIdAssetMap = MapUtil.newHashMap();
@@ -59,7 +59,7 @@ public class FundNavServiceImpl implements FundNavService {
             String fundId = fundIdNavEntry.getKey();
             List<NavDO> fundNavDoList = fundIdNavEntry.getValue();
             List<AssetDO> fundAssetDoList = fundIdAssetMap.get(fundId);
-            FundInfoDO fundInfoDO = fundIdInfoMap.get(fundId);
+            FundAndCompanyInfoDO fundInfoDO = fundIdCompanyNameMap.get(fundId);
             List<FundNavDataDTO> fundNavDataDTOList = buildFundNavDataDTO(fundInfoDO, fundNavDoList, fundAssetDoList);
             navDataDTOList.addAll(fundNavDataDTOList);
         }
@@ -96,10 +96,13 @@ public class FundNavServiceImpl implements FundNavService {
     private List<FundNavDeletionDTO> buildFundNavDeletionDTO(FundAndCompanyInfoDO fundAndCompanyInfoDO, List<FundDeletionInfoDO> fundDeletionInfoDOList, Map<String, TradeDateDO> tradeDateDoMap) {
         String fundName = fundAndCompanyInfoDO.getFundName();
         String trustName = fundAndCompanyInfoDO.getCompanyName();
+        String trustRegisterNumber = fundAndCompanyInfoDO.getCompanyRegisterNumber();
         String registerNumber = fundAndCompanyInfoDO.getRegisterNumber();
         return fundDeletionInfoDOList.stream().map(e -> {
             FundNavDeletionDTO fundNavDeletionDTO = new FundNavDeletionDTO();
             fundNavDeletionDTO.setTrustName(trustName);
+            fundNavDeletionDTO.setTrustRegisterNumber(trustRegisterNumber);
+            fundNavDeletionDTO.setFundId(e.getFundId());
             fundNavDeletionDTO.setFundName(fundName);
             fundNavDeletionDTO.setRegisterNumber(registerNumber);
             TradeDateDO tradeDateDO = tradeDateDoMap.get(e.getDeletionDate());
@@ -110,9 +113,11 @@ public class FundNavServiceImpl implements FundNavService {
         }).sorted(Comparator.comparing(FundNavDeletionDTO::getFundName).thenComparing(FundNavDeletionDTO::getDate)).toList();
     }
 
-    private List<FundNavDataDTO> buildFundNavDataDTO(FundInfoDO fundInfoDO, List<NavDO> fundNavDoList, List<AssetDO> fundAssetDoList) {
+    private List<FundNavDataDTO> buildFundNavDataDTO(FundAndCompanyInfoDO fundInfoDO, List<NavDO> fundNavDoList, List<AssetDO> fundAssetDoList) {
         String fundName = fundInfoDO.getFundName();
         String registerNumber = fundInfoDO.getRegisterNumber();
+        String trustName = fundInfoDO.getCompanyName();
+        String trustRegisterNumber = fundInfoDO.getCompanyRegisterNumber();
         Map<String, BigDecimal> priceDateAssetMap = MapUtil.newHashMap();
         if (CollUtil.isNotEmpty(fundAssetDoList)) {
             priceDateAssetMap = fundAssetDoList.stream().collect(Collectors.toMap(k -> DateUtil.format(k.getPriceDate(), DateConst.YYYY_MM_DD), AssetDO::getAssetNet));
@@ -120,6 +125,9 @@ public class FundNavServiceImpl implements FundNavService {
         Map<String, BigDecimal> finalPriceDateAssetMap = priceDateAssetMap;
         return fundNavDoList.stream().map(e -> {
             FundNavDataDTO fundNavDataDTO = new FundNavDataDTO();
+            fundNavDataDTO.setTrustName(trustName);
+            fundNavDataDTO.setTrustRegisterNumber(trustRegisterNumber);
+            fundNavDataDTO.setFundId(e.getFundId());
             fundNavDataDTO.setFundName(fundName);
             fundNavDataDTO.setRegisterNumber(registerNumber);
             String priceDate = e.getPriceDate() != null ? DateUtil.format(e.getPriceDate(), DateConst.YYYY_MM_DD) : null;

+ 5 - 5
service-manage/src/main/java/com/simuwang/manage/task/CompetitionTask.java

@@ -57,9 +57,9 @@ public class CompetitionTask {
         // 通过邮件发送"基金净值采集结果明细表格"
         if (method == 1) {
             MailboxInfoDTO mailboxInfoDTO = emailSystemConfigService.getFromEmailInfo();
-            String ReceivingMailbox = emailSystemConfigService.getRecipientEmail();
+            String receivingMailbox = emailSystemConfigService.getRecipientEmail();
             try {
-                EmailUtil.senEmail(mailboxInfoDTO, ReceivingMailbox, new File(filePath), "基金净值采集结果明细", "", "基金净值采集结果明细");
+                EmailUtil.senEmail(mailboxInfoDTO, receivingMailbox, new File(filePath), "基金净值采集结果明细", "", "基金净值采集结果明细");
                 log.info("基金净值采集结果明细表 -> 邮件已发送");
             } catch (Exception e) {
                 log.error("邮件发送基金净值采集结果明细表异常 -> 堆栈信息:{}", ExceptionUtil.stacktraceToString(e));
@@ -72,7 +72,7 @@ public class CompetitionTask {
      * 每周五 18:00 执行
      */
     @Scheduled(cron = "0 0 18 ? * 5")
-    public void NavDeletionTask() {
+    public void navDeletionTask() {
         List<FundNavDeletionDTO> navDeletionDTOList = fundNavService.getFundNavDeletion();
         String filePath = competitionConfig.getDirectory() + "基金净值缺失明细_" + DateUtil.format(new Date(), DateConst.YYYYMMDD) + ".xlsx";
         EasyExcel.write(filePath, FundNavDeletionDTO.class)
@@ -84,9 +84,9 @@ public class CompetitionTask {
         // 通过邮件发送"基金净值采集结果明细表格"
         if (method == 1) {
             MailboxInfoDTO mailboxInfoDTO = emailSystemConfigService.getFromEmailInfo();
-            String ReceivingMailbox = emailSystemConfigService.getRecipientEmail();
+            String recipientEmail = emailSystemConfigService.getRecipientEmail();
             try {
-                EmailUtil.senEmail(mailboxInfoDTO, ReceivingMailbox, new File(filePath), "基金净值缺失明细", "", "基金净值缺失明细");
+                EmailUtil.senEmail(mailboxInfoDTO, recipientEmail, new File(filePath), "基金净值缺失明细", "", "基金净值缺失明细");
                 log.info("基金净值缺失明细表 -> 邮件已发送");
             } catch (Exception e) {
                 log.error("邮件发送基金净值缺失明细表异常 -> 堆栈信息:{}", ExceptionUtil.stacktraceToString(e));