Browse Source

no message

xingzai 1 năm trước cách đây
mục cha
commit
e3a8c85985
5 tập tin đã thay đổi với 73 bổ sung106 xóa
  1. 19 2
      controllers/tag.go
  2. 17 13
      models/cygx_tag.go
  3. 14 0
      models/report_selection.go
  4. 1 0
      models/resource_data.go
  5. 22 91
      services/resource_data.go

+ 19 - 2
controllers/tag.go

@@ -10,7 +10,6 @@ type TagController struct {
 	BaseAuthController
 }
 
-
 // @Title 获取标签列表-自定义顺序
 // @Description 获取标签列表-自定义顺序接口
 // @Success 200 {object} cygx.ChartPermissionResp
@@ -55,6 +54,24 @@ func (this *TagController) TagCustomizeList() {
 		br.ErrMsg = "获取标签信息失败,Err:" + err.Error()
 		return
 	}
+	for _, v := range list {
+		if v.ArticleTypes != "" {
+			v.Atag = true
+			v.CheckList = append(v.CheckList, "A")
+		}
+		if v.ActivityTypes != "" {
+			v.Btag = true
+			v.CheckList = append(v.CheckList, "B")
+		}
+		if v.Industries != "" {
+			v.Ctag = true
+			v.CheckList = append(v.CheckList, "C")
+		}
+		if v.SubjectNames != "" {
+			v.Dtag = true
+			v.CheckList = append(v.CheckList, "D")
+		}
+	}
 	resp.List = list
 	br.Ret = 200
 	br.Success = true
@@ -97,4 +114,4 @@ func (this *TagController) History() {
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "记录成功"
-}
+}

+ 17 - 13
models/cygx_tag.go

@@ -34,21 +34,25 @@ func (m *CygxTag) Update(cols []string) (err error) {
 }
 
 type CygxTagList struct {
-	TagId         int64  `orm:"column(tag_id);pk"`
-	TagName       string `orm:"column(tag_name);NOT NULL"`       // 标签名
-	ArticleTypes  string `orm:"column(article_types);NOT NULL"`  // 报告系列
-	ActivityTypes string `orm:"column(activity_types);NOT NULL"` // 活动类型
-	Industries    string `orm:"column(industries);NOT NULL"`     // 产业
-	SubjectNames  string `orm:"column(subject_names);NOT NULL"`  // 标的
-	Sort          int    `orm:"column(sort);"`                   // 优先级
-	ModifyTime    string `orm:"column(modify_time)"`             // 修改时间
-	CreateTime    string `orm:"column(create_time)"`             // 创建时间
-	OnlineTime    string `orm:"column(online_time)"`             // 上线时间
-	OfflineTime   string `orm:"column(offline_time)"`            // 下线时间
-	Status        int    `orm:"column(status);NOT NULL"`         // 状态:0-禁用 1-启用
+	TagId         int64    `orm:"column(tag_id);pk"`
+	TagName       string   `orm:"column(tag_name);NOT NULL"`       // 标签名
+	ArticleTypes  string   `orm:"column(article_types);NOT NULL"`  // 报告系列
+	ActivityTypes string   `orm:"column(activity_types);NOT NULL"` // 活动类型
+	Industries    string   `orm:"column(industries);NOT NULL"`     // 产业
+	SubjectNames  string   `orm:"column(subject_names);NOT NULL"`  // 标的
+	Sort          int      `orm:"column(sort);"`                   // 优先级
+	ModifyTime    string   `orm:"column(modify_time)"`             // 修改时间
+	CreateTime    string   `orm:"column(create_time)"`             // 创建时间
+	OnlineTime    string   `orm:"column(online_time)"`             // 上线时间
+	OfflineTime   string   `orm:"column(offline_time)"`            // 下线时间
+	Status        int      `orm:"column(status);NOT NULL"`         // 状态:0-禁用 1-启用
+	Atag          bool     // A标签是否有值
+	Btag          bool     // A标签是否有值
+	Ctag          bool     // A标签是否有值
+	Dtag          bool     // A标签是否有值
+	CheckList     []string // ABCD勾选了哪几列
 }
 
