123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- package ficc_report
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type ReportDetail struct {
- ReportInfo *ReportItem `json:"report_info"`
- ReportChapterList []*ReportChapterListItem `json:"report_chapter_list"`
- AuthOk bool `json:"auth_ok"`
- LikeNum int64 `description:"点赞总数" json:"like_num"`
- LikeEnabled int8 `description:"是否已点赞: 0-未点赞 1-已点赞" json:"like_enabled"`
- ReportShowType int `description:"展示形式:1-列表 2-专栏" json:"report_show_type"`
- CollectionId int `description:"收藏ID: 大于0则表示已收藏" json:"collection_id"`
- RoadVideoId int `json:"road_video_id" description:"绑定的路演视频ID"`
- ReportDetailShowType int `description:"报告详情的展示类型:1-拼接;2:目录" json:"report_detail_show_type"`
- HasPermission int `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
- Mobile string `description:"用户手机号"`
- SellerMobile string `description:"销售电话"`
- SellerName string `description:"销售姓名"`
- }
- type ReportChapterListItem struct {
- ReportChapterId int `json:"report_chapter_id"`
- ReportId int `json:"report_id"`
- Title string `json:"title"`
- TypeId int `json:"type_id"`
- TypeName string `json:"type_name"`
- Trend string `json:"trend"`
- ReportChapterTypeKey string `json:"report_chapter_type_key"`
- ReportChapterTypeThumb string `json:"report_chapter_type_thumb"`
- ReportChapterTypeName string `json:"report_chapter_type_name"`
- Sort int `json:"sort"`
- PublishTime time.Time `json:"publish_time"`
- IsClose int `gorm:"column:is_close;type:tinyint(1);default:0" json:"is_close"` //音频品种是否关闭
- Content string `description:"内容" json:"content"`
- VideoUrl string `json:"video_url" description:"音频文件URL"`
- VideoName string `json:"video_name" description:"音频文件名称"`
- VideoPlaySeconds string `json:"video_play_seconds" description:"音频播放时长"`
- VideoSize string `json:"video_size" description:"音频文件大小,单位M"`
- }
- type ReportItem struct {
- ReportId int `json:"report_id"`
- ClassifyNameFirst string `description:"一级分类名称" json:"classify_name_first"`
- ClassifyNameSecond string `description:"二级分类名称" json:"classify_name_second"`
- Title string `description:"标题" json:"title"`
- Abstract string `description:"摘要" json:"abstract"`
- Author string `description:"作者" json:"author"`
- Frequency string `description:"频度" json:"frequency"`
- PublishTime time.Time `description:"发布时间" json:"publish_time"`
- Stage int `description:"期数" json:"stage"`
- Content string `description:"内容" json:"content"`
- VideoUrl string `description:"音频文件URL" json:"video_url"`
- VideoName string `description:"音频文件名称" json:"video_name"`
- VideoSize string `description:"音频文件大小,单位M" json:"video_size"`
- VideoPlaySeconds string `description:"音频播放时长" json:"video_play_seconds"`
- VideoImg string `description:"音频播放条的图片" json:"video_img"`
- ContentSub string `description:"内容前两个章节" json:"content_sub"`
- BannerUrl string `description:"详情页banner" json:"banner_url"`
- ShareBgImg string `description:"分享背景图" json:"share_bg_img"`
- HasChapter int `description:"是否有章节" json:"has_chapter"`
- ReportLayout int8 `description:"报告布局,1:常规布局,2:智能布局。默认:1" json:"report_layout"`
- HeadImg string `description:"报告头图地址" json:"head_img"`
- EndImg string `description:"报告尾图地址" json:"end_img"`
- CanvasColor string `description:"画布颜色" json:"canvas_color"`
- HeadStyle string `description:"版头样式" json:"head_style"`
- EndStyle string `description:"版尾样式" json:"end_style"`
- ArticleId int `description:"文章ID"`
- Disclaimer string `description:"免责声明" json:"disclaimer"`
- }
- type Report struct {
- Id int `orm:"column(id)" description:"报告Id"`
- AddType int `json:"-" description:"新增方式:1:新增报告,2:继承报告"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- State int `description:"状态:1-未提交 2-待审核 3-驳回 4-审核"`
- Stage int `description:"期数"`
- MsgIsSend int `json:"-" description:"消息是否已发送,0:否,1:是"`
- ThsMsgIsSend int `json:"-" description:"客户群消息是否已发送,0:否,1:是"`
- Content string `description:"内容"`
- VideoUrl string `description:"音频文件URL"`
- VideoName string `description:"音频文件名称"`
- VideoPlaySeconds string `description:"音频播放时长"`
- VideoSize string `description:"音频文件大小,单位M"`
- ContentSub string `json:"-" description:"内容前两个章节"`
- ReportCode string `description:"报告唯一编码"`
- ReportVersion int `json:"-" description:"1:旧版,2:新版"`
- HasChapter int `json:"-" description:"是否有章节 0-否 1-是"`
- ChapterType string `json:"-" description:"章节类型 day-晨报 week-周报"`
- OldReportId int `json:"-" description:"research_report表ID, 大于0则表示该报告为老后台同步过来的"`
- MsgSendTime time.Time `json:"-" description:"模版消息发送时间"`
- AdminId int `description:"创建者账号"`
- AdminRealName string `description:"创建者姓名"`
- ApproveTime time.Time `description:"审批时间"`
- PublishTime time.Time `description:"发布时间"`
- CreateTime time.Time `description:"创建时间"`
- ModifyTime time.Time `description:"修改时间"`
- // eta1.8.3(研报改版)相关内容
- ContentStruct string `description:"内容组件"`
- LastModifyAdminId int `description:"最后更新人ID"`
- LastModifyAdminName string `description:"最后更新人姓名"`
- ContentModifyTime time.Time `description:"内容更新时间"`
- Pv int `description:"pv"`
- Uv int `description:"uv"`
- HeadImg string `description:"报告头图地址"`
- EndImg string `description:"报告尾图地址"`
- HeadStyle string `description:"版头样式"`
- EndStyle string `description:"版尾样式"`
- CanvasColor string `description:"画布颜色"`
- NeedSplice int `description:"是否拼接版头版位的标记,主要是为了兼容历史报告。0-不需要 1-需要"`
- HeadResourceId int `description:"版头资源ID"`
- EndResourceId int `description:"版尾资源ID"`
- ClassifyIdThird int `description:"三级分类id"`
- ClassifyNameThird string `description:"三级分类名称"`
- CollaborateType int8 `description:"协作方式,1:个人,2:多人协作。默认:1"`
- ReportLayout int8 `description:"报告布局,1:常规布局,2:智能布局。默认:1"`
- IsPublicPublish int8 `description:"是否公开发布,1:是,2:否"`
- ReportCreateTime time.Time `description:"报告时间创建时间"`
- }
- func GetByReportId(reportId int) (item *Report, err error) {
- o := orm.NewOrmUsingDB("rddp")
- sql := `SELECT * FROM report WHERE id =?`
- err = o.Raw(sql, reportId).QueryRow(&item)
- return
- }
- func GetFiccRreportToCygxArticle(condition string, pars []interface{}) (items []*Report, err error) {
- o := orm.NewOrmUsingDB("rddp")
- sql := ` SELECT * FROM report WHERE state = 2 AND is_public_publish = 1
- AND classify_name_first IN ('宏观报告','晨会纪要','调研纪要','数据点评','从宏观看商品')
- AND classify_name_second IN ('大类资产周报','晨会纪要','黑色调研','宏观G2观察','人民币汇率双周报','房地产市场跟踪','黄金月报','铜行业数据点评','原油基本面推演','原油船期数据跟踪','EIA原油库存点评','从宏观看商品','铜行业跟踪')
- AND IF ( classify_name_first = '宏观报告' , classify_name_second IN ('大类资产周报','宏观G2观察','人民币汇率双周报','房地产市场跟踪','黄金月报') ,1=1 )
- AND IF ( classify_name_first = '晨会纪要' , classify_name_second = '晨会纪要' ,1=1 )
- AND IF ( classify_name_first = '调研纪要' , classify_name_second = '黑色调研' ,1=1 )
- AND IF ( classify_name_first = '从宏观看商品' , classify_name_second = '从宏观看商品' ,1=1 )
- AND IF ( classify_name_first = '数据点评' , classify_name_second IN ('铜行业数据点评','原油基本面推演','原油船期数据跟踪','EIA原油库存点评','铜行业跟踪') ,1=1 ) ` + condition + ` ORDER BY modify_time DESC `
- _, err = o.Raw(sql, pars).QueryRows(&items)
- return
- }
- type GetReporteSetResp struct {
- ClassifyNameFirst string `description:"一级分类名称" `
- ClassifyNameSecond string `description:"二级分类名称"`
- TagName string `description:"自定义标签筛选"`
- }
- // 获取同步规则种类
- type GetReporteSetListResp struct {
- List []*GetReporteSetResp
- }
|