|
@@ -14,7 +14,7 @@ import (
|
|
)
|
|
)
|
|
|
|
|
|
// InitPCSGBloombergData 初始化中石油新加坡Bloomberg指标
|
|
// InitPCSGBloombergData 初始化中石油新加坡Bloomberg指标
|
|
-func InitPCSGBloombergData(dataPath string) {
|
|
|
|
|
|
+func InitPCSGBloombergData(dataPath, vCode string) {
|
|
var err error
|
|
var err error
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -32,7 +32,7 @@ func InitPCSGBloombergData(dataPath string) {
|
|
|
|
|
|
dir := filepath.Dir(path)
|
|
dir := filepath.Dir(path)
|
|
dataPath = dir + dataPath
|
|
dataPath = dir + dataPath
|
|
- //dataPath = "docs/HistorySample_0508.xlsx"
|
|
|
|
|
|
+ //dataPath = "docs/dailyHistory-u6J9B5mVFY9p-20240619.xlsx"
|
|
f, e := excelize.OpenFile(dataPath)
|
|
f, e := excelize.OpenFile(dataPath)
|
|
if e != nil {
|
|
if e != nil {
|
|
err = fmt.Errorf("open file err: %s", e.Error())
|
|
err = fmt.Errorf("open file err: %s", e.Error())
|
|
@@ -126,6 +126,10 @@ func InitPCSGBloombergData(dataPath string) {
|
|
|
|
|
|
// 请求接口导入数据
|
|
// 请求接口导入数据
|
|
method := "bloomberg/pcsg/import_history_data"
|
|
method := "bloomberg/pcsg/import_history_data"
|
|
|
|
+ var isVCode bool
|
|
|
|
+ if vCode == "true" {
|
|
|
|
+ isVCode = true
|
|
|
|
+ }
|
|
for _, v := range indexMap {
|
|
for _, v := range indexMap {
|
|
if v.IndexCode == "" {
|
|
if v.IndexCode == "" {
|
|
continue
|
|
continue
|
|
@@ -133,6 +137,7 @@ func InitPCSGBloombergData(dataPath string) {
|
|
requestMap := make(map[string]interface{})
|
|
requestMap := make(map[string]interface{})
|
|
requestMap["IndexCode"] = v.IndexCode
|
|
requestMap["IndexCode"] = v.IndexCode
|
|
requestMap["DataMap"] = v.DataMap
|
|
requestMap["DataMap"] = v.DataMap
|
|
|
|
+ requestMap["IsVCode"] = isVCode
|
|
indexRes, e := PostEdbLib(requestMap, method)
|
|
indexRes, e := PostEdbLib(requestMap, method)
|
|
if e != nil {
|
|
if e != nil {
|
|
fmt.Printf("post edb lib err: %s; result: %s", e.Error(), string(indexRes))
|
|
fmt.Printf("post edb lib err: %s; result: %s", e.Error(), string(indexRes))
|