Commit 006dc1a5 authored by 张亚辉's avatar 张亚辉

分红处理

parent dcc9bbad
...@@ -133,15 +133,16 @@ public class ProductOrderServiceImpl implements ProductOrderService, Constant { ...@@ -133,15 +133,16 @@ public class ProductOrderServiceImpl implements ProductOrderService, Constant {
public List<FundBounsResp> getFundBounsinfo(List<String> list, String date) { public List<FundBounsResp> getFundBounsinfo(List<String> list, String date) {
LambdaQueryWrapper<TxFundDistribution> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TxFundDistribution> queryWrapper = new LambdaQueryWrapper<>();
final List<TxFundDistribution> distributionList = this.txFundDistributionMapper final List<TxFundDistribution> distributionList = this.txFundDistributionMapper
.selectList(queryWrapper.ge(TxFundDistribution::getRegisterDate, date) .selectList(queryWrapper.ge(TxFundDistribution::getExDate, date)
.in(TxFundDistribution::getFundCode, list).eq(TxFundDistribution::getDeleteTag, BizEnums.DeleteTag.tag_init)); .in(TxFundDistribution::getFundCode, list)
.eq(TxFundDistribution::getDeleteTag, BizEnums.DeleteTag.tag_init));
if (CollectionUtils.isNotEmpty(distributionList)) { if (CollectionUtils.isNotEmpty(distributionList)) {
// 查询分红权益日内基金净值 // 查询分红权益日内基金净值
TxFundNavExample fundNavExample = new TxFundNavExample(); TxFundNavExample fundNavExample = new TxFundNavExample();
fundNavExample.createCriteria() fundNavExample.createCriteria()
.andFundIdIn(distributionList.stream().map(c -> String.valueOf(c.getFundId())).collect(Collectors.toList())) .andFundIdIn(distributionList.stream().map(c -> String.valueOf(c.getFundId())).collect(Collectors.toList()))
.andPriceDateIn(distributionList.stream().map(TxFundDistribution::getRegisterDate).collect(Collectors.toList())) .andPriceDateIn(distributionList.stream().map(TxFundDistribution::getExDate).collect(Collectors.toList()))
.andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init); .andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
final Map<String, List<TxFundNav>> txFundNavMap = this.txFundNavMapper.selectByExample(fundNavExample) final Map<String, List<TxFundNav>> txFundNavMap = this.txFundNavMapper.selectByExample(fundNavExample)
.stream().collect(Collectors.groupingBy(TxFundNav::getFundId)); .stream().collect(Collectors.groupingBy(TxFundNav::getFundId));
...@@ -150,14 +151,14 @@ public class ProductOrderServiceImpl implements ProductOrderService, Constant { ...@@ -150,14 +151,14 @@ public class ProductOrderServiceImpl implements ProductOrderService, Constant {
final FundBounsResp build = FundBounsResp.builder() final FundBounsResp build = FundBounsResp.builder()
.fundId(c.getFundId()) .fundId(c.getFundId())
.fundCode(c.getFundCode()) .fundCode(c.getFundCode())
.registerDate(c.getRegisterDate()) .exDate(c.getExDate())
.distributeDate(c.getDistributeDate()) .distributeDate(c.getDistributeDate())
.distribution(c.getDistribution()) .distribution(c.getDistribution())
.build(); .build();
final TxFundNav txFundNav = txFundNavMap.get(String.valueOf(c.getFundId())).stream() final TxFundNav txFundNav = txFundNavMap.get(String.valueOf(c.getFundId())).stream()
.filter(nav -> StringUtils.equals(String.valueOf(c.getFundId()), nav.getFundId()) .filter(nav -> StringUtils.equals(String.valueOf(c.getFundId()), nav.getFundId())
&& c.getRegisterDate().getTime() == nav.getPriceDate().getTime()).findFirst().get(); && c.getExDate().getTime() == nav.getPriceDate().getTime()).findFirst().get();
build.setFundNet(txFundNav.getNav()); build.setFundNet(txFundNav.getNav());
return build; return build;
......
...@@ -10,8 +10,8 @@ management.endpoints.web.base-path = /myhealth ...@@ -10,8 +10,8 @@ management.endpoints.web.base-path = /myhealth
management.endpoint.health.enabled=true management.endpoint.health.enabled=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
spring.datasource.url=jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false spring.datasource.url=jdbc:mysql://tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username=tamp_admin spring.datasource.username=tamp
spring.datasource.password= @imeng123 spring.datasource.password= @imeng123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment