Explorar o código

Merge branch 'debug' of http://8.136.199.33:3000/hongze/hongze_yb into debug

# Conflicts:
#	utils/constants.go
hsun %!s(int64=2) %!d(string=hai) anos
pai
achega
c43e96b80c
Modificáronse 3 ficheiros con 8 adicións e 5 borrados
  1. 3 3
      models/tables/edb_data/query.go
  2. 3 1
      services/chart/edb_data.go
  3. 2 1
      utils/constants.go

+ 3 - 3
models/tables/edb_data/query.go

@@ -15,7 +15,7 @@ func GetEdbDataTableName(source int) (tableName string) {
 		tableName = "edb_data_ths"
 	case utils.DATA_SOURCE_WIND:
 		tableName = "edb_data_wind"
-	case utils.DATA_SOURCE_PB:
+	case utils.DATA_SOURCE_PB, utils.DATA_SOURCE_PB_FINANCE:
 		tableName = "edb_data_pb"
 	case utils.DATA_SOURCE_CALCULATE:
 		tableName = "edb_data_calculate"
@@ -119,7 +119,7 @@ func GetEdbDataList(source, endInfoId int, startDate, endDate string) (list []*E
 	if len(list) > 0 {
 		for _, row := range list {
 			if row.DataTime != "" {
-				row.DataTime = row.DataTime[:10]	// 此处获取的字符串row.DataTime长度有长有短,截取年月日
+				row.DataTime = row.DataTime[:10] // 此处获取的字符串row.DataTime长度有长有短,截取年月日
 				//tempTime, _ := time.Parse("2006-01-02T00:00:00+08:00", row.DataTime)
 				//row.DataTime = tempTime.Format(utils.FormatDate)
 			}
@@ -150,4 +150,4 @@ func GetEdbInfoMaxAndMinInfo(source int, edbCode string) (item *EdbInfoMaxAndMin
 	err = global.MYSQL["data"].Raw(sql, edbCode).Scan(&latest_value).Error
 	item.LatestValue = latest_value
 	return
-}
+}

+ 3 - 1
services/chart/edb_data.go

@@ -35,6 +35,8 @@ func RefreshEdbData(edbInfoId, source int, edbCode, startDate string) (resp *Ref
 		urlStr = "/wind/refresh"
 	case utils.DATA_SOURCE_PB:
 		urlStr = "/pb/refresh"
+	case utils.DATA_SOURCE_PB_FINANCE:
+		urlStr = "/pb_finance/refresh"
 	case utils.DATA_SOURCE_MANUAL:
 		urlStr = "/manual/refresh"
 	case utils.DATA_SOURCE_LZ:
@@ -121,4 +123,4 @@ func RefreshEdbCalculateData(edbInfoId int, edbCode, startDate string) (resp *Re
 	param["StartDate"] = startDate
 	resp, err = postRefreshEdbData(param, "/calculate/refresh")
 	return
-}
+}

+ 2 - 1
utils/constants.go

@@ -69,6 +69,7 @@ const (
 	DATA_SOURCE_LT                              //路透->25
 	DATA_SOURCE_COAL                            //中国煤炭网->26
 	DATA_SOURCE_PYTHON                          //python代码->27
+	DATA_SOURCE_PB_FINANCE                      //彭博财务数据->28
 )
 
 const (
@@ -150,4 +151,4 @@ const (
 	USER_RECORD_PLATFORM_CYGX                 // 查研观向小程序
 	_
 	USER_RECORD_PLATFORM_YB // 研报小程序
-)
+)