1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
func (f *BasisCrawl) ConvertToEntity() entity.FundBasis {
var fundBaseEntity entity.FundBasis
// 部分基金code解析为: 006049(前端)、006050(后端),如:https://fundf10.eastmoney.com/jbgk_006049.html
if strings.Contains(f.Code, "、") {
f.Code = strings.Split(f.Code, "、")[0]
}
fundBaseEntity.Code = utils.ExtractNumberFromString(f.Code)
fundBaseEntity.FullName = f.FullName
fundBaseEntity.ShortName = f.ShortName
// 类型分割
typeInfo := strings.Split(f.Type, "-")
fundBaseEntity.MainType = typeInfo[0]
fundBaseEntity.SubType = typeInfo[1]
// 基金公司
fundBaseEntity.Company = f.Company
// 基金经理
fundBaseEntity.Manager = f.Manager
fundBaseEntity.ManagerDesc = strings.ReplaceAll(f.ManagerDesc,"//","")
fundBaseEntity.Benchmark = f.Benchmark
// 发布时间
fundBaseEntity.ReleaseDate = replaceDateChinese(f.ReleaseDate)
// 成立日期
fundBaseEntity.EstablishDate = strings.TrimSpace(replaceDateChinese(strings.Split(f.EstablishDate, "/")[0]))
// 成立规模
establishShares := utils.ExtractNumberFromString(replaceDateChinese(strings.Split(f.EstablishShares, "/")[1]))
fundBaseEntity.EstablishShares, _ = strconv.ParseFloat(establishShares, 64)
// 管理费率
manageFeeRate := utils.ExtractNumberFromString(f.ManageFeeRate)
fundBaseEntity.ManageFeeRate, _ = strconv.ParseFloat(manageFeeRate, 64)
// 托管费率
fundBaseEntity.CustodyFeeRate, _ = strconv.ParseFloat(utils.ExtractNumberFromString(f.CustodyFeeRate), 64)
// 销售服务费率
fundBaseEntity.SaleFeeRate, _ = strconv.ParseFloat(utils.ExtractNumberFromString(f.SaleFeeRate), 64)
return fundBaseEntity
}
|