Procházet zdrojové kódy

feat:模板配置-email_fund_nav增加template_id字段

mozuwen před 7 měsíci
rodič
revize
a09327092b

+ 5 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/EmailFundNavDO.java

@@ -65,6 +65,11 @@ public class EmailFundNavDO {
     @TableField(value = "exception_status")
     private Integer exceptionStatus;
     /**
+     * 模板id(0-通用模板)
+     */
+    @TableField(value = "template_id")
+    private Integer templateId;
+    /**
      * 记录的有效性;1-有效;0-无效;
      */
     @TableField(value = "isvalid")

+ 4 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/EmailFundNavDTO.java

@@ -40,6 +40,10 @@ public class EmailFundNavDTO {
      */
     private String assetNet;
     /**
+     * 模板id(0-通用模板)
+     */
+    private Integer templateId;
+    /**
      * 匹配上的基金id
      */
     private List<String> fundIdList;

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

@@ -8,7 +8,7 @@ import java.util.List;
 public class TemplateDetailDTO {
 
     /**
-     * 模板idi
+     * 模板id
      */
     private Integer templateId;
     /**

+ 3 - 2
service-base/src/main/resources/mapper/EmailFundNavMapper.xml

@@ -12,6 +12,7 @@
         <result column="cumulative_nav_withdrawal" property="cumulativeNavWithdrawal"/>
         <result column="is_stored" property="isStored"/>
         <result column="exception_status" property="exceptionStatus"/>
+        <result column="template_id" property="templateId"/>
         <result column="isvalid" property="isvalid"/>
         <result column="creatorid" property="creatorId"/>
         <result column="createtime" property="createTime"/>
@@ -24,12 +25,12 @@
 
     <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundNavDO">
         insert into PPW_EMAIL.email_fund_nav(file_id, fund_id, fund_name,register_number,price_date,
-                                              nav,cumulative_nav_withdrawal,is_stored,exception_status,
+                                              nav,cumulative_nav_withdrawal,is_stored,exception_status,template_id,
                                               isvalid, creatorid, createtime, updaterid, updatetime)
         values
         <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
             (#{itemDo.fileId},#{itemDo.fundId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},
-             #{itemDo.nav},#{itemDo.cumulativeNavWithdrawal},#{itemDo.isStored},#{itemDo.exceptionStatus},
+             #{itemDo.nav},#{itemDo.cumulativeNavWithdrawal},#{itemDo.isStored},#{itemDo.exceptionStatus},#{itemDo.templateId},
             #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
         </foreach>
     </insert>

+ 2 - 0
service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

@@ -317,6 +317,7 @@ public class EmailParseService {
                 emailFundNavDO.setFundName(fundNavDTO.getFundName());
                 emailFundNavDO.setRegisterNumber(fundNavDTO.getRegisterNumber());
                 emailFundNavDO.setExceptionStatus(fundNavDTO.getParseStatus());
+                emailFundNavDO.setTemplateId(fundNavDTO.getTemplateId());
                 emailFundNavDO.setIsvalid(1);
                 emailFundNavDO.setCreatorId(0);
                 emailFundNavDO.setCreateTime(parseDate);
@@ -333,6 +334,7 @@ public class EmailParseService {
             emailFundNavDO.setFundName(fundNavDTO.getFundName());
             emailFundNavDO.setRegisterNumber(fundNavDTO.getRegisterNumber());
             emailFundNavDO.setExceptionStatus(fundNavDTO.getParseStatus());
+            emailFundNavDO.setTemplateId(fundNavDTO.getTemplateId());
             emailFundNavDO.setIsStored(isStored);
             emailFundNavDO.setIsvalid(1);
             emailFundNavDO.setCreatorId(0);

+ 1 - 0
service-daq/src/main/java/com/simuwang/daq/service/EmailTemplateService.java

@@ -94,6 +94,7 @@ public class EmailTemplateService {
                     List<EmailFundNavDTO> fundNavDTOList = extraFundNav(filePath, textContent, templateDetailDTO);
                     fundNavDTOList = fundNavDTOList.stream().filter(NavDataUtil::navDataFormatCheck).toList();
                     if (CollUtil.isNotEmpty(fundNavDTOList)) {
+                        fundNavDTOList.forEach(e->e.setTemplateId(templateDetailDTO.getTemplateId()));
                         emailFundNavDTOList.addAll(fundNavDTOList);
                     }
                 } catch (Exception e) {

+ 5 - 1
service-daq/src/main/java/com/simuwang/daq/service/NavEmailParser.java

@@ -89,6 +89,10 @@ public class NavEmailParser extends AbstractEmailParser {
                 emailFundNavDTOList = valuationEmailParser.parse(emailContentInfoDTO, emailFieldMap);
             }
         }
+        // email_fund_nav增加template_id字段
+        if (CollUtil.isEmpty(emailFundNavDTOList)) {
+            emailFundNavDTOList.forEach(e -> e.setTemplateId(0));
+        }
 
         // 通用模版解析 -> 根据配置的模板进行解析
         if (CollUtil.isEmpty(emailFundNavDTOList)) {
@@ -477,7 +481,7 @@ public class NavEmailParser extends AbstractEmailParser {
         // 母基金缺少代码的情况
         if (hasParentField && fieldPositionMap.get(EmailFieldConst.PARENT_REGISTER_NUMBER) == null) {
             List<FieldPositionDTO> fieldPositionDTOS = tempFieldPositionMap.get(EmailFieldConst.REGISTER_NUMBER);
-            if(CollUtil.isNotEmpty(fieldPositionDTOS)) {
+            if (CollUtil.isNotEmpty(fieldPositionDTOS)) {
                 Pair<Integer, Integer> parentRegisterNumberPair = fieldPositionDTOS.stream()
                         .filter(e -> e.getFieldValue().contains("协会") || e.getFieldValue().contains("备案")).map(FieldPositionDTO::getPair).findFirst().orElse(null);
                 fieldPositionMap.put(EmailFieldConst.PARENT_REGISTER_NUMBER, parentRegisterNumberPair);