-
 // 获取tag列表
 func GetCygxTagList(cond string) (items []*CygxTagList, err error) {
 	o := orm.NewOrm()

+ 14 - 0
models/report_selection.go

@@ -16,6 +16,8 @@ type CygxReportSelectionRep struct {
 	UpdateDescription string `description:"更新说明"`
 	IsRed             bool   `description:"是否标记红点"`
 	ReadNum           int    `description:"阅读次数"`
+	Periods           string `description:"期数"`
+	MarketStrategy    string `description:"市场策略核心逻辑汇总"`
 }
 
 type CygxReportSelectionListPublicRep struct {
@@ -196,3 +198,15 @@ type AddReportSelectionStopTimeRep struct {
 	OutType   int `description:"退出方式,1正常退出,2强制关闭"`
 	Source    int `description:"来源,1:深度研究、2:本周研究汇总、3:上周纪要汇总"`
 }
+
+// 列表
+func GetReportSelectionList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxReportSelectionRep, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_report_selection  as art WHERE 1= 1 AND art.publish_status = 1  `
+	if condition != "" {
+		sql += condition
+	}
+	sql += `   LIMIT ?,?`
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}

+ 1 - 0
models/resource_data.go

@@ -103,6 +103,7 @@ type CygxResourceDataNewResp struct {
 	Meetingreviewchapt *CygxMorningMeetingGatherDetailListResp `description:"晨会精华"`
 	ProductInterior    *CygxProductInteriorResp                `description:"产品内测"`
 	IndustrialResource *IndustrialManagement                   `description:"产业资源包"`
+	ReportSelection    *CygxReportSelectionRep                 `description:"重点公司(原报告精选)"`
 }
 
 // 列表

+ 22 - 91
services/resource_data.go

@@ -43,6 +43,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 	var minutessummaryIds []int     //上周纪要汇总
 	var meetingreviewchaptIds []int //晨会精华
 	var productinteriorIds []int    //产品内测
+	var reportselectionIds []int    // 报告精选
 	//Source      string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial 、 本周研究汇总: researchsummary 、 上周纪要汇总 :minutessummary 、晨会精华 :meetingreviewchapt  、 产品内测:productinterior
 	for _, v := range list {
 		if v.Source == "article" {
@@ -67,6 +68,8 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			meetingreviewchaptIds = append(meetingreviewchaptIds, v.SourceId)
 		} else if v.Source == "productinterior" {
 			productinteriorIds = append(productinteriorIds, v.SourceId)
+		} else if v.Source == "reportselection" {
+			reportselectionIds = append(reportselectionIds, v.SourceId)
 		}
 	}
 	detail, e := models.GetConfigByCode("city_img_url")
@@ -296,97 +299,6 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		}
 	}
 
-	////处理路演
-	//if len(roadshowIds) > 0 {
-	//	pars = make([]interface{}, 0)
-	//	condition = ` AND video_id IN (` + utils.GetOrmInReplace(len(roadshowIds)) + `)`
-	//	pars = append(pars, roadshowIds)
-	//	roadshowVideoList, e := models.GetMicroRoadshowVideoListBycondition(condition, pars, 0, len(roadshowIds))
-	//	if e != nil {
-	//		err = errors.New("GetResourceDataList, Err: " + e.Error())
-	//		return
-	//	}
-	//	for _, v := range roadshowVideoList {
-	//		mapItems[fmt.Sprint("roadshow", v.VideoId)].Title = v.VideoName
-	//		mapItems[fmt.Sprint("roadshow", v.VideoId)].ImgUrl = v.ImgUrl
-	//		mapItems[fmt.Sprint("roadshow", v.VideoId)].PublishDate = v.CreateTime.Format(utils.FormatDateTime)
-	//	}
-	//}
-	////处理路活动视频
-	//if len(activityvideoIds) > 0 {
-	//	pars = make([]interface{}, 0)
-	//	condition = ` AND video_id IN (` + utils.GetOrmInReplace(len(activityvideoIds)) + `)`
-	//	pars = append(pars, activityvideoIds)
-	//	activityVideoList, e := models.GetActivityVideoList(condition, pars, 0, len(activityvideoIds))
-	//	if e != nil {
-	//		err = errors.New("GetResourceDataList, Err: " + e.Error())
-	//		return
-	//	}
-	//	//// 获取默认图配置
-	//	_, videoMap, _, _, e := GetMicroRoadShowDefaultImgConfig()
-	//	if e != nil {
-	//		err = errors.New("GetMicroRoadShowDefaultImgConfig, Err: " + e.Error())
-	//		return
-	//	}
-	//	for _, v := range activityVideoList {
-	//		mapItems[fmt.Sprint("activityvideo", v.VideoId)].Title = v.VideoName
-	//		mapItems[fmt.Sprint("activityvideo", v.VideoId)].ImgUrl = videoMap[v.ChartPermissionId]
-	//		mapItems[fmt.Sprint("activityvideo", v.VideoId)].ChartPermissionId = v.ChartPermissionId
-	//	}
-	//}
-	////处理路活音频
-	//if len(activityvoiceIds) > 0 {
-	//	pars = make([]interface{}, 0)
-	//	condition = ` AND activity_voice_id IN (` + utils.GetOrmInReplace(len(activityvoiceIds)) + `)`
-	//	pars = append(pars, activityvoiceIds)
-	//	activityVoiceList, e := models.GetActivityVoiceList(condition, pars, 0, len(activityvoiceIds))
-	//	if e != nil {
-	//		err = errors.New("GetResourceDataList, Err: " + e.Error())
-	//		return
-	//	}
-	//
-	//	// 用户权限
-	//	authInfo, permissionArr, e := GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
-	//	if e != nil {
-	//		err = errors.New("GetUserRaiPermissionInfo, Err: " + e.Error())
-	//		return
-	//	}
-	//
-	//	// 获取默认图配置
-	//	audioMap, _, _, _, e := GetMicroRoadShowDefaultImgConfig()
-	//	if e != nil {
-	//		err = errors.New("GetMicroRoadShowDefaultImgConfig, Err: " + e.Error())
-	//		return
-	//	}
-	//	for i, v := range activityVoiceList {
-	//		au := new(models.UserPermissionAuthInfo)
-	//		au.SellerName = authInfo.SellerName
-	//		au.SellerMobile = authInfo.SellerMobile
-	//		au.HasPermission = authInfo.HasPermission
-	//		au.OperationMode = authInfo.OperationMode
-	//		if au.HasPermission == 1 {
-	//			// 非宏观权限进一步判断是否有权限
-	//			if activityVoiceList[i].ChartPermissionId != utils.HONG_GUAN_ID && !utils.InArrayByStr(permissionArr, activityVoiceList[i].ChartPermissionName) {
-	//				au.HasPermission = 2
-	//			}
-	//		}
-	//		// 无权限的弹框提示
-	//		if au.HasPermission != 1 {
-	//			if au.OperationMode == UserPermissionOperationModeCall {
-	//				au.PopupMsg = UserPermissionPopupMsgCallActivity
-	//			} else {
-	//				au.PopupMsg = UserPermissionPopupMsgApplyActivity
-	//			}
-	//		}
-	//		mapItems[fmt.Sprint("activityvoice", v.ActivityVoiceId)].AuthInfo = au
-	//		mapItems[fmt.Sprint("activityvoice", v.ActivityVoiceId)].Title = v.VoiceName
-	//		mapItems[fmt.Sprint("activityvoice", v.ActivityVoiceId)].ImgUrl = audioMap[v.ChartPermissionId]
-	//		if au.HasPermission == 1 {
-	//			mapItems[fmt.Sprint("activityvoice", v.ActivityVoiceId)].ResourceUrl = v.VoiceUrl
-	//		}
-	//	}
-	//}
-
 	//处理路演 处理路活动视频 处理路活音频
 	if len(roadshowIds)+len(activityvideoIds)+len(activityvoiceIds) > 0 {
 
@@ -507,6 +419,25 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		}
 	}
 
+	//处理报告精选
+	lenreportselectionIds := len(reportselectionIds)
+	if lenreportselectionIds > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND article_id IN (` + utils.GetOrmInReplace(lenreportselectionIds) + `)`
+		pars = append(pars, reportselectionIds)
+		listreportselection, e := models.GetReportSelectionList(condition, pars, 0, lenreportselectionIds)
+		if e != nil {
+			err = errors.New("GetReportSelectionList, Err: " + e.Error())
+			return
+		}
+		for _, v := range listreportselection {
+			v.Title += "(第" + v.Periods + "期)"
+			v.MarketStrategy = AnnotationHtml(v.MarketStrategy)
+			v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
+			mapItems[fmt.Sprint("reportselection", v.ArticleId)].ReportSelection = v
+		}
+	}
+
 	for _, vList := range list {
 		for _, v := range mapItems {
 			if v.SourceId == vList.SourceId {