123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- // MeetingProbabilities excel表格详情表
- type MeetingProbabilities struct {
- MeetingInfoId int `orm:"column(meeting_info_id);pk"`
- Content string `description:"表格内容"`
- ExcelImage string `description:"表格图片"`
- DateTime string `description:"数据日期"`
- IsDelete int `description:"是否删除,0:未删除,1:已删除"`
- ModifyTime time.Time `description:"最近修改日期"`
- CreateTime time.Time `description:"创建日期"`
- }
- type MyExcelInfoList struct {
- ExcelInfoId int `orm:"column(excel_info_id);pk"`
- Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
- ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
- ExcelName string `description:"表格名称"`
- UniqueCode string `description:"表格唯一编码"`
- ExcelClassifyId int `description:"表格分类id"`
- SysUserId int `description:"操作人id"`
- SysUserRealName string `description:"操作人真实姓名"`
- ExcelImage string `description:"表格图片"`
- FileUrl string `description:"表格下载地址"`
- Sort int `description:"排序字段,数字越小越排前面"`
- ModifyTime time.Time `description:"最近修改日期"`
- CreateTime time.Time `description:"创建日期"`
- }
- // AddMeetingProbabilities 新增表格
- func AddMeetingProbabilities(meetingInfo *MeetingProbabilities) (err error) {
- o := orm.NewOrmUsingDB("data")
- // 表格信息入库
- lastId, err := o.Insert(meetingInfo)
- if err != nil {
- return
- }
- meetingInfo.MeetingInfoId = int(lastId)
- return
- }
- type ISheet struct {
- ScrollTop int `json:"scrollTop"`
- ScrollLeft int `json:"scrollLeft"`
- Index string `json:"index"`
- Status int `json:"status"`
- JfGirdSelectSave []struct{} `json:"jfgird_select_save"`
- LuckySheetSelectSave []struct{} `json:"luckysheet_select_save"`
- Data [][]interface{} `json:"data"`
- Config map[string]struct {
- } `json:"config"`
- VisibleDataRow []int `json:"visibledatarow"`
- VisibleDataColumn []int `json:"visibledatacolumn"`
- ChWidth int `json:"ch_width"`
- RhHeight int `json:"rh_height"`
- LuckySheetSelectionRange []int `json:"luckysheet_selection_range"`
- ZoomRatio int `json:"zoomRatio"`
- CellData []ISheetCellData `json:"celldata"`
- }
- type ISheetData struct {
- M string `json:"m"`
- Ct ISheetDataCt `json:"ct"`
- V string `json:"v"`
- }
- type ISheetDataCt struct {
- Fa string `json:"fa"`
- T string `json:"t"`
- }
- type ISheetCellData struct {
- R int `json:"r"`
- C int `json:"c"`
- V ISheetData `json:"v"`
- }
- type SheetData struct {
- Data [][]*struct {
- Ct struct {
- Fa string `json:"fa"`
- T string `json:"t"`
- } `json:"ct"`
- M string `json:"m"`
- V float64 `json:"v"`
- } `json:"data"`
- }
- // AddExcelInfoReq 新增表格请求
- type AddExcelInfoReq struct {
- ExcelName string `description:"表格名称"`
- Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
- ExcelType int `description:"表格类型,1:指标列,2:日期列,默认:1"`
- ExcelImage string `description:"表格截图"`
- ExcelClassifyId int `description:"分类id"`
- Content string `description:"Excel表格内容"`
- TableData interface{} `description:"自定义表格的数据内容"`
- }
- func GetMeetingProbabilitiesMaxDate(dateTime string) (max_date time.Time, err error) {
- o := orm.NewOrm()
- sql := ` SELECT COUNT(1) FROM meeting_probabilities WHERE date_time =? `
- err = o.Raw(sql, dateTime).QueryRow(&max_date)
- return
- }
|