|
@@ -2,6 +2,7 @@ package com.simuwang.manage.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.simuwang.base.common.conts.DateConst;
|
|
@@ -32,6 +33,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.io.IOException;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -190,6 +192,11 @@ public class FundAliasServiceImpl implements FundAliasService {
|
|
|
if (CollUtil.isNotEmpty(fundAliasDOList)) {
|
|
|
fundAliasMapper.batchUpdate(fundAliasDOList);
|
|
|
}
|
|
|
+
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
+ // async update fund nav and asset
|
|
|
+ updateFundNavAndAsset(DateUtil.format(date, DateConst.YYYY_MM_DD));
|
|
|
+ });
|
|
|
return "update success";
|
|
|
}
|
|
|
|
|
@@ -255,9 +262,9 @@ public class FundAliasServiceImpl implements FundAliasService {
|
|
|
navMapper.batchInsert(navDOList);
|
|
|
}
|
|
|
List<Integer> emailFundNavIdList = emailFundNavDOList.stream().map(EmailFundNavDO::getId).toList();
|
|
|
- log.info("基金Id:{}, 更新email_fund_nav的字段id:{}", fundId, emailFundNavIdList);
|
|
|
|
|
|
if (CollUtil.isNotEmpty(emailFundNavIdList)) {
|
|
|
+ log.info("基金Id:{}, 更新email_fund_nav的字段id:{}", fundId, emailFundNavIdList);
|
|
|
emailFundNavMapper.updateFundIdByIds(fundId, emailFundNavIdList);
|
|
|
}
|
|
|
}
|