meeting_probabilities.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // MeetingProbabilities excel表格详情表
  7. type MeetingProbabilities struct {
  8. MeetingInfoId int `orm:"column(meeting_info_id);pk"`
  9. Content string `description:"表格内容"`
  10. ExcelImage string `description:"表格图片"`
  11. DateTime string `description:"数据日期"`
  12. IsDelete int `description:"是否删除,0:未删除,1:已删除"`
  13. ModifyTime time.Time `description:"最近修改日期"`
  14. CreateTime time.Time `description:"创建日期"`
  15. }
  16. type MeetingProbabilitiesResp struct {
  17. Ret int
  18. Msg string
  19. ErrMsg string
  20. ErrCode string
  21. Data []*MeetingProbabilities
  22. }
  23. // AddMeetingProbabilities 新增表格
  24. func AddMeetingProbabilities(meetingInfo *MeetingProbabilities) (newId int, err error) {
  25. o := orm.NewOrmUsingDB("data")
  26. // 表格信息入库
  27. lastId, err := o.Insert(meetingInfo)
  28. if err != nil {
  29. return
  30. }
  31. meetingInfo.MeetingInfoId = int(lastId)
  32. newId = int(lastId)
  33. return
  34. }
  35. func GetMeetingProbabilitiesAll(dateStr string) (list []*MeetingProbabilities, err error) {
  36. o := orm.NewOrm()
  37. sql := `SELECT * FROM meeting_probabilities WHERE date_time>=?`
  38. _, err = o.Raw(sql, dateStr).QueryRows(&list)
  39. return
  40. }
  41. type ISheet struct {
  42. ScrollTop int `json:"scrollTop"`
  43. ScrollLeft int `json:"scrollLeft"`
  44. Index string `json:"index"`
  45. Status int `json:"status"`
  46. JfGirdSelectSave []struct{} `json:"jfgird_select_save"`
  47. LuckySheetSelectSave []struct{} `json:"luckysheet_select_save"`
  48. Data [][]interface{} `json:"data"`
  49. Config map[string]struct {
  50. } `json:"config"`
  51. VisibleDataRow []int `json:"visibledatarow"`
  52. VisibleDataColumn []int `json:"visibledatacolumn"`
  53. ChWidth int `json:"ch_width"`
  54. RhHeight int `json:"rh_height"`
  55. LuckySheetSelectionRange []int `json:"luckysheet_selection_range"`
  56. ZoomRatio int `json:"zoomRatio"`
  57. CellData []ISheetCellData `json:"celldata"`
  58. }
  59. type ISheetData struct {
  60. M string `json:"m"`
  61. Ct ISheetDataCt `json:"ct"`
  62. V string `json:"v"`
  63. }
  64. type ISheetDataCt struct {
  65. Fa string `json:"fa"`
  66. T string `json:"t"`
  67. }
  68. type ISheetCellData struct {
  69. R int `json:"r"`
  70. C int `json:"c"`
  71. V ISheetData `json:"v"`
  72. }
  73. type SheetData struct {
  74. Data [][]*struct {
  75. Ct struct {
  76. Fa string `json:"fa"`
  77. T string `json:"t"`
  78. } `json:"ct"`
  79. M string `json:"m"`
  80. V float64 `json:"v"`
  81. } `json:"data"`
  82. }
  83. // AddExcelInfoReq 新增表格请求
  84. type AddExcelInfoReq struct {
  85. ExcelName string `description:"表格名称"`
  86. Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
  87. ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
  88. ExcelImage string `description:"表格截图"`
  89. ExcelClassifyId int `description:"分类id"`
  90. Content string `description:"Excel表格内容"`
  91. TableData interface{} `description:"自定义表格的数据内容"`
  92. }
  93. func GetMeetingProbabilitiesMaxDate() (max_date time.Time, err error) {
  94. o := orm.NewOrm()
  95. sql := ` SELECT max(a.date_time)as max_date FROM meeting_probabilities as a `
  96. err = o.Raw(sql).QueryRow(&max_date)
  97. return
  98. }