xiziwen hace 3 semanas
padre
commit
c8d666d6b7
Se han modificado 7 ficheros con 668 adiciones y 16 borrados
  1. 295 0
      controllers/base_from_clarksons.go
  2. 265 0
      models/base_from_clarksons.go
  3. 2 0
      models/db.go
  4. 27 0
      routers/commentsRouter.go
  5. 5 0
      routers/router.go
  6. 57 0
      utils/common.go
  7. 17 16
      utils/constants.go

+ 295 - 0
controllers/base_from_clarksons.go

@@ -0,0 +1,295 @@
+package controllers
+
+import (
+	"encoding/json"
+	"eta/eta_index_lib/logic"
+	"eta/eta_index_lib/models"
+	"eta/eta_index_lib/utils"
+	"fmt"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type ClarksonsDataController struct {
+	BaseAuthController
+}
+
+// @Title 克拉克森
+// @Description 刷新克拉克森数据接口
+// @Param	request	body models.CoalMineDataReq true "type json string"
+// @Success 200 {object} models.EdbClassify
+// @router /data [post]
+func (this *ClarksonsDataController) ClarksonsData() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	var req models.CoalMineDataReq
+
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+
+	var dateMap = make(map[int]string)
+	var indexMap = make(map[string]*models.BaseFromClarksonsIndex)
+	//var indexMap = make(map[string]string)
+	var itemsIndex []*models.BaseFromClarksonsData
+	codeList, err := models.GetBaseFromClarksonsIndex()
+	if err != nil && err.Error() != utils.ErrNoRow() {
+		utils.FileLog.Info("获取克拉克森指标失败:", err)
+		return
+	}
+
+	if len(codeList) > 0 {
+		for _, v := range codeList {
+			indexMap[v.IndexCode] = v
+		}
+	}
+
+	for _, sheet := range req.SheetData {
+		//遍历行读取
+		maxRow := sheet.MaxRow
+		var indexId int64
+		index := new(models.BaseFromClarksonsIndex)
+		indexCode := ""
+		for i := 3; i < maxRow; i++ {
+			//获取样本情况
+			row := sheet.Rows[i]
+			cells := row.Cells
+			// indexCode
+			if i == 3 {
+				indexCode = cells[1].Value
+				continue
+			}
+
+			if indexItem, ok := indexMap[indexCode]; !ok {
+				// indexName
+				if i == 4 {
+					index.IndexName = cells[1].Value
+					continue
+				}
+
+				// unit
+				if i == 5 {
+					index.Unit = cells[1].Value
+					continue
+				}
+
+				index.IndexCode = indexCode
+				index.Frequency = "周度"
+				index.ClassifyId = 0
+				index.CreateTime = time.Now()
+				index.ModifyTime = time.Now()
+
+				indexId, err = models.AddBaseFromClarksonsIndex(index)
+				if err != nil {
+					utils.FileLog.Info("添加指标名称错误", err.Error())
+					return
+				}
+				index.BaseFromClarksonsIndexId = int(indexId)
+				indexMap[indexCode] = index
+			} else {
+				index = indexItem
+			}
+
+			// 数据及日期
+			if i > 5 {
+				var date string
+				if len(cells) == 0 {
+					break
+				}
+				for k, cell := range cells {
+					text := cell.Value
+					text = strings.Replace(text, "\\", "", -1)
+					if text != "" {
+						// 时间
+						if k == 0 {
+							if text != "" {
+								dataTime, err := utils.ParseDateTime(text)
+								if err != nil {
+									utils.FileLog.Info("解析时间字符串出错:", err)
+									fmt.Println("解析时间字符串出错:", err)
+									return
+								}
+								date = dataTime.Format(utils.FormatDate)
+							}
+							dateMap[k] = date
+						}
+
+						// 数据
+						if k == 1 {
+							item := new(models.BaseFromClarksonsData)
+							item.IndexCode = indexCode
+							item.Value = text
+							item.DataTime = date
+							item.BaseFromClarksonsIndexId = index.BaseFromClarksonsIndexId
+							item.ModifyTime = time.Now()
+							item.CreateTime = time.Now()
+							itemsIndex = append(itemsIndex, item)
+
+							continue
+						}
+					}
+				}
+			}
+		}
+		if len(itemsIndex) > 2 {
+			time1, _ := time.Parse(utils.FormatDate, itemsIndex[0].DataTime)
+			time2, _ := time.Parse(utils.FormatDate, itemsIndex[1].DataTime)
+			diff := time2.Sub(time1)/24
+
+			if diff < 5 {
+				index.Frequency = "日度"
+			} else if diff > 5 && diff < 10 {
+				index.Frequency = "周度"
+			} else if diff > 20 && diff < 50 {
+				index.Frequency = "月度"
+			} else if diff > 50 && diff < 100 {
+				index.Frequency = "季度"
+			} else if diff > 100 {
+				index.Frequency = "年度"
+			}
+		}
+		err = models.UpdateBaseFromClarksonsIndex(index)
+		if err != nil {
+			fmt.Println("修改指标频度错误", err)
+			return
+		} else {
+			fmt.Println("修改指标频度成功 ", index.IndexCode,index.Frequency)
+		}
+	}
+
+
+	count, err := models.AddBaseFromClarksonsDataMuti(itemsIndex)
+	if err != nil {
+		fmt.Println("添加数据错误", err.Error())
+	} else {
+		fmt.Println("添加数据成功", count)
+	}
+
+	fmt.Println("数据操作完成")
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	return
+}
+
+// @Title 新增克拉克森指标接口
+// @Description 新增克拉克森指标接口
+// @Success 200 {object} models.AddEdbInfoReq
+// @router /add [post]
+func (this *ClarksonsDataController) Add() {
+	br := new(models.BaseResponse).Init()
+	var cacheKey string
+	defer func() {
+		utils.Rc.Delete(cacheKey)
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	source := utils.DATA_SOURCE_CLARKSONS
+	var req models.AddEdbInfoReq
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+	if req.EdbCode == "" {
+		br.Msg = "请输入指标编码!"
+		br.ErrMsg = "请输入指标编码,指标编码为空"
+		return
+	}
+	cacheKey = utils.CACHE_EDB_DATA_ADD + strconv.Itoa(source) + "_" + req.EdbCode
+	if !utils.Rc.IsExist(cacheKey) {
+		utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
+		err = models.AddEdbDataFromClarksons(req.EdbCode)
+		if err != nil {
+			br.Msg = "获取指标信息失败!"
+			br.ErrMsg = "获取指标信息失败 AddEdbDataFromClarksons,Err:" + err.Error()
+			return
+		}
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+	} else {
+		br.Ret = 501
+		br.Success = true
+		br.Msg = "系统处理中,请稍后重试"
+	}
+}
+
+// @Title 刷新克拉克森指标接口
+// @Description 刷新克拉克森指标接口
+// @Success 200 {object} models.RefreshEdbInfoReq
+// @router /refresh [post]
+func (this *ClarksonsDataController) Refresh() {
+	br := new(models.BaseResponse).Init()
+	var cacheKey string
+	defer func() {
+		utils.Rc.Delete(cacheKey)
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	source := utils.DATA_SOURCE_MTJH
+	var req models.RefreshEdbInfoReq
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+	if req.EdbCode == "" {
+		br.Msg = "请输入指标编码!"
+		br.ErrMsg = "请输入指标编码,指标编码为空"
+		return
+	}
+	if req.EdbInfoId <= 0 {
+		br.Msg = "请输入指标ID!"
+		br.ErrMsg = "请输入指标ID"
+		return
+	}
+
+	cacheKey = utils.CACHE_EDB_DATA_REFRESH + strconv.Itoa(source) + "_" + req.EdbCode
+	if utils.Rc.IsExist(cacheKey) {
+		br.Ret = 501
+		br.Success = true
+		br.Msg = "系统处理中,请稍后重试"
+		return
+	}
+
+	utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
+	// 获取指标详情
+	edbInfo, err := models.GetEdbInfoById(req.EdbInfoId)
+	if err != nil {
+		br.Msg = "指标不存在!"
+		br.ErrMsg = "指标不存在"
+		return
+	}
+
+	err = models.RefreshEdbDataFromClarksons(req.EdbInfoId, req.EdbCode, req.StartDate)
+	if err != nil && err.Error() != utils.ErrNoRow() {
+		br.Msg = "刷新指标信息失败!"
+		br.ErrMsg = "刷新指标信息失败 RefreshEdbDataFromCoal,Err:" + err.Error()
+		return
+	}
+	// 更新指标最大最小值
+	err, errMsg := models.UnifiedModifyEdbInfoMaxAndMinInfo(edbInfo)
+	if err != nil {
+		br.Msg = errMsg
+		br.ErrMsg = err.Error()
+		return
+	}
+
+	// 更新ES
+	go logic.UpdateEs(edbInfo.EdbInfoId)
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+}

+ 265 - 0
models/base_from_clarksons.go

@@ -0,0 +1,265 @@
+package models
+
+import (
+	"eta/eta_index_lib/utils"
+	"fmt"
+	"github.com/beego/beego/v2/client/orm"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type BaseFromClarksonsIndex struct {
+	BaseFromClarksonsIndexId int       `orm:"pk"`
+	ClassifyId               int       `description:"指标分类id"`
+	IndexCode                string    `description:"指标编码"`
+	IndexName                string    `description:"指标名称"`
+	Unit                     string    `description:"单位"`
+	Frequency                string    `description:"频度"`
+	Sort                     int       `description:"排序"`
+	CreateTime               time.Time
+	ModifyTime               time.Time
+}
+
+type BaseFromClarksonsData struct {
+	BaseFromClarksonsDataId  int       `orm:"column(base_from_clarksons_data_id);pk"`
+	BaseFromClarksonsIndexId int       `description:"指标id"`
+	IndexCode                string    `description:"指标编码"`
+	DataTime                 string    `description:"数据日期"`
+	Value                    string    `description:"数据值"`
+	CreateTime               time.Time `description:"创建时间"`
+	ModifyTime               time.Time `description:"修改时间"`
+}
+
+// 查询指标
+func GetBaseFromClarksonsIndex() (items []*BaseFromClarksonsIndex, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM base_from_clarksons_index`
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
+// 查询指标
+func GetBaseFromClarksonsData() (items []*BaseFromClarksonsData, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM base_from_clarksons_data`
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
+// 添加数据
+func AddBaseFromClarksonsIndex(item *BaseFromClarksonsIndex) (lastId int64, err error) {
+	o := orm.NewOrm()
+	lastId, err = o.Insert(item)
+	return
+}
+
+func AddBaseFromClarksonsDataMuti(items []*BaseFromClarksonsData) (count int64, err error) {
+	o := orm.NewOrm()
+	count, err = o.InsertMulti(500, items)
+	return
+}
+
+func UpdateBaseFromClarksonsIndex(item *BaseFromClarksonsIndex) (err error) {
+	o := orm.NewOrm()
+	sql := `UPDATE base_from_clarksons_index SET frequency=?  WHERE index_code=? `
+	_, err = o.Raw(sql, item.Frequency, item.IndexCode).Exec()
+	return
+}
+
+func AddEdbDataFromClarksons(edbCode string) (err error) {
+	o := orm.NewOrm()
+
+	coalBaseDataAll, err := GetClarksonsindexByCode(edbCode)
+	if err != nil && err.Error() != utils.ErrNoRow() {
+		return
+	}
+
+	var isAdd bool
+	addSql := ` INSERT INTO edb_data_mtjh(edb_info_id,edb_code,data_time,value,create_time,modify_time,data_timestamp) values `
+	existMap := make(map[string]string)
+	for _, sv := range coalBaseDataAll {
+		eDate := sv.DataTime
+		var timeStr string
+		var dataTime time.Time
+		var sDataTime string
+		var timestamp int64
+
+		sDataTime = eDate
+		dataTime, err = time.ParseInLocation(utils.FormatDate, eDate, time.Local)
+		if err != nil {
+			fmt.Println("time.Parse Err:" + eDate)
+			return err
+		}
+		timestamp = dataTime.UnixNano() / 1e6
+		timeStr = fmt.Sprintf("%d", timestamp)
+
+		value := strings.Replace(sv.Value, "%", "", -1)
+		if _, ok := existMap[sDataTime]; !ok {
+			addSql += GetAddSql("0", edbCode, sDataTime, timeStr, value)
+			fmt.Println("edbCode:", edbCode)
+			fmt.Println("sDataTime:", sDataTime)
+			fmt.Println("timeStr:", timeStr)
+			fmt.Println("value:", value)
+			isAdd = true
+		}
+		existMap[eDate] = value
+	}
+	if isAdd {
+		addSql = strings.TrimRight(addSql, ",")
+		utils.FileLog.Info("addSql:" + addSql)
+		_, err = o.Raw(addSql).Exec()
+		if err != nil {
+			return err
+		}
+	}
+	return
+}
+
+func RefreshEdbDataFromClarksons(edbInfoId int, edbCode, startDate string) (err error) {
+	source := utils.DATA_SOURCE_MTJH
+	subSource := utils.DATA_SUB_SOURCE_EDB
+	o := orm.NewOrm()
+	if err != nil {
+		return
+	}
+
+	edbInfoIdStr := strconv.Itoa(edbInfoId)
+	//计算数据
+	var condition string
+	var pars []interface{}
+
+	if edbCode != "" {
+		condition += " AND index_code=? "
+		pars = append(pars, edbCode)
+	}
+
+	if startDate != "" {
+		condition += " AND data_time>=? "
+		pars = append(pars, startDate)
+	}
+
+	glDataList, err := GetClarksonsDataByTradeCode(condition, pars)
+	if err != nil {
+		return
+	}
+
+	// 真实数据的最大日期  , 插入规则配置的日期
+	var realDataMaxDate, edbDataInsertConfigDate time.Time
+	var edbDataInsertConfig *EdbDataInsertConfig
+	var isFindConfigDateRealData bool //是否找到配置日期的实际数据的值
+	{
+		edbDataInsertConfig, err = GetEdbDataInsertConfigByEdbId(edbInfoId)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			return
+		}
+		if edbDataInsertConfig != nil {
+			edbDataInsertConfigDate = edbDataInsertConfig.Date
+		}
+	}
+
+	//获取指标所有数据
+	var existCondition string
+	var existPars []interface{}
+
+	existCondition += " AND edb_info_id=? "
+	existPars = append(existPars, edbInfoId)
+	if startDate != "" {
+		existCondition += " AND data_time>=? "
+		existPars = append(existPars, startDate)
+	}
+
+	existList, err := GetEdbDataByCondition(source, subSource, existCondition, existPars)
+	if err != nil {
+		return err
+	}
+	existMap := make(map[string]*EdbInfoSearchData)
+	for _, v := range existList {
+		existMap[v.DataTime] = v
+	}
+
+	addSql := ` INSERT INTO edb_data_mtjh(edb_info_id,edb_code,data_time,value,create_time,modify_time,data_timestamp) values `
+	var isAdd bool
+	for _, v := range glDataList {
+		var value string
+		value = strings.Replace(v.Value, "%", "", -1)
+		item := v
+		itemValue := value
+		if _, ok := existMap[v.DataTime]; !ok {
+			eDate := item.DataTime
+			var timeStr string
+			var dataTime time.Time
+			var sDataTime string
+			var timestamp int64
+
+			sDataTime = eDate
+			dataTime, err = time.ParseInLocation(utils.FormatDate, eDate, time.Local)
+			if err != nil {
+				fmt.Println("time.Parse Err:" + eDate)
+				return err
+			}
+			timestamp = dataTime.UnixNano() / 1e6
+			timeStr = fmt.Sprintf("%d", timestamp)
+
+			sValue := itemValue
+			if sValue != "" {
+				saveValue := sValue
+
+				if findItem, ok := existMap[eDate]; !ok {
+					addSql += GetAddSql(edbInfoIdStr, edbCode, sDataTime, timeStr, saveValue)
+					isAdd = true
+				} else {
+					if findItem != nil && utils.SubFloatToString(findItem.Value, 30) != sValue {
+						err = ModifyEdbDataById(source, subSource, findItem.EdbDataId, sValue)
+						if err != nil {
+							return err
+						}
+					}
+				}
+			}
+
+			// 下面代码主要目的是处理掉手动插入的数据判断
+			{
+				if realDataMaxDate.IsZero() || dataTime.After(realDataMaxDate) {
+					realDataMaxDate = dataTime
+				}
+				if edbDataInsertConfigDate.IsZero() || dataTime.Equal(edbDataInsertConfigDate) {
+					isFindConfigDateRealData = true
+				}
+			}
+
+		}
+	}
+
+	// 处理手工数据补充的配置
+	HandleConfigInsertEdbData(realDataMaxDate, edbDataInsertConfig, edbInfoId, source, subSource, existMap, isFindConfigDateRealData)
+
+	if isAdd {
+		addSql = strings.TrimRight(addSql, ",")
+		_, err = o.Raw(addSql).Exec()
+		if err != nil {
+			return err
+		}
+	}
+
+	return
+}
+
+// GetClarksonsindexByCode
+func GetClarksonsindexByCode(indexCode string) (items []*BaseFromClarksonsData, err error) {
+	o := orm.NewOrm()
+	sql := "SELECT * FROM base_from_clarksons_data WHERE index_code=? "
+	_, err = o.Raw(sql, indexCode).QueryRows(&items)
+	return
+}
+
+func GetClarksonsDataByTradeCode(condition string, pars []interface{}) (item []*BaseFromClarksonsData, err error) {
+	sql := ` SELECT * FROM base_from_clarksons_data WHERE 1=1 `
+	o := orm.NewOrm()
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` ORDER BY data_time DESC `
+	_, err = o.Raw(sql, pars).QueryRows(&item)
+	return
+}

+ 2 - 0
models/db.go

@@ -177,6 +177,8 @@ func initBaseIndex() {
 		new(BaseFromHisugarData),
 		new(EdbDataCalculateStl),
 		new(CalculateStlConfig),
+		new(BaseFromClarksonsIndex),
+		new(BaseFromClarksonsData),
 	)
 }
 

+ 27 - 0
routers/commentsRouter.go

@@ -628,6 +628,33 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_index_lib/controllers:ClarksonsDataController"] = append(beego.GlobalControllerRouter["eta/eta_index_lib/controllers:ClarksonsDataController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_index_lib/controllers:ClarksonsDataController"] = append(beego.GlobalControllerRouter["eta/eta_index_lib/controllers:ClarksonsDataController"],
+        beego.ControllerComments{
+            Method: "ClarksonsData",
+            Router: `/data`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_index_lib/controllers:ClarksonsDataController"] = append(beego.GlobalControllerRouter["eta/eta_index_lib/controllers:ClarksonsDataController"],
+        beego.ControllerComments{
+            Method: "Refresh",
+            Router: `/refresh`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_index_lib/controllers:CoalController"] = append(beego.GlobalControllerRouter["eta/eta_index_lib/controllers:CoalController"],
         beego.ControllerComments{
             Method: "Add",

+ 5 - 0
routers/router.go

@@ -317,6 +317,11 @@ func init() {
 				&controllers.HisugarController{},
 			),
 		),
+		beego.NSNamespace("/clarksons",
+			beego.NSInclude(
+				&controllers.ClarksonsDataController{},
+			),
+		),
 	)
 	beego.AddNamespace(ns)
 }

+ 57 - 0
utils/common.go

@@ -1702,3 +1702,60 @@ func CalculateEndOfHalfYear(baseDate time.Time, years, moveType int) int {
 func GetCurrentTime() string {
 	return time.Now().Format("2006-01-02 15:04:05")
 }
+
+// ParseDateTime 尝试解析不同的日期格式
+func ParseDateTime(dateStr string) (time.Time, error) {
+	// 检查是否是只有年份的格式 "1971"
+	if len(dateStr) == 4 {
+		return parseYearOnlyDate(dateStr)
+	} else if strings.Contains(dateStr, "-") {
+		// 检查是否是季度格式 "Q1-1970"
+		if strings.HasPrefix(dateStr, "Q") {
+			return parseQuarterDate(dateStr)
+		}
+
+		// 检查是否是 "28-Jun-2019" 格式
+		if len(dateStr) > 9 {
+			return time.Parse("2-Jan-2006", dateStr)
+		}
+	} else {
+		excelDate, err := strconv.Atoi(dateStr)
+		if err != nil {
+			return time.Time{}, err
+		}
+
+		// 创建time.Time对象,这里使用的是UTC时区
+		t := time.Date(1899, 12, 30, 0, 0, 0, 0, time.UTC).AddDate(0, 0, excelDate)
+		return t, nil
+	}
+
+	return time.Time{}, fmt.Errorf("unsupported date format: %s", dateStr)
+}
+
+// parseQuarterDate 解析季度日期 "Q1-1970"
+func parseQuarterDate(dateStr string) (time.Time, error) {
+	parts := strings.Split(dateStr, "-")
+	if len(parts) != 2 {
+		return time.Time{}, fmt.Errorf("invalid quarter date format: %s", dateStr)
+	}
+	q, err := strconv.Atoi(parts[0][1:])
+	if err != nil {
+		return time.Time{}, err
+	}
+	year, err := strconv.Atoi(parts[1])
+	if err != nil {
+		return time.Time{}, err
+	}
+	// 根据季度计算月份
+	month := time.January + time.Month((q-1)*3)
+	return time.Date(year, month, 1, 0, 0, 0, 0, time.UTC), nil
+}
+
+// parseYearOnlyDate 解析只有年份的日期 "1971"
+func parseYearOnlyDate(dateStr string) (time.Time, error) {
+	year, err := strconv.Atoi(dateStr)
+	if err != nil {
+		return time.Time{}, err
+	}
+	return time.Date(year, time.January, 1, 0, 0, 0, 0, time.UTC), nil
+}

+ 17 - 16
utils/constants.go

@@ -105,22 +105,23 @@ const (
 	DATA_SOURCE_MTJH                                 = 80       // 煤炭江湖->80
 	DATA_SOURCE_CALCULATE_SUM                        = 81
 	DATA_SOURCE_CALCULATE_AVG                        = 82
-	DATA_SOURCE_BLOOMBERG                            = 83 // bloomberg彭博数据
-	DATA_SOURCE_BUSINESS                             = 84 // 来源于自有数据
-	DATA_SOURCE_SCI99                                = 85 // 卓创资讯
-	DATA_SOURCE_CCF                                  = 86 // CCF化纤信息
-	DATA_SOURCE_CALCULATE_RANGEANLYSIS               = 87 //区间计算->87
-	DATA_SOURCE_SCI_HQ                               = 88 // 卓创红期->88
-	DATA_SOURCE_OILCHEM                              = 89 // 隆众资讯 -> 89
-	DATA_SOURCE_PREDICT_CALCULATE_RANGEANLYSIS       = 90 // 预测指标区间计算->90
-	DATA_SOURCE_LY                                   = 91 // 粮油商务网
-	DATA_SOURCE_TRADE_ANALYSIS                       = 92 // 持仓分析
-	DATA_SOURCE_USDA_FAS                             = 96 //美国农业部
-	DATA_SOURCE_HISUGAR                              = 93 // 泛糖科技 -> 93
-	DATA_SOURCE_CALCULATE_STL                        = 98 // STL趋势分解 -> 98
-	DATA_SOURCE_PREDICT_CALCULATE_PHASE_SHIFT        = 94 //预测指标 - 期数移位
-	DATA_SOURCE_CALCULATE_PHASE_SHIFT                = 95 // 期数移动
-	DATA_SOURCE_RZD                                  = 97 // 睿咨得科技 -> 93
+	DATA_SOURCE_BLOOMBERG                            = 83  // bloomberg彭博数据
+	DATA_SOURCE_BUSINESS                             = 84  // 来源于自有数据
+	DATA_SOURCE_SCI99                                = 85  // 卓创资讯
+	DATA_SOURCE_CCF                                  = 86  // CCF化纤信息
+	DATA_SOURCE_CALCULATE_RANGEANLYSIS               = 87  //区间计算->87
+	DATA_SOURCE_SCI_HQ                               = 88  // 卓创红期->88
+	DATA_SOURCE_OILCHEM                              = 89  // 隆众资讯 -> 89
+	DATA_SOURCE_PREDICT_CALCULATE_RANGEANLYSIS       = 90  // 预测指标区间计算->90
+	DATA_SOURCE_LY                                   = 91  // 粮油商务网
+	DATA_SOURCE_TRADE_ANALYSIS                       = 92  // 持仓分析
+	DATA_SOURCE_USDA_FAS                             = 96  //美国农业部
+	DATA_SOURCE_HISUGAR                              = 93  // 泛糖科技 -> 93
+	DATA_SOURCE_CALCULATE_STL                        = 98  // STL趋势分解 -> 98
+	DATA_SOURCE_PREDICT_CALCULATE_PHASE_SHIFT        = 94  //预测指标 - 期数移位
+	DATA_SOURCE_CALCULATE_PHASE_SHIFT                = 95  // 期数移动
+	DATA_SOURCE_RZD                                  = 97  // 睿咨得科技 -> 93
+	DATA_SOURCE_CLARKSONS                            = 101 // 克拉克森 -> 101
 )
 
 // 指标来源的中文展示