123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- package request
- import "encoding/json"
- // MoveExcelInfoReq 移动excel表格请求
- type MoveExcelInfoReq struct {
- ExcelClassifyId int `description:"excel表格分类id"`
- ExcelInfoId int `description:"excel表格ID"`
- PrevExcelInfoId int `description:"上一个excel表格ID"`
- NextExcelInfoId int `description:"下一个excel表格ID"`
- }
- // DeleteExcelInfoReq 删除表格请求
- type DeleteExcelInfoReq struct {
- ExcelInfoId int `description:"表格ID"`
- }
- // AddExcelInfoReq 新增表格请求
- type AddExcelInfoReq struct {
- ExcelInfoId int `description:"表格ID"`
- ExcelName string `description:"表格名称"`
- Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,5平衡表,默认:1"`
- ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
- ExcelImage string `description:"表格截图"`
- ExcelClassifyId int `description:"分类id"`
- Content string `description:"Excel表格内容"`
- TableData interface{} `description:"自定义表格的数据内容"`
- ParentId int `description:"表格的父级id"`
- SourcesFrom string `description:"图表来源"`
- }
- // EditExcelInfoReq 编辑表格请求
- type EditExcelInfoReq struct {
- ExcelInfoId int `description:"ETA表格ID"`
- ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
- ExcelName string `description:"表格名称"`
- ExcelImage string `description:"表格截图"`
- ExcelClassifyId int `description:"分类id"`
- Content string `description:"Excel表格内容"`
- TableData interface{} `description:"自定义表格的数据内容"`
- SourcesFrom string `description:"图表来源"`
- }
- // SetExcelInfoImageReq 设置excel表格图片请求
- type SetExcelInfoImageReq struct {
- ExcelInfoId int `description:"表格ID"`
- ImageUrl string `description:"表格图片地址"`
- }
- // AddExcelDraftReq 新增表格草稿请求
- type AddExcelDraftReq struct {
- ExcelInfoId int `description:"ETA表格ID"`
- ExcelName string `description:"表格名称"`
- ExcelClassifyId int `description:"分类id"`
- Content string `description:"Excel表格内容"`
- }
- // CalculateReq 公式计算
- type CalculateReq struct {
- CalculateFormula string `description:"计算公式"`
- TagMap map[string]float64 `description:"标签与值的关系"`
- }
- // GetOtherEdbDateDataReq 获取其他指标的指定日期的数据
- type GetOtherEdbDateDataReq struct {
- EdbInfoId int `description:"指标id"`
- SortType string `description:"如何排序,是正序还是倒序,枚举值:asc 正序,desc 倒序,不传默认倒序"`
- DateList []string `description:"日期列表,从小到大"`
- DateDecimal map[string]int `description:"日期行的小数位数映射"`
- }
- type GetBatchEdbDateDataReq struct {
- EdbInfoId []int `description:"指标id"`
- Num int `description:"默认期数"`
- Decimal []int `description:"指标上的小数位数"`
- SortType string `description:"如何排序,是正序还是倒序,枚举值:asc 正序,desc 倒序,不传默认倒序"`
- DateList []string `description:"日期列表,从小到大"`
- }
- // GetFutureDateDataReq 获取未来日期的数据
- type GetFutureDateDataReq struct {
- EdbInfoIdList []int `description:"指标id列表,从左至右,从上到下的顺序"`
- DateType int `description:"日期类型,1:期数,2:截止日期"`
- Num int `description:"需要添加的期数"`
- Decimal []int `description:"小数位数, 从左至右,从上到下的顺序"`
- StartDate string `description:"开始日期"`
- EndDate string `description:"结束日期"`
- }
- // GetHistoryDateDataReq 获取历史日期的数据
- type GetHistoryDateDataReq struct {
- EdbInfoIdList []int `description:"指标id列表,从左至右,从上到下的顺序"`
- Num int `description:"需要添加的期数"`
- Decimal []int `description:"小数位数, 从左至右,从上到下的顺序"`
- EndDate string `description:"结束日期"`
- }
- // TableSaveReq 表格保存
- type TableSaveReq struct {
- ExcelName string `description:"表格名称"`
- ExcelImage string `description:"表格截图"`
- ExcelClassifyId int `description:"分类id"`
- TableData interface{} `description:"表格数据"`
- }
- // TableDataReq 自定义表格请求参数
- type TableDataReq struct {
- EdbInfoIdList []int `description:"指标id列表,从左至右,从上到下的顺序"`
- Sort int `description:"日期排序,1:倒序,2:正序"`
- Data []EdbInfoData `description:"数据列表"`
- TextRowData [][]ManualDataReq `description:"文本列表"`
- DecimalConfig []DecimalConfig `description:"小数位数配置"`
- DateSize interface{} `description:"日期列的大小"`
- }
- type DecimalConfig struct {
- Row string `description:"行上的索引, 目前仅保存指标的日期"`
- Col int `description:"列上的索引, 目前仅保存edbInfoId"`
- Decimal int `description:"小数位数, 从左至右,从上到下的顺序"`
- }
- // EdbInfoData 自定义表格的数据
- type EdbInfoData struct {
- EdbInfoId int `description:"指标ID"`
- Tag string `description:"标签"`
- EdbName string `description:"指标名称"`
- EdbNameEn string `description:"英文指标名称"`
- EdbAliasName string `description:"指标别名"`
- Frequency string `description:"频度"`
- Unit string `description:"单位"`
- UnitEn string `description:"英文单位"`
- Decimal int `description:"小数位数"`
- ClassifyId int `description:"所属分类" json:"-"`
- IsJoinPermission int `description:"是否加入权限管控,0:不加入;1:加入;默认:0" json:"-"`
- HaveOperaAuth bool `description:"是否有数据权限,默认:false"`
- Data []ManualDataReq `description:"单元格数据列表"`
- }
- type EdbInfoDataTemp struct {
- EdbInfoId int `description:"指标ID"`
- Tag string `description:"标签"`
- EdbName string `description:"指标名称"`
- EdbNameEn string `description:"英文指标名称"`
- EdbAliasName string `description:"指标别名"`
- Frequency string `description:"频度"`
- Unit string `description:"单位"`
- UnitEn string `description:"英文单位"`
- Decimal *int `description:"小数位数"`
- ClassifyId int `description:"所属分类" json:"-"`
- IsJoinPermission int `description:"是否加入权限管控,0:不加入;1:加入;默认:0" json:"-"`
- HaveOperaAuth bool `description:"是否有数据权限,默认:false"`
- Data []ManualDataReq `description:"单元格数据列表"`
- }
- func (e *EdbInfoData) UnmarshalJSON(data []byte) error {
- var alias EdbInfoDataTemp
- if err := json.Unmarshal(data, &alias); err != nil {
- return err
- }
- if alias.Decimal != nil {
- e.Decimal = *alias.Decimal
- } else {
- e.Decimal = -1
- }
- e.EdbInfoId = alias.EdbInfoId
- e.Tag = alias.Tag
- e.EdbName = alias.EdbName
- e.EdbNameEn = alias.EdbNameEn
- e.EdbAliasName = alias.EdbAliasName
- e.Frequency = alias.Frequency
- e.Unit = alias.Unit
- e.UnitEn = alias.UnitEn
- e.ClassifyId = alias.ClassifyId
- e.IsJoinPermission = alias.IsJoinPermission
- e.HaveOperaAuth = alias.HaveOperaAuth
- e.Data = alias.Data
- return nil
- }
- // ManualDataReq 自定义表格的单元格数据
- type ManualDataReq struct {
- DataType int `description:"数据类型,1:普通的,2:插值法,3:手动输入,4:公式计算,5:预测值"`
- DataTime string `description:"所属日期"`
- DataTimeType int `description:"日期类型,1:实际日期;2:未来日期"`
- ShowValue string `description:"展示值"`
- Value string `description:"实际值(计算公式)"`
- Decimal int `description:"小数位数"`
- RelationEdbInfoList []RelationEdbInfo `description:"关联指标(计算公式中关联的指标,用于计算的时候去匹配)"`
- }
- type ManualDataTemp struct {
- DataType int `description:"数据类型,1:普通的,2:插值法,3:手动输入,4:公式计算,5:预测值"`
- DataTime string `description:"所属日期"`
- DataTimeType int `description:"日期类型,1:实际日期;2:未来日期"`
- ShowValue string `description:"展示值"`
- Value string `description:"实际值(计算公式)"`
- Decimal *int `description:"小数位数"`
- RelationEdbInfoList []RelationEdbInfo `description:"关联指标(计算公式中关联的指标,用于计算的时候去匹配)"`
- }
- func (m *ManualDataReq) UnmarshalJSON(data []byte) error {
- var alias ManualDataTemp
- if err := json.Unmarshal(data, &alias); err != nil {
- return err
- }
- if alias.Decimal != nil {
- m.Decimal = *alias.Decimal
- } else {
- m.Decimal = -1
- }
- m.DataType = alias.DataType
- m.DataTime = alias.DataTime
- m.DataTimeType = alias.DataTimeType
- m.ShowValue = alias.ShowValue
- m.Value = alias.Value
- m.RelationEdbInfoList = alias.RelationEdbInfoList
- return nil
- }
- // RelationEdbInfo 自定义表格中单元格的关联指标
- type RelationEdbInfo struct {
- Tag string `description:"指标标签"`
- Row string `description:"第几行"`
- }
- // CopyExcelInfoReq 复制表格请求
- type CopyExcelInfoReq struct {
- ExcelInfoId int `description:"ETA表格ID"`
- ExcelName string `description:"表格名称"`
- ExcelClassifyId int `description:"分类id"`
- }
- // MarkEditExcel 标记编辑表格的请求数据
- type MarkEditExcel struct {
- ExcelInfoId int `description:"表格id"`
- Status int `description:"标记状态,1:编辑中,2:编辑完成"`
- }
- // RenameExcelInfoReq 表格重命名请求
- type RenameExcelInfoReq struct {
- ExcelInfoId int `description:"ETA表格ID"`
- ExcelName string `description:"表格名称"`
- }
- type SaveExcelInfoWorkerReq struct {
- ExcelInfoId int `description:"ETA表格ID"`
- SysUserIds string `description:"协作人ID 用英文逗号拼接"`
- }
- // ShareExcelInfoReq 分享表格请求
- type ShareExcelInfoReq struct {
- ExcelInfoId int `description:"表格ID"`
- ViewUserIds []int `description:"查看权限用户IDs"`
- EditUserIds []int `description:"编辑权限用户IDs"`
- }
- type ExcelRuleMappingReq struct {
- ExcelRuleMappingId int `description:"规则映射ID"`
- ExcelInfoId int `description:"ETA表格ID"`
- RuleType int `description:"规则类型:1-大于,2-小于,3-介于,4-等于,5-发生日期"`
- LeftValue string `description:"条件值"`
- LeftValueType int `description:"条件值的类型,1:数值,2:坐标"`
- RightValue string `description:"条件值, 用于介于的条件"`
- RightValueType int `description:"条件值的类型,1:数值,2:坐标"`
- FontColor string `description:"字体颜色"`
- BackgroundColor string `description:"背景颜色"`
- Remark string `description:"预设的单元格样式名称"`
- Scope string `description:"应用选区"`
- }
- type DeleteExcelRuleMappingReq struct {
- ExcelRuleMappingId int `description:"规则映射ID"`
- }
|