30 Коміти 56f1bc82a0 ... b5a43a3a66

Автор SHA1 Опис Дата
  zhangchuanxing b5a43a3a66 Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_clpt into cygx_13.9 1 день тому
  zhangchuanxing 9753041a01 no message 6 днів тому
  zhangchuanxing 564ca2f5bd no message 1 тиждень тому
  zhangchuanxing 023798eacc no message 1 тиждень тому
  zhangchuanxing d1433c4abb Merge branch 'cygx_14.1' of http://8.136.199.33:3000/hongze/hongze_clpt 1 тиждень тому
  zhangchuanxing 6e6586ebaf no message 1 тиждень тому
  zhangchuanxing 180a42139d no message 1 тиждень тому
  zhangchuanxing 99427153fb no message 3 тижнів тому
  zhangchuanxing 19aa6812ba no message 3 тижнів тому
  zhangchuanxing d374a9b350 no message 3 тижнів тому
  zhangchuanxing c8314c0366 no message 3 тижнів тому
  zhangchuanxing 16002fdf2a no message 3 тижнів тому
  zhangchuanxing 77d0302d9e no message 3 тижнів тому
  zhangchuanxing 5b3880a7d5 no message 3 тижнів тому
  zhangchuanxing e5fe72f1d8 no message 3 тижнів тому
  zhangchuanxing 14f3425812 no message 3 тижнів тому
  zhangchuanxing 536450da71 no message 3 тижнів тому
  zhangchuanxing 8cfebe1304 Merge branch 'need/cygx_959' of http://8.136.199.33:3000/hongze/hongze_clpt 1 місяць тому
  zhangchuanxing a50da2b278 no message 1 місяць тому
  zhangchuanxing 5dacb2ea5e no message 1 місяць тому
  zhangchuanxing d93ac4e440 no message 1 місяць тому
  zhangchuanxing 896fb5fca2 no message 1 місяць тому
  zhangchuanxing d780284400 no message 1 місяць тому
  zhangchuanxing a997a40d5b no message 1 місяць тому
  zhangchuanxing 0d98eeb814 no message 1 місяць тому
  zhangchuanxing faa678225e no message 1 місяць тому
  zhangchuanxing 6821a77c3c no message 1 місяць тому
  zhangchuanxing c843a1c9b4 no message 1 місяць тому
  zhangchuanxing a22b3aa479 no message 1 місяць тому
  zhangchuanxing cbd70055d9 no message 2 місяців тому

+ 2 - 1
.gitignore

@@ -12,4 +12,5 @@
 /static/searchKeywordCount.xlsx
 .DS_Store
 /doc/
-*DS_Store
+*DS_Store
+cygxlogs/

+ 6 - 1
controllers/activity.go

@@ -1184,6 +1184,9 @@ func (this *ActivityController) SignupAdd() {
 			} else {
 				go services.ActivityUserRemind(user, activityInfo, 4)
 				resp.PopupMsg = "<b>报名成功,已加入您的活动日程</b><br/><br/>想要及时获取活动信息变更通知,请关注【查研观向小助手】公众号"
+				if activityInfo.IsZoom == 1 && activityInfo.IsLimitPeople > 0 {
+					resp.PopupMsg = "<b>报名成功,已加入您的活动日程</b><br/><b>届时请通过zoom会议链接或app自主入会</b><br/><br/>想要及时获取活动信息变更通知,请关注【查研观向小助手】公众号"
+				}
 			}
 
 			if activityInfo.IsResearchPoints {
@@ -2394,8 +2397,10 @@ func (this *ActivityController) ScheduleList() {
 		}
 		v.SignupType = mapActivitySignup[v.ActivityId]
 		//处理列表的标签是否展示逻辑
-		resp.List = append(resp.List, services.ActivityButtonShow(v, user, make([]string, 0)))
+		//resp.List = append(resp.List, services.ActivityButtonShow(v, user, make([]string, 0)))
 	}
+
+	resp.List = services.ActivityArrButtonShow(list, user, make([]string, 0))
 	resp.Paging = page
 	br.Ret = 200
 	br.Success = true

+ 1 - 1
controllers/article.go

@@ -202,7 +202,7 @@ func (this *ArticleController) Detail() {
 			}
 
 			if articleId == 11223 { // 这是一篇非常特殊的文章,要单独处理 需求池 976
-				if strings.Contains(companyPermission, utils.YI_YAO_NAME) || strings.Contains(companyPermission, utils.XIAO_FEI_NAME) || strings.Contains(companyPermission, utils.KE_JI_NAME) || strings.Contains(companyPermission, utils.ZHI_ZAO_NAME) {
+				if strings.Contains(companyPermission, utils.YI_YAO_NAME) || strings.Contains(companyPermission, utils.XIAO_FEI_NAME) || strings.Contains(companyPermission, utils.KE_JI_NAME) || strings.Contains(companyPermission, utils.ZHI_ZAO_NAME) || strings.Contains(companyPermission, utils.CE_LUE_NAME) || strings.Contains(companyPermission, utils.GU_SHOU_NAME) || strings.Contains(companyPermission, utils.ZHOU_QI_NAME) {
 					hasPersion = true
 				}
 			}

+ 2 - 2
controllers/banner.go

@@ -220,7 +220,7 @@ func (this *BaseBannerController) ListYx() {
 	var listB []*models.BannerUrlYxResp
 	var listC []*models.BannerUrlYxResp
 	listA = []*models.BannerUrlYxResp{
-		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_5.png", Path: "/index/"},
+		//&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_5.png", Path: "/index/"},
 		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_6.png", Path: ""},
 	}
 
@@ -228,7 +228,7 @@ func (this *BaseBannerController) ListYx() {
 		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_3.png", Path: "/index/"},
 	}
 
-	listC =  []*models.BannerUrlYxResp{
+	listC = []*models.BannerUrlYxResp{
 		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_4.png", Path: ""},
 	}
 	resp.ListA = listA

+ 54 - 12
controllers/base_auth.go

@@ -7,23 +7,22 @@ import (
 	"net/http"
 	"net/url"
 	"strconv"
+	"strings"
 
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/utils"
-
-	"github.com/rdlucklib/rdluck_tools/log"
 )
 
-var apiLog *log.Log
+//var apiLog *log.Log
 
-func init() {
-	if utils.RunMode == "release" {
-		logDir := `/data/rdlucklog/hongze_clpt`
-		apiLog = log.Init("20060102.api", logDir)
-	} else {
-		apiLog = log.Init("20060102.api")
-	}
-}
+//	func init() {
+//		if utils.RunMode == "release" {
+//			logDir := `/data/rdlucklog/hongze_clpt`
+//			apiLog = log.Init("20060102.api", logDir)
+//		} else {
+//			apiLog = log.Init("20060102.api")
+//		}
+//	}
 
 type BaseAuthController struct {
 	web.Controller
@@ -133,9 +132,52 @@ func (c *BaseAuthController) JSON(data interface{}, hasIndent bool, coding bool)
 	}
 	ip := c.Ctx.Input.IP()
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	c.logUri(content, requestBody, ip)
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}
 	return c.Ctx.Output.Body(content)
 }
+
+func (c *BaseAuthController) logUri(respContent []byte, requestBody, ip string) {
+	authorization := ""
+	method := c.Ctx.Input.Method()
+	uri := c.Ctx.Input.URI()
+	//fmt.Println("Url:", uri)
+	if method != "HEAD" {
+		if method == "POST" || method == "GET" {
+			authorization = c.Ctx.Input.Header("authorization")
+			if authorization == "" {
+				authorization = c.Ctx.Input.Header("Authorization")
+			}
+			if authorization == "" {
+				newAuthorization := c.GetString("authorization")
+				if newAuthorization != `` {
+					authorization = "authorization=" + newAuthorization
+				} else {
+					newAuthorization = c.GetString("Authorization")
+					authorization = "authorization=" + newAuthorization
+				}
+			} else {
+				if strings.Contains(authorization, ";") {
+					authorization = strings.Replace(authorization, ";", "$", 1)
+				}
+			}
+			if authorization == "" {
+				strArr := strings.Split(uri, "?")
+				for k, v := range strArr {
+					fmt.Println(k, v)
+				}
+				if len(strArr) > 1 {
+					authorization = strArr[1]
+					authorization = strings.Replace(authorization, "Authorization", "authorization", -1)
+					fmt.Println(authorization)
+				}
+			}
+		}
+	}
+
+	utils.ApiLog.Info("uri:%s, authorization:%s, requestBody:%s, responseBody:%s, ip:%s", c.Ctx.Input.URI(), authorization, requestBody, respContent, ip)
+	return
+}

+ 53 - 11
controllers/base_auth_mobile.go

@@ -8,21 +8,20 @@ import (
 	"net/http"
 	"net/url"
 	"strconv"
+	"strings"
 
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/utils"
-
-	"github.com/rdlucklib/rdluck_tools/log"
 )
 
-func init() {
-	if utils.RunMode == "release" {
-		logDir := `/data/rdlucklog/hongze_cygx`
-		apiLog = log.Init("20060102.api", logDir)
-	} else {
-		apiLog = log.Init("20060102.api")
-	}
-}
+//func init() {
+//	if utils.RunMode == "release" {
+//		logDir := `/data/rdlucklog/hongze_cygx`
+//		apiLog = log.Init("20060102.api", logDir)
+//	} else {
+//		apiLog = log.Init("20060102.api")
+//	}
+//}
 
 type BaseAuthMobileController struct {
 	web.Controller
@@ -132,9 +131,52 @@ func (c *BaseAuthMobileController) JSON(data interface{}, hasIndent bool, coding
 	}
 	ip := c.Ctx.Input.IP()
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	c.logUri(content, requestBody, ip)
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}
 	return c.Ctx.Output.Body(content)
 }
