浏览代码

fix: 基金管理,净值规模,分红管理,缺失管理增加日期字段排序

chenjianhua 6 月之前
父节点
当前提交
5423d157bb

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

@@ -77,6 +77,10 @@ public class DeletionInfoDO {
      * 是否发送过邮件
      */
     private Integer isSend;
+    /**
+     * 最新缺失日期
+     */
+    private String lastDeletionDate;
 
     public DeletionInfoVO toVO() {
         DeletionInfoVO deletionInfoVO = new DeletionInfoVO();
@@ -86,6 +90,7 @@ public class DeletionInfoDO {
         deletionInfoVO.setDeletionType(this.deletionType);
         deletionInfoVO.setDeletionNum(this.deletionNum);
         deletionInfoVO.setProcessedNum(this.processedNum);
+        deletionInfoVO.setLastDeletionDate(this.lastDeletionDate);
         return deletionInfoVO;
     }
 }

+ 3 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/FundAliasDO.java

@@ -3,6 +3,7 @@ package com.simuwang.base.pojo.dos;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.pojo.vo.FundAliasVO;
 import lombok.Data;
 
@@ -59,6 +60,7 @@ public class FundAliasDO {
      */
     private Date updateTime;
 
+    private Date lastPriceDate;
     public FundAliasVO toVo() {
         FundAliasVO fundAliasVO = new FundAliasVO();
         fundAliasVO.setId(this.id);
@@ -67,6 +69,7 @@ public class FundAliasDO {
         fundAliasVO.setTargetFundId(this.targetFundId);
         fundAliasVO.setTargetFundName(this.targetFundName);
         fundAliasVO.setTargetRegisterNumber(this.targetRegisterNumber);
+        fundAliasVO.setPriceDate(this.lastPriceDate==null?null: DateUtils.format(this.lastPriceDate,DateUtils.YYYY_MM_DD));
         fundAliasVO.setCompanyName(this.companyName);
         return fundAliasVO;
     }

service-base/src/main/resources/mapper/EmailFundNavService.xml → service-base/src/main/resources/mapper/CompanyInformationMapper.xml


+ 15 - 6
service-base/src/main/resources/mapper/DeletionInfoMapper.xml

@@ -68,9 +68,11 @@
         c.company_name,
         d.deletion_type,
         ddn.deletion_num,
-        ddp.processed_num
+        ddp.processed_num,
+        d.last_deletion_date
         FROM
-        PPW_EMAIL.deletion_info d
+        (select de.fund_id,de.deletion_type,max(de.deletion_date) as last_deletion_date from PPW_EMAIL.deletion_info de where de.isvalid=1
+        group by de.fund_id,de.deletion_type) d
         LEFT JOIN PPW_EMAIL.pvn_fund_info info
         ON d.fund_id = info.fund_id and info.isvalid=1
         LEFT JOIN PPW_EMAIL.pvn_company_info c
@@ -117,7 +119,14 @@
         <if test="deletionEndNum != null and deletionEndNum != ''">
             and ddn.deletion_num <![CDATA[ <= ]]> #{deletionEndNum}
         </if>
-        group by d.fund_id,d.deletion_type
+        <choose>
+            <when test="sort != null and sort !='' and sort=='lastDeletionDate' and order != null and order !=''">
+                order by d.last_deletion_date ${order}
+            </when>
+            <otherwise>
+                order by d.last_deletion_date desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
     </select>
     <select id="countDeletion" resultType="java.lang.Long"
@@ -130,7 +139,8 @@
         ddn.deletion_num,
         ddp.processed_num
         FROM
-        PPW_EMAIL.deletion_info d
+        (select de.fund_id,de.deletion_type,max(de.deletion_date) as last_deletion_date from PPW_EMAIL.deletion_info de where de.isvalid=1
+        group by de.fund_id,de.deletion_type) d
         LEFT JOIN PPW_EMAIL.pvn_fund_info info
         ON d.fund_id = info.fund_id and info.isvalid=1
         LEFT JOIN PPW_EMAIL.pvn_company_info c
@@ -176,8 +186,7 @@
         </if>
         <if test="deletionEndNum != null and deletionEndNum != ''">
             and ddn.deletion_num <![CDATA[ <= ]]> #{deletionEndNum}
-        </if>
-        group by d.fund_id,d.deletion_type) a
+        </if>) a
     </select>
     <select id="getLastDeletionDateByFundId" resultType="java.lang.String">
         select max(deletion_date) from PPW_EMAIL.deletion_info where fund_id=#{fundId} and deletion_type=#{deletionType}

+ 8 - 1
service-base/src/main/resources/mapper/DistributionMapper.xml

@@ -89,7 +89,14 @@
         <if test="endDate != null and endDate !=''">
             and d.distribute_date <![CDATA[ <= ]]> #{endDate}
         </if>
-        order by d.updatetime desc
+        <choose>
+            <when test="sort != null and sort !='' and sort=='distributeDate' and order != null and order !=''">
+                order by d.distribute_date ${order}
+            </when>
+            <otherwise>
+                order by d.distribute_date desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
     </select>
     <select id="countDistributionList" resultType="java.lang.Long"

+ 8 - 1
service-base/src/main/resources/mapper/EmailFundAssetMapper.xml

@@ -100,7 +100,14 @@
                 #{exceptionStatus}
             </foreach>
         </if>
-        order by asset.updatetime desc
+        <choose>
+            <when test="sort != null and sort !='' and sort=='priceDate' and order != null and order !=''">
+                order by asset.price_date ${order}
+            </when>
+            <otherwise>
+                order by asset.price_date desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
     </select>
     <select id="countAssetDetail" resultType="java.lang.Long"

+ 8 - 1
service-base/src/main/resources/mapper/EmailFundNavMapper.xml

@@ -104,7 +104,14 @@
         <if test="emailId != null and emailId !=''">
             and parse.id =#{emailId}
         </if>
-        order by nav.updatetime desc
+        <choose>
+            <when test="sort != null and sort !='' and sort=='priceDate' and order != null and order !=''">
+                order by nav.price_date ${order}
+            </when>
+            <otherwise>
+                order by nav.price_date desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
     </select>
     <select id="countNavDetail" resultType="java.lang.Long"

+ 13 - 1
service-base/src/main/resources/mapper/FundAliasMapper.xml

@@ -8,6 +8,7 @@
         <result column="target_fund_id" property="targetFundId"/>
         <result column="target_fund_name" property="targetFundName"/>
         <result column="target_register_number" property="targetRegisterNumber"/>
+        <result column="last_price_date" property="lastPriceDate"/>
         <result column="company_name" property="companyName"/>
         <result column="isvalid" property="isvalid"/>
         <result column="creatorid" property="creatorId"/>
@@ -91,6 +92,7 @@
         info.fund_name as target_fund_name,
         info.register_number as target_register_number,
         c.company_name as company_name,
+        a.last_price_date as last_price_date,
         alias.isvalid,
         alias.creatorid,
         alias.createtime,
@@ -101,6 +103,9 @@
         on alias.target_fund_id = info.fund_id and info.isvalid=1
         left join PPW_EMAIL.pvn_company_info c
         on c.company_id = info.trust_id and c.isvalid=1
+        left join (select c.fund_name,c.register_number,max(c.price_date) as last_price_date from PPW_EMAIL.email_fund_nav c where c.isvalid=1
+                                                                                             group by c.fund_name,c.register_number) a
+        on a.fund_name = alias.source_fund_name and a.register_number=alias.source_register_number
         where alias.isvalid=1
         <if test="fundName != null and fundName !=''">
             and (alias.source_fund_name like concat('%',#{fundName},'%') or alias.source_register_number like concat('%',#{fundName},'%') )
@@ -114,7 +119,14 @@
         <if test="isMapping != null and isMapping == 1">
             and alias.target_fund_id is not null
         </if>
-        order by alias.updatetime desc
+        <choose>
+            <when test="sort != null and sort !='' and sort=='priceDate' and order != null and order !=''">
+                order by a.last_price_date ${order}
+            </when>
+            <otherwise>
+                order by a.last_price_date desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
     </select>
     <select id="countFundAlias" resultType="java.lang.Long"

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

@@ -86,8 +86,15 @@
         <if test="endDate != null and endDate !=''">
             and f.inception_date <![CDATA[ <= ]]> #{endDate}
         </if>) a
+        <choose>
+            <when test="sort != null and sort !='' and sort=='lastPriceDate' and order != null and order !=''">
+                order by a.lastPriceDate ${order}
+            </when>
+            <otherwise>
+                order by a.lastPriceDate desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
-        order by a.lastPriceDate desc
     </select>
 
     <select id="queryFundByNameAndRegisterNumber" resultType="com.simuwang.base.pojo.dos.FundInfoDO">

+ 8 - 1
service-base/src/main/resources/mapper/FundNavAssetMapper.xml

@@ -59,7 +59,14 @@
         <if test="updateEndDate != null and updateEndDate !=''">
             and (nav.updatetime <![CDATA[ <= ]]> #{updateEndDate} or asset.updatetime <![CDATA[ <= ]]> #{updateEndDate})
         </if>
-        order by updatetime desc
+        <choose>
+            <when test="sort != null and sort !='' and sort=='priceDate' and order != null and order !=''">
+                order by price_date ${order}
+            </when>
+            <otherwise>
+                order by price_date desc
+            </otherwise>
+        </choose>
         limit #{offset},#{pageSize}
     </select>
     <select id="countNavAssetList" resultType="java.lang.Long"

+ 0 - 5
service-manage/src/main/java/com/simuwang/manage/service/impl/DeletionServiceImpl.java

@@ -60,11 +60,6 @@ public class DeletionServiceImpl implements DeletionService {
         List<DeletionInfoDO> deletionInfoDOList = deletionInfoMapper.searchDeletionList(deletionPageQuery);
         long total = deletionInfoMapper.countDeletion(deletionPageQuery);
         List<DeletionInfoVO> dataList = deletionInfoDOList.stream().map(DeletionInfoDO::toVO).collect(Collectors.toList());
-        for(DeletionInfoVO vo : dataList){
-            String fundId = vo.getFundId();
-            String lastDeletionDate = deletionInfoMapper.getLastDeletionDateByFundId(fundId,vo.getDeletionType());
-            vo.setLastDeletionDate(lastDeletionDate);
-        }
         return MybatisPage.of(total,dataList);
     }
 

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/service/impl/FundAliasServiceImpl.java

@@ -63,8 +63,8 @@ public class FundAliasServiceImpl implements FundAliasService {
             //异常净值数量
             Integer assetTotal = emailFundAssetMapper.countNoStoreAsset(vo.getSourceFundName(),vo.getSourceRegisterNumber());
             vo.setAssetTotal(assetTotal);
-            //最新净值日期
-            vo.setPriceDate(emailFundNavMapper.getMaxPriceDate(vo.getSourceFundName()));
+//            //最新净值日期
+//            vo.setPriceDate(emailFundNavMapper.getMaxPriceDate(vo.getSourceFundName()));
         }
         long total = fundAliasMapper.countFundAlias(fundAliasPageQuery);
         return MybatisPage.of(total,fundAliasVOList);