Commit 6865f642 authored by zp's avatar zp

Merge branch 'master' of 47.100.44.39:zhoupeng/tamp_fund

parents 98f6e80d 5d59808a
......@@ -1436,7 +1436,7 @@ public class ProductServiceImpl implements ProductService, Constant {
PageMethod.startPage(1, 1);
IfaImportedFundNavExample navExample = new IfaImportedFundNavExample();
navExample.createCriteria().andFundIdEqualTo(id).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
navExample.setOrderByClause("price_date");
navExample.setOrderByClause("price_date desc");
List<IfaImportedFundNav> navList = ifaImportedFundNavMapper.selectByExample(navExample);
if (CollectionUtils.isNotEmpty(navList)) {
detailResp.setNet(Net.builder().netDate(navList.get(0).getPriceDate().getTime())
......@@ -1490,9 +1490,13 @@ public class ProductServiceImpl implements ProductService, Constant {
if (i < fundNavs.size() - 1) {
IfaImportedFundNav pre = fundNavs.get(i + 1);
if (pre.getNav().compareTo(BigDecimal.ZERO) == 1) {
BigDecimal dailyIncrease = f.getNav().subtract(pre.getNav()).divide(pre.getNav(), 4, BigDecimal.ROUND_HALF_UP);
vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
if (pre.getCumulativeNav() != null && f.getCumulativeNav() != null) {
if (pre.getCumulativeNav().compareTo(BigDecimal.ZERO) == 1) {
BigDecimal dailyIncrease = f.getCumulativeNav().subtract(pre.getCumulativeNav()).divide(pre.getCumulativeNav(), 4, BigDecimal.ROUND_HALF_UP);
vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
}
} else {
vo.setDailyIncrease("--");
}
}
}
......
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