Browse Source

feat:私募基金基本信息接口的实现

mozuwen 1 năm trước cách đây
mục cha
commit
d587c75b26

+ 18 - 0
src/main/java/com/smppw/analysis/application/service/info/FundInfoService.java

@@ -531,4 +531,22 @@ public class FundInfoService {
         });
         return resultList;
     }
+
+    public PrivatelyFundBaseInfoVO getFundBaseInfo(String fundId) {
+        PrivatelyFundBaseInfoVO privatelyFundBaseInfoVO = new PrivatelyFundBaseInfoVO();
+        //私募基金基本信息
+        PrivatelyFundBaseInfoDo privatelyFundInfo = this.baseInfoService.listPrivatelyFundInfo(fundId);
+        if (privatelyFundInfo == null) {
+            return privatelyFundBaseInfoVO;
+        }
+        privatelyFundBaseInfoVO = BeanUtil.copyProperties(privatelyFundInfo, PrivatelyFundBaseInfoVO.class);
+        //获取基金的基金经理
+        List<FundManagerInfoDo> fundManagerInfoList = this.baseInfoService.listFundManagerByFundId(fundId);
+        if (CollUtil.isNotEmpty(fundManagerInfoList)) {
+            privatelyFundBaseInfoVO.setFundManager(fundManagerInfoList.stream()
+                    .map(FundManagerInfoDo::getManagerName).collect(Collectors.joining(",")));
+        }
+        //处理基金策略
+        return privatelyFundBaseInfoVO;
+    }
 }

+ 17 - 2
src/main/java/com/smppw/analysis/client/FundApi.java

