浏览代码

预览接口处理

xyxie 8 月之前
父节点
当前提交
49374aa34b
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      services/data/future_good/profit_chart_info.go

+ 3 - 2
services/data/future_good/profit_chart_info.go

@@ -328,6 +328,7 @@ func ProfitChartChartData(baseEdbInfo *data_manage.EdbInfo, baseDataListMap map[
 
 			// 获取当前日期相对开始日期的期数
 			tmpN := (currDate.Year()-findDateTime.Year())*12 + int(currDate.Month()-findDateTime.Month())
+			fmt.Println(tmpN)
 			if tmpN <= 0 {
 				continue
 			}
@@ -637,7 +638,7 @@ func handleProfitResultData(xDataListInit []data_manage.XData, baseEdbInfo *data
 		}
 	}
 
-	maxI := len(allEdbInfoIds)
+	maxI := 0
 	for _, yData := range newYDataList {
 		lenEdb := len(yData.XEdbInfoIdList)
 		for i := 0; i < lenEdb; i++ {
@@ -650,7 +651,7 @@ func handleProfitResultData(xDataListInit []data_manage.XData, baseEdbInfo *data
 	}
 
 	earliestDateTime = time.Date(earliestDateTime.Year(), earliestDateTime.Month(), 1, 0, 0, 0, 0, time.Local)
-	xDataList = xDataList[0:maxI]
+	xDataList = xDataList[0 : maxI+1]
 	for yIndex, yData := range newYDataList {
 		if len(yData.XEdbInfoIdList) > maxI+1 {
 			newYDataList[yIndex].XEdbInfoIdList = yData.XEdbInfoIdList[0 : maxI+1]