|
@@ -78,17 +78,26 @@ func RefreshEdbDataFromFubao(edbInfoId int, edbCode, startDate string, fubaoData
|
|
|
existMap[v.DataTime] = v
|
|
|
}
|
|
|
|
|
|
+ fmt.Println("existMap start")
|
|
|
+ fmt.Println(existMap)
|
|
|
+ fmt.Println("existMap end")
|
|
|
+
|
|
|
edbInfoIdStr := strconv.Itoa(edbInfoId)
|
|
|
|
|
|
addSql := ` INSERT INTO edb_data_fubao(edb_info_id,edb_code,data_time,value,create_time,modify_time,data_timestamp) values `
|
|
|
var isAdd bool
|
|
|
|
|
|
- for _, dataItem := range fubaoData.ReturnValue.Data {
|
|
|
+ for k, dataItem := range fubaoData.ReturnValue.Data {
|
|
|
|
|
|
dataTime, err := time.ParseInLocation(utils.FormatDate, dataItem.Datadate, time.Local)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ if k < 3 {
|
|
|
+ fmt.Println("dataItem.Datadate start")
|
|
|
+ fmt.Println(dataItem.Datadate)
|
|
|
+ fmt.Println("dataItem.Datadate end")
|
|
|
+ }
|
|
|
|
|
|
if findItem, ok := existMap[dataItem.Datadate]; !ok {
|
|
|
timestamp := dataTime.UnixNano() / 1e6
|
|
@@ -97,6 +106,12 @@ func RefreshEdbDataFromFubao(edbInfoId int, edbCode, startDate string, fubaoData
|
|
|
addSql += GetAddSql(edbInfoIdStr, edbCode, dataItem.Datadate, timeStr, dataItem.PriceStr)
|
|
|
isAdd = true
|
|
|
} else {
|
|
|
+ fmt.Println("update start")
|
|
|
+ fmt.Println(findItem.Value)
|
|
|
+ fmt.Println(dataItem.PriceStr)
|
|
|
+ fmt.Println(utils.SubFloatToString(findItem.Value, 30))
|
|
|
+ fmt.Println("update end")
|
|
|
+
|
|
|
if findItem != nil && utils.SubFloatToString(findItem.Value, 30) != dataItem.PriceStr {
|
|
|
err = ModifyEdbDataById(source, findItem.EdbDataId, dataItem.PriceStr)
|
|
|
if err != nil {
|
|
@@ -114,6 +129,10 @@ func RefreshEdbDataFromFubao(edbInfoId int, edbCode, startDate string, fubaoData
|
|
|
isFindConfigDateRealData = true
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if dataItem.Datadate == startDate {
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 处理手工数据补充的配置
|