@@ -111,6 +111,7 @@ public class FundApi {
      * 公募基金费率信息
      *
      * @param secId  基金id
+     * @param appKey 访问授权码,用于接口验签
      * @return 基金费率信息
      */
     @GetMapping("mf-fee")
@@ -123,6 +124,7 @@ public class FundApi {
      * 私募基金详情页-基金经理
      *
      * @param secId 基金id
+     * @param appKey 访问授权码,用于接口验签
      * @return 基金经理信息
      */
     @GetMapping("manager-info")
@@ -133,7 +135,7 @@ public class FundApi {
     /**
      * 公募基金详情页-基金经理
      *
-     * @param params 基金id
+     * @param params 详情请看请求体
      * @return 基金经理信息
      */
     @GetMapping("mf-manager-info")
@@ -144,7 +146,7 @@ public class FundApi {
     /**
      * 公募基金的基金经理变更历史
      *
-     * @param params 基金id
+     * @param params 详情请看请求体
      * @return 公募基金的基金经理变更历史
      */
     @GetMapping("manager-change")
@@ -152,4 +154,17 @@ public class FundApi {
         return ResultVo.ok(this.service.managerChangeList(params));
     }
 
+    /**
+     * 私募基金的基本信息
+     *
+     * @param secId 基金id
+     * @param appKey 访问授权码,用于接口验签
+     * @return 私募基金基本信息
+     */
+    @GetMapping("base-info")
+    public ResultVo<PrivatelyFundBaseInfoVO> getFundBaseInfo(@RequestParam("secId") String secId, String appKey) {
+        return ResultVo.ok(this.service.getFundBaseInfo(secId));
+    }
+
+
 }

+ 8 - 0
src/main/java/com/smppw/analysis/domain/dao/FundInformationDao.java

@@ -120,4 +120,12 @@ public class FundInformationDao {
     public ValueLabelVO getLastCompanyScale(String companyId) {
         return this.companyFundScaleRangeHistoryMapper.getLastCompanyScale(companyId);
     }
+
+    public PrivatelyFundBaseInfoDo listPrivatelyFundInfo(String fundId){
+        return this.fundInformationMapper.listPrivatelyFundInfo(fundId);
+    }
+
+    public List<FundManagerInfoDo> listFundManagerByFundId(String fundId){
+        return this.fundInformationMapper.listFundManagerByFundId(fundId);
+    }
 }

+ 23 - 0
src/main/java/com/smppw/analysis/domain/dataobject/FundManagerInfoDo.java

@@ -0,0 +1,23 @@
+package com.smppw.analysis.domain.dataobject;
+
+import lombok.Data;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/14 19:00
+ * @description 基金-基金经理
+ */
+@Data
+public class FundManagerInfoDo {
+
+    /**
+     * id
+     */
+    private String managerId;
+
+    /**
+     * 名称
+     */
+    private String managerName;
+
+}

+ 127 - 0
src/main/java/com/smppw/analysis/domain/dataobject/PrivatelyFundBaseInfoDo.java

@@ -0,0 +1,127 @@
+package com.smppw.analysis.domain.dataobject;
+
+import lombok.Data;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/14 17:00
+ * @description 私募基金基本信息
+ */
+@Data
+public class PrivatelyFundBaseInfoDo {
+    /**
+     * 基金id
+     */
+    private String fundId;
+
+    /**
+     * 基金全称
+     */
+    private String fundName;
+
+    /**
+     * 基金简称
+     */
+    private String fundShortName;
+
+    /**
+     * 基金类型
+     */
+    private String fundTypeValue;
+
+    /**
+     * 基金经理
+     */
+    private String fundManager;
+
+    /**
+     * 基金管理人id
+     */
+    private String trustId;
+
+    /**
+     * 基金管理人全称
+     */
+    private String trustFullName;
+
+    /**
+     * 基金管理人简称
+     */
+    private String trustName;
+
+    /**
+     * 基金货币
+     */
+    private String baseCurrency;
+
+    /**
+     * 净值披露频率
+     */
+    private String navFrequency;
+
+    /**
+     * 成立日期
+     */
+    private String inceptionDate;
+
+    /**
+     * 策略
+     */
+    private Integer strategy;
+
+    /**
+     * 二级策略
+     */
+    private Integer substrategy;
+
+    /**
+     * 三级策略
+     */
+    private Integer thirdStrategy;
+
+    /**
+     * 是否分级
+     */
+    private Integer istiered;
+
+    /**
+     * 是否伞型
+     */
+    private Integer umbrellaFund;
+
+    /**
+     * 投顾标志:-1表示无投顾;1表示初级投顾;2表示重点投顾;3表示核心投顾;
+     */
+    private String advisorType;
+
+    /**
+     * 投资顾问id
+     */
+    private String advisorId;
+
+    /**
+     * 托管银行
+     */
+    private String custodianName;
+
+    /**
+     * 备案编码
+     */
+    private String registerNumber;
+
+    /**
+     * 开放日
+     */
+    private String openDay;
+
+    /**
+     * 封闭期
+     */
+    private String lockupPeriod;
+
+    /**
+     * 基金状态
+     */
+    private Integer fundStatus;
+
+}

+ 68 - 0
src/main/java/com/smppw/analysis/domain/dto/info/FundBaseInfoVO.java

@@ -0,0 +1,68 @@
+package com.smppw.analysis.domain.dto.info;
+
+import lombok.Data;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/14 17:00
+ * @description 基金基本信息
+ */
+@Data
+public class FundBaseInfoVO {
+
+    /**
+     * 基金id
+     */
+    private String fundId;
+
+    /**
+     * 基金全称
+     */
+    private String fundName;
+
+    /**
+     * 基金简称
+     */
+    private String fundShortName;
+
+    /**
+     * 基金类型
+     */
+    private String fundTypeValue;
+
+    /**
+     * 基金经理
+     */
+    private String fundManager;
+
+    /**
+     * 基金管理人id
+     */
+    private String trustId;
+
+    /**
+     * 基金管理人全称
+     */
+    private String trustFullName;
+
+    /**
+     * 基金管理人简称
+     */
+    private String trustName;
+
+    /**
+     * 基金货币
+     */
+    private String baseCurrency;
+
+    /**
+     * 净值披露频率
+     */
+    private String navFrequency;
+
+    /**
+     * 基金状态
+     */
+    private Integer fundStatus;
+
+}

+ 72 - 0
src/main/java/com/smppw/analysis/domain/dto/info/PrivatelyFundBaseInfoVO.java

@@ -0,0 +1,72 @@
+package com.smppw.analysis.domain.dto.info;
+
+import lombok.Data;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/14 17:00
+ * @description 私募基金基本信息
+ */
+@Data
+public class PrivatelyFundBaseInfoVO extends FundBaseInfoVO {
+
+    /**
+     * 成立日期
+     */
+    private String inceptionDate;
+
+    /**
+     * 策略
+     */
+    private String strategy;
+
+    /**
+     * 二级策略
+     */
+    private String substrategy;
+
+    /**
+     * 三级策略
+     */
+    private String thirdStrategy;
+
+    /**
+     * 是否分级
+     */
+    private String istiered;
+
+    /**
+     * 是否伞型
+     */
+    private String umbrellaFund;
+
+    /**
+     * 投顾标志:-1表示无投顾;1表示初级投顾;2表示重点投顾;3表示核心投顾;
+     */
+    private String advisorType;
+
+    /**
+     * 投资顾问
+     */
+    private String advisorName;
+    /**
+     * 托管银行
+     */
+    private String custodianName;
+
+    /**
+     * 备案编码
+     */
+    private String registerNumber;
+
+    /**
+     * 开放日
+     */
+    private String openDay;
+
+    /**
+     * 封闭期
+     */
+    private String lockupPeriod;
+
+}

+ 17 - 0
src/main/java/com/smppw/analysis/domain/mapper/core/FundInformationMapper.java

@@ -56,6 +56,7 @@ public interface FundInformationMapper {
 
     /**
      * 获取基金的申赎费率信息
+     *
      * @param fundId 基金id
      * @return 基金的申赎费率信息
      */
@@ -77,4 +78,20 @@ public interface FundInformationMapper {
      */
     List<MfManagerFundNumDo> listMfManagerFundNumByManagerId(@Param("managerIdList") List<String> managerIdList);
 
+    /**
+     * 获取私募基金的基本信息
+     *
+     * @param fundId 基金id
+     * @return 私募基金的基本信息
+     */
+    PrivatelyFundBaseInfoDo listPrivatelyFundInfo(@Param("fundId") String fundId);
+
+    /**
+     * 获取基金的基金经理
+     *
+     * @param fundId 基金id
+     * @return 基金的基金经理
+     */
+    List<FundManagerInfoDo> listFundManagerByFundId(@Param("fundId") String fundId);
+
 }

+ 17 - 0
src/main/java/com/smppw/analysis/domain/service/BaseInfoService.java

@@ -182,8 +182,25 @@ public interface BaseInfoService {
 
     /**
      * 获取基金资产规模
+     *
      * @param managerId 基金经理id
      * @return 基金资产规模
      */
     List<ManualFundAssetSizeDo> getAssetSizeList(String managerId);
+
+    /**
+     * 获取私募基金的基本信息
+     *
+     * @param fundId 基金id
+     * @return 私募基金的基本信息
+     */
+    PrivatelyFundBaseInfoDo listPrivatelyFundInfo(String fundId);
+
+    /**
+     * 获取基金的基金经理
+     *
+     * @param fundId 基金id
+     * @return 基金的基金经理
+     */
+    List<FundManagerInfoDo> listFundManagerByFundId(String fundId);
 }

+ 10 - 0
src/main/java/com/smppw/analysis/domain/service/impl/BaseInfoServiceImpl.java

@@ -349,6 +349,16 @@ public class BaseInfoServiceImpl implements BaseInfoService, ApplicationContextA
         return fundAssetSizeMapper.getAssetSizeList(managerId);
     }
 
+    @Override
+    public PrivatelyFundBaseInfoDo listPrivatelyFundInfo(String fundId) {
+        return fundInformationDao.listPrivatelyFundInfo(fundId);
+    }
+
+    @Override
+    public List<FundManagerInfoDo> listFundManagerByFundId(String fundId) {
+        return fundInformationDao.listFundManagerByFundId(fundId);
+    }
+
     /**
      * 把指定类型的标的的名称映射查询出来
      *

+ 39 - 0
src/main/resources/mapping/core/FundInformationMapper.xml

@@ -399,4 +399,43 @@
             #{fundId}
         </foreach>
     </select>
+
+    <select id="listPrivatelyFundInfo"
+            resultType="com.smppw.analysis.domain.dataobject.PrivatelyFundBaseInfoDo">
+        select t1.fund_id         as fundId,
+               t1.fund_short_name as fundShortName,
+               t1.fund_name       as fundName,
+               t1.fund_type       as fundType,
+               t1.register_date   as registerDate,
+               t2.first_strategy  as strategy,
+               t2.second_strategy as substrategy,
+               t2.third_strategy  as thirdStrategy,
+               t1.istiered        as istiered,
+               t1.base_currency   as baseCurrency,
+               t1.advisor_id      as advisorId,
+               t1.trust_id        as trustId,
+               t1.custodian_id    as custodianId,
+               t3.umbrella_fund   as umbrellaFund,
+               t1.register_number as registerNumber,
+               t1.lock_period     as lockPeriod,
+               t1.open_day        as openDay,
+               t1.nav_frequency   as navFrequency,
+               t4.fund_status     as fundStatus
+        from rz_hfdb_core.fund_information t1
+                 join rz_hfdb_core.fund_strategy t2 on t1.fund_id = t2.fund_id and t2.isvalid = 1
+                 join rz_hfdb_core.fund_attributes t3 on t1.fund_id = t3.fund_id and t3.isvalid = 1
+                 join rz_hfdb_core.fund_status t4 on t1.fund_id = t4.fund_id and t4.isvalid = 1
+        where t1.isvalid = 1
+          and t1.fund_id = #{fundId}
+    </select>
+
+    <select id="listFundManagerByFundId" resultType="com.smppw.analysis.domain.dataobject.FundManagerInfoDo">
+        select t2.fund_manager_id as mnagerId, t3.personnel_name as managerName
+        from rz_hfdb_core.fund_information t1
+                 join rz_hfdb_core.fund_manager_mapping t2 on t1.fund_id = t2.fund_id and t2.isvalid = 1 and t2.management_end_date is null
+                 join rz_hfdb_core.personnel_information t3 on t2.fund_manager_id = t3.personnel_id and t3.isvalid = 1
+        where t1.isvalid = 1
+          and t1.fund_id = #{fundId}
+    </select>
+
 </mapper>