123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- package models
- import (
- "time"
- )
- type ChartRangeAnalysisExtraConf struct {
- EdbInfoMode int `description:"指标模式 0: 单指标,1: 多指标"`
- DateRangeType int `description:"区间划分类型 0:智能划分,1:手工划分,2:跨年划分"`
- AutoDateConf ChartRangeAnalysisAutoDateConf `description:"智能划分时间区间配置"`
- ManualDateConf []ChartRangeAnalysisManualDateConf `description:"手工划分时间区间配置"`
- YearDateConf ChartRangeAnalysisYearDateConf `description:"跨年划分时间区间配置"`
- CalculateType int `description:"计算类型 0: 区间均值,1: 区间累计值,2:区间涨幅,3:区间年化增长率,4:区间最大值,5:区间最小值"`
- UnNormalDataDealType int `description:"异常值处理配置 0:不处理,1:剔除,2替换"`
- UnNormalDataConf ChartRangeAnalysisDeleteDataConf
- DataConvertType int `description:"数据转换类型 0不转, 1乘 2除 3对数"`
- DataConvertConf ChartRangeAnalysisDataConvertConf `description:"数据转换详情"`
- SeriesName string `description:"指标系列名称"`
- EdbInfoType int `description:"指标类型:0普通指标,1预测指标"`
- MultipleGraphConfigId int `description:"配置ID"`
- }
- type ChartRangeAnalysisAutoDateChangeConf struct {
- BaseDateType int `description:"基准日期类型:0指标日期,1系统日期"`
- MoveForward int `description:"前移的期数"`
- DateChange []*EdbDataDateChangeConf
- }
- type EdbDataDateChangeConf struct {
- Year int
- Month int
- Day int
- Frequency string `description:"频度变换"`
- FrequencyDay string `description:"频度的固定日期"`
- ChangeType int `description:"日期变换类型1日期位移,2指定频率"`
- }
- type ChartRangeAnalysisDeleteDataConf struct {
- Formula string `description:"比较符号:=、>、<、>=、<="`
- Value float64 `description:"比较的值"`
- ReplaceValue float64 `description:"替换的值"`
- }
- type ChartRangeAnalysisDataConvertConf struct {
- Value float64 `description:"数据转换值"`
- Unit string `description:"数据转换单位"`
- EnUnit string `description:"数据转换单位"`
- }
- type ChartRangeAnalysisManualDateConf struct { //手工划分
- StartDate string `description:"开始日期"`
- EndDate string `description:"结束日期"`
- }
- type ChartRangeAnalysisAutoDateConf struct { //智能划分
- IsAutoStartDate int `description:"起始日期是否是动态设置:0固定,1动态"`
- StartDate string `description:"固定模式下的起始日期"`
- EndDate string `description:"固定模式下的截止日期"`
- IsAutoEndDate int `description:"截止日期是否是动态设置:0固定,1动态"`
- StartDateConf ChartRangeAnalysisAutoDateChangeConf `description:"动态起始日期配置"`
- EndDateConf ChartRangeAnalysisAutoDateChangeConf `description:"动态截止日期配置"`
- }
- type ChartRangeAnalysisYearDateConf struct {
- StartDay string `description:"开始日"`
- EndDay string `description:"结束日"`
- }
- type ChartRangeAnalysisManualDateConfList []ChartRangeAnalysisManualDateConf
- func (a ChartRangeAnalysisManualDateConfList) Len() int { return len(a) }
- func (a ChartRangeAnalysisManualDateConfList) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
- func (a ChartRangeAnalysisManualDateConfList) Less(i, j int) bool {
- return a[i].StartDate < a[j].StartDate
- }
- type ChartRangeAnalysisDataResp struct { //图表详情返回值
- *ChartRangeAnalysisExtraConf
- SeriesId int `description:"指标系列ID"`
- ConfigEdbNum int `description:"生成的指标数"`
- }
- type ChartRangeAnalysisDateDataItem struct {
- StartDate time.Time
- EndDate time.Time
- DataList []*EdbDataList
- }
- // ChartRangeAnalysisConfigEdbResp 指标列表
- type ChartRangeAnalysisConfigEdbResp struct {
- EdbInfoList []*ChartRangeAnalysisConfigEdbItem `description:"指标列表"`
- }
- type ChartRangeAnalysisConfigEdbItem struct {
- EdbInfoId int `description:"指标id"`
- EdbName string `description:"指标名称"`
- EdbNameEn string `description:"指标名称"`
- Frequency string `description:"频度"`
- Unit string `description:"单位"`
- UnitEn string `description:"单位"`
- ClassifyId int `description:"分类id"`
- FromEdbInfoId int `description:"计算来源指标id"`
- EdbTypeInfo int `description:"指标类型,0普通指标,1预测指标"`
- }
- type SortEdbDataList []*EdbDataList
- func (m SortEdbDataList) Len() int {
- return len(m)
- }
- func (m SortEdbDataList) Less(i, j int) bool {
- return m[i].DataTime > m[j].DataTime
- }
- func (m SortEdbDataList) Swap(i, j int) {
- m[i], m[j] = m[j], m[i]
- }
|