Forráskód Böngészése

fix: 缺失计算调整,增加备注修改

chenjianhua 7 hónapja
szülő
commit
ed3fc58860

+ 3 - 0
service-base/src/main/java/com/simuwang/base/mapper/DistributionMapper.java

@@ -1,5 +1,6 @@
 package com.simuwang.base.mapper;
 
+import com.simuwang.base.common.enums.DistributeType;
 import com.simuwang.base.pojo.dos.DistributionDO;
 import com.simuwang.base.pojo.dos.DistributionTablePageDO;
 import com.simuwang.base.pojo.dto.query.DistributionPageQuery;
@@ -31,4 +32,6 @@ public interface DistributionMapper {
     void saveDistribution(DistributionDO distributionDO);
 
     void deleteDistribution(@Param("ids") List<Integer> idList);
+
+    List<DistributionDO> getDistributionByFundId(@Param("fundId")String fundId,@Param("distributeType") DistributeType distributeType);
 }

+ 10 - 1
service-base/src/main/resources/mapper/DeletionInfoMapper.xml

@@ -38,7 +38,16 @@
         </foreach>
     </update>
     <update id="updateRemark">
-        update PPW_EMAIL.deletion_info set remark=#{remark} where fund_id=#{fundId} and deletion_type=#{deletionType} and deletion_date = #{deletionDate} and isvalid=1
+        update PPW_EMAIL.deletion_info set remark=#{remark} where isvalid=1
+        <if test="fundId != null and fundId !=''">
+            and fund_id=#{fundId}
+        </if>
+        <if test="deletionType != null and deletionType !=''">
+            and deletion_type=#{deletionType}
+        </if>
+        <if test="deletionDate != null and deletionDate !=''">
+            and deletion_date=#{deletionDate}
+        </if>
     </update>
     <select id="searchDeletionList" resultMap="BaseResultMap"
             parameterType="com.simuwang.base.pojo.dto.query.DeletionPageQuery">

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

@@ -121,8 +121,12 @@
         select id,fund_id,distribute_date,distribute_type,distribution,isvalid,creatorid,createtime,updatetime,updaterid
         from PPW_EMAIL.distribution where isvalid =1 and id=#{id}
     </select>
-    <select id="selectDistributionByDate" resultType="com.simuwang.base.pojo.dos.DistributionDO">
+    <select id="selectDistributionByDate" resultMap="BaseMap">
         select id,fund_id,distribute_date,distribute_type,distribution,isvalid,creatorid,createtime,updatetime,updaterid
         from PPW_EMAIL.distribution where isvalid =1 and fund_id=#{fundId} and distribute_date=#{distributeDate}
     </select>
+    <select id="getDistributionByFundId" resultMap="BaseMap">
+        select id,fund_id,distribute_date,distribute_type,distribution,isvalid,creatorid,createtime,updatetime,updaterid
+        from PPW_EMAIL.distribution where isvalid =1 and fund_id=#{fundId} and distribute_type=#{distributeType}
+    </select>
 </mapper>

+ 9 - 0
service-manage/src/main/java/com/simuwang/manage/task/FundDeletionTask.java

@@ -2,6 +2,7 @@ package com.simuwang.manage.task;
 
 import cn.hutool.core.date.DateUtil;
 import com.simuwang.base.common.enums.DeletionType;
+import com.simuwang.base.common.enums.DistributeType;
 import com.simuwang.base.common.enums.Frequency;
 import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.common.util.StringUtil;
@@ -42,6 +43,9 @@ public class FundDeletionTask {
 
     @Autowired
     private DeletionInfoMapper deletionInfoMapper;
+
+    @Autowired
+    private DistributionMapper distributionMapper;
     @Scheduled(cron = "0 0 5,12,20 * * ?")
     public void computeDeletion(){
         List<String> fundIdList = navMapper.getAllFundId();
@@ -67,7 +71,12 @@ public class FundDeletionTask {
     }
 
     private void distributionDeletion(String fundId, List<NavDO> navDOList) {
+        //查询是否存在拆分
+        List<DistributionDO> distributionDOS = distributionMapper.getDistributionByFundId(fundId, DistributeType.DIVIDENDS_SPLIT);
+        if(distributionDOS.size() > 0){
+            //存在拆分,不做分红缺失计算,同时吧以往的数据置为无效
 
+        }
     }
 
     private void assetDeletion(String fundId, List<AssetDO> assetDOList, List<TradeDateDO> tradeDateDOList, FundReportFrequencyDO fundReportFrequencyDO) {