ziwen 1 年之前
父節點
當前提交
e1d61f0a29
共有 1 個文件被更改,包括 101 次插入0 次删除
  1. 101 0
      models/meeting_probabilities.go

+ 101 - 0
models/meeting_probabilities.go

@@ -0,0 +1,101 @@
+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:"创建日期"`
+}
+
+
+func GetMeetingProbabilities(startDate, endDate string) (list []*MeetingProbabilities, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM meeting_probabilities WHERE create_time>=? AND create_time<=? `
+	_, err = o.Raw(sql, startDate, endDate).QueryRows(&list)
+	return
+}
+
+// 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() (max_date time.Time, err error) {
+	o := orm.NewOrm()
+	sql := ` SELECT max(a.date_time)as max_date FROM meeting_probabilities as a `
+	err = o.Raw(sql).QueryRow(&max_date)
+	return
+}