+
+func (c *BaseAuthMobileController) logUri(respContent []byte, requestBody, ip string) {
+	authorization := ""
+	method := c.Ctx.Input.Method()
+	uri := c.Ctx.Input.URI()
+	//fmt.Println("Url:", uri)
+	if method != "HEAD" {
+		if method == "POST" || method == "GET" {
+			authorization = c.Ctx.Input.Header("authorization")
+			if authorization == "" {
+				authorization = c.Ctx.Input.Header("Authorization")
+			}
+			if authorization == "" {
+				newAuthorization := c.GetString("authorization")
+				if newAuthorization != `` {
+					authorization = "authorization=" + newAuthorization
+				} else {
+					newAuthorization = c.GetString("Authorization")
+					authorization = "authorization=" + newAuthorization
+				}
+			} else {
+				if strings.Contains(authorization, ";") {
+					authorization = strings.Replace(authorization, ";", "$", 1)
+				}
+			}
+			if authorization == "" {
+				strArr := strings.Split(uri, "?")
+				for k, v := range strArr {
+					fmt.Println(k, v)
+				}
+				if len(strArr) > 1 {
+					authorization = strArr[1]
+					authorization = strings.Replace(authorization, "Authorization", "authorization", -1)
+					fmt.Println(authorization)
+				}
+			}
+		}
+	}
+
+	utils.ApiLog.Info("uri:%s, authorization:%s, requestBody:%s, responseBody:%s, ip:%s", c.Ctx.Input.URI(), authorization, requestBody, respContent, ip)
+	return
+}

+ 50 - 39
controllers/base_common.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"encoding/json"
+	"fmt"
 	"github.com/beego/beego/v2/server/web"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/utils"
@@ -24,8 +25,8 @@ func (this *BaseCommonController) Prepare() {
 	} else {
 		requestBody, _ = url.QueryUnescape(string(this.Ctx.Input.RequestBody))
 	}
-	ip := this.Ctx.Input.IP()
-	apiLog.Println("请求地址:", this.Ctx.Input.URI(), "RequestBody:", requestBody, "IP:", ip)
+	//ip := this.Ctx.Input.IP()
+	//apiLog.Println("请求地址:", this.Ctx.Input.URI(), "RequestBody:", requestBody, "IP:", ip)
 
 	authorization := this.Ctx.Input.Header("Authorization")
 	if authorization == "" {
@@ -38,42 +39,9 @@ func (this *BaseCommonController) Prepare() {
 	if strings.Contains(uri, "/api/wechat/login") {
 		authorization = ""
 	}
-	if authorization != "" {
-		//session, err := models.GetSessionByToken(authorization)
-		//if err != nil {
-		//	if err.Error() == utils.ErrNoRow() {
-		//		this.JSON(models.BaseResponse{Ret: 408, Msg: "信息已变更,请重新登陆!", ErrMsg: "Token 信息已变更:Token: " + authorization}, false, false)
-		//		this.StopRun()
-		//		return
-		//	}
-		//	this.JSON(models.BaseResponse{Ret: 408, Msg: "网络异常,请稍后重试!", ErrMsg: "获取用户信息异常,Eerr:" + err.Error()}, false, false)
-		//	this.StopRun()
-		//	return
-		//}
-		//if session == nil {
-		//	this.JSON(models.BaseResponse{Ret: 408, Msg: "网络异常,请稍后重试!", ErrMsg: "sesson is empty "}, false, false)
-		//	this.StopRun()
-		//	return
-		//}
-		//wxUser, err := models.GetWxUserItemByUserId(session.UserId)
-		//if err != nil {
-		//	if err.Error() == utils.ErrNoRow() {
-		//		this.JSON(models.BaseResponse{Ret: 408, Msg: "信息已变更,请重新登陆!", ErrMsg: "获取admin 信息失败 " + strconv.Itoa(session.UserId)}, false, false)
-		//		this.StopRun()
-		//		return
-		//	}
-		//	this.JSON(models.BaseResponse{Ret: 408, Msg: "网络异常,请稍后重试!", ErrMsg: "获取wx_user信息异常,Eerr:" + err.Error()}, false, false)
-		//	this.StopRun()
-		//	return
-		//}
-		//if wxUser == nil {
-		//	this.JSON(models.BaseResponse{Ret: 408, Msg: "网络异常,请稍后重试!", ErrMsg: "admin is empty "}, false, false)
-		//	this.StopRun()
-		//	return
-		//}
-		//this.User = wxUser
-	}
-	//this.Token = authorization
+
+	ip := this.Ctx.Input.IP()
+	utils.ApiLog.Info("uri:%s, requestBody:%s, responseBody:%s, ip:%s", this.Ctx.Input.URI(), requestBody, ip)
 }
 
 func (c *BaseCommonController) ServeJSON(encoding ...bool) {
@@ -113,10 +81,53 @@ func (c *BaseCommonController) JSON(data interface{}, hasIndent bool, coding boo
 	}
 	ip := c.Ctx.Input.IP()
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	c.logUri(content, requestBody, ip)
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
 
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}
 	return c.Ctx.Output.Body(content)
 }
