meeting_probabilities.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package models
  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 MyExcelInfoList struct {
  17. ExcelInfoId int `orm:"column(excel_info_id);pk"`
  18. Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
  19. ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
  20. ExcelName string `description:"表格名称"`
  21. UniqueCode string `description:"表格唯一编码"`
  22. ExcelClassifyId int `description:"表格分类id"`
  23. SysUserId int `description:"操作人id"`
  24. SysUserRealName string `description:"操作人真实姓名"`
  25. ExcelImage string `description:"表格图片"`
  26. FileUrl string `description:"表格下载地址"`
  27. Sort int `description:"排序字段,数字越小越排前面"`
  28. ModifyTime time.Time `description:"最近修改日期"`
  29. CreateTime time.Time `description:"创建日期"`
  30. }
  31. // AddMeetingProbabilities 新增表格
  32. func AddMeetingProbabilities(meetingInfo *MeetingProbabilities) (err error) {
  33. o := orm.NewOrmUsingDB("data")
  34. // 表格信息入库
  35. lastId, err := o.Insert(meetingInfo)
  36. if err != nil {
  37. return
  38. }
  39. meetingInfo.MeetingInfoId = int(lastId)
  40. return
  41. }
  42. type ISheet struct {
  43. ScrollTop int `json:"scrollTop"`
  44. ScrollLeft int `json:"scrollLeft"`
  45. Index string `json:"index"`
  46. Status int `json:"status"`
  47. JfGirdSelectSave []struct{} `json:"jfgird_select_save"`
  48. LuckySheetSelectSave []struct{} `json:"luckysheet_select_save"`
  49. Data [][]interface{} `json:"data"`
  50. Config map[string]struct {
  51. } `json:"config"`
  52. VisibleDataRow []int `json:"visibledatarow"`
  53. VisibleDataColumn []int `json:"visibledatacolumn"`
  54. ChWidth int `json:"ch_width"`
  55. RhHeight int `json:"rh_height"`
  56. LuckySheetSelectionRange []int `json:"luckysheet_selection_range"`
  57. ZoomRatio int `json:"zoomRatio"`
  58. CellData []ISheetCellData `json:"celldata"`
  59. }
  60. type ISheetData struct {
  61. M string `json:"m"`
  62. Ct ISheetDataCt `json:"ct"`
  63. V string `json:"v"`
  64. }
  65. type ISheetDataCt struct {
  66. Fa string `json:"fa"`
  67. T string `json:"t"`
  68. }
  69. type ISheetCellData struct {
  70. R int `json:"r"`
  71. C int `json:"c"`
  72. V ISheetData `json:"v"`
  73. }
  74. type SheetData struct {
  75. Data [][]*struct {
  76. Ct struct {
  77. Fa string `json:"fa"`
  78. T string `json:"t"`
  79. } `json:"ct"`
  80. M string `json:"m"`
  81. V float64 `json:"v"`
  82. } `json:"data"`
  83. }
  84. // AddExcelInfoReq 新增表格请求
  85. type AddExcelInfoReq struct {
  86. ExcelName string `description:"表格名称"`
  87. Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
  88. ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
  89. ExcelImage string `description:"表格截图"`
  90. ExcelClassifyId int `description:"分类id"`
  91. Content string `description:"Excel表格内容"`
  92. TableData interface{} `description:"自定义表格的数据内容"`
  93. }
  94. func GetMeetingProbabilitiesMaxDate(dateTime string) (max_date time.Time, err error) {
  95. o := orm.NewOrm()
  96. sql := ` SELECT COUNT(1) FROM meeting_probabilities WHERE date_time =? `
  97. err = o.Raw(sql, dateTime).QueryRow(&max_date)
  98. return
  99. }