chart_info.go 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. package chart_info
  2. import (
  3. "hongze/hongze_yb/models/request"
  4. responseModel "hongze/hongze_yb/models/response"
  5. "hongze/hongze_yb/models/tables/chart_edb_mapping"
  6. "hongze/hongze_yb/models/tables/chart_info"
  7. "time"
  8. )
  9. type ChartInfoDetailResp struct {
  10. ChartInfo *chart_info.ChartInfoView
  11. EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingList
  12. XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
  13. XDataList []XData `description:"商品价格曲线的X轴数据"`
  14. YDataList []YData `description:"柱方图的y轴数据"`
  15. MyChartInfo *responseModel.MyChartItem
  16. CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
  17. DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
  18. }
  19. type ChartLibChartInfoDetailResp struct {
  20. ChartInfo *chart_info.ChartInfoView
  21. EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingTimeString
  22. XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
  23. XDataList []XData `description:"商品价格曲线的X轴数据"`
  24. YDataList []YData `description:"柱方图的y轴数据"`
  25. CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
  26. DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
  27. WaterMark string `description:"水印"`
  28. }
  29. // XData 商品价格曲线的的x轴数据
  30. type XData struct {
  31. Name string `description:"别名"`
  32. NameEn string `description:"英文别名"`
  33. IsHide int `description:"是否隐藏,0不隐藏,1隐藏"`
  34. }
  35. // YData 柱方图的y轴数据
  36. type YData struct {
  37. Date string `description:"数据日期"`
  38. ConfigDate time.Time `description:"配置的日期" json:"-"`
  39. Color string `description:"数据颜色"`
  40. Name string `description:"别名"`
  41. NameEn string `description:"英文别名"`
  42. Value []float64 `description:"每个指标的值"`
  43. NoDataEdbList []int `description:"没有数据的指标列表"`
  44. XEdbInfoIdList []int `description:"对应X轴的指标id列表"`
  45. EdbValMap map[int]float64 `description:"指标与值的对应" json:"-"`
  46. M []int `description:"对应开始日期的间隔值" json:"-"`
  47. NameList []string `description:"每个值对应的名称"`
  48. EnNameList []string `description:"每个值对应的英文名称"`
  49. SeriesEdb struct {
  50. SeriesId int `description:"因子指标系列ID"`
  51. EdbInfoId int `description:"指标ID"`
  52. } `description:"对应的系列指标"`
  53. }
  54. type CorrelationInfo struct {
  55. LeadValue int `description:"领先值"`
  56. LeadUnit string `description:"领先单位"`
  57. StartDate string `description:"开始日期"`
  58. EndDate string `description:"结束日期"`
  59. EdbInfoIdFirst int `description:"A指标ID"`
  60. EdbInfoIdSecond int `description:"B指标ID"`
  61. PeriodData string `description:"X轴-期数数据"`
  62. CorrelationData string `description:"Y轴-相关性系数"`
  63. AnalysisMode int `description:"分析模式: 0-单因子; 1-多因子"`
  64. }
  65. // RollingCorrelationChartDataResp 滚动相关性图
  66. type RollingCorrelationChartDataResp struct {
  67. XDateTimeValue []string `description:"滚动相关性图的x轴数据,日期数据"`
  68. YDataList []YData `description:"滚动相关性图的y轴数据"`
  69. }
  70. // ProfitFutureGoodChartResp 商品利润图
  71. type ProfitFutureGoodChartResp struct {
  72. XDataList []XData
  73. YDataList []YData
  74. ProfitName string `description:"利润的名称"`
  75. ProfitNameEn string `description:"利润的英文名称"`
  76. Extra request.ChartInfoReq `description:"柱方图的配置"`
  77. }
  78. // RadarChartInfoResp 雷达图数据
  79. type RadarChartInfoResp struct {
  80. YDataList []RadarYData `description:"数据列"`
  81. XEdbIdValue []int
  82. }
  83. // RadarYData 雷达图的y轴数据
  84. type RadarYData struct {
  85. Date string `description:"数据日期"`
  86. Color string `description:"数据颜色"`
  87. Name string `description:"别名"`
  88. Value []float64 `description:"每个指标的值"`
  89. }
  90. // 截面组合图额外配置
  91. type ChartSectionExtraConf struct {
  92. DateConfList []*ChartSectionDateConfItem
  93. IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
  94. XDataList []XData `description:"横轴名称设置"`
  95. UnitList *ChartSectionCombineUnit `description:"纵轴单位设置"`
  96. BaseChartSeriesName string `description:"基准系列名称"`
  97. SortType int `description:"排序类型,0默认,1升序,2降序"`
  98. }
  99. // 截面组合图额外配置
  100. type ChartSectionAllExtraConf struct {
  101. ChartSectionExtraConf
  102. SeriesList []*ChartSectionSeriesItem
  103. }
  104. type ChartSectionDateConfItem struct {
  105. MoveForward int `description:"前移的期数"`
  106. EdbInfoId int `description:"指标ID"`
  107. EdbName string `description:"指标名称"`
  108. EdbNameEn string `description:"指标名称英文"`
  109. EdbInfoType int `description:"指标类型"`
  110. Frequency string `description:"频度"`
  111. EndDate string `description:"最新日期"`
  112. StaticDate string `description:"固定日期"`
  113. DateType int `description:"日期类型:0 指标日期,1系统日期, 2固定日期"`
  114. DateConfName string `description:"引用日期名称"` // 引用日期名称不能重复
  115. DateConfNameEn string `description:"引用日期英文名称"`
  116. DateChange []*ChartSectionDateChange
  117. }
  118. // 截面组合图引用日期配置
  119. type ChartSectionDateChange struct {
  120. Year int
  121. Month int
  122. Day int
  123. Frequency string `description:"频度变换"`
  124. FrequencyDay string `description:"频度的固定日期"`
  125. ChangeType int `description:"日期变换类型1日期位移,2指定频率"`
  126. }
  127. // 截面组合图系列配置
  128. type ChartSectionSeriesItem struct {
  129. ChartSeriesId int `description:"系列ID"`
  130. SeriesName string `description:"系列名称"` //系列名称不可同名
  131. SeriesNameEn string `description:"系列英文名称"`
  132. ChartStyle string `description:"图表类型"`
  133. ChartColor string `description:"颜色"`
  134. ChartWidth int `description:"线条大小"`
  135. IsPoint int `description:"是否用数据点展示(0 否,1是)"`
  136. IsNumber int `description:"是否用数值展示(0 否,1是)"`
  137. IsAxis int `description:"1:左轴,0:右轴"`
  138. MaxData float64 `description:"上限"`
  139. MinData float64 `description:"下限"`
  140. //IsOrder bool `description:"true:正序,false:逆序"`
  141. EdbInfoList []*ChartSectionSeriesEdbConf
  142. DataList []float64
  143. NoDataEdbIndex []int
  144. }
  145. type ChartSectionSeriesEdbConf struct {
  146. ChartSeriesEdbMappingId int `description:"映射ID"`
  147. ChartSeriesId int `description:"系列ID"`
  148. //ChartInfoId int `description:"图表ID"`
  149. EdbInfoId int `description:"指标id"`
  150. DateConf *ChartSectionSeriesDateConfItem
  151. EdbName string `description:"中文别名"`
  152. EdbNameEn string `description:"英文别名"`
  153. EdbInfoType int `description:"指标类型"`
  154. Unit string `description:"单位"`
  155. UnitEn string `description:"英文单位"`
  156. DateConfName string `description:"引用日期名称"`
  157. DateConfType int `description:"日期类型,0指标最新日期, 1引用日期"`
  158. }
  159. // 系列里的指标日期配置
  160. type ChartSectionSeriesDateConfItem struct {
  161. MoveForward int `description:"前移的期数"`
  162. DateChange []*ChartSectionDateChange
  163. }
  164. // PreviewSectionCombineChartReq 预览截面组合图的请求
  165. type PreviewSectionCombineChartReq struct {
  166. ChartName string `description:"图表名称"`
  167. ChartClassifyId int `description:"分类id"`
  168. ExtraConfig string `description:"图表额外配置信息,json字符串"`
  169. }
  170. type ChartSectionCombineUnit struct {
  171. LeftName string `description:"左轴单位"`
  172. LeftNameEn string `description:"左轴英文单位"`
  173. RightName string `description:"右轴单位"`
  174. RightNameEn string `description:"右轴英文单位"`
  175. RightTwoName string `description:"右2轴单位"`
  176. RightTwoNameEn string `description:"右2轴英文单位"`
  177. }
  178. type ChartSectionCombineDataResp struct {
  179. DateConfList []*ChartSectionDateConfItem
  180. IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
  181. XDataList []XData `description:"横轴名称设置"`
  182. UnitList *ChartSectionCombineUnit `description:"纵轴单位设置"`
  183. BaseChartSeriesName string `description:"基准系列名称"`
  184. SortType int `description:"排序类型,0默认,1升序,2降序"`
  185. SeriesList []*ChartSectionSeriesItem
  186. LeftMin string `description:"图表左侧最小值"`
  187. LeftMax string `description:"图表左侧最大值"`
  188. RightMin string `description:"图表右侧最小值"`
  189. RightMax string `description:"图表右侧最大值"`
  190. Right2Min string `description:"图表右侧最小值"`
  191. Right2Max string `description:"图表右侧最大值"`
  192. }
  193. // 时序组合图额外配置
  194. type ChartTimeCombineExtraConf struct {
  195. IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
  196. }
  197. type ChartTimeCombineDataResp struct {
  198. IsHeap int `description:"是否堆积(1.堆积,0不堆积)"`
  199. }