Browse Source

no message

zhangchuanxing 5 months ago
parent
commit
a0ca591fdf

+ 12 - 3
controllers/report.go

@@ -51,6 +51,7 @@ func (this *MobileReportController) TradeList() {
 	var list []*models.TradeReportMapping
 	var err error
 	mapCategory := make(map[int]int)
+	mapCategoryFollowType := make(map[int]int)
 	if ChartPermissionId == utils.CE_LUE_ID || ChartPermissionId == utils.GU_SHOU_ID {
 		listTrade, errTrade := models.GetReportMappingStrategyHomeAllByCygx(user.UserId, ChartPermissionId)
 
@@ -84,6 +85,7 @@ func (this *MobileReportController) TradeList() {
 			}
 			for _, v := range categoryList {
 				mapCategory[v.IdCygx] = v.IdCygx
+				mapCategoryFollowType[v.IdCygx] = v.FollowType
 			}
 		}
 	} else {
@@ -138,6 +140,7 @@ func (this *MobileReportController) TradeList() {
 			if mapCategory[v.CategoryId] > 0 {
 				list[k].IsFollow = true
 			}
+			list[k].FollowType = mapCategoryFollowType[v.CategoryId]
 			list[k].ListArticle = make([]*models.HomeArticle, 0)
 		}
 	}
@@ -645,6 +648,7 @@ func (this *ReportController) IndustrialFllow() {
 		return
 	}
 	industrialManagementId := req.IndustrialManagementId
