chart_info.go 9.4 KB

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