Explorar el Código

Merge branch 'feature/chart_minmax_0116'

hsun hace 1 año
padre
commit
4fa25d2a3b

+ 2 - 0
controllers/data_manage/chart_info.go

@@ -2534,6 +2534,8 @@ func (this *ChartInfoController) CopyChartInfo() {
 		LeftMax:           oldChartInfo.LeftMax,
 		RightMin:          oldChartInfo.RightMin,
 		RightMax:          oldChartInfo.RightMax,
+		Right2Min:         oldChartInfo.Right2Min,
+		Right2Max:         oldChartInfo.Right2Max,
 		Disabled:          oldChartInfo.Disabled,
 		Source:            oldChartInfo.Source,
 		ExtraConfig:       oldChartInfo.ExtraConfig,

+ 4 - 0
controllers/data_manage/multiple_graph_config.go

@@ -742,6 +742,8 @@ func (this *ChartInfoController) MultipleGraphConfigSaveChart() {
 				LeftMax:          fmt.Sprint(curveConf.LeftMax),
 				RightMin:         fmt.Sprint(curveConf.RightMin),
 				RightMax:         fmt.Sprint(curveConf.RightMax),
+				Right2Min:        fmt.Sprint(curveConf.Right2Min),
+				Right2Max:        fmt.Sprint(curveConf.Right2Max),
 			}
 			chartInfo, err, errMsg, isSendEmail = data.AddChartInfo(addChartReq, sysUser.AdminId, sysUser.RealName)
 		} else {
@@ -760,6 +762,8 @@ func (this *ChartInfoController) MultipleGraphConfigSaveChart() {
 				LeftMax:          fmt.Sprint(curveConf.LeftMax),
 				RightMin:         fmt.Sprint(curveConf.RightMin),
 				RightMax:         fmt.Sprint(curveConf.RightMax),
+				Right2Min:        fmt.Sprint(curveConf.Right2Min),
+				Right2Max:        fmt.Sprint(curveConf.Right2Max),
 			}
 			chartInfo, err, errMsg, isSendEmail = data.EditChartInfo(editChartReq, sysUser)
 			if err != nil {

+ 39 - 3
models/data_manage/chart_info.go

@@ -38,6 +38,9 @@ type ChartInfo struct {
 	LeftMax           string `description:"图表左侧最大值"`
 	RightMin          string `description:"图表右侧最小值"`
 	RightMax          string `description:"图表右侧最大值"`
+	Right2Min         string `description:"图表右侧2最小值"`
+	Right2Max         string `description:"图表右侧2最大值"`
+	MinMaxSave        int    `description:"是否手动保存过上下限:0-否;1-是"`
 	Disabled          int    `description:"是否禁用,0:启用,1:禁用,默认:0"`
 	BarConfig         string `description:"柱方图的配置,json数据"`
 	Source            int    `description:"1:ETA图库;2:商品价格曲线"`
@@ -160,6 +163,9 @@ type SaveChartInfoReq struct {
 	LeftMax          string           `description:"图表左侧最大值"`
 	RightMin         string           `description:"图表右侧最小值"`
 	RightMax         string           `description:"图表右侧最大值"`
+	Right2Min        string           `description:"图表右侧最小值"`
+	Right2Max        string           `description:"图表右侧最大值"`
+	MinMaxSave       int              `description:"是否手动保存过上下限:0-否;1-是"`
 	ExtraConfig      string           `description:"图表额外配置,json数据"`
 	StartYear        int              `description:"当选择的日期类型为最近N年类型时,即date_type=20, 用start_year表示N"`
 }
@@ -234,6 +240,9 @@ type EditChartInfoReq struct {
 	LeftMax              string                  `description:"图表左侧最大值"`
 	RightMin             string                  `description:"图表右侧最小值"`
 	RightMax             string                  `description:"图表右侧最大值"`
+	Right2Min            string                  `description:"图表右侧最小值"`
+	Right2Max            string                  `description:"图表右侧最大值"`
+	MinMaxSave           int                     `description:"是否手动保存过上下限:0-否;1-是"`
 	BarChartInfo         BarChartInfoReq         `description:"柱方图的配置"`
 	CorrelationChartInfo CorrelationChartInfoReq `description:"相关性图表配置"`
 	ExtraConfig          string                  `description:"图表额外配置信息,json字符串"`
@@ -574,9 +583,12 @@ func ModifyChartInfoAndMapping(edbInfoIdStr string, req *SaveChartInfoReq, chart
  			  left_min=?,
 			  left_max=?,
 			  right_min=?,
-			  right_max=?, 
+			  right_max=?,
+			  right2_min=?,
+			  right2_max=?,
+			  min_max_save=?,
               start_year=?`
-		pars := []interface{}{edbInfoIdStr, req.DateType, req.StartDate, req.EndDate, req.LeftMin, req.LeftMax, req.RightMin, req.RightMax, req.StartYear}
+		pars := []interface{}{edbInfoIdStr, req.DateType, req.StartDate, req.EndDate, req.LeftMin, req.LeftMax, req.RightMin, req.RightMax, req.Right2Min, req.Right2Max, req.MinMaxSave, req.StartYear}
 		if req.ExtraConfig != `` {
 			updateStr += `,extra_config=? `
 			pars = append(pars, req.ExtraConfig)
@@ -604,9 +616,12 @@ func ModifyChartInfoAndMapping(edbInfoIdStr string, req *SaveChartInfoReq, chart
 			  left_max=?,
 			  right_min=?,
 			  right_max=?,
+			  right2_min=?,
+			  right2_max=?,
+			  min_max_save=?,
 			  start_year=?
 			WHERE chart_info_id = ?`
-		_, err = to.Raw(sql, edbInfoIdStr, req.Calendar, req.DateType, req.StartDate, req.EndDate, req.StartDate, req.EndDate, req.LeftMin, req.LeftMax, req.RightMin, req.RightMax, req.StartYear, req.ChartInfoId).Exec()
+		_, err = to.Raw(sql, edbInfoIdStr, req.Calendar, req.DateType, req.StartDate, req.EndDate, req.StartDate, req.EndDate, req.LeftMin, req.LeftMax, req.RightMin, req.RightMax, req.Right2Min, req.Right2Max, req.MinMaxSave, req.StartYear, req.ChartInfoId).Exec()
 		if err != nil {
 			fmt.Println("UPDATE  chart_info Err:", err.Error())
 			return err
@@ -773,6 +788,15 @@ func EditChartInfoAndMapping(req *EditChartInfoReq, edbInfoIdStr string, calenda
 	sql += `,right_max = ? `
 	pars = append(pars, req.RightMax)
 
+	sql += `,right2_min = ? `
+	pars = append(pars, req.Right2Min)
+
+	sql += `,right2_max = ? `
+	pars = append(pars, req.Right2Max)
+
+	sql += `,min_max_save = ? `
+	pars = append(pars, req.MinMaxSave)
+
 	sql += `WHERE chart_info_id = ?`
 
 	pars = append(pars, req.ChartInfoId)
@@ -930,6 +954,12 @@ func EditFutureGoodChartInfoAndMapping(req *EditChartInfoReq, edbInfoIdStr strin
 	sql += `,right_max = ? `
 	pars = append(pars, req.RightMax)
 
+	sql += `,right2_min = ? `
+	pars = append(pars, req.Right2Min)
+
+	sql += `,right2_max = ? `
+	pars = append(pars, req.Right2Max)
+
 	sql += `WHERE chart_info_id = ?`
 
 	pars = append(pars, req.ChartInfoId)
@@ -1089,6 +1119,9 @@ type AddChartInfoReq struct {
 	LeftMax              string                  `description:"图表左侧最大值"`
 	RightMin             string                  `description:"图表右侧最小值"`
 	RightMax             string                  `description:"图表右侧最大值"`
+	Right2Min            string                  `description:"图表右侧2最小值"`
+	Right2Max            string                  `description:"图表右侧2最大值"`
+	MinMaxSave           int                     `description:"是否手动保存过上下限:0-否;1-是"`
 	BarChartInfo         BarChartInfoReq         `description:"柱方图的配置"`
 	CorrelationChartInfo CorrelationChartInfoReq `description:"相关性图表配置"`
 	ExtraConfig          string                  `description:"图表额外配置信息,json字符串"`
@@ -1397,6 +1430,9 @@ type ChartInfoView struct {
 	LeftMax           string `description:"图表左侧最大值"`
 	RightMin          string `description:"图表右侧最小值"`
 	RightMax          string `description:"图表右侧最大值"`
+	Right2Min         string `description:"图表右侧最小值"`
+	Right2Max         string `description:"图表右侧最大值"`
+	MinMaxSave        int    `description:"是否手动保存过上下限:0-否;1-是"`
 	IsEdit            bool   `description:"是否有编辑权限"`
 	IsEnChart         bool   `description:"是否展示英文标识"`
 	WarnMsg           string `description:"错误信息"`

+ 2 - 0
models/data_manage/multiple_graph_config.go

@@ -56,6 +56,8 @@ type CurveConfig struct {
 	LeftMax     float64 `description:"图表左侧最大值"`
 	RightMin    float64 `description:"图表右侧最小值"`
 	RightMax    float64 `description:"图表右侧最大值"`
+	Right2Min   float64 `description:"图表右侧最小值"`
+	Right2Max   float64 `description:"图表右侧最大值"`
 	IsOrder     bool    `description:"true:正序,false:逆序"`
 	EdbInfoType bool    `description:"true:标准指标,false:领先指标"`
 	LeadValue   int     `description:"领先值"`

+ 3 - 0
services/data/chart_info.go

@@ -2156,6 +2156,9 @@ func AddChartInfo(req data_manage.AddChartInfoReq, sysUserId int, sysUserRealNam
 	chartInfo.LeftMax = req.LeftMax
 	chartInfo.RightMin = req.RightMin
 	chartInfo.RightMax = req.RightMax
+	chartInfo.Right2Min = req.Right2Min
+	chartInfo.Right2Max = req.Right2Max
+	chartInfo.MinMaxSave = req.MinMaxSave
 	chartInfo.Disabled = disableVal
 	chartInfo.BarConfig = barChartConf
 	chartInfo.ExtraConfig = extraConfig