+	followType := req.FollowType
 	var condition string
 	countIndustrial, err := models.GetIndustrialManagementCount(industrialManagementId)
 	if err != nil {
@@ -666,6 +670,7 @@ func (this *ReportController) IndustrialFllow() {
 	resp := new(models.CygxIndustryFllowResp)
 	item := new(models.CygxIndustryFllow)
 	item.IndustrialManagementId = industrialManagementId
+	item.FollowType = followType
 	item.UserId = uid
 	item.Email = user.Email
 	item.Mobile = user.Mobile
@@ -687,7 +692,6 @@ func (this *ReportController) IndustrialFllow() {
 		resp.Status = 1
 		br.Msg = "关注成功"
 	} else {
-		item.Type = 2
 		err = models.RemoveCygxIndustryFllow(uid, industrialManagementId)
 		if err != nil {
 			br.Msg = "操作失败"
@@ -698,7 +702,7 @@ func (this *ReportController) IndustrialFllow() {
 		br.Msg = "已取消关注"
 	}
 	//处理是否关注全部赛道字段
-	go services.IndustryFllowWithTrack(industrialManagementId, count, uid)
+	//go services.IndustryFllowWithTrack(industrialManagementId, count, uid)
 	go services.IndustryFllowUserLabelLogAdd(industrialManagementId, count, uid) //处理用户标签
 	go services.AddCygxIndustryFllowLog(item)                                    //添加操作日志记录
 	br.Ret = 200
@@ -732,6 +736,7 @@ func (this *ReportController) CategoryFllow() {
 		return
 	}
 	categoryId := req.CategoryId
+	followType := req.FollowType
 	var condition string
 	//countCategory, err := models.GetCategoryCount(categoryId)
 	//if err != nil {
@@ -777,6 +782,7 @@ func (this *ReportController) CategoryFllow() {
 		item.RealName = user.RealName
 		item.CompanyId = user.CompanyId
 		item.CompanyName = user.CompanyName
+		item.FollowType = followType
 		item.CreateTime = time.Now()
 		item.ModifyTime = time.Now()
 		_, err = models.AddCygxCategoryFllow(item)
@@ -2260,7 +2266,7 @@ func (this *MobileReportController) ZouqiTradeList() {
 		return
 	}
 
-	fllowMap := services.GetXzsChooseCategoryZhouqiMapByMobile(user.Mobile)
+	fllowMap, fllowMapType := services.GetXzsChooseCategoryZhouqiMapByMobile(user.Mobile)
 
 	resp := new(models.TradeReportMappingResp)
 	var list []*models.TradeReportMapping
@@ -2273,6 +2279,7 @@ func (this *MobileReportController) ZouqiTradeList() {
 			item.MatchTypeName = v.MatchTypeName
 			item.UpdateTime = utils.TimeRemoveHms(v.ArticleUpdateTime)
 			item.IsFollow = fllowMap[item.CategoryId]
+			item.FollowType = fllowMapType[item.CategoryId]
 			item.ListArticle = make([]*models.HomeArticle, 0)
 			list = append(list, item)
 		}
@@ -2442,6 +2449,7 @@ func (this *ReportController) CategoryZhouqiFllow() {
 		return
 	}
 	categoryId := req.CategoryId
+	followType := req.FollowType
 	count, err := models.GetCountCategoryFllowZhouqi(categoryId, user.Mobile)
 	if err != nil {
 		br.Msg = "获取数据失败!"
@@ -2458,6 +2466,7 @@ func (this *ReportController) CategoryZhouqiFllow() {
 		item.RealName = user.RealName
 		item.CompanyId = user.CompanyId
 		item.CompanyName = user.CompanyName
+		item.FollowType = followType
 		item.CreateTime = time.Now()
 		item.ModifyTime = time.Now()
 		_, err = models.AddCygxCategoryFllowZhouqi(item)

+ 3 - 0
models/industry_fllow.go

@@ -18,14 +18,17 @@ type CygxIndustryFllow struct {
 	ModifyTime             time.Time `description:"更新时间"`
 	RealName               string    `description:"用户实际名称"`
 	Source                 int       `description:"来源1查研观向,2查研观向小助手"`
+	FollowType             int       `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 }
 
 type CygxIndustryFllowRep struct {
 	IndustrialManagementId int `description:"产业D"`
+	FollowType             int `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 }
 
 type CygxCategoryFllowRep struct {
 	CategoryId int `description:"分类ID"`
+	FollowType int `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 }
 
 // 根据手机号获取用户关注的产业

+ 1 - 0
models/report.go

@@ -24,6 +24,7 @@ type IndustrialManagement struct {
 	IsRed                  bool                 `description:"是否标记红点"`
 	IsHot                  bool                 `description:"是否是热门"`
 	IsFollow               bool                 `description:"是否关注"`
+	FollowType             int                  `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 	IsNew                  bool                 `description:"是否展示 NEW 标签"`
 	IsShowRoadshow         bool                 `description:"是否展示 微路演 标签"`
 	ArticleReadNum         int                  `description:"文章阅读数量"`

+ 1 - 0
models/report_mapping.go

@@ -32,6 +32,7 @@ type TradeReportMapping struct {
 	MatchTypeName    string         `description:"匹配类型"`
 	IsRed            bool           `description:"是否标红"`
 	IsFollow         bool           `description:"是否关注"`
+	FollowType       int            `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 	UpdateTime       string         `description:"更新时间"`
 	Readnum          int            `description:"阅读数量"`
 	ListArticle      []*HomeArticle `description:"文章列表"`

+ 1 - 0
models/xzs_choose_category.go

@@ -17,6 +17,7 @@ type CygxXzsChooseCategory struct {
 	CreateTime  time.Time `description:"创建时间"`
 	ModifyTime  time.Time `description:"更新时间"`
 	IdCygx      int       `description:"cygx_report_mapping_cygx 表主键ID"`
+	FollowType  int       `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 }
 
 // 根据手机号获取用户关注的产业

+ 1 - 0
models/xzs_choose_category_zhouqi.go

@@ -16,6 +16,7 @@ type CygxXzsChooseCategoryZhouqi struct {
 	CategoryId  int       `description:"cygx_zhouqi_article_map 表主键"`
 	CreateTime  time.Time `description:"创建时间"`
 	ModifyTime  time.Time `description:"更新时间"`
+	FollowType  int       `description:"1,重点关注,3不感兴趣,0默认接受推送"`
 }
 
 // 根据手机号获取用户关注的产业

+ 3 - 1
services/ficc_report.go

@@ -8,7 +8,7 @@ import (
 )
 
 // GetXzsChooseCategoryZhouqiMapByMobile 根据手机号获取周期分类的关注信息
-func GetXzsChooseCategoryZhouqiMapByMobile(mobile string) (mapResp map[int]bool) {
+func GetXzsChooseCategoryZhouqiMapByMobile(mobile string) (mapResp map[int]bool, mapFollowResp map[int]int) {
 	if mobile == "" {
 		return
 	}
@@ -26,8 +26,10 @@ func GetXzsChooseCategoryZhouqiMapByMobile(mobile string) (mapResp map[int]bool)
 		return
 	}
 	mapResp = make(map[int]bool, 0)
+	mapFollowResp = make(map[int]int, 0)
 	for _, v := range listFollw {
 		mapResp[v.CategoryId] = true
+		mapFollowResp[v.CategoryId] = v.FollowType
 	}
 	return
 }

+ 3 - 0
services/industrial_management.go

@@ -86,9 +86,11 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
 		return
 	}
 	fllowMap := make(map[int]int)
+	fllowTypeMap := make(map[int]int)
 	if len(fllowList) > 0 {
 		for _, v := range fllowList {
 			fllowMap[v.IndustrialManagementId] = v.IndustrialManagementId
+			fllowTypeMap[v.IndustrialManagementId] = v.FollowType
 		}
 	}
 
@@ -142,6 +144,7 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
 			v.IndustryVideo = videoSimple
 		}
 		v.AuthInfo = au
+		v.FollowType = fllowTypeMap[v.IndustrialManagementId]
 	}
 	if len(industrialIdArr) > 0 {
 		//合并产业关联的标的

+ 1 - 2
utils/constants.go

@@ -103,8 +103,7 @@ const (
 	REOURCE_YX                       string = "Yx"
 	REOURCE_HZ                       string = "Hz"
 	GU_SHOU_NAME                     string = "固收"
-	GU_SHOU_ID                       int    = 100000 // 自定义权限类型ID ,十万起步
-	GU_SHOU_ID_CHART                 int    = 53     // chart_permission 表 固收ID
+	GU_SHOU_ID                       int    = 53 //  chart_permission 表 固收ID
 	HONG_GUAN_NAME                   string = "宏观"
 	CYGX_TACTICS_TIME_LINE_STATUS    string = "cygx_tactics_time_line_status" // 策略时间线是否对外开放
 	TIME_LINE_ID                     int    = 99999                           // 策略时间线的值