|
@@ -421,8 +421,8 @@ func GetChartEdbData(chartInfoId int, startDate, endDate string, baseEdbInfoMapp
|
|
|
yDataList[k].Value = v.Value[0 : maxIndex+1]
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- tmpXDataList, newYDataList, err := handleResultData(regionType, futureGoodEdbType, yDataList, futureGoodEdbInfoList, maxIndex)
|
|
|
+ baseEdbLen := len(edbInfoMappingList)
|
|
|
+ tmpXDataList, newYDataList, err := handleResultData(regionType, futureGoodEdbType, baseEdbLen, yDataList, futureGoodEdbInfoList, maxIndex)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -531,6 +531,7 @@ func BarChartData(baseEdbInfoMapping *chartEdbMappingModel.ChartEdbInfoMapping,
|
|
|
noDataIdList = append(noDataIdList, baseEdbInfoMapping.EdbInfoId)
|
|
|
noDataIdMap[baseEdbInfoMapping.EdbInfoId] = baseEdbInfoMapping.EdbInfoId
|
|
|
}
|
|
|
+ xEdbInfoIdList = append(xEdbInfoIdList, v.EdbInfoId)
|
|
|
continue
|
|
|
}
|
|
|
tmpRealDateTime, findDataValueTmp, isFindTmp, e := GetNeedDateData(realDateTime, edbDataListMap[v.EdbInfoId], baseEdbDataMap[v.EdbInfoId], futureGoodEdbDataMap)
|
|
@@ -677,7 +678,7 @@ func BarChartData(baseEdbInfoMapping *chartEdbMappingModel.ChartEdbInfoMapping,
|
|
|
}
|
|
|
|
|
|
// handleResultData 处理成最终的结果数据
|
|
|
-func handleResultData(regionType string, futureGoodEdbType int, yDataList []chart_info.YData, futureGoodEdbInfoList []*future_good_edb_info.FutureGoodEdbInfo, maxIndex int) (xDataList []request.XData, newYDataList []chart_info.YData, err error) {
|
|
|
+func handleResultData(regionType string, futureGoodEdbType, baseEdbLen int, yDataList []chart_info.YData, futureGoodEdbInfoList []*future_good_edb_info.FutureGoodEdbInfo, maxIndex int) (xDataList []request.XData, newYDataList []chart_info.YData, err error) {
|
|
|
xDataList = make([]request.XData, 0)
|
|
|
newYDataList = yDataList
|
|
|
|
|
@@ -715,11 +716,11 @@ func handleResultData(regionType string, futureGoodEdbType int, yDataList []char
|
|
|
tmpNList := nList
|
|
|
|
|
|
//当前的主力合约
|
|
|
- newYDataList[yIndex].XEdbInfoIdList = append(newYDataList[yIndex].XEdbInfoIdList, yData.XEdbInfoIdList[0])
|
|
|
- newYDataList[yIndex].Value = append(newYDataList[yIndex].Value, yData.Value[0])
|
|
|
+ newYDataList[yIndex].XEdbInfoIdList = append(newYDataList[yIndex].XEdbInfoIdList, yData.XEdbInfoIdList[0:baseEdbLen]...)
|
|
|
+ newYDataList[yIndex].Value = append(newYDataList[yIndex].Value, yData.Value[0:baseEdbLen]...)
|
|
|
|
|
|
- xEdbInfoIdList := yData.XEdbInfoIdList[1:]
|
|
|
- valIndex := 1
|
|
|
+ xEdbInfoIdList := yData.XEdbInfoIdList[baseEdbLen:]
|
|
|
+ valIndex := baseEdbLen
|
|
|
needNum := 0
|
|
|
for _, n := range tmpNList {
|
|
|
if len(xEdbInfoIdList) > 0 {
|
|
@@ -792,7 +793,7 @@ func handleResultData(regionType string, futureGoodEdbType int, yDataList []char
|
|
|
//v.XEdbInfoIdList
|
|
|
for edbInfoIndex, edbInfoId := range v.XEdbInfoIdList {
|
|
|
// 第一个不处理
|
|
|
- if edbInfoIndex == 0 {
|
|
|
+ if edbInfoIndex <= baseEdbLen-1 {
|
|
|
continue
|
|
|
}
|
|
|
|
|
@@ -831,12 +832,12 @@ func handleResultData(regionType string, futureGoodEdbType int, yDataList []char
|
|
|
tmpNList := nList
|
|
|
|
|
|
//当前的主力合约
|
|
|
- newYDataList[yIndex].XEdbInfoIdList = append(newYDataList[yIndex].XEdbInfoIdList, yData.XEdbInfoIdList[0])
|
|
|
- newYDataList[yIndex].Value = append(newYDataList[yIndex].Value, yData.Value[0])
|
|
|
+ newYDataList[yIndex].XEdbInfoIdList = append(newYDataList[yIndex].XEdbInfoIdList, yData.XEdbInfoIdList[0:baseEdbLen]...)
|
|
|
+ newYDataList[yIndex].Value = append(newYDataList[yIndex].Value, yData.Value[0:baseEdbLen]...)
|
|
|
|
|
|
- xEdbInfoIdList := yData.XEdbInfoIdList[1:]
|
|
|
+ xEdbInfoIdList := yData.XEdbInfoIdList[baseEdbLen:]
|
|
|
currDataTime := yData.ConfigDate
|
|
|
- valIndex := 1
|
|
|
+ valIndex := baseEdbLen
|
|
|
needNum := 0
|
|
|
for _, n := range tmpNList {
|
|
|
if len(xEdbInfoIdList) > 0 {
|