+
+func (c *BaseCommonController) logUri(respContent []byte, requestBody, ip string) {
+	authorization := ""
+	method := c.Ctx.Input.Method()
+	uri := c.Ctx.Input.URI()
+	//fmt.Println("Url:", uri)
+	if method != "HEAD" {
+		if method == "POST" || method == "GET" {
+			authorization = c.Ctx.Input.Header("authorization")
+			if authorization == "" {
+				authorization = c.Ctx.Input.Header("Authorization")
+			}
+			if authorization == "" {
+				newAuthorization := c.GetString("authorization")
+				if newAuthorization != `` {
+					authorization = "authorization=" + newAuthorization
+				} else {
+					newAuthorization = c.GetString("Authorization")
+					authorization = "authorization=" + newAuthorization
+				}
+			} else {
+				if strings.Contains(authorization, ";") {
+					authorization = strings.Replace(authorization, ";", "$", 1)
+				}
+			}
+			if authorization == "" {
+				strArr := strings.Split(uri, "?")
+				for k, v := range strArr {
+					fmt.Println(k, v)
+				}
+				if len(strArr) > 1 {
+					authorization = strArr[1]
+					authorization = strings.Replace(authorization, "Authorization", "authorization", -1)
+					fmt.Println(authorization)
+				}
+			}
+		}
+	}
+
+	utils.ApiLog.Info("uri:%s, authorization:%s, requestBody:%s, responseBody:%s, ip:%s", c.Ctx.Input.URI(), authorization, requestBody, respContent, ip)
+	return
+}

+ 2 - 2
controllers/home.go

@@ -323,13 +323,13 @@ func (this *MobileHomeController) NewList() {
 	//} else {
 	condition += `  AND is_hide = 0  AND source NOT IN ('activity','activityspecial','newchart','industrialsourceHz','industrialsourceYx')  AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) ` + conditionInit
 	//conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)
-	conditionActivity, err := services.ActivityConditioninitSql(user, "", 0)
+	conditionActivity, err := services.ActivityConditioninitSql(user, "  AND art.active_state IN  (1,2) ", 0)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 		return
 	}
-	conditionActivity += `  AND art.publish_status = 1 `
+	conditionActivity += `  AND art.publish_status = 1  `
 	var conditionOrder string
 	conditionOrder = ` ORDER BY art.activity_time DESC ,  art.active_state ASC   `
 	conditionActivity += conditionOrder

+ 259 - 0
controllers/report.go

@@ -2251,3 +2251,262 @@ func (this *MobileReportController) TacticsList() {
 	br.Msg = "获取成功"
 	br.Data = resp
 }
+
+// @Title 周期行业报告分类列表接口
+// @Description 周期获取行业报告分类列表接口
+// @Success 200 {object} models.TradeReportMappingResp
+// @router /zhouqi_tradeList [get]
+func (this *MobileReportController) ZouqiTradeList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	listCategory, err := models.GetCygxZhouqiArticleMapFirst()
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
+
+	fllowMap := services.GetXzsChooseCategoryZhouqiMapByMobile(user.Mobile)
+
+	resp := new(models.TradeReportMappingResp)
+	var list []*models.TradeReportMapping
+	if len(listCategory) == 0 {
+		list = make([]*models.TradeReportMapping, 0)
+	} else {
+		for _, v := range listCategory {
+			item := new(models.TradeReportMapping)
+			item.CategoryId = v.CategoryId
+			item.MatchTypeName = v.MatchTypeName
+			item.UpdateTime = utils.TimeRemoveHms(v.ArticleUpdateTime)
+			item.IsFollow = fllowMap[item.CategoryId]
+			item.ListArticle = make([]*models.HomeArticle, 0)
+			list = append(list, item)
+		}
+	}
+	resp.List = list
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// @Title 周期根据行业分类获取行业文章列表
+// @Description 周期根据行业分类获取行业文章列表接口
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   CategoryId   query   int  true       "分类ID"
+// @Success 200 {object} models.TacticsListResp
+// @router /tactics/zhouqi_list [get]
+func (this *MobileReportController) ZhouqiTacticsList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	//uid := user.UserId
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	categoryId, _ := this.GetInt("CategoryId")
+
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = paging.StartIndex(currentIndex, pageSize)
+
+	detail, err := models.GetCygxZhouqiArticleMapInfoById(categoryId)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取信息失败,Err:" + err.Error()
+		return
+	}
+	var total int
+	//var err error
+	resp := new(models.TacticsListResp)
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	list := make([]*models.ArticleListResp, 0)
+	listCategory, err := models.GetCygxZhouqiArticleMapByParentId(categoryId)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取产业报告+晨会点评列表,Err:" + err.Error()
+		return
+	}
+	var matchTypeName = []string{}
+	var seriesName = []string{}
+	for _, v := range listCategory {
+		if v.MatchTypeName != "" {
+			matchTypeName = append(matchTypeName, v.MatchTypeName)
+		}
+		if v.SeriesName != "" {
+			seriesName = append(seriesName, v.SeriesName)
+		}
+	}
+
+	var conditionOr string
+	if detail.FiccReportId != "" {
+		conditionOr = " OR  art.report_id  IN (" + detail.FiccReportId + ")" // 手动配置报告展示逻辑处理
+	}
+	if len(seriesName) > 0 {
+		conditionOr += "  OR series_name IN  ('" + strings.Join(seriesName, "','") + "') "
+	}
+
+	var condition string
+	//var pars []interface{}
+	//if len(seriesName) == 0 {
+	//	condition = " AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')"
+	//} else {
+	//	condition = " AND  ( field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')   OR series_name IN  ('" + strings.Join(seriesName, "','") + "')   )"
+	//}
+	condition = " AND  ( field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')  " + conditionOr + " ) "
+	list, total, err = models.GetReportAndproductIndustrylListimgZhouqi(condition, startSize, pageSize)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.Msg = "GetHomeList,Err:" + err.Error()
+		return
+	}
+
+	listPublic, err := services.HandleArticleCategoryImg(list, user)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取报告封面图片失败, Err:" + err.Error()
+		return
+	}
+
+	var articleIds []int
+	var productInteriorIs []int
+
+	for _, v := range listPublic {
+		if v.Resource == 1 {
+			articleIds = append(articleIds, v.ArticleId)
+		}
+		if v.Resource == 2 {
+			productInteriorIs = append(productInteriorIs, v.ArticleId)
+		}
+	}
+
+	articleMapPv := services.GetArticleHistoryByArticleId(articleIds)                       //文章Pv
+	articleCollectMap, _ := services.GetCygxArticleCollectMap(user.UserId)                  //用户收藏的文章
+	articleCollectNumMap, _ := services.GetCygxArticleCollectNumMapByArtcileIds(articleIds) //文章收藏的数量
+
+	productInteriorMapPv := services.GetCygxProductInteriorHistoryListPvMap(productInteriorIs) //产品内测Pv
+	listResp := make([]*models.HomeArticle, 0)
+	for _, v := range listPublic {
+		item := new(models.HomeArticle)
+		item.ArticleId = v.ArticleId
+		item.ReportId = v.ReportId
+		item.Title = v.Title
+		item.Annotation = v.Annotation
+		item.Abstract = v.Abstract
+		item.ImgUrlPc = v.ImgUrlPc
+		item.PublishDate = v.PublishDate
+		item.Resource = v.Resource
+		if v.Resource == 1 {
+			item.Pv = articleMapPv[v.ArticleId]
+			item.IsCollect = articleCollectMap[v.ArticleId]
+			item.CollectNum = articleCollectNumMap[v.ArticleId]
+		}
+		if v.Resource == 2 {
+			item.Pv = productInteriorMapPv[v.ArticleId]
+		}
+
+		if v.ReportId > 0 {
+			item.Resource = 3
+		}
+		listResp = append(listResp, item)
+	}
+	if len(listResp) == 0 {
+		listResp = make([]*models.HomeArticle, 0)
+	}
+	page = paging.GetPaging(currentIndex, pageSize, total)
+	resp.List = listResp
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// @Title 周期行业关注/取消关注
+// @Description 周期行业关注/取消关注 接口
+// @Param	request	body models.CygxCategoryFllowRep true "type json string"
+// @Success 200
+// @router /category/zhouqi_fllow [post]
+func (this *ReportController) CategoryZhouqiFllow() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	uid := user.UserId
+	var req models.CygxCategoryFllowRep
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+	categoryId := req.CategoryId
+	count, err := models.GetCountCategoryFllowZhouqi(categoryId, user.Mobile)
+	if err != nil {
+		br.Msg = "获取数据失败!"
+		br.ErrMsg = "获取数据失败,Err:" + err.Error()
+		return
+	}
+	resp := new(models.CygxIndustryFllowResp)
+	if count == 0 {
+		item := new(models.CygxXzsChooseCategoryZhouqi)
+		item.CategoryId = categoryId
+		item.UserId = uid
+		item.Email = user.Email
+		item.Mobile = user.Mobile
+		item.RealName = user.RealName
+		item.CompanyId = user.CompanyId
+		item.CompanyName = user.CompanyName
+		item.CreateTime = time.Now()
+		item.ModifyTime = time.Now()
+		_, err = models.AddCygxCategoryFllowZhouqi(item)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "操作失败,Err:" + err.Error()
+			return
+		}
+		resp.Status = 1
+		br.Msg = "关注成功"
+	} else {
+		err = models.RemoveCygxCategoryFllowZhouqi(user.Mobile, categoryId)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "取消关注失败,Err:" + err.Error()
+			return
+		}
+		resp.Status = 2
+		br.Msg = "已取消关注"
+	}
+	br.Ret = 200
+	br.Success = true
+	br.Data = resp
+}

+ 43 - 34
controllers/report_selection.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"encoding/json"
+	"fmt"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/services"
 	"hongze/hongze_clpt/utils"
@@ -161,8 +162,34 @@ func (this *ReportSelectionController) Detail() {
 							v2.CompanyLabel = append(v2.CompanyLabel, vCompanyLabel+"#")
 						}
 					}
+					if v2.SubjectName == "" {
+						v2.ShowName = v2.IndustrialManagementNames
+					} else {
+						v2.ShowName = v2.SubjectName
+					}
 				}
-				itemSubject.ListSubject = append(itemSubject.ListSubject, &models.ReportSelectionChartLogSubjectName{SubjectName: v2.SubjectName, IsNew: v2.IsNew, IndustrialSubjectId: v2.IndustrialSubjectId})
+				if v2.ThirdName != "" {
+					v2.ShowName = v2.ThirdName
+				}
+				subjectItem := new(models.ReportSelectionChartLogSubjectName)
+				subjectItem.SubjectName = v2.SubjectName
+				subjectItem.IsNew = v2.IsNew
+				subjectItem.IndustrialSubjectId = v2.IndustrialSubjectId
+				subjectItem.IndustrialManagementId, _ = strconv.Atoi(v2.IndustrialManagementId)
+				subjectItem.IndustrialManagementName = v2.IndustrialManagementNames
+				subjectItem.ThirdId = v2.ThirdId
+				if v2.ThirdName != "" {
+					subjectItem.SubjectName = v2.ThirdName
+				} else {
+					if subjectItem.SubjectName == "" {
+						subjectItem.SubjectName = subjectItem.IndustrialManagementName
+					}
+				}
+				subjectItem.Md5String = utils.MD5(fmt.Sprint("IN_ID", v2.IndustrialManagementId, "S_ID", v2.IndustrialSubjectId, "T_ID", v2.ThirdId))
+				v2.Md5String = subjectItem.Md5String
+
+				itemSubject.ListSubject = append(itemSubject.ListSubject, subjectItem)
+				//itemSubject.ListSubject = append(itemSubject.ListSubject, &models.ReportSelectionChartLogSubjectName{SubjectName: v2.SubjectName, IsNew: v2.IsNew, IndustrialSubjectId: v2.IndustrialSubjectId})
 			}
 			item.BodyChartSummary = mapChartLog[v.PermissionName]
 			item.List = listSonLog
@@ -174,27 +201,7 @@ func (this *ReportSelectionController) Detail() {
 		}
 		existMap[v.ChartPermissionId] = v.ChartPermissionId
 	}
-	//historyRecord := new(models.CygxReportHistoryRecord)
-	//historyRecord.UserId = uid
-	//historyRecord.ArticleId = articleId
-	//historyRecord.CreateTime = time.Now()
-	//historyRecord.Mobile = user.Mobile
-	//historyRecord.Email = user.Email
-	//historyRecord.CompanyId = user.CompanyId
-	//historyRecord.CompanyName = user.CompanyName
-	//historyRecord.RegisterPlatform = utils.REGISTER_PLATFORM
-	//historyRecord.ReportType = "bgjx"
-	//sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
-	//if err != nil && err.Error() != utils.ErrNoRow() {
-	//	br.Msg = "获取信息失败"
-	//	br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-	//	return
-	//}
-	//historyRecord.RealName = user.RealName
-	//if sellerItem != nil {
-	//	historyRecord.SellerName = sellerItem.RealName
-	//}
-	//go services.AddCygxReportHistoryRecord(user, articleId, "bgjx")
+
 	resp.List = items
 	resp.ListPermissionSubject = itemsSubject
 	resp.Detail = detail
@@ -232,22 +239,24 @@ func (this *ReportSelectionController) ClickHistory() {
 		br.ErrMsg = "文章不存在,文章ID错误"
 		return
 	}
-	if req.IndustrialSubjectId <= 0 {
+	if req.IndustrialSubjectId+req.IndustrialManagementId+req.ThirdId <= 0 {
 		br.Msg = "标的ID不存在"
-		br.ErrMsg = "标的ID不存在,标的ID错误"
+		br.ErrMsg = "产业或标的ID不存在"
 		return
 	}
 	item := models.CygxReportSelectionSubjectHistory{
-		UserId:              user.UserId,
-		ArticleId:           req.ArticleId,
-		CreateTime:          time.Now(),
-		ModifyTime:          time.Now(),
-		Mobile:              user.Mobile,
-		Email:               user.Email,
-		CompanyId:           user.CompanyId,
-		CompanyName:         user.CompanyName,
-		IndustrialSubjectId: req.IndustrialSubjectId,
-		RegisterPlatform:    utils.REGISTER_PLATFORM,
+		UserId:                 user.UserId,
+		ArticleId:              req.ArticleId,
+		CreateTime:             time.Now(),
+		ModifyTime:             time.Now(),
+		Mobile:                 user.Mobile,
+		Email:                  user.Email,
+		CompanyId:              user.CompanyId,
+		CompanyName:            user.CompanyName,
+		IndustrialSubjectId:    req.IndustrialSubjectId,
+		IndustrialManagementId: req.IndustrialManagementId,
+		ThirdId:                req.ThirdId,
+		RegisterPlatform:       utils.REGISTER_PLATFORM,
 	}
 	err = models.AddCygxReportSelectionSubjectHistory(&item)
 	if err != nil {

+ 1 - 1
controllers/yanxuan_special.go

@@ -188,7 +188,7 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 	if item.MyCollectNum > 0 {
 		item.IsCollect = 1
 	}
-
+	item.Pv += item.HzPv // 添加弘则PV
 	var resp models.CygxYanxuanSpecialResp
 	resp.HasPermission = 1
 	resp.CygxYanxuanSpecialItem = *item

+ 6 - 0
models/activity.go

@@ -155,6 +155,8 @@ type ActivityDetail struct {
 	CancelDeadline            string                     `description:"取消报名截止时间"`
 	ChartPermissionNameDeputy string                     `description:"副行业名称"`
 	TopTime                   int                        `description:"置顶时间"`
+	IsZoom                    int                        `description:"是否是Zoom模版  1是,0否"`
+	MeetingId                 string                     `description:"会议ID"`
 }
 
 // 活动详情
@@ -235,6 +237,8 @@ type ActivityListResp struct {
 	IsYidongActivity        bool                       `description:"是否属于易董同步过来的活动"`
 	TopTime                 int                        `description:"置顶时间"`
 	ShareImg                string                     `description:"分享图片"`
+	IsZoom                  int                        `description:"是否是Zoom模版  1是,0否"`
+	MeetingId               string                     `description:"会议ID"`
 }
 
 type ActivityCheck struct {
@@ -579,6 +583,7 @@ func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpe
 			art.is_can_outbound_call,
 			art.is_research_points,
 			art.cancel_deadline,
+			art.is_zoom,
 			art.host 
 		FROM
 			cygx_activity AS art
@@ -617,6 +622,7 @@ func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpe
 			"",
 			"",
 			"",
+			"",
 			art.host 
 		FROM
 			cygx_activity_special AS art

+ 17 - 0
models/cygx_yanxuan_special.go

@@ -60,6 +60,7 @@ type CygxYanxuanSpecialItem struct {
 	Annotation      string   `description:"核心观点"`
 	Pv              int      `description:"Pv"`
 	Uv              int      `description:"Uv"`
+	HzPv            int      `description:"HzPv"`
 	BodyHighlight   []string `description:"搜索高亮展示结果"`
 }
 
@@ -280,6 +281,14 @@ func UpdateYanxuanSpecialPv(id int) (err error) {
 	return
 }
 
+// UpdateYanxuanSpecialHzPv 修改研选专栏的阅读弘则Pv
+func UpdateYanxuanSpecialHzPv(id int) (err error) {
+	o := orm.NewOrm()
+	sql := `UPDATE cygx_yanxuan_special SET hz_pv=hz_pv+1 WHERE id = ? `
+	_, err = o.Raw(sql, id).Exec()
+	return
+}
+
 // UpdateYanxuanSpecialUv 修改研选专栏的阅读Uv
 func UpdateYanxuanSpecialUv(id int) (err error) {
 	o := orm.NewOrm()
@@ -288,6 +297,14 @@ func UpdateYanxuanSpecialUv(id int) (err error) {
 	return
 }
 
+// UpdateYanxuanSpecialHzUv 修改研选专栏的阅读弘则Uv
+func UpdateYanxuanSpecialHzUv(id int) (err error) {
+	o := orm.NewOrm()
+	sql := `UPDATE cygx_yanxuan_special SET hz_uv=hz_uv+1 WHERE id = ? `
+	_, err = o.Raw(sql, id).Exec()
+	return
+}
+
 // 增加收藏数量
 func UpdateYanxuanSpecialarticleCollectNumIncrease(id int) (err error) {
 	o := orm.NewOrm()

+ 2 - 1
models/db.go

@@ -108,9 +108,10 @@ func init() {
 		new(CygxTimelineLog),
 		new(CygxActivitySpecialPermissionPoints),
 		new(time_line.CygxGushouTimeLineHistory),
+		new(CygxXzsChooseCategoryZhouqi),
 	)
 	// 记录ORM查询日志
 	orm.Debug = true
-	orm.DebugLog = orm.NewLog(utils.BinLog)
+	orm.DebugLog = orm.NewLog(utils.Binlog)
 
 }

+ 24 - 0
models/report.go

@@ -1273,3 +1273,27 @@ GROUP BY a.article_id ORDER BY publish_date DESC
 	_, err = o.Raw(sql, createtime).QueryRows(&items)
 	return
 }
+
+// 获取行业报告列表
+func GetReportAndproductIndustrylListimgZhouqi(condition string, startSize, pageSize int) (items []*ArticleListResp, total int, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			art.article_id,
+			art.report_id,
+			art.body,
+			art.annotation,
+			art.abstract,
+			art.category_id,
+			art.title,
+			art.publish_date,
+			1 AS resource 
+		FROM
+			cygx_article AS art 
+		WHERE
+			art.publish_status = 1   	AND category_name = '周期'  ` + condition
+	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
+	err = o.Raw(totalSql).QueryRow(&total)
+	sql += `    ORDER BY publish_date DESC LIMIT ?,? `
+	_, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
+	return
+}

+ 24 - 14
models/report_selection.go

@@ -67,23 +67,33 @@ type ReportSelectionChartLogPermission struct {
 }
 
 type ReportSelectionChartLogSubjectName struct {
-	SubjectName         string `description:"标的名称"`
-	IndustrialSubjectId int    `description:"标的ID"`
-	IsNew               bool   `description:"是否展示新标签"`
+	SubjectName              string `description:"标的名称"`
+	IndustrialSubjectId      int    `description:"标的ID"`
+	IndustrialManagementId   int    `description:"产业Id"`
+	IndustrialManagementName string `description:"产业资源包名称"`
+	ThirdId                  int    `description:"类似产业、标的的三方ID"`
+	ThirdName                string `description:"类似产业、标的的三方名称"`
+	IsNew                    bool   `description:"是否展示新标签"`
+	Md5String                string `description:"Md5唯一标识"`
 }
 
 type CygxReportSelectionLogDetail struct {
-	IndustrialManagementId string   `description:"产业Id"`
-	IndustrialSubjectId    int      `description:"标的ID"`
-	SubjectName            string   `description:"标的名称"`
-	IsShowApplyButton      bool     `description:"是否展示申请路由按钮"`
-	IsNew                  bool     `description:"是否展示新标签"`
-	Body                   string   `description:"内容"`
-	CompanyLabel           []string `description:"公司标签"`
-	Label                  string   `description:"公司标签"`
-	OverviewArticleId      int      `description:"综述报告Id"`
-	IsShowOverviewArticle  int      `description:"是否展示综述报告 1展示,0隐藏"`
-	List                   []*IndustriaReportSelection
+	IndustrialManagementId    string   `description:"产业Id"`
+	IndustrialManagementNames string   `description:"产业资源包名称  多个用 , 隔开"`
+	IndustrialSubjectId       int      `description:"标的ID"`
+	SubjectName               string   `description:"标的名称"`
+	IsShowApplyButton         bool     `description:"是否展示申请路由按钮"`
+	IsNew                     bool     `description:"是否展示新标签"`
+	Body                      string   `description:"内容"`
+	CompanyLabel              []string `description:"公司标签"`
+	Label                     string   `description:"公司标签"`
+	OverviewArticleId         int      `description:"综述报告Id"`
+	IsShowOverviewArticle     int      `description:"是否展示综述报告 1展示,0隐藏"`
+	ThirdId                   int      `description:"类似产业、标的的三方ID"`
+	ThirdName                 string   `description:"类似产业、标的的三方名称"`
+	Md5String                 string   `description:"Md5唯一标识"`
+	ShowName                  string   `description:"展示名称"`
+	List                      []*IndustriaReportSelection
 }
 type IndustriaReportSelection struct {
 	IndustrialManagementId int    `description:"产业Id"`

+ 17 - 13
models/report_selection_subject_history.go

@@ -6,22 +6,26 @@ import (
 )
 
 type CygxReportSelectionSubjectHistory struct {
-	Id                  int       `orm:"column(id);pk"`
-	ArticleId           int       `description:"文章ID"`
-	UserId              int       `description:"用户ID"`
-	CreateTime          time.Time `description:"创建时间"`
-	ModifyTime          time.Time `description:"修改时间"`
-	Mobile              string    `description:"手机号"`
-	Email               string    `description:"邮箱"`
-	CompanyId           int       `description:"公司id"`
-	CompanyName         string    `description:"公司名称"`
-	IndustrialSubjectId int       `description:"标的ID"`
-	RegisterPlatform    int       `description:"来源 1小程序,2:网页"`
+	Id                     int       `orm:"column(id);pk"`
+	ArticleId              int       `description:"文章ID"`
+	UserId                 int       `description:"用户ID"`
+	CreateTime             time.Time `description:"创建时间"`
+	ModifyTime             time.Time `description:"修改时间"`
+	Mobile                 string    `description:"手机号"`
+	Email                  string    `description:"邮箱"`
+	CompanyId              int       `description:"公司id"`
+	CompanyName            string    `description:"公司名称"`
+	IndustrialSubjectId    int       `description:"标的ID"`
+	IndustrialManagementId int       `description:"产业Id"`
+	ThirdId                int       `description:"类似产业、标的的三方ID"`
+	RegisterPlatform       int       `description:"来源 1小程序,2:网页"`
 }
 
 type AddCygxReportSelectionSubjectHistoryReq struct {
-	ArticleId           int `description:"文章id"`
-	IndustrialSubjectId int `description:"标的ID"`
+	ArticleId              int `description:"文章id"`
+	IndustrialSubjectId    int `description:"标的ID"`
+	IndustrialManagementId int `description:"产业Id"`
+	ThirdId                int `description:"类似产业、标的的三方ID"`
 }
 
 // 添加

+ 56 - 0
models/xzs_choose_category_zhouqi.go

@@ -0,0 +1,56 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type CygxXzsChooseCategoryZhouqi struct {
+	Id          int       `orm:"column(id);pk"`
+	UserId      int       `description:"用户ID"`
+	Mobile      string    `description:"手机号"`
+	Email       string    `description:"邮箱"`
+	CompanyId   int       `description:"公司id"`
+	CompanyName string    `description:"公司名称"`
+	RealName    string    `description:"用户实际名称"`
+	CategoryId  int       `description:"cygx_zhouqi_article_map 表主键"`
+	CreateTime  time.Time `description:"创建时间"`
+	ModifyTime  time.Time `description:"更新时间"`
+}
+
+// 根据手机号获取用户关注的产业
+func GetCygxXzsChooseCategoryZhouqiList(mobile string) (items []*CygxXzsChooseCategoryZhouqi, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_xzs_choose_category_zhouqi WHERE mobile = ?`
+	_, err = o.Raw(sql, mobile).QueryRows(&items)
+	return
+}
+
+// 添加
+func AddCygxCategoryFllowZhouqi(item *CygxXzsChooseCategoryZhouqi) (lastId int64, err error) {
+	o := orm.NewOrm()
+	lastId, err = o.Insert(item)
+	return
+}
+
+// 删除
+func RemoveCygxCategoryFllowZhouqi(mobile string, CategoryId int) (err error) {
+	o := orm.NewOrm()
+	sql := `DELETE FROM cygx_xzs_choose_category_zhouqi WHERE mobile=? AND category_id=? `
+	_, err = o.Raw(sql, mobile, CategoryId).Exec()
+	return
+}
+
+// 获取关注数量
+func GetCountCategoryFllowZhouqi(categoryId int, mobile string) (count int, err error) {
+	sql := `SELECT COUNT(1) AS count FROM cygx_xzs_choose_category_zhouqi WHERE mobile=? AND category_id=? `
+	err = orm.NewOrm().Raw(sql, mobile, categoryId).QueryRow(&count)
+	return
+}
+
+type XzsChooseMapZhouqiResp struct {
+	Id                  int    `description:"id"`
+	CategoryId          int    `description:"权益文章对应分类,cygx_article"`
+	CharPpermissionName string `description:"权限名称"`
+	MatchTypeName       string `description:"分类名称"`
+}

+ 59 - 0
models/zhouqi_article_map.go

@@ -0,0 +1,59 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+)
+
+type CygxZhouqiArticleMap struct {
+	CategoryId        int    `description:"产业Id"`
+	MatchTypeName     string `description:"行业名称"`
+	SeriesName        string `description:"系列名称"`
+	ArticleUpdateTime string `description:"对应文章的更新时间"`
+}
+
+type CygxZhouqiArticleDetail struct {
+	FiccReportId string `description:"Ficc研报单一篇报告,多个地方展示配置项"`
+}
+
+// 获取周期下面的一级分类
+func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			category_id,
+			match_type_name,
+			series_name,
+			article_update_time 
+		FROM
+			cygx_zhouqi_article_map 
+		WHERE
+			hidden = 0 
+			AND parent_id = 0 
+		ORDER BY
+			sort DESC `
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
+// 根据父级分类ID获取下面的子分类
+func GetCygxZhouqiArticleMapByParentId(parentId int) (items []*CygxZhouqiArticleMap, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			category_id,
+			match_type_name,
+			series_name,
+			article_update_time 
+		FROM
+			cygx_zhouqi_article_map 
+		WHERE
+			parent_id = ?  `
+	_, err = o.Raw(sql, parentId).QueryRows(&items)
+	return
+}
+
+// 通过纪要ID获取详情
+func GetCygxZhouqiArticleMapInfoById(categoryId int) (item *CygxZhouqiArticleDetail, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_zhouqi_article_map  WHERE category_id=?  `
+	err = o.Raw(sql, categoryId).QueryRow(&item)
+	return
+}

+ 27 - 0
routers/commentsRouter.go

@@ -619,6 +619,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileReportController"],
+        beego.ControllerComments{
+            Method: "ZhouqiTacticsList",
+            Router: `/tactics/zhouqi_list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileReportController"],
         beego.ControllerComments{
             Method: "Timeline",
@@ -646,6 +655,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileReportController"],
+        beego.ControllerComments{
+            Method: "ZouqiTradeList",
+            Router: `/zhouqi_tradeList`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileResearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileResearchController"],
         beego.ControllerComments{
             Method: "Billboard",
@@ -835,6 +853,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "CategoryZhouqiFllow",
+            Router: `/category/zhouqi_fllow`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ReportController"],
         beego.ControllerComments{
             Method: "CommentAdd",

+ 19 - 0
services/activity.go

@@ -699,6 +699,13 @@ func ActivityButtonShow(item *models.ActivityDetail, user *models.WxUserItem, pe
 					activityDetail.IsShowMeetingReminder = true
 					activityDetail.IsShowOutboundCall = true
 				}
+				if activityDetail.IsZoom == 1 {
+					activityDetail.IsShowMeetingReminder = true
+					if activityDetail.LimitPeopleNum == 0 {
+						activityDetail.IsShowOutboundCall = false
+					}
+				}
+
 			}
 
 			//公司线下调研 4
@@ -822,6 +829,8 @@ func ActivityButtonShow(item *models.ActivityDetail, user *models.WxUserItem, pe
 		IsExternalLabel:         v.IsExternalLabel,
 		SiginupDeadline:         v.SiginupDeadline,
 		CancelDeadline:          v.CancelDeadline,
+		IsZoom:                  v.IsZoom,
+		MeetingId:               v.MeetingId,
 	}
 	au := new(models.UserPermissionAuthInfo)
 	au.SellerName = authInfo.SellerName
@@ -979,6 +988,13 @@ func ActivityArrButtonShow(items []*models.ActivityDetail, user *models.WxUserIt
 						activityDetail.IsShowMeetingReminder = true
 						activityDetail.IsShowOutboundCall = true
 					}
+
+					if activityDetail.IsZoom == 1 {
+						activityDetail.IsShowMeetingReminder = true
+						if activityDetail.LimitPeopleNum == 0 {
+							activityDetail.IsShowOutboundCall = false
+						}
+					}
 				}
 
 				//公司线下调研 4
@@ -1089,7 +1105,10 @@ func ActivityArrButtonShow(items []*models.ActivityDetail, user *models.WxUserIt
 			CancelDeadline:          v.CancelDeadline,
 			IsYidongActivity:        v.IsYidongActivity,
 			TopTime:                 v.TopTime,
+			IsZoom:                  v.IsZoom,
+			MeetingId:               v.MeetingId,
 		}
+
 		au := new(models.UserPermissionAuthInfo)
 		au.SellerName = authInfo.SellerName
 		au.SellerMobile = authInfo.SellerMobile

+ 29 - 5
services/cygx_yanxuan_special_company.go

@@ -154,6 +154,22 @@ func AddSpecialRecord(user *models.WxUserItem, specialId, stopTime int) (err err
 					return
 				}
 			}
+		} else {
+			//专栏Pv数量进行加一
+			e = models.UpdateYanxuanSpecialHzPv(specialId)
+			if e != nil {
+				err = errors.New("UpdateYanxuanSpecialHzPv, Err: " + e.Error())
+				return
+			}
+
+			//如果没有阅读过,那么就给专栏文章的UV、作者的UV进行加一
+			if totalRecord == 0 {
+				e = models.UpdateYanxuanSpecialHzUv(specialId)
+				if e != nil {
+					err = errors.New("UpdateYanxuanSpecialHzUv, Err: " + e.Error())
+					return
+				}
+			}
 		}
 	}
 
@@ -194,16 +210,24 @@ func GetYanxuanSpecialRecordByYanxuanSpecialId(articleIds []int) (mapResp map[in
 	}
 	var condition string
 	var pars []interface{}
-	condition = ` AND yanxuan_special_id IN (` + utils.GetOrmInReplace(lenIds) + `) `
+	//condition = ` AND yanxuan_special_id IN (` + utils.GetOrmInReplace(lenIds) + `) `
+	//pars = append(pars, articleIds)
+	//listPv, e := models.GetCygxYanxuanSpecialRecordListPv(condition, pars)
+	//if e != nil {
+	//	err = errors.New("GetCygxArticleHistoryRecordNewpvListPvCy, Err: " + e.Error())
+	//	return
+	//}
+	condition += ` AND id  IN (` + utils.GetOrmInReplace(lenIds) + `) `
 	pars = append(pars, articleIds)
-	listPv, e := models.GetCygxYanxuanSpecialRecordListPv(condition, pars)
-	if e != nil {
-		err = errors.New("GetCygxArticleHistoryRecordNewpvListPvCy, Err: " + e.Error())
+	listPv, e := models.GetYanxuanSpecialListBycondition(condition, pars, 0, lenIds)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("GetYanxuanSpecialListBycondition, Err: " + e.Error())
 		return
 	}
+
 	mapResp = make(map[int]int, 0)
 	for _, v := range listPv {
-		mapResp[v.YanxuanSpecialId] = v.Pv
+		mapResp[v.Id] = v.Pv + v.HzPv
 	}
 	return
 }

+ 33 - 0
services/ficc_report.go

@@ -0,0 +1,33 @@
+package services
+
+import (
+	"errors"
+	"fmt"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/utils"
+)
+
+// GetXzsChooseCategoryZhouqiMapByMobile 根据手机号获取周期分类的关注信息
+func GetXzsChooseCategoryZhouqiMapByMobile(mobile string) (mapResp map[int]bool) {
+	if mobile == "" {
+		return
+	}
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println("err:", err)
+			go utils.SendAlarmMsg(fmt.Sprint("更新周期对应分类下所管理文章的更新时间 失败,GetXzsChooseCategoryZhouqiMapByMobile Err:"+err.Error()+"mobile", mobile), 3)
+		}
+	}()
+
+	listFollw, e := models.GetCygxXzsChooseCategoryZhouqiList(mobile)
+	if e != nil {
+		err = errors.New("GetCygxZhouqiArticleMapByParentId, Err: " + err.Error())
+		return
+	}
+	mapResp = make(map[int]bool, 0)
+	for _, v := range listFollw {
+		mapResp[v.CategoryId] = true
+	}
+	return
+}

+ 11 - 3
services/tag.go

@@ -63,6 +63,7 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 	}
 
 	var tagType int // 定义特殊标签的类型,判断传过来的参数是否有固定标签的搜索
+	var tagName string
 	for _, tagInfo := range listTag {
 		//ActivityTypes 与 ArticleTypes 进行合并
 		if tagInfo.ActivityTypes != "" {
@@ -95,6 +96,7 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 		if tagType == 0 && tagInfo.TagType > 0 {
 			tagType = tagInfo.TagType
 		}
+		tagName = tagInfo.TagName
 	}
 	switch tagType {
 	case 0: // 无固定标签
@@ -183,7 +185,11 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 			}
 			conditionInit += " AND id IN  (" + strings.Join(resourceDataIdStrs, ",") + ")   "
 		}
-		//conditionInit += "	OR   IF    ( source IN ('ficcreport') , tag_name IN ('纪要')  ,1=1 ) "
+
+		var tagNames = []string{"纪要", "深度", "概览", "点评"}
+		if utils.InArrayByStr(tagNames, tagName) { //如果是这个四个类型的标签搜索单独针对FICC研报的周期行业进行筛选
+			conditionInit += " OR (  tag_name IN ('" + tagName + "')   AND  chart_permission_id =    " + strconv.Itoa(chartPermissionId) + ")  "
+		}
 	case 1: // 热门活动
 		conf, e := models.GetConfigByCode(utils.CYGX_TAG_HOT_ACTIVITY_ID)
 		if e != nil {
@@ -257,12 +263,14 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 	case 4: // 语音问答
 		conditionInit = "   AND source = '" + utils.CYGX_OBJ_ASKSERIEVIDEO + "'"
 
-	case 5: //固定标签【跟踪】,包含以下系列:医药-趋势观察 ,科技-产业跟踪 ,智造-产业跟踪 ,消费-月度调研 ,周期-(周度观点,产业跟踪)
-		condition = `   AND category_name IN ( '医药行业', '智造行业', '消费行业', '科技行业', '周期' )  
+	case 5: //固定标签【跟踪】,包含以下系列:医药-趋势观察 ,科技-产业跟踪 ,智造-产业跟踪 ,消费-月度调研 ,周期-(周度观点,产业跟踪),策略-(每日复盘),固收-(债市复盘)
+		condition = `   AND category_name IN ( '医药行业', '智造行业', '消费行业', '科技行业', '周期', '策略思考', '固收研究' )  
 						AND IF  ( category_name IN ( '医药行业' ), sub_category_name IN ( '趋势观察' ), 1 = 1 ) 
 						AND IF	( category_name IN ( '科技行业' ), sub_category_name IN ( '产业跟踪' ), 1 = 1 ) 
 						AND IF	( category_name IN ( '智造行业' ), sub_category_name IN ( '产业跟踪' ), 1 = 1 ) 
 						AND IF	( category_name IN ( '消费行业' ), sub_category_name IN ( '月度调研' ), 1 = 1 ) 
+						AND IF	( category_name IN ( '策略思考' ), sub_category_name IN ( '每日复盘' ), 1 = 1 ) 
+						AND IF	( category_name IN ( '固收研究' ), sub_category_name IN ( '债市复盘' ), 1 = 1 ) 
 						AND IF	( category_name IN ( '周期' ), sub_category_name IN ( '周度观点', '产业跟踪' ), 1 = 1 ) AND publish_status = 1 `
 		pars = make([]interface{}, 0)
 		articleList, e := models.GetArticleList(condition, pars)

+ 39 - 0
utils/config.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"github.com/beego/beego/v2/server/web"
 	"github.com/rdlucklib/rdluck_tools/cache"
+	"strconv"
 )
 
 var (
@@ -56,6 +57,8 @@ var (
 	RAI_MOBILE_WU_ANG_DI  string // 权益吴昂迪手机号
 	RAI_MOBILE_GE_LIN     string // 权益葛琳手机号
 
+	ZHOU_QI_ID int // 行业周期的ID
+
 )
 
 // 模板消息推送
@@ -70,6 +73,19 @@ var (
 	WxMsgCategoryTemplateIdActivityPublishApply      string //买方研选关注的产业下,单个活动/研选报告发布通知-类目模板ID
 )
 
+// 日志配置
+var (
+	LogPath     string //调用过程中的日志存放地址
+	LogFile     string
+	LogDataPath string //调用过程中图表相关的日志存放地址
+	LogDataFile string
+	BinLogPath  string //数据库相关的日志存放地址
+	BinLogFile  string
+	ApiLogPath  string //接口请求地址和接口返回值日志存放地址
+	ApiLogFile  string
+	LogMaxDays  int //日志最大保留天数
+)
+
 func init() {
 	tmpRunMode, err := web.AppConfig.String("run_mode")
 	if err != nil {
@@ -178,6 +194,20 @@ func init() {
 	}
 	HeadimgurlDefault = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202202/20220225/XFBBOUmDC5AXkfxnHiuqKpPtoofH.png"
 
+	//日志配置
+	{
+		LogPath = config["log_path"]
+		LogFile = config["log_file"]
+		LogDataPath = config["log_data_path"]
+		LogDataFile = config["log_data_file"]
+		BinLogPath = config["binlog_path"]
+		BinLogFile = config["binlog_file"]
+		ApiLogPath = config["apilog_path"]
+		ApiLogFile = config["apilog_file"]
+		logMaxDaysStr := config["log_max_day"]
+		LogMaxDays, _ = strconv.Atoi(logMaxDaysStr)
+	}
+
 	//易董开放api配置
 	YiDongApiConfig()
 }
@@ -199,6 +229,15 @@ func YiDongApiConfig() {
 	}
 }
 
+// 行业ID信息
+func ChartPermissionId() {
+	if RunMode == "release" {
+		ZHOU_QI_ID = 62
+	} else {
+		ZHOU_QI_ID = 148
+	}
+}
+
 //http://webapi.brilliantstart.cn/api/
 //http://webapi.brilliantstart.cn/swagger/
 //http://139.196.122.219:8603/swagger/

+ 142 - 7
utils/logs.go

@@ -1,20 +1,155 @@
 package utils
 
 import (
+	"encoding/json"
 	"github.com/beego/beego/v2/core/logs"
 	"os"
-	"time"
+	"path"
+)
+
+//var FileLog *logs.BeeLogger
+//var BinLog *logs.BeeLogger
+//
+//func init() {
+//	FileLog = logs.NewLogger(1000000)
+//	FileLog.SetLogger(logs.AdapterFile, `{"filename":"./rdlucklog/hongze_clpt.log"}`)
+//
+//	binLogDir := `./binlog`
+//	os.MkdirAll(binLogDir, os.ModePerm)
+//	BinLog = logs.NewLogger(1000000)
+//	BinLog.SetLogger(logs.AdapterMultiFile, `{"filename":"./binlog/binlog.`+time.Now().Format(FormatDate)+`.log","maxdays":30}`)
+//}
+
+const (
+	DefaultLogPath    = "./cygxlogs/filelog"
+	DefaultBinlogPath = "./cygxlogs/binlog"
+	DefaultDataPath   = "./cygxlogs/datalog"
+	DefaultApiLogPath = "./cygxlogs/apilog"
 )
 
 var FileLog *logs.BeeLogger
-var BinLog *logs.BeeLogger
+var ApiLog *logs.BeeLogger
+var FileLogData *logs.BeeLogger
+var Binlog *logs.BeeLogger
 
 func init() {
+	if LogMaxDays == 0 {
+		LogMaxDays = 7
+	}
+	logPath := LogPath
+	if logPath == "" {
+		logPath = DefaultLogPath
+	}
+	logFile := LogFile
+	if logFile == "" {
+		logFile = "filelog.log"
+	}
+	os.MkdirAll(logPath, os.ModePerm)
+
+	// 打开文件
+	logFileName := path.Join(logPath, logFile)
 	FileLog = logs.NewLogger(1000000)
-	FileLog.SetLogger(logs.AdapterFile, `{"filename":"./rdlucklog/hongze_clpt.log"}`)
+	logConf := getDefaultLogConfig()
+
+	logConf.FileName = logFileName
+	b, _ := json.Marshal(logConf)
+	FileLog.SetLogger(logs.AdapterFile, string(b))
+	FileLog.EnableFuncCallDepth(true)
+
+	initBinlog()
+	initApiLog()
+	initFileLogData()
+}
+
+type logConfig struct {
+	FileName string `json:"filename" description:"保存的文件名"`
+	MaxLines int    `json:"maxlines"  description:"每个文件保存的最大行数,默认值 1000000"`
+	MaxSize  int    `json:"maxsize" description:"每个文件保存的最大尺寸,默认值是 1 << 28, //256 MB"`
+	Daily    bool   `json:"daily" description:"是否按照每天 logrotate,默认是 true"`
+	MaxDays  int    `json:"maxdays" description:"文件最多保存多少天,默认保存 7 天"`
+	Rotate   bool   `json:"rotate" description:"是否开启 logrotate,默认是 true"`
+	Level    int    `json:"level" description:"日志保存的时候的级别,默认是 Trace 级别"`
+	Color    bool   `json:"color" description:"日志是否输出颜色"`
+	//Perm     string `json:"perm" description:"日志文件权限"`
+}
+
+func initBinlog() {
+	//binlog日志
+	//binlog日志
+	binlogPath := BinLogPath
+	if binlogPath == "" {
+		binlogPath = DefaultBinlogPath
+	}
+	binlogFile := BinLogFile
+	if binlogFile == "" {
+		binlogFile = "binlog.log"
+	}
+	os.MkdirAll(binlogPath, os.ModePerm)
+	logFileName := path.Join(binlogPath, binlogFile)
+	Binlog = logs.NewLogger(1000000)
+	logConf := getDefaultLogConfig()
+
+	logConf.FileName = logFileName
+	//logConf.MaxLines = 10000000
+	//logConf.Rotate = true
+	b, _ := json.Marshal(logConf)
+	Binlog.SetLogger(logs.AdapterFile, string(b))
+	Binlog.EnableFuncCallDepth(true)
+}
+
+func initApiLog() {
+	logPath := ApiLogPath
+	if logPath == "" {
+		logPath = DefaultApiLogPath
+	}
+	logFile := ApiLogFile
+	if logFile == "" {
+		logFile = "apilog.log"
+	}
+	os.MkdirAll(logPath, os.ModePerm)
+
+	// 打开文件
+	logFileName := path.Join(logPath, logFile)
+	ApiLog = logs.NewLogger(1000000)
+	logConf := getDefaultLogConfig()
+
+	logConf.FileName = logFileName
+	b, _ := json.Marshal(logConf)
+	ApiLog.SetLogger(logs.AdapterFile, string(b))
+	ApiLog.EnableFuncCallDepth(true)
+}
+
+func initFileLogData() {
+	logPath := LogDataPath
+	if logPath == "" {
+		logPath = DefaultDataPath
+	}
+	logFile := LogDataFile
+	if logFile == "" {
+		logFile = "datalog.log"
+	}
+	os.MkdirAll(logPath, os.ModePerm)
+
+	// 打开文件
+	logFileName := path.Join(logPath, logFile)
+	FileLogData = logs.NewLogger(1000000)
+	logConf := getDefaultLogConfig()
+
+	logConf.FileName = logFileName
+	b, _ := json.Marshal(logConf)
+	FileLogData.SetLogger(logs.AdapterFile, string(b))
+	FileLogData.EnableFuncCallDepth(true)
+}
 
-	binLogDir := `./binlog`
-	os.MkdirAll(binLogDir, os.ModePerm)
-	BinLog = logs.NewLogger(1000000)
-	BinLog.SetLogger(logs.AdapterMultiFile, `{"filename":"./binlog/binlog.`+time.Now().Format(FormatDate)+`.log","maxdays":30}`)
+func getDefaultLogConfig() logConfig {
+	return logConfig{
+		FileName: "",
+		MaxLines: 10000000,
+		MaxSize:  1 << 28,
+		Daily:    true,
+		MaxDays:  LogMaxDays, //我就是喜欢31天,咋滴,不喜欢你就自己改-_-!
+		Rotate:   true,
+		Level:    logs.LevelTrace,
+		//Perm:     "",
+	}
 }