hsun 2 months ago
parent
commit
6ca31991fd
1 changed files with 6 additions and 0 deletions
  1. 6 0
      models/pcsg/bloomberg.go

+ 6 - 0
models/pcsg/bloomberg.go

@@ -11,6 +11,7 @@ import (
 const (
 	TaskKey0000      = "IDpcsgDailySnap0000"
 	SubOneDayTaskKey = "IDpcsgDailySnap0330" // 日期-1的key
+	TaskKey0345      = "IDpcsgDailySnap0345"
 )
 
 // PythonBloombergGeneralData 通用数据格式(有空改成Map吧...然后做成配置方便加新字段...)
@@ -29,6 +30,7 @@ type PythonBloombergGeneralData struct {
 	OPEN_INT_DATE          string   `json:"OPEN_INT_DATE"`
 	DL_SNAPSHOT_START_TIME string   `json:"DL_SNAPSHOT_START_TIME" description:"数据日期"`
 	LAST_UPDATE            string   `json:"LAST_UPDATE" description:"IDpcsgDailySnap0000和IDpcsgDailySnap0330判断用的"`
+	PX_CLOSE_DT            string   `json:"PX_CLOSE_DT" description:"数据日期"`
 }
 
 // PythonBloombergGeneralResult API响应体
@@ -94,6 +96,10 @@ func FormatPythonBloombergGeneralData2Base(origin PythonBloombergGeneralData, fr
 		dataTime, _ = time.ParseInLocation(utils.FormatDate, origin.OPEN_INT_DATE, time.Local)
 		val = origin.OPEN_INT
 	}
+	if taskKey == TaskKey0345 && origin.PX_CLOSE_DT != "" && origin.PX_LAST != nil {
+		dataTime, _ = time.ParseInLocation(utils.FormatDate, origin.PX_CLOSE_DT, time.Local)
+		val = origin.PX_LAST
+	}
 	if (taskKey == TaskKey0000 || taskKey == SubOneDayTaskKey) && origin.DL_SNAPSHOT_START_TIME != "" && origin.PX_LAST != nil {
 		// 根据LAST_UPDATE的格式进行判断, 仅加入格式为hh:mm:ss的
 		_, e := time.ParseInLocation("15:04:05", origin.LAST_UPDATE, time.Local)