|
@@ -5,12 +5,13 @@ import (
|
|
|
"errors"
|
|
|
"eta/eta_index_lib/utils"
|
|
|
"fmt"
|
|
|
- "github.com/beego/beego/v2/client/orm"
|
|
|
- "github.com/shopspring/decimal"
|
|
|
- "github.com/yidane/formula"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/beego/beego/v2/client/orm"
|
|
|
+ "github.com/shopspring/decimal"
|
|
|
+ "github.com/yidane/formula"
|
|
|
)
|
|
|
|
|
|
// EdbInfoCalculateSaveReq 计算(运算)指标请求参数
|
|
@@ -682,23 +683,25 @@ type EdbInfoCalculateEdbInfoIdReq struct {
|
|
|
|
|
|
// EdbInfoCalculateBatchEditReq 编辑计算指标的请求参数
|
|
|
type EdbInfoCalculateBatchEditReq struct {
|
|
|
- EdbName string `description:"指标名称"`
|
|
|
- Frequency string `description:"频度"`
|
|
|
- Unit string `description:"单位"`
|
|
|
- ClassifyId int `description:"分类id"`
|
|
|
- Formula string `description:"N值"`
|
|
|
- EdbInfoId int `description:"编辑指标id"`
|
|
|
- FromEdbInfoId int `description:"计算来源指标id"`
|
|
|
- Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:升频"`
|
|
|
- MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
|
|
|
- MoveFrequency string `description:"移动频度:天/周/月/季/年"`
|
|
|
- EdbInfoIdArr []EdbInfoCalculateEdbInfoIdReq `description:"关联指标列表"`
|
|
|
- Calendar string `description:"公历/农历" orm:"default(公历)"`
|
|
|
- Extra string `description:"指标的额外配置"`
|
|
|
- Data interface{} `description:"数据"`
|
|
|
- EmptyType int `description:"空值处理类型(0查找前后35天,1不计算,2前值填充,3后值填充,4等于0)"`
|
|
|
- MaxEmptyType int `description:"MAX、MIN公式空值处理类型(1、等于0;2、跳过空值)"`
|
|
|
- CalculateFormula string `description:"计算公式"`
|
|
|
+ EdbName string `description:"指标名称"`
|
|
|
+ Frequency string `description:"频度"`
|
|
|
+ Unit string `description:"单位"`
|
|
|
+ ClassifyId int `description:"分类id"`
|
|
|
+ OperateUserId int `description:"操作人id"`
|
|
|
+ OperateUserRealName string `description:"操作人姓名"`
|
|
|
+ Formula string `description:"N值"`
|
|
|
+ EdbInfoId int `description:"编辑指标id"`
|
|
|
+ FromEdbInfoId int `description:"计算来源指标id"`
|
|
|
+ Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:升频"`
|
|
|
+ MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
|
|
|
+ MoveFrequency string `description:"移动频度:天/周/月/季/年"`
|
|
|
+ EdbInfoIdArr []EdbInfoCalculateEdbInfoIdReq `description:"关联指标列表"`
|
|
|
+ Calendar string `description:"公历/农历" orm:"default(公历)"`
|
|
|
+ Extra string `description:"指标的额外配置"`
|
|
|
+ Data interface{} `description:"数据"`
|
|
|
+ EmptyType int `description:"空值处理类型(0查找前后35天,1不计算,2前值填充,3后值填充,4等于0)"`
|
|
|
+ MaxEmptyType int `description:"MAX、MIN公式空值处理类型(1、等于0;2、跳过空值)"`
|
|
|
+ CalculateFormula string `description:"计算公式"`
|
|
|
}
|
|
|
|
|
|
// CheckFormula2 校验公式是否正常(比如说除法的分母不能为0之类的,实际上就是用预设的字段数据做一次计算)
|