|
@@ -2621,58 +2621,6 @@ type RadarYData struct {
|
|
|
Value []float64 `description:"每个指标的值"`
|
|
|
}
|
|
|
|
|
|
-// ChartInfoSourcesFrom 图表来源
|
|
|
-type ChartInfoSourcesFrom struct {
|
|
|
- IsShow bool `description:"是否展示" json:"isShow"`
|
|
|
- Text string `description:"来源文本" json:"text"`
|
|
|
- Color string `description:"来源颜色" json:"color"`
|
|
|
- FontSize int `description:"来源字号" json:"fontSize"`
|
|
|
-}
|
|
|
-
|
|
|
-// UpdateChartInfoSortByClassifyIdV2 根据分类id更新排序
|
|
|
-func UpdateChartInfoSortByClassifyIdV2(classifyId, nowSort int, prevChartInfoId int, updateSort string) (err error) {
|
|
|
- o := orm.NewOrmUsingDB("data")
|
|
|
- sql := ` update chart_info set sort = ` + updateSort + ` WHERE chart_classify_id = ?`
|
|
|
- if prevChartInfoId > 0 {
|
|
|
- sql += ` AND ( sort > ? or ( chart_info_id > ` + fmt.Sprint(prevChartInfoId) + ` and sort=` + fmt.Sprint(nowSort) + ` )) `
|
|
|
- } else {
|
|
|
- sql += ` AND ( sort > ? )`
|
|
|
- }
|
|
|
- _, err = o.Raw(sql, classifyId, nowSort).Exec()
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// GetChartInfoMaxSortByClassifyId 获取分类下指标的最大的排序数
|
|
|
-func GetChartInfoMaxSortByClassifyId(classifyId int) (sort int, err error) {
|
|
|
- o := orm.NewOrmUsingDB("data")
|
|
|
- sql := `SELECT Max(sort) AS sort FROM chart_info WHERE chart_classify_id = ? `
|
|
|
- err = o.Raw(sql, classifyId).QueryRow(&sort)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// GetChartInfoBySourceAndParentId 根据图表来源及父级ID获取图表
|
|
|
-func GetChartInfoBySourceAndParentId(source, parentId, adminId int) (items []*ChartClassifyItems, err error) {
|
|
|
- o := orm.NewOrmUsingDB("data")
|
|
|
- sql := ` SELECT chart_info_id,chart_classify_id,chart_name AS chart_classify_name,chart_name_en AS chart_classify_name_en,
|
|
|
- unique_code,sys_user_id,sys_user_real_name,date_type,start_date,end_date,chart_type,calendar,season_start_date,season_end_date,source
|
|
|
- FROM chart_info WHERE source = ? AND chart_classify_id = ?`
|
|
|
- pars := make([]interface{}, 0)
|
|
|
- pars = append(pars, source, parentId)
|
|
|
- if adminId > 0 {
|
|
|
- sql += ` AND sys_user_id = ?`
|
|
|
- pars = append(pars, adminId)
|
|
|
- }
|
|
|
- sql += ` ORDER BY sort asc,chart_info_id ASC `
|
|
|
- _, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// PreviewSeasonChartReq 预览季节性图的请求入参
|
|
|
-type PreviewSeasonChartReq struct {
|
|
|
- ChartEdbInfoList []*ChartSaveItem `description:"指标及配置信息"`
|
|
|
- SeasonExtraConfig SeasonExtraItem `description:"季节图额外配置信息,json字符串"`
|
|
|
-}
|
|
|
-
|
|
|
// 截面组合图额外配置
|
|
|
type ChartSectionExtraConf struct {
|
|
|
DateConfList []*ChartSectionDateConfItem
|
|
@@ -2784,6 +2732,81 @@ type ChartSectionCombineUnit struct {
|
|
|
RightTwoNameEn string `description:"右2轴英文单位"`
|
|
|
}
|
|
|
|
|
|
+// 时序组合图额外配置
|
|
|
+type ChartTimeCombineExtraConf struct {
|
|
|
+ IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
|
|
|
+}
|
|
|
+
|
|
|
+type ChartTimeCombineDataResp struct {
|
|
|
+ IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
|
|
|
+}
|
|
|
+
|
|
|
+type PreviewSectionCombineDateCalculateResp struct {
|
|
|
+ Date string
|
|
|
+}
|
|
|
+
|
|
|
+type PreviewSectionCombineDateCalculateReq struct {
|
|
|
+ MoveForward int `description:"前移的期数"`
|
|
|
+ EdbInfoId int `description:"指标ID"`
|
|
|
+ Frequency string `description:"频度"`
|
|
|
+ DateConfName string `description:"引用日期名称"` // 引用日期名称不能重复
|
|
|
+ DateChange []*ChartSectionDateChange
|
|
|
+ DateConfList []*ChartSectionDateConfItem
|
|
|
+ DateType int `description:"日期类型,0指标最新日期, 1引用日期"`
|
|
|
+}
|
|
|
+
|
|
|
+// ChartInfoSourcesFrom 图表来源
|
|
|
+type ChartInfoSourcesFrom struct {
|
|
|
+ IsShow bool `description:"是否展示" json:"isShow"`
|
|
|
+ Text string `description:"来源文本" json:"text"`
|
|
|
+ Color string `description:"来源颜色" json:"color"`
|
|
|
+ FontSize int `description:"来源字号" json:"fontSize"`
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateChartInfoSortByClassifyIdV2 根据分类id更新排序
|
|
|
+func UpdateChartInfoSortByClassifyIdV2(classifyId, nowSort int, prevChartInfoId int, updateSort string) (err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ sql := ` update chart_info set sort = ` + updateSort + ` WHERE chart_classify_id = ?`
|
|
|
+ if prevChartInfoId > 0 {
|
|
|
+ sql += ` AND ( sort > ? or ( chart_info_id > ` + fmt.Sprint(prevChartInfoId) + ` and sort=` + fmt.Sprint(nowSort) + ` )) `
|
|
|
+ } else {
|
|
|
+ sql += ` AND ( sort > ? )`
|
|
|
+ }
|
|
|
+ _, err = o.Raw(sql, classifyId, nowSort).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// GetChartInfoMaxSortByClassifyId 获取分类下指标的最大的排序数
|
|
|
+func GetChartInfoMaxSortByClassifyId(classifyId int) (sort int, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ sql := `SELECT Max(sort) AS sort FROM chart_info WHERE chart_classify_id = ? `
|
|
|
+ err = o.Raw(sql, classifyId).QueryRow(&sort)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// GetChartInfoBySourceAndParentId 根据图表来源及父级ID获取图表
|
|
|
+func GetChartInfoBySourceAndParentId(source, parentId, adminId int) (items []*ChartClassifyItems, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ sql := ` SELECT chart_info_id,chart_classify_id,chart_name AS chart_classify_name,chart_name_en AS chart_classify_name_en,
|
|
|
+ unique_code,sys_user_id,sys_user_real_name,date_type,start_date,end_date,chart_type,calendar,season_start_date,season_end_date,source
|
|
|
+ FROM chart_info WHERE source = ? AND chart_classify_id = ?`
|
|
|
+ pars := make([]interface{}, 0)
|
|
|
+ pars = append(pars, source, parentId)
|
|
|
+ if adminId > 0 {
|
|
|
+ sql += ` AND sys_user_id = ?`
|
|
|
+ pars = append(pars, adminId)
|
|
|
+ }
|
|
|
+ sql += ` ORDER BY sort asc,chart_info_id ASC `
|
|
|
+ _, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// PreviewSeasonChartReq 预览季节性图的请求入参
|
|
|
+type PreviewSeasonChartReq struct {
|
|
|
+ ChartEdbInfoList []*ChartSaveItem `description:"指标及配置信息"`
|
|
|
+ SeasonExtraConfig SeasonExtraItem `description:"季节图额外配置信息,json字符串"`
|
|
|
+}
|
|
|
+
|
|
|
// EditChartInfoImageV2
|
|
|
// @Description: 修改图表的缩略图
|
|
|
// @author: Roc
|
|
@@ -2804,15 +2827,6 @@ func EditChartInfoImageV2(chartInfoId int, imageUrl string) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// 时序组合图额外配置
|
|
|
-type ChartTimeCombineExtraConf struct {
|
|
|
- IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
|
|
|
-}
|
|
|
-
|
|
|
-type ChartTimeCombineDataResp struct {
|
|
|
- IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
|
|
|
-}
|
|
|
-
|
|
|
func getThsHfEdbDataListByMongo(source, subSource, edbInfoId int, startDate, endDate string) (list []*EdbDataList, err error) {
|
|
|
list = make([]*EdbDataList, 0)
|
|
|
|
|
@@ -2881,17 +2895,3 @@ func getThsHfEdbDataListMinAndMaxByMongo(source, subSource, edbInfoId int, start
|
|
|
maxData = result.MaxValue
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
-type PreviewSectionCombineDateCalculateResp struct {
|
|
|
- Date string
|
|
|
-}
|
|
|
-
|
|
|
-type PreviewSectionCombineDateCalculateReq struct {
|
|
|
- MoveForward int `description:"前移的期数"`
|
|
|
- EdbInfoId int `description:"指标ID"`
|
|
|
- Frequency string `description:"频度"`
|
|
|
- DateConfName string `description:"引用日期名称"` // 引用日期名称不能重复
|
|
|
- DateChange []*ChartSectionDateChange
|
|
|
- DateConfList []*ChartSectionDateConfItem
|
|
|
- DateType int `description:"日期类型,0指标最新日期, 1引用日期"`
|
|
|
-}
|