Browse Source

Merge remote-tracking branch 'origin/eta/1.3.1' into debug

Roc 1 year ago
parent
commit
9de8d3d118

+ 66 - 71
controllers/data_manage/cross_variety/chart_info.go

@@ -1,10 +1,13 @@
 package cross_variety
 package cross_variety
 
 
 import (
 import (
+	"encoding/json"
 	"eta/eta_api/controllers"
 	"eta/eta_api/controllers"
 	"eta/eta_api/models"
 	"eta/eta_api/models"
 	"eta/eta_api/models/data_manage"
 	"eta/eta_api/models/data_manage"
+	"eta/eta_api/models/data_manage/cross_variety/request"
 	"eta/eta_api/services/data"
 	"eta/eta_api/services/data"
+	"eta/eta_api/services/data/cross_variety"
 	"eta/eta_api/utils"
 	"eta/eta_api/utils"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"strconv"
 	"strconv"
@@ -193,9 +196,9 @@ func (c *ChartInfoController) List() {
 }
 }
 
 
 // Preview
 // Preview
-// @Title 拟合方程图表-预览数据
-// @Description 拟合方程图表-获取预览数据
-// // @Param	request	body request.LineChartInfoReq true "type json string"
+// @Title 跨品种分析图表-预览数据
+// @Description 跨品种分析图表-获取预览数据
+// // @Param	request	body request.ChartConfigReq true "type json string"
 // @Success 200 {object} data_manage.ChartEdbInfoDetailResp
 // @Success 200 {object} data_manage.ChartEdbInfoDetailResp
 // @router /chart_info/preview [post]
 // @router /chart_info/preview [post]
 func (c *ChartInfoController) Preview() {
 func (c *ChartInfoController) Preview() {
@@ -211,75 +214,67 @@ func (c *ChartInfoController) Preview() {
 		br.Ret = 408
 		br.Ret = 408
 		return
 		return
 	}
 	}
-	//var req request.ChartConfigReq
-	//if err := json.Unmarshal(c.Ctx.Input.RequestBody, &req); err != nil {
-	//	br.Msg = "参数解析异常!"
-	//	br.ErrMsg = "参数解析失败,Err:" + err.Error()
-	//	return
-	//}
-	//lenXdbInfoList := len(req.XEdbInfoIdList)
-	//lenYdbInfoList := len(req.YEdbInfoIdList)
-	//if lenXdbInfoList < 2 {
-	//	br.Msg = "X轴指标不能小于两个"
-	//	br.IsSendEmail = false
-	//	return
-	//}
-	//if lenYdbInfoList < 2 {
-	//	br.Msg = "Y轴指标不能小于两个"
-	//	br.IsSendEmail = false
-	//	return
-	//}
-	//if lenYdbInfoList != lenXdbInfoList {
-	//	br.Msg = "X轴与Y轴指标数量不一致"
-	//	br.IsSendEmail = false
-	//	return
-	//}
-	//
-	//chartInfo := new(data_manage.ChartInfoView)
-	//chartInfo.ChartType = 9
-	//
-	//// 获取图表x轴y轴
-	//_, dataResp, err, errMsg := line_equation.GetChartEdbData(0, req, true, true, true)
-	//if err != nil {
-	//	br.Msg = "获取失败"
-	//	if errMsg != `` {
-	//		br.Msg = errMsg
-	//	}
-	//	br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
-	//	return
-	//}
-	//
-	//resp := response.ChartInfoResp{List: []response.ChartDataResp{
-	//	{
-	//		LatestDate:          dataResp.AData.LatestDate,
-	//		EdbInfoCategoryType: dataResp.AData.EdbInfoCategoryType,
-	//		Name:                dataResp.AData.EdbName,
-	//		NameEn:              dataResp.AData.EdbNameEn,
-	//		MinData:             dataResp.AData.MinData,
-	//		MaxData:             dataResp.AData.MaxData,
-	//		DataList:            dataResp.AData.DataList,
-	//	},
-	//	{
-	//		LatestDate:          dataResp.BData.LatestDate,
-	//		EdbInfoCategoryType: dataResp.BData.EdbInfoCategoryType,
-	//		Name:                dataResp.BData.EdbName,
-	//		NameEn:              dataResp.BData.EdbNameEn,
-	//		MinData:             dataResp.BData.MinData,
-	//		MaxData:             dataResp.BData.MaxData,
-	//		DataList:            dataResp.BData.DataList,
-	//	},
-	//	{
-	//		LatestDate:          dataResp.R2Data.LatestDate,
-	//		EdbInfoCategoryType: dataResp.R2Data.EdbInfoCategoryType,
-	//		Name:                dataResp.R2Data.EdbName,
-	//		NameEn:              dataResp.R2Data.EdbNameEn,
-	//		MinData:             dataResp.R2Data.MinData,
-	//		MaxData:             dataResp.R2Data.MaxData,
-	//		DataList:            dataResp.R2Data.DataList,
-	//	},
-	//}}
+	var req request.ChartConfigReq
+	if err := json.Unmarshal(c.Ctx.Input.RequestBody, &req); err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+
+	if req.TagX <= 0 {
+		br.Msg = "请选择X轴坐标的标签"
+		br.IsSendEmail = false
+		return
+	}
+
+	if req.TagY <= 0 {
+		br.Msg = "请选择Y轴坐标的标签"
+		br.IsSendEmail = false
+		return
+	}
+
+	if req.CalculateValue <= 0 {
+		br.Msg = "请设置时间长度"
+		br.IsSendEmail = false
+		return
+	}
 
 
-	//br.Data = resp
+	// 品种配置
+	varietyListList := len(req.VarietyList)
+	if varietyListList < 0 {
+		br.Msg = "请选择品种"
+		br.IsSendEmail = false
+		return
+	}
+
+	// 日期配置
+	dateConfigList := len(req.DateConfigList)
+	if dateConfigList < 0 {
+		br.Msg = "请选择日期"
+		br.IsSendEmail = false
+		return
+	}
+	if dateConfigList > 5 {
+		br.Msg = "日期数量已达上限!"
+		br.IsSendEmail = false
+		return
+	}
+
+	chartInfo := new(data_manage.ChartInfoView)
+	chartInfo.ChartType = 9
+
+	// 获取图表x轴y轴
+	_, dataResp, err, errMsg, isSendEmail := cross_variety.GetChartData(0, req)
+	if err != nil {
+		br.IsSendEmail = isSendEmail
+		br.Msg = "获取失败"
+		if errMsg != `` {
+			br.Msg = errMsg
+		}
+		br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
+		return
+	}
+	br.Data = dataResp
 	br.Ret = 200
 	br.Ret = 200
 	br.Success = true
 	br.Success = true
 	br.Msg = "获取成功"
 	br.Msg = "获取成功"

+ 20 - 0
models/data_manage/cross_variety/chart_tag.go

@@ -1,6 +1,7 @@
 package cross_variety
 package cross_variety
 
 
 import (
 import (
+	"eta/eta_api/utils"
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/beego/beego/v2/client/orm"
 	"time"
 	"time"
 )
 )
@@ -98,3 +99,22 @@ func (item *ChartTag) Delete() (err error) {
 	_, err = o.Delete(item)
 	_, err = o.Delete(item)
 	return
 	return
 }
 }
+
+// GetTagListByIdList
+// @Description: 根据ID列表获取标签列表
+// @author: Roc
+// @datetime 2023-11-23 17:56:39
+// @param idList []int
+// @return items []*ChartTag
+// @return err error
+func GetTagListByIdList(idList []int) (items []*ChartTag, err error) {
+	num := len(idList)
+	if num <= 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("data")
+	sql := `SELECT * FROM chart_tag WHERE 1 = 1 AND chart_tag_id in (` + utils.GetOrmInReplace(num) + `)`
+	_, err = o.Raw(sql, idList).QueryRows(&items)
+
+	return
+}

+ 21 - 0
models/data_manage/cross_variety/chart_tag_variety.go

@@ -2,6 +2,7 @@ package cross_variety
 
 
 import (
 import (
 	"eta/eta_api/models/data_manage/cross_variety/request"
 	"eta/eta_api/models/data_manage/cross_variety/request"
+	"eta/eta_api/utils"
 	"fmt"
 	"fmt"
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/beego/beego/v2/client/orm"
 	"strings"
 	"strings"
@@ -53,6 +54,26 @@ func GetChartTagVarietyListByTag(chartTagId int) (items []*ChartTagVariety, err
 	return
 	return
 }
 }
 
 
+// GetChartTagVarietyListByTagAndVariety
+// @Description: 根据标签id和品种id列表获取所绑定的品种列表
+// @author: Roc
+// @datetime 2023-11-23 15:04:20
+// @param chartTagId int
+// @param varietyIdList []int
+// @return items []*ChartTagVariety
+// @return err error
+func GetChartTagVarietyListByTagAndVariety(chartTagId int, varietyIdList []int) (items []*ChartTagVariety, err error) {
+	num := len(varietyIdList)
+	if num <= 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("data")
+	sql := `SELECT * FROM chart_tag_variety WHERE chart_tag_id = ? AND chart_variety_id in (` + utils.GetOrmInReplace(num) + `) `
+	_, err = o.Raw(sql, chartTagId, varietyIdList).QueryRows(&items)
+
+	return
+}
+
 // ChartTagVarietyItem
 // ChartTagVarietyItem
 // @Description: 图表标签/品种/指标数据
 // @Description: 图表标签/品种/指标数据
 type ChartTagVarietyItem struct {
 type ChartTagVarietyItem struct {

+ 20 - 0
models/data_manage/cross_variety/chart_variety.go

@@ -1,6 +1,7 @@
 package cross_variety
 package cross_variety
 
 
 import (
 import (
+	"eta/eta_api/utils"
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/beego/beego/v2/client/orm"
 	"time"
 	"time"
 )
 )
@@ -98,3 +99,22 @@ func GetVarietyList() (items []*ChartVariety, err error) {
 
 
 	return
 	return
 }
 }
+
+// GetVarietyListByIdList
+// @Description: 根据ID列表获取品种列表
+// @author: Roc
+// @datetime 2023-11-23 17:56:39
+// @param idList []int
+// @return items []*ChartVariety
+// @return err error
+func GetVarietyListByIdList(idList []int) (items []*ChartVariety, err error) {
+	num := len(idList)
+	if num <= 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("data")
+	sql := `SELECT * FROM chart_variety WHERE 1 = 1 AND chart_variety_id in (` + utils.GetOrmInReplace(num) + `)`
+	_, err = o.Raw(sql, idList).QueryRows(&items)
+
+	return
+}

+ 12 - 13
models/data_manage/cross_variety/request/chart.go

@@ -1,20 +1,19 @@
 package request
 package request
 
 
 // ChartConfigReq
 // ChartConfigReq
-// @Description: 图表配置
+// @Description: 跨品种分析的图表配置
 type ChartConfigReq struct {
 type ChartConfigReq struct {
-	TagX           int    `description:"X轴的标签ID"`
-	TagY           int    `description:"Y轴的标签ID"`
-	DateType       int    `description:"日期类型"`
-	StartDate      string `description:"开始日期"`
-	EndDate        string `description:"结束日期"`
-	XEdbInfoIdList []int  `description:"X轴的指标id列表"`
-	YEdbInfoIdList []int  `description:"Y轴的指标id列表"`
-	Source         int    `description:"来源,5:斜率图;6:截距图;7:相关性图"`
+	TagX           int               `description:"X轴的标签ID"`
+	TagY           int               `description:"Y轴的标签ID"`
+	CalculateValue int               `description:"计算窗口"`
+	CalculateUnit  string            `description:"计算频度"`
+	DateConfigList []ChartConfigDate `description:"日期配置列表"`
+	VarietyList    []int             `description:"品种id列表"`
 }
 }
 
 
-type AddChartInfoReq struct {
-	//MultipleGraphConfigId int              `description:"统一配置id,有的话就是编辑,没有则是新增"`
-	//BatchAddChart         []AddChart       `description:"批量创建图的信息"`
-	//ExtraConfig           LineChartInfoReq `description:"图表额外配置信息"`
+// ChartConfigDate
+// @Description: 跨品种分析的日期配置
+type ChartConfigDate struct {
+	DateType int `description:"日期类型,,1:最新日期;2:N天前"`
+	Num      int
 }
 }

+ 399 - 0
services/data/cross_variety/chart.go

@@ -0,0 +1,399 @@
+package cross_variety
+
+import (
+	"errors"
+	"eta/eta_api/models/data_manage"
+	cross_varietyModel "eta/eta_api/models/data_manage/cross_variety"
+	"eta/eta_api/models/data_manage/cross_variety/request"
+	"eta/eta_api/services/data"
+	"eta/eta_api/utils"
+	"fmt"
+	"github.com/shopspring/decimal"
+	"time"
+)
+
+type LineEquationDataResp struct {
+	MaxData             float64
+	MinData             float64
+	LatestDate          string `description:"真实数据的最后日期"`
+	EdbInfoCategoryType int
+	ChartColor          string
+	ChartStyle          string
+	PredictChartColor   string
+	ChartType           int
+	ChartWidth          int
+	EdbName             string
+	EdbNameEn           string
+	Unit                string
+	UnitEn              string
+	IsAxis              int
+	DataList            []data_manage.EdbDataList
+}
+
+// ChartInfoResp 截面散点图数据
+type ChartInfoResp struct {
+	XName       string                         `description:"x轴名称"`
+	XNameEn     string                         `description:"x轴名称(英文)"`
+	XUnitName   string                         `description:"x轴单位名称"`
+	XUnitNameEn string                         `description:"x轴单位名称(英文)"`
+	YName       string                         `description:"y轴名称"`
+	YNameEn     string                         `description:"y轴名称(英文)"`
+	YUnitName   string                         `description:"y轴单位名称"`
+	YUnitNameEn string                         `description:"y轴单位名称(英文)"`
+	XMinValue   string                         `description:"X轴的最小值"`
+	XMaxValue   string                         `description:"X轴的最大值"`
+	YMinValue   string                         `description:"Y轴的最小值"`
+	YMaxValue   string                         `description:"Y轴的最大值"`
+	DataList    []SectionScatterSeriesItemResp `description:"数据列"`
+}
+
+// SectionScatterSeriesItemResp 系列的返回
+type SectionScatterSeriesItemResp struct {
+	Name                string            `description:"系列名"`
+	NameEn              string            `description:"系列名(英文)"`
+	Color               string            `description:"颜色"`
+	CoordinatePointData []CoordinatePoint `description:"趋势线的前后坐标点"`
+}
+
+// SectionScatterEdbItemResp 截面散点的返回参数
+type SectionScatterEdbItemResp struct {
+	XEdbInfoId int     `description:"X轴指标id"`
+	XDate      string  `description:"X轴指标实际日期"`
+	XName      string  `description:"X轴指标名称"`
+	XNameEn    string  `description:"X轴指标英文名称"`
+	XValue     float64 `description:"X轴实际值"`
+	YEdbInfoId int     `description:"Y轴指标id"`
+	YDate      string  `description:"Y轴指标实际日期"`
+	YName      string  `description:"Y轴指标名称"`
+	YNameEn    string  `description:"Y轴指标英文名称"`
+	YValue     float64 `description:"Y轴实际值"`
+	IsShow     bool    `description:"是否展示"`
+	Name       string  `description:"标签名称"`
+	NameEn     string  `description:"英文标签名称"`
+}
+
+// CoordinatePoint 坐标点
+type CoordinatePoint struct {
+	X     float64
+	Y     float64
+	XDate string
+	YDate string
+}
+
+// GetChartData
+// @Description: 获取跨品种分析图表数据
+// @author: Roc
+// @datetime 2023-11-24 09:42:59
+// @param chartInfoId int
+// @param config request.ChartConfigReq
+// @return edbList []*data_manage.ChartEdbInfoMapping
+// @return dataResp ChartInfoResp
+// @return err error
+// @return errMsg string
+// @return isSendEmail bool
+func GetChartData(chartInfoId int, config request.ChartConfigReq) (edbList []*data_manage.ChartEdbInfoMapping, dataResp ChartInfoResp, err error, errMsg string, isSendEmail bool) {
+	moveUnitDays, ok := utils.FrequencyDaysMap[config.CalculateUnit]
+	if !ok {
+		errMsg = "错误的分析周期"
+		err = errors.New(errMsg)
+		isSendEmail = false
+		return
+	}
+
+	isSendEmail = true
+
+	// 品种map
+	varietyMap := make(map[int]*cross_varietyModel.ChartVariety)
+	{
+		varietyList, tmpErr := cross_varietyModel.GetVarietyListByIdList(config.VarietyList)
+		if tmpErr != nil {
+			err = tmpErr
+			return
+		}
+		for _, v := range varietyList {
+			varietyMap[v.ChartVarietyId] = v
+		}
+	}
+
+	// 标签m
+	var xTagInfo, yTagInfo *cross_varietyModel.ChartTag
+	{
+		tagList, tmpErr := cross_varietyModel.GetTagListByIdList([]int{config.TagX, config.TagY})
+		if tmpErr != nil {
+			err = tmpErr
+			return
+		}
+		for _, v := range tagList {
+			if v.ChartTagId == config.TagX {
+				xTagInfo = v
+			} else if v.ChartTagId == config.TagY {
+				yTagInfo = v
+			}
+		}
+	}
+	if xTagInfo == nil {
+		errMsg = "找不到对应的X轴标签"
+		err = errors.New(errMsg)
+		return
+	}
+	if yTagInfo == nil {
+		errMsg = "找不到对应的Y轴标签"
+		err = errors.New(errMsg)
+		return
+	}
+
+	xVarietyEdbMap := make(map[int]int)
+	yVarietyEdbMap := make(map[int]int)
+	xList, err := cross_varietyModel.GetChartTagVarietyListByTagAndVariety(config.TagX, config.VarietyList)
+	if err != nil {
+		errMsg = "获取失败"
+		err = errors.New("获取X轴的品种指标配置信息失败,Err:" + err.Error())
+		return
+	}
+	yList, err := cross_varietyModel.GetChartTagVarietyListByTagAndVariety(config.TagY, config.VarietyList)
+	if err != nil {
+		errMsg = "获取失败"
+		err = errors.New("获取Y轴的品种指标配置信息失败,Err:" + err.Error())
+		return
+	}
+	edbInfoIdList := make([]int, 0)
+	for _, v := range xList {
+		edbInfoIdList = append(edbInfoIdList, v.EdbInfoId)
+		xVarietyEdbMap[v.ChartVarietyId] = v.EdbInfoId
+	}
+	for _, v := range yList {
+		edbInfoIdList = append(edbInfoIdList, v.EdbInfoId)
+		yVarietyEdbMap[v.ChartVarietyId] = v.EdbInfoId
+	}
+
+	// todo 需要取交集
+
+	if len(edbInfoIdList) <= 0 {
+		errMsg = "品种未配置指标"
+		err = errors.New(errMsg)
+		isSendEmail = false
+		return
+	}
+	mappingList, err := data_manage.GetChartEdbMappingListByEdbInfoIdList(edbInfoIdList)
+	if err != nil {
+		errMsg = "获取指标信息失败"
+		err = errors.New("获取指标信息失败,ERR:" + err.Error())
+		return
+	}
+
+	// 指标对应的所有数据
+	chartType := 1 //1:普通图,2:季节性图
+	calendar := "公历"
+	edbDataListMap, edbList, err := data.GetEdbDataMapList(chartInfoId, chartType, calendar, "", "", mappingList, "")
+	if err != nil {
+		return
+	}
+
+	currDay := time.Now()
+	currDay = time.Date(currDay.Year(), currDay.Month(), currDay.Day(), 0, 0, 0, 0, time.Local)
+
+	dataMap := make(map[string]float64)
+	dateMap := make(map[string]string)
+	for dateIndex, dateConfig := range config.DateConfigList {
+		for _, edbInfoMapping := range mappingList {
+			// 数据会是正序的
+			dataList, ok := edbDataListMap[edbInfoMapping.EdbInfoId]
+			if !ok {
+				continue
+			}
+
+			lenData := len(dataList)
+			if lenData <= 0 {
+				continue
+			}
+
+			// 数据开始日期
+			endDateStr := ``
+			var endDate time.Time
+			// 数据的开始索引
+			k := lenData - 1
+			var currVal float64
+			switch dateConfig.DateType {
+			case 1: // 1:最新日期;
+				endDateStr = dataList[k].DataTime
+				tmpDate, tmpErr := time.ParseInLocation(utils.FormatDate, endDateStr, time.Local)
+				if tmpErr != nil {
+					err = tmpErr
+					return
+				}
+				endDate = tmpDate
+				currVal = dataList[k].Value
+			case 2: // 2:N天前
+				tmpEndDate := currDay.AddDate(0, 0, -dateConfig.Num)
+				tmpEndDateStr := tmpEndDate.Format(utils.FormatDate)
+
+				for i := k; i >= 0; i-- {
+					tmpDateStr := dataList[i].DataTime
+					// 如果正好是这一天,那么就直接break了
+					if tmpEndDateStr == tmpDateStr {
+						k = i
+						endDateStr = tmpDateStr
+						currVal = dataList[i].Value
+						break
+					}
+					tmpDate, tmpErr := time.ParseInLocation(utils.FormatDate, tmpDateStr, time.Local)
+					if tmpErr != nil {
+						err = tmpErr
+						return
+					}
+					// 如果这期的日期晚于选择的日期,那么继续遍历
+					if tmpDate.After(tmpEndDate) {
+						continue
+					}
+					k = i
+					endDateStr = tmpDateStr
+					endDate = tmpDate
+					currVal = dataList[i].Value
+					break
+				}
+			}
+
+			// 没有找到日期,那么就不处理
+			if endDateStr == `` || endDate.IsZero() {
+				continue
+			}
+
+			// 最早的日期
+			earliestDate := endDate.AddDate(0, 0, -config.CalculateValue*moveUnitDays)
+			earliestDateStr := earliestDate.Format(utils.FormatDate)
+
+			var minVal, maxVal float64
+			var isNotFirst bool // 是否是第一条数据
+			for i := k; i >= 0; i-- {
+				tmpData := dataList[i]
+				if !isNotFirst {
+					maxVal = tmpData.Value
+					minVal = tmpData.Value
+					isNotFirst = true
+					continue
+				}
+
+				tmpDateStr := dataList[i].DataTime
+				// 如果正好是这一天,那么就直接break了
+				if earliestDateStr == tmpDateStr {
+					break
+				}
+				tmpDate, tmpErr := time.ParseInLocation(utils.FormatDate, tmpDateStr, time.Local)
+				if tmpErr != nil {
+					err = tmpErr
+					return
+				}
+				// 如果这期的日期早于选择的日期,那么继续停止遍历
+				if tmpDate.Before(earliestDate) {
+					continue
+				}
+
+				if tmpData.Value > maxVal {
+					maxVal = tmpData.Value
+				}
+				if tmpData.Value < minVal {
+					minVal = tmpData.Value
+				}
+			}
+
+			// 最大值等于最小值,说明计算结果无效
+			if maxVal == minVal {
+				continue
+			}
+			//百分位=(现值-Min)/(Max-Min)
+			tmpV := (currVal - minVal) / (maxVal - minVal) * 100
+			tmpV, _ = decimal.NewFromFloat(tmpV).Round(4).Float64()
+
+			// key的生成(日期配置下标+指标id)
+			key := fmt.Sprint(dateIndex, "_", edbInfoMapping.EdbInfoId)
+			dataMap[key] = tmpV
+			dateMap[key] = endDateStr
+		}
+	}
+
+	// 返回数据处理
+	dataList := make([]SectionScatterSeriesItemResp, 0)
+	var xMinVal, xMaxVal, yMinVal, yMaxVal float64
+	var isNotFirst bool
+
+	for _, varietyId := range config.VarietyList {
+		xEdbInfoId, ok1 := xVarietyEdbMap[varietyId]
+		if !ok1 {
+			continue
+		}
+		yEdbInfoId, ok2 := yVarietyEdbMap[varietyId]
+		if !ok2 {
+			continue
+		}
+		variety, ok := varietyMap[varietyId]
+		if !ok {
+			continue
+		}
+
+		coordinatePointList := make([]CoordinatePoint, 0)
+
+		for dateIndex, _ := range config.DateConfigList {
+			key1 := fmt.Sprint(dateIndex, "_", xEdbInfoId)
+			xVal, ok1 := dataMap[key1]
+			if !ok1 {
+				continue
+			}
+			key2 := fmt.Sprint(dateIndex, "_", yEdbInfoId)
+			yVal, ok2 := dataMap[key2]
+			if !ok2 {
+				continue
+			}
+			if !isNotFirst {
+				xMinVal = xVal
+				xMaxVal = xVal
+				yMinVal = yVal
+				yMaxVal = yVal
+				isNotFirst = true
+			} else {
+				if xVal < xMinVal {
+					xMinVal = xVal
+				}
+				if xVal > xMaxVal {
+					xMaxVal = xVal
+				}
+				if yVal < yMinVal {
+					yMinVal = yVal
+				}
+				if yVal > yMaxVal {
+					yMaxVal = yVal
+				}
+			}
+			coordinatePointList = append(coordinatePointList, CoordinatePoint{
+				X:     xVal,
+				Y:     yVal,
+				XDate: dateMap[key1],
+				YDate: dateMap[key2],
+			})
+		}
+
+		dataList = append(dataList, SectionScatterSeriesItemResp{
+			Name:                variety.ChartVarietyName,
+			NameEn:              "",
+			Color:               "",
+			CoordinatePointData: coordinatePointList,
+		})
+	}
+
+	dataResp = ChartInfoResp{
+		XName:       xTagInfo.ChartTagName,
+		XNameEn:     "",
+		XUnitName:   "%",
+		XUnitNameEn: "%",
+		YName:       yTagInfo.ChartTagName,
+		YNameEn:     "",
+		YUnitName:   "%",
+		YUnitNameEn: "%",
+		XMinValue:   fmt.Sprint(xMinVal),
+		XMaxValue:   fmt.Sprint(xMaxVal),
+		YMinValue:   fmt.Sprint(yMinVal),
+		YMaxValue:   fmt.Sprint(yMaxVal),
+		DataList:    dataList,
+	}
+
+	return
+}