Commit e936c12d authored by 张亚辉's avatar 张亚辉

Merge branch 'yh_1207'

parents ae1c0658 909629a8
...@@ -7,25 +7,6 @@ import lombok.Builder; ...@@ -7,25 +7,6 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
/** /**
* 基金历史业绩 * 基金历史业绩
*/ */
...@@ -251,6 +232,12 @@ public class FundCount { ...@@ -251,6 +232,12 @@ public class FundCount {
*/ */
private BigDecimal retIncepBm1A; private BigDecimal retIncepBm1A;
private BigDecimal sharperatio1m;
private BigDecimal sharperatio3m;
private BigDecimal sharperatio6m;
/** /**
* 最近一年的夏普比率 * 最近一年的夏普比率
*/ */
...@@ -276,11 +263,19 @@ public class FundCount { ...@@ -276,11 +263,19 @@ public class FundCount {
*/ */
private BigDecimal sharperatio5y; private BigDecimal sharperatio5y;
private BigDecimal sharperatioYtd;
/** /**
* 成立以来的夏普比率 * 成立以来的夏普比率
*/ */
private BigDecimal sharperatioIncep; private BigDecimal sharperatioIncep;
private BigDecimal stddev1m;
private BigDecimal stddev3m;
private BigDecimal stddev6m;
/** /**
* 最近一年的年化波动率 * 最近一年的年化波动率
*/ */
...@@ -356,6 +351,14 @@ public class FundCount { ...@@ -356,6 +351,14 @@ public class FundCount {
*/ */
private BigDecimal maxdrawdownIncep; private BigDecimal maxdrawdownIncep;
private BigDecimal maxdrawdown1m;
private BigDecimal maxdrawdown3m;
private BigDecimal maxdrawdown6m;
private BigDecimal maxdrawdownYtd;
/** /**
* 数据来源 1:tanpu,2:私募排排 3:指数 * 数据来源 1:tanpu,2:私募排排 3:指数
*/ */
...@@ -376,4 +379,354 @@ public class FundCount { ...@@ -376,4 +379,354 @@ public class FundCount {
private Integer sort; private Integer sort;
private Integer deleteTag; private Integer deleteTag;
/**
* 卡玛比率
*/
private BigDecimal calmarRatio;
/**
* alpha
*/
private BigDecimal alpha;
/**
* beta
*/
private BigDecimal beta;
/**
* 胜率
*/
private BigDecimal winRate;
/**
* 最近一月卡尔玛比率
*/
private BigDecimal calmarRatio1m;
/**
* 最近三月卡尔玛比率
*/
private BigDecimal calmarRatio3m;
/**
* 最近六月卡尔玛比率
*/
private BigDecimal calmarRatio6m;
/**
* 最近一年卡尔玛比率
*/
private BigDecimal calmarRatio1y;
/**
* 最近两年卡尔玛比率
*/
private BigDecimal calmarRatio2y;
/**
* 最近三年卡尔玛比率
*/
private BigDecimal calmarRatio3y;
/**
* 最近五年卡尔玛比率
*/
private BigDecimal calmarRatio5y;
/**
* 成立以来卡尔玛比率
*/
private BigDecimal calmarRatioIncep;
/**
* 今年以来卡尔玛比率
*/
private BigDecimal calmarRatioYtd;
/**
* 最近一月索提诺比率
*/
private BigDecimal sortinoRatio1m;
/**
* 最近三月索提诺比率
*/
private BigDecimal sortinoRatio3m;
/**
* 最近六月索提诺比率
*/
private BigDecimal sortinoRatio6m;
/**
* 最近一年索提诺比率
*/
private BigDecimal sortinoRatio1y;
/**
* 最近两年索提诺比率
*/
private BigDecimal sortinoRatio2y;
/**
* 最近三年索提诺比率
*/
private BigDecimal sortinoRatio3y;
/**
* 最近五年索提诺比率
*/
private BigDecimal sortinoRatio5y;
/**
* 成立以来索提诺比率
*/
private BigDecimal sortinoRatioIncep;
/**
* 今年以来索提诺比率
*/
private BigDecimal sortinoRatioYtd;
/**
* 最近一月alha
*/
private BigDecimal alpha1m;
/**
* 最近三月alha
*/
private BigDecimal alpha3m;
/**
* 最近六月alha
*/
private BigDecimal alpha6m;
/**
* 最近一年alha
*/
private BigDecimal alpha1y;
/**
* 最近两年alha
*/
private BigDecimal alpha2y;
/**
* 最近三年alha
*/
private BigDecimal alpha3y;
/**
* 最近五年alha
*/
private BigDecimal alpha5y;
/**
* 成立以来alha
*/
private BigDecimal alphaIncep;
/**
* 今年以来alha
*/
private BigDecimal alphaYtd;
/**
* 最近一月beta
*/
private BigDecimal beta1m;
/**
* 最近三月beta
*/
private BigDecimal beta3m;
/**
* 最近六月beta
*/
private BigDecimal beta6m;
/**
* 最近一年beta
*/
private BigDecimal beta1y;
/**
* 最近两年beta
*/
private BigDecimal beta2y;
/**
* 最近三年beta
*/
private BigDecimal beta3y;
/**
* 最近五年beta
*/
private BigDecimal beta5y;
/**
* 成立以来beta
*/
private BigDecimal betaIncep;
/**
* 今年以来beta
*/
private BigDecimal betaYtd;
/**
* 最近一月胜率
*/
private BigDecimal winRate1m;
/**
* 最近三月胜率
*/
private BigDecimal winRate3m;
/**
* 最近六月胜率
*/
private BigDecimal winRate6m;
/**
* 最近一年胜率
*/
private BigDecimal winRate1y;
/**
* 最近两年胜率
*/
private BigDecimal winRate2y;
/**
* 最近三年胜率
*/
private BigDecimal winRate3y;
/**
* 最近五年胜率
*/
private BigDecimal winRate5y;
/**
* 成立以来胜率
*/
private BigDecimal winRateIncep;
/**
* 今年以来胜率
*/
private BigDecimal winRateYtd;
/**
* 最近一月下行标准差
*/
private BigDecimal downsideRisk1m;
/**
* 最近三月下行标准差
*/
private BigDecimal downsideRisk3m;
/**
* 最近六月下行标准差
*/
private BigDecimal downsideRisk6m;
/**
* 最近一年下行标准差
*/
private BigDecimal downsideRisk1y;
/**
* 最近两年下行标准差
*/
private BigDecimal downsideRisk2y;
/**
* 最近三年下行标准差
*/
private BigDecimal downsideRisk3y;
/**
* 最近五年下行标准差
*/
private BigDecimal downsideRisk5y;
/**
* 成立以来下行标准差
*/
private BigDecimal downsideRiskIncep;
/**
* 今年以来下行标准差
*/
private BigDecimal downsideRiskYtd;
/**
* 最近一月信息比率
*/
private BigDecimal informationalRatio1m;
/**
* 最近三月信息比率
*/
private BigDecimal informationalRatio3m;
/**
* 最近六月信息比率
*/
private BigDecimal informationalRatio6m;
/**
* 最近一年信息比率
*/
private BigDecimal informationalRatio1y;
/**
* 最近两年信息比率
*/
private BigDecimal informationalRatio2y;
/**
* 最近三年信息比率
*/
private BigDecimal informationalRatio3y;
/**
* 最近五年信息比率
*/
private BigDecimal informationalRatio5y;
/**
* 成立以来信息比率
*/
private BigDecimal informationalRatioIncep;
/**
* 今年以来信息比率
*/
private BigDecimal informationalRatioYtd;
/**
* 年度收益
*/
private String annualRet;
/**
* 月度收益
*/
private String monthlyRet;
/**
* 年度回撤
*/
private String annualMaxdrawdown;
} }
\ No newline at end of file
...@@ -247,6 +247,11 @@ public class FundInfo { ...@@ -247,6 +247,11 @@ public class FundInfo {
private String redeemDay; private String redeemDay;
/**
* 1 有净值 0 没有净值
*/
private Integer hasNav;
/** /**
* 券商资管产品特点 * 券商资管产品特点
*/ */
......
...@@ -3371,6 +3371,66 @@ public class FundInfoExample { ...@@ -3371,6 +3371,66 @@ public class FundInfoExample {
addCriterion("redeem_day not between", value1, value2, "redeemDay"); addCriterion("redeem_day not between", value1, value2, "redeemDay");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andHasNavIsNull() {
addCriterion("has_nav is null");
return (Criteria) this;
}
public Criteria andHasNavIsNotNull() {
addCriterion("has_nav is not null");
return (Criteria) this;
}
public Criteria andHasNavEqualTo(Integer value) {
addCriterion("has_nav =", value, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavNotEqualTo(Integer value) {
addCriterion("has_nav <>", value, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavGreaterThan(Integer value) {
addCriterion("has_nav >", value, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavGreaterThanOrEqualTo(Integer value) {
addCriterion("has_nav >=", value, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavLessThan(Integer value) {
addCriterion("has_nav <", value, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavLessThanOrEqualTo(Integer value) {
addCriterion("has_nav <=", value, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavIn(List<Integer> values) {
addCriterion("has_nav in", values, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavNotIn(List<Integer> values) {
addCriterion("has_nav not in", values, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavBetween(Integer value1, Integer value2) {
addCriterion("has_nav between", value1, value2, "hasNav");
return (Criteria) this;
}
public Criteria andHasNavNotBetween(Integer value1, Integer value2) {
addCriterion("has_nav not between", value1, value2, "hasNav");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
...@@ -6,24 +6,6 @@ import java.util.List; ...@@ -6,24 +6,6 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@Mapper @Mapper
public interface FundCountMapper { public interface FundCountMapper {
long countByExample(FundCountExample example); long countByExample(FundCountExample example);
...@@ -38,18 +20,26 @@ public interface FundCountMapper { ...@@ -38,18 +20,26 @@ public interface FundCountMapper {
int insertOrUpdateSelective(FundCount record); int insertOrUpdateSelective(FundCount record);
int insertOrUpdateWithBLOBs(FundCount record);
int insertSelective(FundCount record); int insertSelective(FundCount record);
List<FundCount> selectByExampleWithBLOBs(FundCountExample example);
List<FundCount> selectByExample(FundCountExample example); List<FundCount> selectByExample(FundCountExample example);
FundCount selectByPrimaryKey(String id); FundCount selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") FundCount record, @Param("example") FundCountExample example); int updateByExampleSelective(@Param("record") FundCount record, @Param("example") FundCountExample example);
int updateByExampleWithBLOBs(@Param("record") FundCount record, @Param("example") FundCountExample example);
int updateByExample(@Param("record") FundCount record, @Param("example") FundCountExample example); int updateByExample(@Param("record") FundCount record, @Param("example") FundCountExample example);
int updateByPrimaryKeySelective(FundCount record); int updateByPrimaryKeySelective(FundCount record);
int updateByPrimaryKeyWithBLOBs(FundCount record);
int updateByPrimaryKey(FundCount record); int updateByPrimaryKey(FundCount record);
int updateBatch(List<FundCount> list); int updateBatch(List<FundCount> list);
......
...@@ -12,20 +12,8 @@ public interface FundInfoMapper { ...@@ -12,20 +12,8 @@ public interface FundInfoMapper {
int deleteByExample(FundInfoExample example); int deleteByExample(FundInfoExample example);
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(String id); int deleteByPrimaryKey(String id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(FundInfo record); int insert(FundInfo record);
int insertOrUpdate(FundInfo record); int insertOrUpdate(FundInfo record);
...@@ -34,24 +22,12 @@ public interface FundInfoMapper { ...@@ -34,24 +22,12 @@ public interface FundInfoMapper {
int insertOrUpdateWithBLOBs(FundInfo record); int insertOrUpdateWithBLOBs(FundInfo record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(FundInfo record); int insertSelective(FundInfo record);
List<FundInfo> selectByExampleWithBLOBs(FundInfoExample example); List<FundInfo> selectByExampleWithBLOBs(FundInfoExample example);
List<FundInfo> selectByExample(FundInfoExample example); List<FundInfo> selectByExample(FundInfoExample example);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
FundInfo selectByPrimaryKey(String id); FundInfo selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") FundInfo record, @Param("example") FundInfoExample example); int updateByExampleSelective(@Param("record") FundInfo record, @Param("example") FundInfoExample example);
...@@ -60,25 +36,15 @@ public interface FundInfoMapper { ...@@ -60,25 +36,15 @@ public interface FundInfoMapper {
int updateByExample(@Param("record") FundInfo record, @Param("example") FundInfoExample example); int updateByExample(@Param("record") FundInfo record, @Param("example") FundInfoExample example);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(FundInfo record); int updateByPrimaryKeySelective(FundInfo record);
int updateByPrimaryKeyWithBLOBs(FundInfo record); int updateByPrimaryKeyWithBLOBs(FundInfo record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(FundInfo record); int updateByPrimaryKey(FundInfo record);
int updateBatch(List<FundInfo> list); int updateBatch(List<FundInfo> list);
int updateBatchSelective(List<FundInfo> list);
int batchInsert(@Param("list") List<FundInfo> list); int batchInsert(@Param("list") List<FundInfo> list);
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ import com.tanpu.common.enums.BizEnums; ...@@ -15,6 +15,7 @@ import com.tanpu.common.enums.BizEnums;
import com.tanpu.common.enums.Constant; import com.tanpu.common.enums.Constant;
import com.tanpu.common.enums.SysConstEnums; import com.tanpu.common.enums.SysConstEnums;
import com.tanpu.common.enums.product.ProductEnums; import com.tanpu.common.enums.product.ProductEnums;
import com.tanpu.common.enums.product.ProductTypeEnum;
import com.tanpu.common.model.Page; import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable; import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.adm.req.IfaNetImportReq; import com.tanpu.common.model.adm.req.IfaNetImportReq;
...@@ -2488,7 +2489,42 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -2488,7 +2489,42 @@ public class ProductServiceImpl implements ProductService, Constant {
public List<Type> getFundLikeShortName(String productName, Pageable page) { public List<Type> getFundLikeShortName(String productName, Pageable page) {
PageMethod.startPage(page.getPageNumber(), page.getPageSize()); PageMethod.startPage(page.getPageNumber(), page.getPageSize());
return this.fundInfoCustomMapper.getFundInfoLikeName("%" + productName + "%"); final List<Type> fundInfoList = this.fundInfoCustomMapper.getFundInfoLikeName("%" + productName + "%");
if (CollectionUtils.isNotEmpty(fundInfoList)) {
// 查询基金收益
FundCountExample countExample = new FundCountExample();
countExample.createCriteria().andFundIdIn(fundInfoList.stream().map(Type::getId).collect(Collectors.toList()))
.andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
final List<FundCount> fundCounts = fundCountMapper.selectByExample(countExample);
Map<String, FundCount> fundCountMap = null;
if (CollectionUtils.isNotEmpty(fundCounts)) {
fundCountMap = fundCounts.stream().collect(Collectors.toMap(FundCount::getFundId, c -> c));
}
// 查询基金最新净值
List<FundNav> fundInfoNewNet = fundInfoCustomMapper.getFundInfoNewNet(fundInfoList.stream().map(Type::getId).collect(Collectors.toList()));
Map<String, FundNav> fundNavMap = null;
if (CollectionUtils.isNotEmpty(fundInfoNewNet)) {
fundNavMap = fundInfoNewNet.stream().collect(Collectors.toMap(FundNav::getFundId, c -> c));
}
Map<String, FundCount> finalFundCountMap = fundCountMap;
Map<String, FundNav> finalFundNavMap = fundNavMap;
fundInfoList.forEach(c -> {
c.setFundType(ProductTypeEnum.TAMP.type);
if (finalFundCountMap != null && finalFundCountMap.containsKey(c.getId())) {
c.setRet1y(BigDecimalUtil.multiply100(finalFundCountMap.get(c.getId()).getRet1y()));
}
if (finalFundNavMap != null && finalFundNavMap.containsKey(c.getId())) {
c.setNet(BigDecimalUtil.toString(finalFundNavMap.get(c.getId()).getNav(), 4));
c.setNetDate(DateUtil.formatDate(finalFundNavMap.get(c.getId()).getPriceDate()));
}
});
}
return fundInfoList;
} }
@Override @Override
......
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