edb_ths_hf.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. package models
  2. import (
  3. "encoding/json"
  4. "eta/eta_index_lib/utils"
  5. "fmt"
  6. "github.com/beego/beego/v2/client/orm"
  7. "github.com/shopspring/decimal"
  8. "reflect"
  9. "sort"
  10. "time"
  11. )
  12. // EdbThsHf 自有数据
  13. type EdbThsHf struct{}
  14. // GetSource 获取来源编码id
  15. func (obj EdbThsHf) GetSource() int {
  16. return utils.DATA_SOURCE_THS
  17. }
  18. // GetSubSource 获取子来源编码id
  19. func (obj EdbThsHf) GetSubSource() int {
  20. return utils.DATA_SUB_SOURCE_HIGH_FREQUENCY
  21. }
  22. // GetSourceName 获取来源名称
  23. func (obj EdbThsHf) GetSourceName() string {
  24. return utils.DATA_SOURCE_NAME_THS
  25. }
  26. // GetEdbType 获取指标类型
  27. func (obj EdbThsHf) GetEdbType() int {
  28. return utils.DEFAULT_EDB_TYPE
  29. }
  30. // ThsHfAddBaseParams
  31. // @Description: 基础指标的添加参数
  32. type ThsHfAddBaseParams struct {
  33. EdbCode string `description:"指标编码"`
  34. EdbName string `description:"指标名称"`
  35. Unit string `description:"单位"`
  36. Frequency string `description:"频度"`
  37. Sort int `description:"排序"`
  38. ClassifyId int `description:"所属分类"`
  39. SysUserId int `description:"用户id"`
  40. SysUserRealName string `description:"用户真实名称"`
  41. UniqueCode string `description:"唯一编码"`
  42. ConvertRule string `description:"转换规则"`
  43. }
  44. // ThsHfEditBaseParams
  45. // @Description: 基础指标的修改参数
  46. type ThsHfEditBaseParams struct {
  47. EdbCode string `description:"指标编码"`
  48. EdbName string `description:"指标名称"`
  49. EdbNameEn string `description:"指标名称(英文)"`
  50. Unit string `description:"单位"`
  51. UnitEn string `description:"单位(英文)"`
  52. ClassifyId int `description:"所属分类"`
  53. SysUserId int `description:"用户id"`
  54. SysUserRealName string `description:"用户真实名称"`
  55. UniqueCode string `description:"编码"`
  56. Lang string `description:"语言版本"`
  57. EdbInfo *EdbInfo `description:"指标信息"`
  58. }
  59. type ThsHfRefreshBaseParams struct {
  60. EdbInfo *EdbInfo
  61. StartDate string
  62. EndDate string
  63. }
  64. // Add
  65. // @Description: 添加指标
  66. // @author: Roc
  67. // @receiver obj
  68. // @datetime 2024-04-30 17:35:14
  69. // @param params ThsHfAddBaseParams
  70. // @param businessIndexItem *BaseFromBusinessIndex
  71. // @return edbInfo *EdbInfo
  72. // @return err error
  73. // @return errMsg string
  74. func (obj EdbThsHf) Add(params ThsHfAddBaseParams, baseIndex *BaseFromThsHfIndex) (edbInfo *EdbInfo, err error) {
  75. o := orm.NewOrm()
  76. tx, e := o.Begin()
  77. if e != nil {
  78. err = fmt.Errorf("orm begin err: %v", e)
  79. return
  80. }
  81. defer func() {
  82. if err != nil {
  83. _ = tx.Rollback()
  84. utils.FileLog.Info(fmt.Sprintf("%s err: %v", reflect.TypeOf(obj).Name(), err))
  85. return
  86. }
  87. _ = tx.Commit()
  88. }()
  89. // 新增指标
  90. edbInfo = new(EdbInfo)
  91. edbInfo.Source = obj.GetSource()
  92. edbInfo.SubSource = obj.GetSubSource()
  93. edbInfo.SourceName = obj.GetSourceName()
  94. edbInfo.EdbType = obj.GetEdbType()
  95. edbInfo.EdbCode = params.EdbCode
  96. edbInfo.EdbName = params.EdbName
  97. edbInfo.EdbNameEn = params.EdbName
  98. edbInfo.EdbNameSource = params.EdbName
  99. edbInfo.Frequency = params.Frequency
  100. edbInfo.Unit = params.Unit
  101. edbInfo.UnitEn = params.Unit
  102. edbInfo.StartDate = baseIndex.StartDate.Format(utils.FormatDate) // 默认取源指标的时间, 刷新完成后更新
  103. edbInfo.EndDate = baseIndex.EndDate.Format(utils.FormatDate)
  104. edbInfo.ClassifyId = params.ClassifyId
  105. edbInfo.SysUserId = params.SysUserId
  106. edbInfo.SysUserRealName = params.SysUserRealName
  107. edbInfo.Sort = params.Sort
  108. edbInfo.TerminalCode = baseIndex.TerminalCode
  109. edbInfo.UniqueCode = params.UniqueCode
  110. edbInfo.CreateTime = time.Now()
  111. edbInfo.ModifyTime = time.Now()
  112. edbInfoId, e := tx.Insert(edbInfo)
  113. if e != nil {
  114. err = fmt.Errorf("insert edb err: %v", e)
  115. return
  116. }
  117. edbInfo.EdbInfoId = int(edbInfoId)
  118. // 新增指标关联
  119. edbMapping := new(BaseFromEdbMapping)
  120. edbMapping.BaseFromIndexId = baseIndex.BaseFromThsHfIndexId
  121. edbMapping.BaseIndexCode = baseIndex.IndexCode
  122. edbMapping.EdbInfoId = edbInfo.EdbInfoId
  123. edbMapping.EdbCode = edbInfo.EdbCode
  124. edbMapping.Source = obj.GetSource()
  125. edbMapping.SubSource = obj.GetSubSource()
  126. edbMapping.ConvertRule = params.ConvertRule
  127. edbMapping.CreateTime = time.Now().Local()
  128. edbMapping.ModifyTime = time.Now().Local()
  129. edbMappingId, e := tx.Insert(edbMapping)
  130. if e != nil {
  131. err = fmt.Errorf("insert base edb mapping err: %v", e)
  132. return
  133. }
  134. edbMapping.Id = int(edbMappingId)
  135. // 刷新数据
  136. err = obj.Refresh(edbInfo, edbMapping, "")
  137. return
  138. }
  139. func (obj EdbThsHf) Refresh(edbInfo *EdbInfo, edbBaseMapping *BaseFromEdbMapping, startDate string) (err error) {
  140. if edbInfo == nil || edbBaseMapping == nil {
  141. err = fmt.Errorf("指标信息/关联信息有误, EdbInfo: %v, EdbBaseMapping: %v", edbInfo, edbBaseMapping)
  142. return
  143. }
  144. // 真实数据的最大日期, 插入规则配置的日期
  145. var realDataMaxDate, edbDataInsertConfigDate time.Time
  146. var edbDataInsertConfig *EdbDataInsertConfig
  147. var isFindConfigDateRealData bool
  148. {
  149. conf, e := GetEdbDataInsertConfigByEdbId(edbInfo.EdbInfoId)
  150. if e != nil && e.Error() != utils.ErrNoRow() {
  151. err = fmt.Errorf("GetEdbDataInsertConfigByEdbId err: %v", e)
  152. return
  153. }
  154. edbDataInsertConfig = conf
  155. if edbDataInsertConfig != nil {
  156. edbDataInsertConfigDate = edbDataInsertConfig.Date
  157. }
  158. }
  159. // 查询时间为开始时间-3d
  160. var queryDate string
  161. if startDate != "" {
  162. st, e := time.ParseInLocation(utils.FormatDate, startDate, time.Local)
  163. if e != nil {
  164. err = fmt.Errorf("刷新开始时间有误, %v", e)
  165. return
  166. }
  167. queryDate = st.AddDate(0, 0, -3).Format(utils.FormatDate)
  168. }
  169. // 源指标数据
  170. baseDataList := make([]*BaseFromThsHfData, 0)
  171. {
  172. ob := new(BaseFromThsHfData)
  173. cond := fmt.Sprintf(" AND %s = ?", ob.Cols().IndexCode)
  174. pars := make([]interface{}, 0)
  175. pars = append(pars, edbBaseMapping.BaseIndexCode)
  176. if queryDate != "" {
  177. cond += fmt.Sprintf(" AND %s >= ?", ob.Cols().DataTime)
  178. pars = append(pars, queryDate)
  179. }
  180. list, e := ob.GetItemsByCondition(cond, pars, []string{}, fmt.Sprintf("%s ASC", ob.Cols().DataTime))
  181. if e != nil {
  182. err = fmt.Errorf("获取数据源数据失败, %v", e)
  183. return
  184. }
  185. baseDataList = list
  186. }
  187. // 转换数据
  188. convertRule := new(ThsHfIndexConvert2EdbRule)
  189. if e := json.Unmarshal([]byte(edbBaseMapping.ConvertRule), &convertRule); e != nil {
  190. err = fmt.Errorf("转换规则有误, %v", e)
  191. return
  192. }
  193. convertData, e := ThsHfConvertData2DayByRule(baseDataList, convertRule)
  194. if e != nil {
  195. err = fmt.Errorf("转换数据失败, %v", e)
  196. return
  197. }
  198. if len(convertData) == 0 {
  199. utils.FileLog.Info("同花顺高频-转换无数据, EdbCode: %s", edbInfo.EdbCode)
  200. return
  201. }
  202. // 获取已有数据
  203. dataOb := new(EdbDataThsHf)
  204. dataExists := make(map[string]*EdbDataThsHf)
  205. searchExistMap := make(map[string]*EdbInfoSearchData)
  206. {
  207. cond := fmt.Sprintf(" AND %s = ?", dataOb.Cols().EdbInfoId)
  208. pars := make([]interface{}, 0)
  209. pars = append(pars, edbInfo.EdbInfoId)
  210. if queryDate != "" {
  211. cond += fmt.Sprintf(" AND %s >= ?", dataOb.Cols().DataTime)
  212. pars = append(pars, queryDate)
  213. }
  214. list, e := dataOb.GetItemsByCondition(cond, pars, []string{}, "")
  215. if e != nil {
  216. err = fmt.Errorf("获取指标数据失败, %v", e)
  217. return
  218. }
  219. for _, v := range list {
  220. dataExists[v.DataTime.Format(utils.FormatDate)] = v
  221. searchExistMap[v.DataTime.Format(utils.FormatDate)] = &EdbInfoSearchData{
  222. EdbDataId: v.EdbDataId,
  223. EdbInfoId: v.EdbInfoId,
  224. DataTime: v.DataTime.Format(utils.FormatDate),
  225. Value: v.Value,
  226. EdbCode: v.EdbCode,
  227. DataTimestamp: v.DataTimestamp,
  228. }
  229. }
  230. }
  231. // 比对数据
  232. insertExist := make(map[string]bool)
  233. insertData := make([]*EdbDataThsHf, 0)
  234. updateData := make([]*EdbDataThsHf, 0)
  235. for k, v := range convertData {
  236. strDate := k.Format(utils.FormatDate)
  237. // 手动插入数据的判断
  238. if realDataMaxDate.IsZero() || k.After(realDataMaxDate) {
  239. realDataMaxDate = k
  240. }
  241. if edbDataInsertConfigDate.IsZero() || k.Equal(edbDataInsertConfigDate) {
  242. isFindConfigDateRealData = true
  243. }
  244. // 入库值
  245. saveVal := decimal.NewFromFloat(v).Round(4).String()
  246. d, e := decimal.NewFromString(saveVal)
  247. if e != nil {
  248. utils.FileLog.Info(fmt.Sprintf("EdbDataThsHf NewFromString err: %v", e))
  249. continue
  250. }
  251. saveFloat, _ := d.Float64()
  252. // 更新
  253. exists := dataExists[strDate]
  254. if exists != nil {
  255. existVal := decimal.NewFromFloat(exists.Value).Round(4).String()
  256. if saveVal != existVal {
  257. exists.Value = saveFloat
  258. updateData = append(updateData, exists)
  259. }
  260. continue
  261. }
  262. // 新增
  263. if insertExist[strDate] {
  264. continue
  265. }
  266. insertExist[strDate] = true
  267. timestamp := k.UnixNano() / 1e6
  268. insertData = append(insertData, &EdbDataThsHf{
  269. EdbInfoId: edbInfo.EdbInfoId,
  270. EdbCode: edbInfo.EdbCode,
  271. DataTime: k,
  272. Value: saveFloat,
  273. CreateTime: time.Now(),
  274. ModifyTime: time.Now(),
  275. DataTimestamp: timestamp,
  276. })
  277. }
  278. // 批量新增/更新
  279. if len(insertData) > 0 {
  280. if e = dataOb.CreateMulti(insertData); e != nil {
  281. err = fmt.Errorf("批量新增指标数据失败, %v", e)
  282. return
  283. }
  284. }
  285. if len(updateData) > 0 {
  286. if e = dataOb.MultiUpdateValue(updateData); e != nil {
  287. err = fmt.Errorf("批量更新指标数据失败, %v", e)
  288. return
  289. }
  290. }
  291. // 处理手工数据补充的配置
  292. HandleConfigInsertEdbData(realDataMaxDate, edbDataInsertConfig, edbInfo.EdbInfoId, obj.GetSource(), obj.GetSubSource(), searchExistMap, isFindConfigDateRealData)
  293. return
  294. }
  295. // ThsHfConvertData2DayByRule 原指标数据转换为日度数据
  296. func ThsHfConvertData2DayByRule(originData []*BaseFromThsHfData, convertRule *ThsHfIndexConvert2EdbRule) (timeData map[time.Time]float64, err error) {
  297. // PS: originData为期望开始日期前三日(有两天非交易日, 那么周一的前日应当算上周五的)至结束日期的数据
  298. timeData = make(map[time.Time]float64)
  299. if len(originData) == 0 || convertRule == nil {
  300. return
  301. }
  302. if !utils.InArrayByInt([]int{1, 2}, convertRule.ConvertType) {
  303. err = fmt.Errorf("取值类型有误, ConvertType: %d", convertRule.ConvertType)
  304. return
  305. }
  306. // 升序排序
  307. sort.Slice(originData, func(i, j int) bool {
  308. return originData[i].DataTimestamp < originData[j].DataTimestamp
  309. })
  310. // 将数据根据日期进行分组
  311. var sortDates []string
  312. groupDateData := make(map[string][]*BaseFromThsHfData)
  313. for _, v := range originData {
  314. d := v.DataTime.Format(utils.FormatDate)
  315. if !utils.InArrayByStr(sortDates, d) {
  316. sortDates = append(sortDates, d)
  317. }
  318. if groupDateData[d] == nil {
  319. groupDateData[d] = make([]*BaseFromThsHfData, 0)
  320. }
  321. groupDateData[d] = append(groupDateData[d], v)
  322. }
  323. // 取值方式-指定时间的值
  324. if convertRule.ConvertType == 1 {
  325. for k, v := range sortDates {
  326. todayTime, e := time.ParseInLocation(utils.FormatDate, v, time.Local)
  327. if e != nil {
  328. utils.FileLog.Info("当日日期转换有误, date: %s, err: %v", v, e)
  329. continue
  330. }
  331. var timeTarget time.Time
  332. dateData := make([]*BaseFromThsHfData, 0)
  333. // 当日
  334. if convertRule.ConvertFixed.FixedDay == 1 {
  335. tg, e := time.ParseInLocation(utils.FormatDateTime, fmt.Sprintf("%s %s", v, convertRule.ConvertFixed.FixedTime), time.Local)
  336. if e != nil {
  337. utils.FileLog.Info(fmt.Sprintf("当日timeTarget转换有误, %v", e))
  338. continue
  339. }
  340. timeTarget = tg
  341. dt := groupDateData[v]
  342. if dt == nil {
  343. utils.FileLog.Info(fmt.Sprintf("%s当日无数据", v))
  344. continue
  345. }
  346. if len(dt) == 0 {
  347. continue
  348. }
  349. dateData = dt
  350. }
  351. // 前一日
  352. if convertRule.ConvertFixed.FixedDay == 2 {
  353. if k < 1 {
  354. utils.FileLog.Info(fmt.Sprintf("%s前日无数据", v))
  355. continue
  356. }
  357. preDate := sortDates[k-1]
  358. tg, e := time.ParseInLocation(utils.FormatDateTime, fmt.Sprintf("%s %s", preDate, convertRule.ConvertFixed.FixedTime), time.Local)
  359. if e != nil {
  360. utils.FileLog.Info(fmt.Sprintf("前日timeTarget转换有误, %v", e))
  361. continue
  362. }
  363. timeTarget = tg
  364. dt := groupDateData[preDate]
  365. if dt == nil {
  366. utils.FileLog.Info(fmt.Sprintf("%s前日无数据", v))
  367. continue
  368. }
  369. if len(dt) == 0 {
  370. continue
  371. }
  372. dateData = dt
  373. }
  374. if len(dateData) == 0 {
  375. utils.FileLog.Info("日期%s无数据序列", v)
  376. continue
  377. }
  378. // 重新获取数据序列中, 时间在目标时间点之后的
  379. newDateData := make([]*BaseFromThsHfData, 0)
  380. for kv, dv := range dateData {
  381. if dv.DataTime.Before(timeTarget) {
  382. continue
  383. }
  384. // 由于升序排列, 直接取之后所有的数据
  385. newDateData = append(newDateData, dateData[kv:]...)
  386. break
  387. }
  388. // 取重组后当日数据中的第一个(有可能目标时间点无值, 那么取之后时间最近的值)
  389. if len(newDateData) == 0 {
  390. utils.FileLog.Info("日期%s无有效数据", v)
  391. continue
  392. }
  393. timeData[todayTime] = newDateData[0].Value
  394. }
  395. return
  396. }
  397. // 取值方式-区间计算值
  398. for k, v := range sortDates {
  399. todayTime, e := time.ParseInLocation(utils.FormatDate, v, time.Local)
  400. if e != nil {
  401. utils.FileLog.Info("当日日期转换有误, date: %s, err: %v", v, e)
  402. continue
  403. }
  404. var thisDate, preDate string
  405. thisDate = v
  406. if k > 1 {
  407. preDate = sortDates[k-1]
  408. }
  409. var startTimeTarget, endTimeTarget time.Time
  410. // 起始时间-当日/前一日
  411. if convertRule.ConvertArea.StartDay == 1 {
  412. tg, e := time.ParseInLocation(utils.FormatDateTime, fmt.Sprintf("%s %s", thisDate, convertRule.ConvertArea.StartTime), time.Local)
  413. if e != nil {
  414. utils.FileLog.Info(fmt.Sprintf("当日startTimeTarget转换有误, %v", e))
  415. continue
  416. }
  417. startTimeTarget = tg
  418. }
  419. if convertRule.ConvertArea.StartDay == 2 {
  420. if preDate == "" {
  421. utils.FileLog.Info(fmt.Sprintf("%s前日无数据", v))
  422. continue
  423. }
  424. tg, e := time.ParseInLocation(utils.FormatDateTime, fmt.Sprintf("%s %s", preDate, convertRule.ConvertArea.StartTime), time.Local)
  425. if e != nil {
  426. utils.FileLog.Info(fmt.Sprintf("前日startTimeTarget转换有误, %v", e))
  427. continue
  428. }
  429. startTimeTarget = tg
  430. }
  431. // 截止时间-当日/前一日
  432. if convertRule.ConvertArea.EndDay == 1 {
  433. tg, e := time.ParseInLocation(utils.FormatDateTime, fmt.Sprintf("%s %s", thisDate, convertRule.ConvertArea.EndTime), time.Local)
  434. if e != nil {
  435. utils.FileLog.Info(fmt.Sprintf("当日endTimeTarget转换有误, %v", e))
  436. continue
  437. }
  438. endTimeTarget = tg
  439. }
  440. if convertRule.ConvertArea.EndDay == 2 {
  441. if preDate == "" {
  442. utils.FileLog.Info(fmt.Sprintf("%s前日无数据", v))
  443. continue
  444. }
  445. tg, e := time.ParseInLocation(utils.FormatDateTime, fmt.Sprintf("%s %s", preDate, convertRule.ConvertArea.EndTime), time.Local)
  446. if e != nil {
  447. utils.FileLog.Info(fmt.Sprintf("前日endTimeTarget转换有误, %v", e))
  448. continue
  449. }
  450. endTimeTarget = tg
  451. }
  452. if startTimeTarget.IsZero() || endTimeTarget.IsZero() {
  453. utils.FileLog.Info(fmt.Sprintf("起始截止时间有误, start: %v, end: %v", startTimeTarget, endTimeTarget))
  454. continue
  455. }
  456. // 合并前日当日数据
  457. dateData := make([]*BaseFromThsHfData, 0)
  458. if convertRule.ConvertArea.StartDay == 1 && convertRule.ConvertArea.EndDay == 1 {
  459. // 起始截止均为当日
  460. dateData = groupDateData[thisDate]
  461. if dateData == nil {
  462. utils.FileLog.Info(fmt.Sprintf("%s当日无数据", thisDate))
  463. continue
  464. }
  465. if len(dateData) == 0 {
  466. utils.FileLog.Info(fmt.Sprintf("%s当日无数据", thisDate))
  467. continue
  468. }
  469. } else {
  470. if preDate == "" {
  471. continue
  472. }
  473. // 起始截止时间含前日
  474. preData := groupDateData[preDate]
  475. if preData == nil {
  476. utils.FileLog.Info(fmt.Sprintf("%s前日无数据", thisDate))
  477. continue
  478. }
  479. if len(preData) == 0 {
  480. utils.FileLog.Info(fmt.Sprintf("%s前日无数据", thisDate))
  481. continue
  482. }
  483. thisData := groupDateData[thisDate]
  484. if thisData == nil {
  485. utils.FileLog.Info(fmt.Sprintf("%s当日无数据", thisDate))
  486. continue
  487. }
  488. if len(thisData) == 0 {
  489. utils.FileLog.Info(fmt.Sprintf("%s当日无数据", thisDate))
  490. continue
  491. }
  492. dateData = append(dateData, preData...)
  493. dateData = append(dateData, thisData...)
  494. }
  495. if len(dateData) == 0 {
  496. utils.FileLog.Info("日期%s无数据序列", v)
  497. continue
  498. }
  499. // 重组时间区间内的数据
  500. newDateData := make([]*BaseFromThsHfData, 0)
  501. for _, dv := range dateData {
  502. if dv.DataTime.Before(startTimeTarget) || dv.DataTime.After(endTimeTarget) {
  503. continue
  504. }
  505. newDateData = append(newDateData, dv)
  506. }
  507. if len(newDateData) == 0 {
  508. utils.FileLog.Info(fmt.Sprintf("时间区间内无数据, start: %v, end: %v", startTimeTarget, endTimeTarget))
  509. continue
  510. }
  511. // 取出区间内的均值/最值
  512. var avgVal, minVal, maxVal, sumVal float64
  513. minVal, maxVal = newDateData[0].Value, newDateData[0].Value
  514. for _, nv := range newDateData {
  515. sumVal += nv.Value
  516. if nv.Value > maxVal {
  517. maxVal = nv.Value
  518. }
  519. if nv.Value < minVal {
  520. minVal = nv.Value
  521. }
  522. }
  523. avgVal = sumVal / float64(len(newDateData))
  524. switch convertRule.ConvertArea.CalculateType {
  525. case 1:
  526. timeData[todayTime] = avgVal
  527. case 2:
  528. timeData[todayTime] = maxVal
  529. case 3:
  530. timeData[todayTime] = minVal
  531. default:
  532. utils.FileLog.Info(fmt.Sprintf("计算方式有误, CalculateType: %d", convertRule.ConvertArea.CalculateType))
  533. }
  534. }
  535. return
  536. }