Explorar o código

Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_cygx into cygx_13.9

zhangchuanxing hai 1 día
pai
achega
560174645a
Modificáronse 43 ficheiros con 1723 adicións e 1987 borrados
  1. 2 1
      .gitignore
  2. 3 0
      controllers/activity.go
  3. 1 1
      controllers/article.go
  4. 1 1
      controllers/banner.go
  5. 54 12
      controllers/base_auth.go
  6. 53 11
      controllers/base_auth_mobile.go
  7. 49 39
      controllers/base_common.go
  8. 1 1
      controllers/home.go
  9. 184 0
      controllers/report.go
  10. 41 34
      controllers/report_selection.go
  11. 4 1
      controllers/tactics.go
  12. 1 1
      controllers/yanxuan_special.go
  13. 13 0
      models/activity.go
  14. 61 44
      models/article.go
  15. 28 2
      models/cygx_yanxuan_special.go
  16. 12 3
      models/db.go
  17. 16 0
      models/ficc_report/ficc_report_by_hand.go
  18. 3 3
      models/ficc_report/report.go
  19. 24 0
      models/report.go
  20. 24 14
      models/report_selection.go
  21. 17 12
      models/report_selection_subject_history.go
  22. 12 0
      models/resource_data.go
  23. 10 0
      models/tactics.go
  24. 14 10
      models/yidong.go
  25. 89 0
      models/yidong/yidong_activity.go
  26. 71 0
      models/yidong/yidong_activity_meet_data.go
  27. 79 0
      models/zhouqi_article_map.go
  28. 18 0
      routers/commentsRouter.go
  29. 13 292
      services/activity.go
  30. 1 117
      services/activity_signup_detail.go
  31. 36 1334
      services/article.go
  32. 49 0
      services/cygx_yanxuan_special.go
  33. 31 5
      services/cygx_yanxuan_special_company.go
  34. 69 1
      services/ficc_report.go
  35. 2 2
      services/rai_company_user_bill.go
  36. 7 7
      services/rai_serve_count.go
  37. 1 0
      services/resource_data.go
  38. 7 7
      services/tactics.go
  39. 12 3
      services/tag.go
  40. 6 0
      services/task.go
  41. 433 21
      services/yidong.go
  42. 29 1
      utils/config.go
  43. 142 7
      utils/logs.go

+ 2 - 1
.gitignore

@@ -7,4 +7,5 @@
 /*.zip
 /riot-index
 /hongze_cygx
-/static
+/static
+cygxlogs/

+ 3 - 0
controllers/activity.go

@@ -874,6 +874,9 @@ func (this *ActivityCoAntroller) SignupAdd() {
 				go services.ActivityUserRemind(user, activityInfo, 4)
 				//resp.PopupMsg = "<b>报名成功,已加入您的活动日程</b><br/>想要及时获取活动信息变更通知,请关注【查研观向小助手】公众号"
 				resp.PopupMsg = "<b>报名成功,已加入您的活动日程</b><br/>是否将活动日程加入您的系统日历,\n\n活动开始前获取手机日历提醒?"
+				if activityInfo.IsZoom == 1 && activityInfo.IsLimitPeople > 0 {
+					resp.PopupMsg = "<b>报名成功,已加入您的活动日程</b><br/><b>届时请通过zoom会议链接或app自主入会</b><br/>是否将活动日程加入您的系统日历,\n\n活动开始前获取手机日历提醒?"
+				}
 			}
 
 			// 如果是买方研选下的专家沙龙,同时推给内容组四人

+ 1 - 1
controllers/article.go

@@ -259,7 +259,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
 				}
 			}

+ 1 - 1
controllers/banner.go

@@ -122,7 +122,7 @@ func (this *BannerController) ListYx() {
 	if utils.RunMode == "release" {
 		listA = []*models.BannerUrlYxResp{
 			//&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/1.png", Path: "pages-purchaser/leaflet/leaflet?leafletImage=https%3A%2F%2Fhzstatic.hzinsights.com%2Fcygx%2Fconfig%2Fresearch_11_0.png"},
-			&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/1.png", Path: "pages-purchaser/leaflet/leaflet?leafletImage=https%3A%2F%2Fhzstatic.hzinsights.com%2Fcygx%2Fconfig%2Fresearch_11_1.png"},
+			//&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/1.png", Path: "pages-purchaser/leaflet/leaflet?leafletImage=https%3A%2F%2Fhzstatic.hzinsights.com%2Fcygx%2Fconfig%2Fresearch_11_1.png"},
 			&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/2.png", Path: "pages-purchaser/survey/surveySubmit"},
 			//&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/4.png", Path: "pages-purchaser/specialColumn/specialColumn"},
 			&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/3_long.png", Path: "pages-purchaser/researchList/researchList"},

+ 54 - 12
controllers/base_auth.go

@@ -10,20 +10,19 @@ import (
 	"net/http"
 	"net/url"
 	"strconv"
-
-	"github.com/rdlucklib/rdluck_tools/log"
+	"strings"
 )
 
-var apiLog *log.Log
+//var apiLog *log.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 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_cygx/models"
 	"hongze/hongze_cygx/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
@@ -129,9 +128,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
+}

+ 49 - 39
controllers/base_common.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"encoding/json"
+	"fmt"
 	"github.com/beego/beego/v2/server/web"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/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,41 +39,8 @@ 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
-	}
+	ip := this.Ctx.Input.IP()
+	utils.ApiLog.Info("uri:%s, requestBody:%s, responseBody:%s, ip:%s", this.Ctx.Input.URI(), requestBody, ip)
 	//this.Token = authorization
 }
 
@@ -113,10 +81,52 @@ 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)
-
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	c.logUri(content, requestBody, 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
+}

+ 1 - 1
controllers/home.go

@@ -674,7 +674,7 @@ func (this *HomeController) 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()

+ 184 - 0
controllers/report.go

@@ -3936,3 +3936,187 @@ func (this *ReportController) ResearchSummaryVoiceHistoryAdd() {
 	br.Msg = "操作成功"
 	return
 }
+
+// @Title 周期行业报告分类列表接口
+// @Description 周期获取行业报告分类列表接口
+// @Success 200 {object} models.TradeReportMappingResp
+// @router /zhouqi_tradeList [get]
+func (this *ReportController) 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
+	}
+
+	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 = v.ArticleUpdateTime
+			//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 *ReportController) 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.TacticsListZhouqiResp)
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	list := make([]*models.HomeArticle, 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 = "GetReportAndproductIndustrylListimgZhouqi,Err:" + err.Error()
+		return
+	}
+
+	listPublic, err := services.HandleArticleCategoryImg(list)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取报告封面图片失败, Err:" + err.Error()
+		return
+	}
+
+	var articleIds []int
+	for _, v := range listPublic {
+		if v.Resource == 1 {
+			articleIds = append(articleIds, v.ArticleId)
+		}
+	}
+
+	articleMapPv := services.GetArticleHistoryByArticleId(articleIds)                       //文章Pv
+	articleCollectMap, _ := services.GetCygxArticleCollectMap(user.UserId)                  //用户收藏的文章
+	articleCollectNumMap, _ := services.GetCygxArticleCollectNumMapByArtcileIds(articleIds) //文章收藏的数量
+	resp.IsShowAbstract = true
+	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.ReportId > 0 {
+			item.Resource = 3
+		}
+		if v.Abstract != "" {
+			item.IsShowAbstract = resp.IsShowAbstract
+		}
+
+		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
+}

+ 41 - 34
controllers/report_selection.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"encoding/json"
+	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
@@ -165,8 +166,33 @@ func (this *ReportSelectionController) Detail() {
 					if v2.Label != "" {
 						v2.CompanyLabel = strings.Split(v2.Label, "{|}")
 					}
+					if v2.SubjectName == "" {
+						v2.ShowName = v2.IndustrialManagementNames
+					} else {
+						v2.ShowName = v2.SubjectName
+					}
+				}
+				if v2.ThirdName != "" {
+					v2.ShowName = v2.ThirdName
 				}
-				itemSubject.ListSubject = append(itemSubject.ListSubject, &models.ReportSelectionChartLogSubjectName{SubjectName: v2.SubjectName, IsNew: v2.IsNew, IndustrialSubjectId: v2.IndustrialSubjectId})
+				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
@@ -178,28 +204,6 @@ 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.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 models.AddCygxReportHistoryRecord(historyRecord)
 	resp.List = items
 	resp.ListPermissionSubject = itemsSubject
 	resp.Detail = detail
@@ -237,21 +241,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,
+		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 {

+ 4 - 1
controllers/tactics.go

@@ -108,7 +108,7 @@ func (this *TacticsController) List() {
 			return
 		}
 		resp.MatchTypeName = detail.MatchTypeName
-		if detail.MatchTypeName == "热点问答" {
+		if detail.MatchTypeName == "热点问答" || detail.ChartPermissionName == utils.ZHOU_QI_NAME || detail.ChartPermissionName == utils.GU_SHOU_NAME {
 			resp.IsShowAbstract = true
 		}
 	}
@@ -130,6 +130,9 @@ func (this *TacticsController) List() {
 		if v.ReportId > 0 {
 			v.Resource = 3
 		}
+		if v.Abstract != "" {
+			v.IsShowAbstract = true
+		}
 	}
 	resp.List = list
 	resp.Paging = page

+ 1 - 1
controllers/yanxuan_special.go

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

+ 13 - 0
models/activity.go

@@ -243,6 +243,8 @@ type ActivityDetail struct {
 	CancelDeadline            string                     `description:"取消报名截止时间"`
 	ChartPermissionNameDeputy string                     `description:"副行业名称"`
 	TopTime                   int                        `description:"置顶时间"`
+	IsZoom                    int                        `description:"是否是Zoom模版  1是,0否"`
+	MeetingId                 string                     `description:"会议ID"`
 }
 type ListArticleActivity struct {
 	Title   string `description:"文章标题"`
@@ -483,6 +485,7 @@ func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpe
 			art.is_external_label,
 			art.siginup_deadline,
 			art.is_research_points,
+			art.is_zoom,
 			art.cancel_deadline
 		FROM
 			cygx_activity AS art
@@ -518,6 +521,7 @@ func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpe
 			"",
 			"",
 			"",
+			"",
 			""
 		FROM
 			cygx_activity_special AS art
@@ -1392,3 +1396,12 @@ WHERE
 	_, err = o.Raw(sql, endDate).QueryRows(&items)
 	return
 }
+
+// UpdateCygxActivityyidongActivityId  ,建立与易董的活动关联
+func UpdateCygxActivityyidongActivityId(yidongActivityId, activityTime, yidongTitle string) (err error) {
+	yidongTitle = "%" + yidongTitle + "%"
+	o := orm.NewOrm()
+	sql := ` UPDATE cygx_activity SET yidong_activity_id_by_cygx = ?  WHERE yidong_activity_id= '' AND   yidong_activity_id_by_cygx = ''  AND jmcj_activity_id= ''  AND  active_state = 3  AND  activity_time =?  AND activity_name_task LIKE  ?    `
+	_, err = o.Raw(sql, yidongActivityId, activityTime, yidongTitle).Exec()
+	return
+}

+ 61 - 44
models/article.go

@@ -8,49 +8,53 @@ import (
 )
 
 type CygxArticle struct {
-	Id               int    `orm:"column(id);pk"`
-	ArticleId        int    `description:"文章id"`
-	Title            string `description:"标题"`
-	TitleEn          string `description:"英文标题 "`
-	UpdateFrequency  string `description:"更新周期"`
-	CreateDate       string `description:"创建时间"`
-	PublishDate      string `description:"发布时间"`
-	Body             string `description:"内容"`
-	BodyText         string `description:"内容"`
-	Abstract         string `description:"摘要"`
-	CategoryName     string `description:"一级分类"`
-	SubCategoryName  string `description:"二级分类"`
-	PublishStatus    int    `description:"发布状态"`
-	CategoryId       int    `description:"分类id"`
-	CategoryIdTwo    int    `description:"分类id用作修改匹配类型使用"`
-	ExpertBackground string `description:"专家背景"`
-	ExpertNumber     string `description:"专家编号"`
-	InterviewDate    string `description:"访谈日期"`
-	Department       string `description:"作者"`
-	ArticleIdMd5     string `description:"ID,md5值"`
-	IsClass          int    `description:"是否归类,1是,0否"`
-	IsSummary        int    `description:"是否是纪要库,1是,0否"`
-	IsReport         int    `description:"是否属于报告,1是,0否"`
-	ReportType       int    `description:"报告类型,1行业报告,2产业报告,0无"`
-	FileLink         string `description:"下载预览链接"`
-	MatchTypeName    string `description:"匹配类型"`
-	Periods          string `description:"期数"`
-	ReportLink       string `description:"报告链接"`
-	ArticleType      string `description:"文章类型 文章类型,lyjh:路演精华 "`
-	HavePublish      int    `description:"是否发布过,1是 ,0 否"`
-	Source           int    `description:"来源 0策略平台同步,1小程序后台添加"`
-	SellerAndMobile  string `description:"销售和手机号"`
-	VideoUrl         string `description:"音频文件URL"`
-	VideoName        string `description:"音频文件名称"`
-	VideoPlaySeconds string `description:"音频播放时长"`
-	Stock            string `description:"个股标签"`
-	FieldName        string `description:"产业标签"`
-	Annotation       string `description:"核心观点"`
-	TypeName         string `description:"策略平台报告类型"`
-	ModifyTimeByCl   string `description:"策略平台报告更新时间"`
-	CeLueFieldId     int    `description:"策略平台领域ID"`
-	Cover            string `description:"封面图片"`
-	ReportId         int    `description:"FICC研报ID"`
+	Id                  int       `orm:"column(id);pk"`
+	ArticleId           int       `description:"文章id"`
+	Title               string    `description:"标题"`
+	TitleEn             string    `description:"英文标题 "`
+	UpdateFrequency     string    `description:"更新周期"`
+	CreateDate          string    `description:"创建时间"`
+	PublishDate         string    `description:"发布时间"`
+	Body                string    `description:"内容"`
+	BodyText            string    `description:"内容"`
+	Abstract            string    `description:"摘要"`
+	CategoryName        string    `description:"一级分类"`
+	SubCategoryName     string    `description:"二级分类"`
+	PublishStatus       int       `description:"发布状态"`
+	CategoryId          int       `description:"分类id"`
+	CategoryIdTwo       int       `description:"分类id用作修改匹配类型使用"`
+	ExpertBackground    string    `description:"专家背景"`
+	ExpertNumber        string    `description:"专家编号"`
+	InterviewDate       string    `description:"访谈日期"`
+	Department          string    `description:"作者"`
+	ArticleIdMd5        string    `description:"ID,md5值"`
+	IsClass             int       `description:"是否归类,1是,0否"`
+	IsSummary           int       `description:"是否是纪要库,1是,0否"`
+	IsReport            int       `description:"是否属于报告,1是,0否"`
+	ReportType          int       `description:"报告类型,1行业报告,2产业报告,0无"`
+	FileLink            string    `description:"下载预览链接"`
+	MatchTypeName       string    `description:"匹配类型"`
+	Periods             string    `description:"期数"`
+	ReportLink          string    `description:"报告链接"`
+	ArticleType         string    `description:"文章类型 文章类型,lyjh:路演精华 "`
+	HavePublish         int       `description:"是否发布过,1是 ,0 否"`
+	Source              int       `description:"来源 0策略平台同步,1小程序后台添加"`
+	SellerAndMobile     string    `description:"销售和手机号"`
+	VideoUrl            string    `description:"音频文件URL"`
+	VideoName           string    `description:"音频文件名称"`
+	VideoPlaySeconds    string    `description:"音频播放时长"`
+	Stock               string    `description:"个股标签"`
+	FieldName           string    `description:"产业标签"`
+	SeriesName          string    `description:"系列名称"`
+	Annotation          string    `description:"核心观点"`
+	TypeName            string    `description:"策略平台报告类型"`
+	ModifyTimeByCl      string    `description:"策略平台报告更新时间"`
+	CeLueFieldId        int       `description:"策略平台领域ID"`
+	Cover               string    `description:"封面图片"`
+	ReportId            int       `description:"FICC研报ID"`
+	CreateTime          time.Time `description:"创建时间"`
+	ChartPermissionId   int       `description:"行业id"`
+	ChartPermissionName string    `description:"行业名称"`
 }
 
 type CygxArticleEs struct {
@@ -124,6 +128,10 @@ type HomeArticle struct {
 	BodyHighlight       []string             `description:"搜索高亮展示结果"`
 	ArticleTypeId       int                  `description:"文章类型ID"`
 	ReportId            int                  `description:"FICC研报ID"`
+	Resource            int                  `description:"来源类型,1:文章、2:产品内测"`
+	IsCollect           bool                 `description:"本人是否收藏"`
+	CollectNum          int                  `description:"收藏人数"`
+	IsShowAbstract      bool                 `description:"是否展示摘要"`
 	List                []*IndustrialManagementIdInt
 }
 
@@ -330,6 +338,14 @@ func GetArticleList(condition string, pars []interface{}) (items []*ArticleDetai
 	return
 }
 
+// 获取文章列表
+func GetArticleListHomeTag(condition string, pars []interface{}) (items []*ArticleDetail, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT	article_id,stock FROM cygx_article  WHERE 1= 1 ` + condition
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}
+
 func ModifyArticleContent(articleId int, content, expertNumStr, expertContentStr, interviewDateStr string) (err error) {
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_article SET body=?,expert_background=?,expert_number=?,interview_date=? WHERE article_id=? `
@@ -439,6 +455,7 @@ type ReportArticle struct {
 	IsCollect        bool   `description:"本人是否收藏"`
 	Pv               int    `description:"PV"`
 	CollectNum       int    `description:"收藏人数"`
+	IsShowAbstract   bool   `description:"是否展示摘要"`
 }
 
 type ReportMappingCategoryRep struct {
@@ -1045,7 +1062,7 @@ func GetCygxCygxArticleListByReportIds(reportIds []int) (items []*CygxArticle, e
 // 已经同步到查研的FICC研报列表
 func GetCygxCygxArticleFiccReportList() (items []*CygxArticle, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT article_id ,report_id FROM cygx_article as art WHERE report_id > 0 `
+	sql := `SELECT article_id ,report_id,publish_status FROM cygx_article as art WHERE report_id > 0 `
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }

+ 28 - 2
models/cygx_yanxuan_special.go

@@ -55,8 +55,9 @@ type CygxYanxuanSpecialItem struct {
 	ContentHasImg   int  //正文是否包含图片 1包含 0不包含
 	ContentHasStyle bool //正文是否包含格式
 	Docs            []Doc
-	Pv              string `description:"Pv"`
-	Uv              string `description:"Uv"`
+	Pv              int `description:"Pv"`
+	Uv              int `description:"Uv"`
+	HzPv            int `description:"HzPv"`
 }
 
 type CygxYanxuanSpecialResp struct {
@@ -104,6 +105,7 @@ type CygxYanxuanSpecialCenterResp struct {
 	Source           string   `description:"来源"`
 	Pv               int      `description:"Pv"`
 	Uv               int      `description:"Uv"`
+	HzPv             int      `description:"HzPv"`
 	PublishDate      string   // 提审过审或驳回时间      string `description:"核心观点"`
 	BodyHighlight    []string `description:"搜索高亮展示结果"`
 	LikeCount        int      `description:"点赞数量"`
@@ -311,6 +313,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()
@@ -319,6 +329,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 UpdateYanxuanSpecialPvNUm(pv, id int) (err error) {
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_yanxuan_special SET pv = ? WHERE id = ? `
@@ -377,3 +395,11 @@ func UpdateYanxuanSpecialLikeCountHistory() (err error) {
 	_, err = o.Raw(sql).Exec()
 	return
 }
+
+// UpdateYanxuanSpecialHzPv 修改研选专栏的阅读弘则Pv
+func Need_1006INIT(hz_pv, hz_uv, id int) (err error) {
+	o := orm.NewOrm()
+	sql := `UPDATE cygx_yanxuan_special SET hz_pv= ? , hz_uv = ?  WHERE id = ? `
+	_, err = o.Raw(sql, hz_pv, hz_uv, id).Exec()
+	return
+}

+ 12 - 3
models/db.go

@@ -1,15 +1,15 @@
 package models
 
 import (
+	"github.com/beego/beego/v2/client/orm"
 	_ "github.com/go-sql-driver/mysql"
 	"hongze/hongze_cygx/models/ficc_report"
 	"hongze/hongze_cygx/models/order"
 	"hongze/hongze_cygx/models/rai_serve"
 	"hongze/hongze_cygx/models/time_line"
+	"hongze/hongze_cygx/models/yidong"
 	"hongze/hongze_cygx/utils"
 	"time"
-
-	"github.com/beego/beego/v2/client/orm"
 )
 
 func init() {
@@ -199,10 +199,11 @@ func init() {
 	initOrder()      // 订单模块
 	initRaiServe()   // 权益服务记录模块
 	initFiccReport() // 权益服务记录模块
+	initYidong()     // 易董初始化数据模块
 
 	// 记录ORM查询日志
 	orm.Debug = true
-	orm.DebugLog = orm.NewLog(utils.BinLog)
+	orm.DebugLog = orm.NewLog(utils.Binlog)
 
 }
 
@@ -234,3 +235,11 @@ func initFiccReport() {
 		new(ficc_report.FiccYbXcxHistory), //ficc研报小程序点击记录
 	)
 }
+
+// initYidong
+func initYidong() {
+	orm.RegisterModel(
+		new(yidong.CygxYidongActivity),         //易董活动原始数据
+		new(yidong.CygxYidongActivityMeetData), //易董活动到会信息原始数据
+	)
+}

+ 16 - 0
models/ficc_report/ficc_report_by_hand.go

@@ -0,0 +1,16 @@
+package ficc_report
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+)
+
+type CygxFiccReportByHand struct {
+	FiccReportId int `description:"FICC研报ID"`
+}
+
+func GetCygxFiccReportByHandList() (items []*CygxFiccReportByHand, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT ficc_report_id  FROM  cygx_ficc_report_by_hand LIMIT 1000  `
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}

+ 3 - 3
models/ficc_report/report.go

@@ -138,12 +138,12 @@ func GetFiccRreportToCygxArticle(condition string, pars []interface{}) (items []
 	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 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   `
+			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
 }

+ 24 - 0
models/report.go

@@ -1540,3 +1540,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 []*HomeArticle, 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 - 12
models/report_selection_subject_history.go

@@ -6,21 +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"`
+	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"`
+	RegisterPlatform       int       `description:"来源 1小程序,2:网页"`
+	ThirdId                int       `description:"类似产业、标的的三方ID"`
 }
 
 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"`
 }
 
 // 添加

+ 12 - 0
models/resource_data.go

@@ -218,3 +218,15 @@ func HideCygxResourceDataFiccReport(sourceIds []int) (err error) {
 
 	return
 }
+
+// 更新搜索标题
+func UpdatecygxResourceDatasearchTitle(searchTitle string, sourceId int) (err error) {
+	o := orm.NewOrm()
+	sql := ` UPDATE cygx_resource_data SET search_title= ?  WHERE source_id =  ? AND   source = 'article'  `
+	_, err = o.Raw(sql, searchTitle, sourceId).Exec()
+	if err != nil {
+		return
+	}
+
+	return
+}

+ 10 - 0
models/tactics.go

@@ -80,6 +80,7 @@ type Tactics2 struct {
 	ReportType      int       `description:"报告类型,1行业报告,2产业报告,0无"`
 	Stock           string    `description:"个股标签"`
 	FieldName       string    `description:"产业标签"`
+	SeriesName      string    `description:"系列名称"`
 	File            string    `description:"Pdf下载链接"`
 	TypeName        string    `description:"策略平台报告类型"`
 	UpdateDate      string    `description:"策略平台报告更新时间"`
@@ -124,6 +125,15 @@ type TacticsListResp struct {
 	List              []*ReportArticle
 }
 
+type TacticsListZhouqiResp struct {
+	Paging            *paging.PagingItem
+	MatchTypeName     string `description:"匹配类型"`
+	ChartPermissionId int    `description:"行业ID"`
+	CategoryImgUrlPc  string `description:"图片"`
+	IsShowAbstract    bool   `description:"是否展示摘要"`
+	List              []*HomeArticle
+}
+
 func GetReportTacticsList(condition string, pars []interface{}, userId, startSize, pageSize int) (items []*ReportArticle, err error) {
 	o := orm.NewOrm()
 	sql := ` SELECT * ,(SELECT COUNT(1) FROM cygx_article_history_record AS rec WHERE rec.user_id = ` + strconv.Itoa(userId) + ` AND  rec.article_id=a.article_id) AS readnum

+ 14 - 10
models/yidong.go

@@ -18,6 +18,7 @@ type Result struct {
 	CompanyCodeOpen                string  `json:"companyCodeOpen"`                // 公司代码是否开启,1是 0否
 	CompanyCodeRequired            string  `json:"companyCodeRequired"`            // 公司代码是否必填,1是 0否
 	CompanyInfo                    string  `json:"companyInfo"`                    // 公司名称
+	CompanyCode                    string  `json:"companyCode"`                    // 弘则在易董那边建会的公司code
 	CompanyShortNameOpen           string  `json:"companyShortNameOpen"`           // 公司名称是否开启,1是 0否
 	CompanyShortNameRequired       string  `json:"companyShortNameRequired"`       // 公司名称是否必填,1是 0否
 	End                            string  `json:"end"`                            // 活动结束时间
@@ -108,16 +109,18 @@ type Resultuser111 struct {
 }
 
 type Resultuser struct {
-	DeviceType        string `json:"deviceType"`        // 参会方式,1-PC,2-Mac,3-Android,4-IOS,5-Web,6-iPad,7-Android Pad,8-小程序,0-PSTN
-	Duration          string `json:"duration"`          // 云会议参会时长
-	DurationInteract  string `json:"durationInteract"`  // 互动交流参会时长
-	DurationLive      string `json:"durationLive"`      // 直播参会时长
-	DurationReview    string `json:"durationReview"`    // 回看参会时长
-	EndTime           string `json:"endTime"`           // 云会议最后退会时间
-	EndTimeInteract   string `json:"endTimeInteract"`   // 互动交流最后退会时间
-	EndTimeLive       string `json:"endTimeLive"`       // 直播最后退会时间
-	EndTimeReview     string `json:"endTimeReview"`     // 回看最后退会时间
-	ID                string `json:"id"`                // 主键id
+	DeviceType        string `json:"deviceType"`       // 参会方式,1-PC,2-Mac,3-Android,4-IOS,5-Web,6-iPad,7-Android Pad,8-小程序,0-PSTN
+	Duration          string `json:"duration"`         // 云会议参会时长
+	DurationInteract  string `json:"durationInteract"` // 互动交流参会时长
+	DurationLive      string `json:"durationLive"`     // 直播参会时长
+	DurationReview    string `json:"durationReview"`   // 回看参会时长
+	EndTime           string `json:"endTime"`          // 云会议最后退会时间
+	EndTimeInteract   string `json:"endTimeInteract"`  // 互动交流最后退会时间
+	EndTimeLive       string `json:"endTimeLive"`      // 直播最后退会时间
+	EndTimeReview     string `json:"endTimeReview"`    // 回看最后退会时间
+	ID                string `json:"id"`               // 主键id
+	Mail              string `json:"mail" comment:"电子邮件"`
+	CompanyName       string `json:"company_name" comment:"公司名称"`
 	JobName           string `json:"jobName"`           // 职务
 	MobileCountryCode string `json:"mobileCountryCode"` // 手机号国际区号码
 	PersonName        string `json:"personName"`        // 姓名
@@ -128,6 +131,7 @@ type Resultuser struct {
 	StartTimeReview   string `json:"startTimeReview"`   // 回看最早入会时间
 	Status            string `json:"status"`            // 状态,D表示被删除
 	UserID            string `json:"userId,omitempty"`  // 用户id
+	SignUpStatus      string `json:"sign_up_status" comment:"报名状态"`
 }
 
 type ApifoxModalUserTgc struct {

+ 89 - 0
models/yidong/yidong_activity.go

@@ -0,0 +1,89 @@
+package yidong
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"hongze/hongze_cygx/utils"
+	"time"
+)
+
+type CygxYidongActivity struct {
+	Id                             string    `json:"id" comment:"主键ID"`
+	YidongId                       string    `json:"yidong_id" comment:"活动唯一标识"`
+	CompanyInfo                    string    `json:"company_info" comment:"公司信息"`
+	Title                          string    `json:"title" comment:"活动标题"`
+	Type                           string    `json:"type" comment:"活动类型"`
+	IndustrySwName                 string    `json:"industry_sw_name" comment:"行业名称"`
+	Start                          string    `json:"start" comment:"开始时间"`
+	End                            string    `json:"end" comment:"结束时间"`
+	SignUpStart                    string    `json:"sign_up_start" comment:"报名开始时间"`
+	SignUpEnd                      string    `json:"sign_up_end" comment:"报名结束时间"`
+	ActivityJoinType               string    `json:"activity_join_type" comment:"参与类型"`
+	Banner                         string    `json:"banner" comment:"活动横幅链接"`
+	Url                            string    `json:"url" comment:"活动链接"`
+	SyncId                         string    `json:"sync_id" comment:"同步ID"`
+	SyncFlag                       string    `json:"sync_flag" comment:"同步标志"`
+	BusinessCardOpen               string    `json:"business_card_open" comment:"是否打开名片"`
+	BusinessCardRequired           string    `json:"business_card_required" comment:"是否要求名片"`
+	PersonNameOpen                 string    `json:"person_name_open" comment:"是否打开姓名"`
+	PersonNameRequired             string    `json:"person_name_required" comment:"是否要求姓名"`
+	PersonTelephoneOpen            string    `json:"person_telephone_open" comment:"是否打开电话"`
+	PersonTelephoneRequired        string    `json:"person_telephone_required" comment:"是否要求电话"`
+	MailOpen                       string    `json:"mail_open" comment:"是否打开邮件"`
+	MailRequired                   string    `json:"mail_required" comment:"是否要求邮件"`
+	CompanyShortNameOpen           string    `json:"company_short_name_open" comment:"是否打开公司简称"`
+	CompanyShortNameRequired       string    `json:"company_short_name_required" comment:"是否要求公司简称"`
+	CompanyCodeOpen                string    `json:"company_code_open" comment:"是否打开公司代码"`
+	CompanyCodeRequired            string    `json:"company_code_required" comment:"是否要求公司代码"`
+	JobNameOpen                    string    `json:"job_name_open" comment:"是否打开职位名称"`
+	JobNameRequired                string    `json:"job_name_required" comment:"是否要求职位名称"`
+	CertificateInformationOpen     string    `json:"certificate_information_open" comment:"是否打开证书信息"`
+	CertificateInformationRequired string    `json:"certificate_information_required" comment:"是否要求证书信息"`
+	InviteeOpen                    *string   `json:"invitee_open" comment:"是否打开受邀人"`
+	InviteeRequired                *string   `json:"invitee_required" comment:"是否要求受邀人"`
+	CreateUserId                   string    `json:"create_user_id" comment:"创建用户ID"`
+	CreatePersonName               string    `json:"create_person_name" comment:"创建人姓名"`
+	PublishFlag                    string    `json:"publish_flag" comment:"发布标志"`
+	CompanyCode                    string    `json:"company_code" comment:"公司代码"`
+	BackFlag                       string    `json:"back_flag" comment:"回退标志"`
+	ActivityForm                   string    `json:"activity_form" comment:"活动形式"`
+	ActivityAddress                string    `json:"activity_address" comment:"活动地址"`
+	MeetingStatus                  string    `json:"meeting_status" comment:"会议状态"`
+	CloudMeetingStatus             string    `json:"cloud_meeting_status" comment:"云会议状态"`
+	InteractQaStatus               string    `json:"interact_qa_status" comment:"互动问答状态"`
+	LiveStatus                     string    `json:"live_status" comment:"直播状态"`
+	CreateTime                     time.Time `comment:"创建时间"`
+}
+
+// AddCygxYidongActivityMulti 批量添加
+func AddCygxYidongActivityMulti(items []*CygxYidongActivity) (err error) {
+	if len(items) == 0 {
+		return
+	}
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
+	defer func() {
+		if err == nil {
+			o.Commit()
+		} else {
+			o.Rollback()
+		}
+	}()
+	if len(items) > 0 {
+		_, err = o.InsertMulti(len(items), items)
+	}
+	return
+}
+
+// 列表
+func GetCygxYidongActivityListByYidongIds(yidongIds []string) (items []*CygxYidongActivity, err error) {
+	lenarr := len(yidongIds)
+	if lenarr == 0 {
+		return
+	}
+	o := orm.NewOrm()
+	sql := `SELECT yidong_id  FROM cygx_yidong_activity   WHERE yidong_id   IN  (` + utils.GetOrmInReplace(lenarr) + `) `
+	_, err = o.Raw(sql, yidongIds).QueryRows(&items)
+	return
+}

+ 71 - 0
models/yidong/yidong_activity_meet_data.go

@@ -0,0 +1,71 @@
+package yidong
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"hongze/hongze_cygx/utils"
+	"time"
+)
+
+type CygxYidongActivityMeetData struct {
+	Id                string    `json:"id" comment:"主键id"`
+	YidongMeetDataId  string    `json:"yidong_meet_data_id" comment:"易董到会信息ID"`
+	YidongId          string    `json:"yidong_id" comment:"活动唯一标识"`
+	Title             string    `json:"title"` // 活动主题
+	UserId            string    `json:"user_id" comment:"用户唯一标识"`
+	PersonTelephone   string    `json:"person_telephone" comment:"电话号码"`
+	Duration          string    `json:"duration" comment:"活动时长"`
+	StartTime         string    `json:"start_time" comment:"活动开始时间"`
+	EndTime           string    `json:"end_time" comment:"活动结束时间"`
+	DeviceType        string    `json:"device_type" comment:"设备类型"`
+	Status            string    `json:"status" comment:"状态"`
+	PersonName        string    `json:"person_name" comment:"用户姓名"`
+	JobName           string    `json:"job_name" comment:"职位名称"`
+	Mail              string    `json:"mail" comment:"电子邮件"`
+	CompanyName       string    `json:"company_name" comment:"公司名称"`
+	MobileCountryCode string    `json:"mobile_country_code" comment:"手机国家代码"`
+	SignUpStatus      string    `json:"sign_up_status" comment:"报名状态"`
+	DurationLive      string    `json:"duration_live" comment:"直播时长"`
+	StartTimeLive     string    `json:"start_time_live" comment:"直播开始时间"`
+	EndTimeLive       string    `json:"end_time_live" comment:"直播结束时间"`
+	DurationReview    string    `json:"duration_review" comment:"回放时长"`
+	StartTimeReview   string    `json:"start_time_review" comment:"回放开始时间"`
+	EndTimeReview     string    `json:"end_time_review" comment:"回放结束时间"`
+	DurationInteract  string    `json:"duration_interact" comment:"互动时长"`
+	StartTimeInteract string    `json:"start_time_interact" comment:"互动开始时间"`
+	EndTimeInteract   string    `json:"end_time_interact" comment:"互动结束时间"`
+	CreateTime        time.Time `comment:"创建时间"`
+}
+
+// AddCygxYidongActivityMeetDataMulti 批量添加
+func AddCygxYidongActivityMeetDataMulti(items []*CygxYidongActivityMeetData) (err error) {
+	if len(items) == 0 {
+		return
+	}
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
+	defer func() {
+		if err == nil {
+			o.Commit()
+		} else {
+			o.Rollback()
+		}
+	}()
+	if len(items) > 0 {
+		_, err = o.InsertMulti(1000, items)
+	}
+	return
+}
+
+// 列表
+func GetCygxYidongActivityMeetDataListByYidongIds(yidongIds []string) (items []*CygxYidongActivityMeetData, err error) {
+	lenarr := len(yidongIds)
+	if lenarr == 0 {
+		return
+	}
+	o := orm.NewOrm()
+	sql := `SELECT yidong_id,person_telephone  FROM cygx_yidong_activity_meet_data   WHERE yidong_id   IN  (` + utils.GetOrmInReplace(lenarr) + `) `
+	_, err = o.Raw(sql, yidongIds).QueryRows(&items)
+	return
+}

+ 79 - 0
models/zhouqi_article_map.go

@@ -0,0 +1,79 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+)
+
+type CygxZhouqiArticleMap struct {
+	CategoryId        int    `description:"产业Id"`
+	ParentId          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,
+			parent_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
+}
+
+// 根据名称获取详情
+func GetCygxZhouqiArticleMapByMatchTypeName(matchTypeName string) (item *CygxZhouqiArticleMap, err error) {
+	o := orm.NewOrm()
+	sql := ``
+	sql = `SELECT a.* FROM cygx_zhouqi_article_map AS a WHERE a.match_type_name=? AND  parent_id > 0  `
+	err = o.Raw(sql, matchTypeName).QueryRow(&item)
+	return
+}
+
+// 更新对应分类所关联的最新文章的时间
+func UpdateCygxZhouqiArticleMapTime(articleUpdateTime string, categoryId int) (err error) {
+	o := orm.NewOrm()
+	sql := ``
+	sql = `UPDATE cygx_zhouqi_article_map SET hidden=0,article_update_time=? WHERE category_id = ? `
+	_, err = o.Raw(sql, articleUpdateTime, categoryId).Exec()
+	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
+}

+ 18 - 0
routers/commentsRouter.go

@@ -1222,6 +1222,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "ZhouqiTacticsList",
+            Router: `/tactics/zhouqi_list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"],
         beego.ControllerComments{
             Method: "ArticleCategoryList",
@@ -1249,6 +1258,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "ZouqiTradeList",
+            Router: `/zhouqi_tradeList`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportSelectionController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportSelectionController"],
         beego.ControllerComments{
             Method: "AddStopTime",

+ 13 - 292
services/activity.go

@@ -1729,298 +1729,6 @@ func LabelStrV5(label string, isShowSubjectName int, temporaryLabel string) (lab
 	return labelNew
 }
 
-func ActivityAttendanceDetail(cont context.Context) (err error) {
-	defer func() {
-		if err != nil {
-			fmt.Println("ActivityAttendanceDetail Err:" + err.Error())
-			go utils.SendAlarmMsg("同步进门财经数据失败", 2)
-			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "ActivityAttendanceDetail ErrMsg:"+err.Error(), utils.EmailSendToUsers)
-		}
-	}()
-
-	configCode := "jin_meng_activity_id"
-	detail, err := models.GetConfigByCode(configCode)
-	if err != nil {
-		return err
-	}
-	fmt.Println(detail.ConfigValue)
-	mapActivityId := make(map[string]string)
-	sliceValue := strings.Split(detail.ConfigValue, ",")
-	for _, v := range sliceValue {
-		mapActivityId[v] = v
-	}
-
-	var activityIds string
-	var activityIdsLongTime string //可回放的会议,到会详情持续更新加入到不做14天限制的活动中
-	fmt.Println("开始同步")
-	dateTime := time.Now().AddDate(0, 0, -7).Format(utils.FormatDate)
-	dateNow := time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
-	startDate := dateTime + " 00:00:00"
-	endDate := dateNow + " 23:59:59"
-	//获取进门财经需要处理的活动
-	listActivityRoadshow, err := models.GetRoadshowDataListByDateTime(startDate, endDate)
-	if err != nil {
-		fmt.Println("GetRoadshowDataListByDateTime Err:", err.Error())
-		return err
-	}
-	for _, vAct := range listActivityRoadshow {
-		doTime := utils.TimeRemoveHms2(vAct.RoadshowBeginTime)
-		findStartDate := doTime + " 00:00:00"
-		findEndDate := doTime + " 23:59:59"
-		var roadshowTitle string
-		roadshowTitle = vAct.RoadshowTitle
-		vAct.RoadshowTitle = strings.Replace(vAct.RoadshowTitle, "【", "", -1)
-		vAct.RoadshowTitle = strings.Replace(vAct.RoadshowTitle, "】", "", -1)
-		vAct.RoadshowTitle = strings.Replace(vAct.RoadshowTitle, " ", "", -1)
-		vAct.RoadshowTitle = strings.Replace(vAct.RoadshowTitle, "-", "", -1)
-		vAct.RoadshowTitle = strings.Replace(vAct.RoadshowTitle, ":", "", -1)
-		nameSlice := strings.Split(vAct.RoadshowTitle, "|")
-		//fmt.Println(timeSlice[0])
-		//对于手动匹配到的活动数据也要更新
-		var activityName string
-		if len(nameSlice) >= 1 {
-			//if vAct.JmcjRoadshowTitle != "" {
-			//	activityName = vAct.JmcjRoadshowTitle
-			//} else {
-			//	activityName = nameSlice[len(nameSlice)-1]
-			//}
-			activityName = nameSlice[len(nameSlice)-1]
-			if activityName != "" {
-				//通过名称去找匹配的活动
-				activityDetail, _ := models.GetAddActivityInfoByTitle(activityName, findStartDate, findEndDate)
-				if activityDetail == nil {
-					continue
-				} else {
-					activityIds += strconv.Itoa(activityDetail.ActivityId) + ","
-				}
-				list, err := models.GetRoadshowDataList(roadshowTitle, findStartDate, findEndDate)
-				if err != nil {
-					fmt.Println("GetTacticsList Err:", err.Error())
-					return err
-				}
-				var isPlayback bool // 是否包含回放
-				needAddAttendanc := make([]*models.CygxActivityAttendanceDetail, 0)
-				var mobileStr string
-				var mobileArr []string
-				if len(list) > 0 {
-					fmt.Println("原来的", vAct.RoadshowTitle)
-					fmt.Println("处理的", activityName)
-					for _, v := range list {
-						if v.UserPhone != "" {
-							item := new(models.CygxActivityAttendanceDetail)
-							item.ActivityId = activityDetail.ActivityId
-							item.RealName = v.UserName
-							item.Mobile = v.UserPhone
-							item.CompanyName = v.Company
-							//item.SellerName = sellerName
-							item.FirstMeetingTime = v.FirstWatchTime
-							item.LastMeetingTime = v.LastWatchTime
-							item.Duration = utils.GetAttendanceDetailSeconds(v.JoinTime)
-							if v.JoinType == 1 {
-								item.MeetingTypeStr = "网络"
-							} else {
-								item.MeetingTypeStr = "电话"
-							}
-							item.MeetingAuthentication = v.AuthInfo
-							if v.DataType == 1 {
-								item.MeetingStatusStr = "直播"
-							} else {
-								item.MeetingStatusStr = "回放"
-								isPlayback = true
-							}
-							item.Position = v.Occupation
-							item.UseridEntity = v.UseridEntity
-							item.ActivityTime = activityDetail.ActivityTime
-							item.CrmCompanyMapStatusId = v.CrmCompanyMapStatusId
-							item.CreateTime = time.Now()
-							mobileStr += "'" + v.UserPhone + "'" + ","
-							mobileArr = append(mobileArr, v.UserPhone)
-							needAddAttendanc = append(needAddAttendanc, item)
-						}
-					}
-					if isPlayback && mapActivityId[strconv.Itoa(activityDetail.ActivityId)] == "" {
-						activityIdsLongTime += strconv.Itoa(activityDetail.ActivityId) + ","
-					}
-					mobileStr = strings.TrimRight(mobileStr, ",")
-					if mobileStr == "" {
-						mobileStr = "1"
-					}
-					listUser, err := models.GetWxUserOutboundMobile(mobileStr)
-					if err != nil {
-						fmt.Println("GetWxUserOutboundMobile Err:", err.Error())
-						return err
-					}
-					for k, v := range needAddAttendanc {
-						for _, v2 := range listUser {
-							if v2.OutboundMobile == v.Mobile || v2.Mobile == v.Mobile {
-								if needAddAttendanc[k].CompanyId == 0 {
-									needAddAttendanc[k].CompanyId = v2.CompanyId
-									needAddAttendanc[k].SellerName = v2.SellerName
-									needAddAttendanc[k].CompanyName = v2.CompanyName
-									needAddAttendanc[k].IsMeetingStr = 1
-								}
-							}
-						}
-					}
-					//fmt.Println(mobileStr)
-					//参会记录
-					err = models.AddAttendancDetail(needAddAttendanc, activityDetail.ActivityId, mobileStr)
-					if err != nil {
-						fmt.Println("AddAttendancDetail Err:", err.Error())
-						return err
-					}
-					////处理是否限制报名
-					err = AddCygxActivityRestrictSignupByAdmin(activityDetail.ActivityId)
-					if err != nil {
-						fmt.Println("AddCygxActivityRestrictSignupByAdmin Err:", err.Error())
-						return err
-					}
-
-					go ActivityUserLabelLogAdd(activityDetail.ActivityId, mobileArr)
-
-					AddctivitySignupDetailByJmcj(needAddAttendanc, activityDetail.ActivityId)
-
-				}
-			}
-		}
-	}
-
-	//获取需要处理的活动
-	listActivity, err := models.GetActivityListByDateTime(startDate, endDate, activityIds, detail.ConfigValue)
-	if err != nil {
-		fmt.Println("GetTacticsList Err:", err.Error())
-		return err
-	}
-	//通过本地去找进门财经的数据
-	for _, vAct := range listActivity {
-		doTime := utils.TimeRemoveHms2(vAct.ActivityTime)
-		findStartDate := doTime + " 00:00:00"
-		findEndDate := doTime + " 23:59:59"
-		nameSlice := strings.Split(vAct.ActivityName, "】")
-		//对于手动匹配到的活动数据也要更新
-		var activityName string
-		if len(nameSlice) > 1 {
-			if vAct.JmcjRoadshowTitle != "" {
-				activityName = vAct.JmcjRoadshowTitle
-			} else {
-				activityName = nameSlice[len(nameSlice)-1]
-			}
-			//activityName = nameSlice[len(nameSlice)-1]
-			if activityName != "" {
-				list, err := models.GetRoadshowDataList(activityName, findStartDate, findEndDate)
-				if err != nil {
-					fmt.Println("GetTacticsList Err:", err.Error())
-					return err
-				}
-				var isPlayback bool // 是否包含回放
-				needAddAttendanc := make([]*models.CygxActivityAttendanceDetail, 0)
-				var mobileStr string
-				var mobileArr []string
-				if len(list) > 0 {
-					fmt.Println("原来的1", vAct.ActivityName)
-					fmt.Println("处理的2", activityName)
-					for _, v := range list {
-						if v.UserPhone != "" {
-							item := new(models.CygxActivityAttendanceDetail)
-							item.ActivityId = vAct.ActivityId
-							item.RealName = v.UserName
-							item.Mobile = v.UserPhone
-							item.CompanyName = v.Company
-							//item.SellerName = sellerName
-							item.FirstMeetingTime = v.FirstWatchTime
-							item.LastMeetingTime = v.LastWatchTime
-							item.Duration = utils.GetAttendanceDetailSeconds(v.JoinTime)
-							if v.JoinType == 1 {
-								item.MeetingTypeStr = "网络"
-							} else {
-								item.MeetingTypeStr = "电话"
-							}
-							item.MeetingAuthentication = v.AuthInfo
-							if v.DataType == 1 {
-								item.MeetingStatusStr = "直播"
-							} else {
-								item.MeetingStatusStr = "回放"
-								isPlayback = true
-							}
-							item.Position = v.Occupation
-							item.UseridEntity = v.UseridEntity
-							item.ActivityTime = vAct.ActivityTime
-							item.CrmCompanyMapStatusId = v.CrmCompanyMapStatusId
-							item.CreateTime = time.Now()
-							mobileStr += "'" + v.UserPhone + "'" + ","
-							mobileArr = append(mobileArr, v.UserPhone)
-							needAddAttendanc = append(needAddAttendanc, item)
-						}
-					}
-					if isPlayback && mapActivityId[strconv.Itoa(vAct.ActivityId)] == "" {
-						activityIdsLongTime += strconv.Itoa(vAct.ActivityId) + ","
-					}
-					mobileStr = strings.TrimRight(mobileStr, ",")
-					if mobileStr == "" {
-						mobileStr = "1"
-					}
-					listUser, err := models.GetWxUserOutboundMobile(mobileStr)
-					if err != nil {
-						fmt.Println("GetWxUserOutboundMobile Err:", err.Error())
-						return err
-					}
-					for k, v := range needAddAttendanc {
-						for _, v2 := range listUser {
-							if v2.OutboundMobile == v.Mobile || v2.Mobile == v.Mobile {
-								if needAddAttendanc[k].CompanyId == 0 {
-									needAddAttendanc[k].CompanyId = v2.CompanyId
-									needAddAttendanc[k].SellerName = v2.SellerName
-									needAddAttendanc[k].CompanyName = v2.CompanyName
-									needAddAttendanc[k].IsMeetingStr = 1
-								}
-							}
-						}
-					}
-					////参会记录
-					err = models.AddAttendancDetail(needAddAttendanc, vAct.ActivityId, mobileStr)
-					if err != nil {
-						fmt.Println("AddAttendancDetail Err:", err.Error())
-						return err
-					}
-					////处理是否限制报名
-					err = AddCygxActivityRestrictSignupByAdmin(vAct.ActivityId)
-					if err != nil {
-						fmt.Println("AddCygxActivityRestrictSignupByAdmin Err:", err.Error())
-						return err
-					}
-					activityIds += strconv.Itoa(vAct.ActivityId) + ","
-
-					go ActivityUserLabelLogAdd(vAct.ActivityId, mobileArr)
-					AddctivitySignupDetailByJmcj(needAddAttendanc, vAct.ActivityId)
-
-				}
-			}
-		}
-	}
-	if activityIdsLongTime != "" {
-		activityIdsLongTime = strings.TrimRight(activityIdsLongTime, ",")
-		activityIdsLongTime = detail.ConfigValue + "," + activityIdsLongTime
-		go models.UpdateConfigByCode(activityIdsLongTime, configCode)
-	}
-
-	activityIds = strings.TrimRight(activityIds, ",")
-	if activityIds != "" {
-		detailList, err := models.GetActivityAttendanceDetailList(activityIds)
-		if err != nil {
-			fmt.Println("GetActivityAttendanceDetailList Err:", err.Error())
-			return err
-		}
-		//添加报名日志 (下载使用)
-		err = models.AddCygxActivityMeetDetailLogOnlineByList(detailList, activityIds)
-		if err != nil {
-			fmt.Println("AddCygxActivityMeetDetailLogOnline Err:", err.Error())
-			return err
-		}
-	}
-	fmt.Println("结束路演同步")
-	return
-}
-
 // 查研观向处理活动用户限制报名
 func AddCygxActivityRestrictSignupByAdmin(activityId int) (err error) {
 	defer func() {
@@ -2542,6 +2250,13 @@ func ActivityButtonShow(item *models.ActivityDetail) (activityDetail *models.Act
 				activityDetail.IsShowMeetingReminder = true
 				activityDetail.IsShowOutboundCall = true
 			}
+
+			if activityDetail.IsZoom == 1 {
+				activityDetail.IsShowMeetingReminder = true
+				if activityDetail.LimitPeopleNum == 0 {
+					activityDetail.IsShowOutboundCall = false
+				}
+			}
 		}
 
 		//公司线下调研 4
@@ -2666,6 +2381,12 @@ func ActivityArrButtonShow(items []*models.ActivityDetail) (activityDetails []*m
 						activityDetail.IsShowMeetingReminder = true
 						activityDetail.IsShowOutboundCall = true
 					}
+					if activityDetail.IsZoom == 1 {
+						activityDetail.IsShowMeetingReminder = true
+						if activityDetail.LimitPeopleNum == 0 {
+							activityDetail.IsShowOutboundCall = false
+						}
+					}
 				}
 
 				//公司线下调研 4

+ 1 - 117
services/activity_signup_detail.go

@@ -94,123 +94,7 @@ func AddctivitySignupDetail(cont context.Context) (err error) {
 	return err
 }
 
-// AddctivitySignupDetailByJmcj 通过进门财经添加用户参数信息
-func AddctivitySignupDetailByJmcj(itemsDetail []*models.CygxActivityAttendanceDetail, activityId int) (err error) {
-	defer func() {
-		if err != nil {
-			fmt.Println(err)
-			go utils.SendAlarmMsg("通过进门财经添加用户参数信息失败 ErrMsg:"+err.Error(), 2)
-		}
-	}()
-	fmt.Println("活动ID", activityId)
-	activityIds := make([]int, 0)
-	activityIds = append(activityIds, activityId)
-	actLen := len(activityIds)
-	var condition string
-	var pars []interface{}
-	if actLen > 0 {
-		condition += ` AND activity_id IN (` + utils.GetOrmInReplace(actLen) + `)`
-		pars = append(pars, activityIds)
-	}
-
-	signUpDetailList, err := models.GetSignupDetailList(condition, pars)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		return err
-	}
-
-	mapsignUpDetai := make(map[string]string)
-	if len(signUpDetailList) > 0 {
-		for _, v := range signUpDetailList {
-			mapsignUpDetai[fmt.Sprint("ActivityId", v.ActivityId, "Mobile", v.Mobile)] = v.Mobile
-		}
-	}
-
-	//获取当天已经结束了 活动的报名人数
-	signUpList, err := models.GetSignupDetailBySignup(condition, pars)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		return err
-	}
-	//建立外呼号与手机号的绑定
-	mapsignUp := make(map[string]string)
-	if len(signUpList) > 0 {
-		for _, v := range signUpList {
-			mapsignUp[fmt.Sprint(v.OutboundMobile)] = v.Mobile
-		}
-	}
-
-	var itemsAdd []*models.CygxActivitySignupDetail
-	var itemsUpdate []*models.CygxActivitySignupDetail
-
-	for _, v := range itemsDetail {
-		var item = new(models.CygxActivitySignupDetail)
-		item.ActivityId = v.ActivityId
-		item.RealName = v.RealName
-		//如果手机号存在那么就是报名的,不存在就是直接参与的
-		if _, ok := mapsignUp[v.Mobile]; ok {
-			item.Mobile = mapsignUp[v.Mobile]
-		} else {
-			item.Mobile = v.Mobile
-		}
-		item.OutboundMobile = v.Mobile
-		item.CompanyName = v.CompanyName
-		item.CompanyId = v.CompanyId
-		item.SellerName = v.SellerName
-		item.FirstMeetingTime = v.FirstMeetingTime
-		item.LastMeetingTime = v.LastMeetingTime
-		item.Duration = v.Duration
-		item.MeetingTypeStr = v.MeetingTypeStr
-		item.MeetingAuthentication = v.MeetingAuthentication
-		item.MeetingStatusStr = v.MeetingStatusStr
-		item.CreateTime = v.CreateTime
-		item.Position = v.Position
-		item.IsMeeting = 1
-		item.UseridEntity = v.UseridEntity
-		item.ActivityTime = v.ActivityTime
-		item.CrmCompanyMapStatusId = v.CrmCompanyMapStatusId
-
-		if _, ok := mapsignUpDetai[fmt.Sprint("ActivityId", v.ActivityId, "Mobile", item.Mobile)]; !ok {
-			itemsAdd = append(itemsAdd, item)
-		} else {
-			itemsUpdate = append(itemsUpdate, item)
-		}
-	}
-	//return err
-	if len(itemsAdd) > 0 {
-		err = models.AddCygxActivitySignupDetail(itemsAdd)
-		if err != nil {
-			return
-		}
-	}
-
-	if len(itemsUpdate) > 0 {
-		err = models.UpdateActivitySignupDetailMulti(itemsUpdate)
-		if err != nil {
-			return
-		}
-	}
-	//处理研选扣点信息
-	YanXuanActivityPointsBillSubmitMeeting(activityId, 0)
-	return err
-}
-
-//func GetCygxActivityAttendanceDetail() {
-//	listAll, err := models.GetActivityAttendanceDetailListAll()
-//	if err != nil {
-//		fmt.Println(err)
-//	}
-//	mapDetal := make(map[int][]*models.CygxActivityAttendanceDetail)
-//
-//	for _, v := range listAll {
-//		mapDetal[v.ActivityId] = append(mapDetal[v.ActivityId], v)
-//	}
-//
-//	for k, v := range mapDetal {
-//		AddctivitySignupDetailByJmcj(v, k)
-//	}
-//	//fmt.Println(mapDetal)
-//}
-
-// AddctivitySignupDetailByJmcj 通过进门财经添加用户参数信息
+// AddctivitySignupDetailByJmcjNew 通过进门财经添加用户参数信息
 func AddctivitySignupDetailByJmcjNew(itemsDetail []*models.CygxActivityAttendanceDetail, activityIds []int) (err error) {
 	defer func() {
 		if err != nil {

+ 36 - 1334
services/article.go

@@ -6,7 +6,6 @@ import (
 	"errors"
 	"fmt"
 	"github.com/PuerkitoBio/goquery"
-	"github.com/beego/beego/v2/client/orm"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/models/company"
 	"hongze/hongze_cygx/utils"
@@ -17,34 +16,8 @@ import (
 	"strconv"
 	"strings"
 	"time"
-	"unicode/utf8"
 )
 
-func GetReportContentSub(content string) (contentSub string, err error) {
-	content = html.UnescapeString(content)
-	doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
-	if err != nil {
-		fmt.Println("create doc err:", err.Error())
-		return
-	}
-	n := 0
-	doc.Find("p").Each(func(i int, s *goquery.Selection) {
-		if n > 3 {
-			return
-		}
-		n++
-		phtml, err := s.Html()
-		if err != nil {
-			fmt.Println("get html err", err.Error())
-			return
-		}
-		if s.Text() != "" || strings.Contains(phtml, "src") {
-			contentSub = contentSub + "<p>" + phtml + "</p>"
-		}
-	})
-	return
-}
-
 func GetReportContentTextSub(content string) (contentSub string, err error) {
 	content = html.UnescapeString(content)
 	doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
@@ -78,233 +51,6 @@ func GetReportContentTextSubNew(content string) (contentSub string, err error) {
 	return
 }
 
-// GetReportContentTextSubByarticle 解析文章内容
-func GetReportContentTextSubByarticle(content, abstract string, articleId int) (contentSub string, err error) {
-	var lenabstract int
-	//如果不是研选就这么展示
-	if articleId < utils.SummaryArticleId {
-		abstract = html.UnescapeString(abstract)
-		doc, errdoc := goquery.NewDocumentFromReader(strings.NewReader(abstract))
-		if errdoc != nil {
-			err = errdoc
-			return
-		}
-		docabstract := doc.Text()
-		lenabstract = utf8.RuneCountInString(docabstract)
-		if lenabstract >= 20 {
-			contentSub = docabstract
-			return
-		} else {
-			contentSub, err = GetReportContentTextSubNew(content)
-		}
-	} else {
-		contentSub, err = GetReportContentTextSubNew(content)
-	}
-
-	return
-
-}
-
-// 解析文章内容
-func GetArticleAll() {
-	var err error
-	defer func() {
-		if err != nil {
-			fmt.Println("err:", err.Error())
-			return
-		}
-	}()
-	list, err := models.GetArticleAll()
-	if err != nil {
-		return
-	}
-	for _, v := range list {
-		fmt.Println(v.ArticleId, v.Title)
-		FixArticleContent(v.ArticleId)
-	}
-}
-
-// 解析报告
-func FixArticleContent(articleId int) {
-	item, err := models.GetArticleDetailById(articleId)
-	if err != nil {
-		fmt.Println("GetArticleDetailById Err:" + err.Error())
-		return
-	}
-	content := item.Body
-	bodyText, _ := GetReportContentTextSub(content)
-	content = html.UnescapeString(content)
-
-	content = strings.Replace(content, "http", "https", -1)
-
-	doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
-	if err != nil {
-		fmt.Println("create doc err:", err.Error())
-		return
-	}
-
-	var expertNumArr []string
-	var expertContentArr []string
-	var interviewDateArr []string
-
-	doc.Find("p").Each(func(i int, s *goquery.Selection) {
-		contentTxt := s.Text()
-		if strings.Contains(contentTxt, "#访谈时间:") || strings.Contains(contentTxt, "访谈时间:") {
-			interviewDate := s.Next().Text()
-			interviewDateArr = append(interviewDateArr, interviewDate)
-		}
-		if strings.Contains(contentTxt, "#专家评价") || strings.Contains(contentTxt, "专家评价") {
-			expertContent := s.Next().Text()
-			if expertContent == "" {
-				expertContent = contentTxt
-			}
-			if expertContent != "" {
-				rightIndex := strings.Index(expertContent, ")")
-				if rightIndex == 0 {
-					rightIndex = strings.Index(expertContent, ")")
-				}
-				if rightIndex > 0 {
-					expertNum := expertContent[:rightIndex]
-					expertNum = strings.Replace(expertNum, "(", "", -1)
-					expertNum = strings.Replace(expertNum, "(", "", -1)
-					expertNum = strings.Replace(expertNum, "专家评价", "", -1)
-					if expertNum != "" {
-						expertNumArr = append(expertNumArr, expertNum)
-						rightIndex = rightIndex
-						expertContentStr := expertContent[rightIndex:]
-						expertContentStr = strings.Replace(expertContentStr, ")", "", -1)
-						expertContentStr = strings.TrimLeft(expertContentStr, ":")
-						expertContentStr = strings.TrimRight(expertContentStr, "(推荐")
-						expertContentArr = append(expertContentArr, expertContentStr)
-					}
-				}
-			}
-		}
-	})
-
-	if len(expertContentArr) <= 0 {
-		doc.Find("pre").Each(func(i int, pre *goquery.Selection) {
-			pre.Find("span").Each(func(n int, span *goquery.Selection) {
-				contentTxt := span.Text()
-				if strings.Contains(contentTxt, "#专家评价") || strings.Contains(contentTxt, "专家评价") {
-					span.Find("span").Each(func(m int, subspan *goquery.Selection) {
-						subspanText := subspan.Text()
-						if strings.Contains(subspanText, "专家评价") {
-							expertContent := subspan.Next().Text()
-							if expertContent != "" {
-								rightIndex := strings.Index(expertContent, ")")
-								if rightIndex == 0 {
-									rightIndex = strings.Index(expertContent, ")")
-								}
-								if rightIndex > 0 {
-									expertNum := expertContent[:rightIndex]
-									expertNum = strings.Replace(expertNum, "(", "", -1)
-									expertNum = strings.Replace(expertNum, "(", "", -1)
-									expertNum = strings.Replace(expertNum, "专家评价", "", -1)
-									if expertNum != "" {
-										expertNumArr = append(expertNumArr, expertNum)
-										rightIndex = rightIndex
-										expertContentStr := expertContent[rightIndex:]
-										expertContentStr = strings.Replace(expertContentStr, ")", "", -1)
-										expertContentStr = strings.TrimLeft(expertContentStr, ":")
-										expertContentStr = strings.TrimRight(expertContentStr, "(推荐")
-										expertContentArr = append(expertContentArr, expertContentStr)
-									}
-								}
-							}
-						}
-
-					})
-				}
-
-				span.Find("span").Each(func(k int, sspan *goquery.Selection) {
-					sspanText := sspan.Text()
-					if strings.Contains(sspanText, "访谈时间") {
-						sspanText = strings.Replace(sspanText, "#访谈时间:", "", -1)
-						sspanText = strings.Replace(sspanText, "访谈时间:", "", -1)
-						sspanText = strings.Replace(sspanText, "\n", "", -1)
-						sspanText = strings.Replace(sspanText, " ", "", -1)
-						sspanText = strings.Trim(sspanText, " ")
-						sspanText = sspanText[:10]
-						interviewDate := sspanText
-						if interviewDate != "" {
-							interviewDateArr = append(interviewDateArr, interviewDate)
-						}
-					}
-				})
-			})
-		})
-	}
-
-	if len(expertContentArr) <= 0 {
-		doc.Find("span").Each(func(i int, span *goquery.Selection) {
-			span.Find("strong").Each(func(n int, strong *goquery.Selection) {
-				spanText := span.Text()
-				strongText := strong.Text()
-				if strings.Contains(strongText, "#专家评价") || strings.Contains(strongText, "专家评价") {
-					expertContent := strong.Parents().Text()
-					if expertContent != "" {
-						rightIndex := strings.Index(expertContent, ")")
-						if rightIndex == 0 {
-							rightIndex = strings.Index(expertContent, ")")
-						}
-						if rightIndex > 0 {
-							expertNum := expertContent[:rightIndex]
-							expertNum = strings.Replace(expertNum, "(", "", -1)
-							expertNum = strings.Replace(expertNum, "(", "", -1)
-							expertNum = strings.Replace(expertNum, "专家评价", "", -1)
-							expertNum = strings.Replace(expertNum, "#", "", -1)
-							expertNum = strings.Replace(expertNum, ":", "", -1)
-							expertNum = strings.Replace(expertNum, "\n", "", -1)
-							if expertNum != "" {
-								expertNumArr = append(expertNumArr, expertNum)
-								rightIndex = rightIndex
-								expertContentStr := expertContent[rightIndex:]
-								expertContentStr = strings.Replace(expertContentStr, ")", "", -1)
-								expertContentStr = strings.TrimLeft(expertContentStr, ":")
-								expertContentStr = strings.TrimRight(expertContentStr, "(推荐")
-								expertContentArr = append(expertContentArr, expertContentStr)
-								return
-							}
-						}
-					}
-				}
-
-				if strings.Contains(spanText, "访谈时间") {
-					spanText = strings.Replace(spanText, "#访谈时间:", "", -1)
-					spanText = strings.Replace(spanText, "访谈时间:", "", -1)
-					spanText = strings.Replace(spanText, "\n", "", -1)
-					spanText = strings.Replace(spanText, " ", "", -1)
-					spanText = strings.Trim(spanText, " ")
-					spanText = spanText[:10]
-					interviewDate := spanText
-					if interviewDate != "" {
-						interviewDateArr = append(interviewDateArr, interviewDate)
-					}
-				}
-			})
-		})
-	}
-
-	var expertNumStr, expertContentStr, interviewDateStr string
-	if len(expertNumArr) > 0 {
-		expertNumStr = expertNumArr[0]
-	}
-	if len(expertContentArr) > 0 {
-		expertContentStr = expertContentArr[0]
-	}
-
-	if len(interviewDateArr) > 0 {
-		interviewDateStr = interviewDateArr[0]
-	}
-	expertNumStr = strings.Replace(expertNumStr, "#:", "", -1)
-	err = models.ModifyArticleExpert(articleId, expertNumStr, expertContentStr, interviewDateStr, bodyText)
-	if err != nil {
-		fmt.Println("ModifyArticleExpert Err:" + err.Error())
-		return
-	}
-}
-
 func FixArticleImgUrl(body string) (contentSub string, err error) {
 	r := strings.NewReader(string(body))
 	doc, err := goquery.NewDocumentFromReader(r)
@@ -321,21 +67,6 @@ func FixArticleImgUrl(body string) (contentSub string, err error) {
 	return
 }
 
-// 获取标签里的第一个内容
-func FixArticleFirstCount(body string) (contentSub string, err error) {
-
-	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
-	if err != nil {
-		fmt.Println("create doc err:", err.Error())
-		return
-	}
-	doc.Find("p").Each(func(i int, s *goquery.Selection) {
-		contentTxt := s.Text()
-		fmt.Println(contentTxt)
-	})
-	return
-}
-
 func SynchronizationArtclehistory() {
 	fmt.Println("同步开始")
 	list, err := models.GetArticleHistoryList()
@@ -371,138 +102,6 @@ func SynchronizationArtclehistory() {
 	fmt.Println("同步结束")
 }
 
-// 统计报表
-func StatisticalReport() {
-	var isSummaryNumAll, isClassNum, pvNumAll, uvNumAll int
-	list, err := models.GetChartPermissionActivity()
-	if err != nil {
-		fmt.Println("获取列表失败", err)
-	}
-	for _, v := range list {
-		var listPv []*models.ReportMappingStatistical
-		if v.PermissionName == "研选" {
-			listPv, err = models.GetStatisticalReportArtilceExpert()
-			if err != nil {
-				fmt.Println("获取Pv列表失败", err)
-			}
-		} else {
-			listPv, err = models.GetStatisticalReportArtilce(v.ChartPermissionId)
-			if err != nil {
-				fmt.Println("获取Pv列表失败", err)
-			}
-		}
-		var pvNum, uvNum, isSummaryNum int
-		for _, v2 := range listPv {
-			pvNum += v2.Pv
-			uvNum += v2.Uv
-			if v2.IsSummary == "1" {
-				isSummaryNum += 1
-			}
-			if v2.IsClass == "1" && v.ChartPermissionId <= 22 {
-				isClassNum += 1
-			}
-			if v2.IsSummary == "1" && v.ChartPermissionId <= 22 {
-				isSummaryNumAll += 1
-			}
-		}
-		if v.ChartPermissionId <= 22 {
-			pvNumAll += pvNum
-			uvNumAll += uvNum
-		}
-		fmt.Println(v.PermissionName+"行业", len(listPv), "篇,其中主观类报告", isSummaryNum, "篇,客观类报告", len(listPv)-isSummaryNum, "篇。共产生阅读量pv-,", pvNum, ",uv-", uvNum)
-	}
-	fmt.Println("目前同步四大行业的总报告(已归类)数量", isClassNum, "篇,其中主观类报告", isSummaryNumAll, "篇,客观类报告", isClassNum-isSummaryNumAll, "篇。共产生阅读量pv-", pvNumAll, ",uv-", uvNumAll)
-	var totalOnline int        //线上
-	var totalOffline int       //线下
-	var totalPeople int        //共累计预约外呼人数
-	var totalSignUpOff int     //线下报名人数
-	var totalSignUpOffTime int //线下报名人数
-	var totalPeopleMeet int    //线下参会人数
-	o := orm.NewOrm()
-	sql := `SELECT COUNT(1) FROM cygx_activity WHERE activity_type_id IN (1,2,3) AND publish_status = 1 AND is_submit_meeting = 1 AND activity_time <= NOW();`
-	err = o.Raw(sql).QueryRow(&totalOnline)
-	if err != nil {
-		fmt.Println("获取线上", err)
-	}
-	sql = `SELECT COUNT(1) FROM cygx_activity WHERE activity_type_id IN (4,5,6) AND publish_status = 1 AND is_submit_meeting = 1 	AND activity_time <= NOW();`
-	err = o.Raw(sql).QueryRow(&totalOffline)
-	if err != nil {
-		fmt.Println("获取线下", err)
-	}
-	sql = `SELECT COUNT( 1 ) FROM
-			cygx_activity_signup  as s 
-			INNER JOIN cygx_activity as a ON  a.activity_id = s.activity_id
-		WHERE
-			s.do_fail_type = 0
-			AND a.is_submit_meeting = 1
-			AND a.activity_time <= NOW()
-			AND a.publish_status = 1`
-	err = o.Raw(sql).QueryRow(&totalPeople)
-	if err != nil {
-		fmt.Println("共累计预约外呼人数", err)
-	}
-
-	sql = `SELECT COUNT( 1 ) FROM
-			cygx_activity_signup  as s 
-			INNER JOIN cygx_activity as a ON  a.activity_id = s.activity_id
-		WHERE
-			s.do_fail_type = 0
-			AND a.is_submit_meeting = 1
-			AND a.activity_time <= NOW()
-			AND a.activity_type_id IN (4,5,6)
-			AND a.publish_status = 1`
-	err = o.Raw(sql).QueryRow(&totalSignUpOff)
-	if err != nil {
-		fmt.Println("共累计预约外呼人数", err)
-	}
-
-	sql = `SELECT COUNT( 1 ) FROM
-			cygx_activity_signup  as s 
-			INNER JOIN cygx_activity as a ON  a.activity_id = s.activity_id
-		WHERE
-			s.do_fail_type = 0
-			AND a.publish_status = 1
-			AND a.is_submit_meeting = 1
-			AND a.activity_time <= NOW()
-			AND a.is_submit_meeting = 1
-			AND a.activity_type_id IN (4,5,6);`
-	err = o.Raw(sql).QueryRow(&totalSignUpOffTime)
-	if err != nil {
-		fmt.Println("线下报名参会人数", err)
-	}
-
-	sql = `SELECT COUNT( 1 ) FROM
-			cygx_activity_signup  as s 
-			INNER JOIN cygx_activity as a ON  a.activity_id = s.activity_id
-		WHERE
-			s.do_fail_type = 0
-			AND a.is_submit_meeting = 1
-			AND a.activity_time <= NOW()
-			AND a.publish_status = 1
-			AND s.is_meeting = 1
-			AND a.activity_type_id IN (4,5,6);`
-	err = o.Raw(sql).QueryRow(&totalPeopleMeet)
-	if err != nil {
-		fmt.Println("线下参会人数", err)
-	}
-
-	fmt.Println("共上线活动", totalOnline+totalOffline, "个,其中线上", totalOnline, "个,线下", totalOffline, "个")
-	fmt.Println("共累计预约外呼人数", totalPeople, "人")
-	fmt.Println("报名线下参会", totalSignUpOff, "人,实际到会人数", totalPeopleMeet, "人,线下到会率约", totalPeopleMeet*100/totalSignUpOff, "%")
-
-	num := totalPeopleMeet / totalSignUpOffTime
-	fmt.Println(num)
-	fmt.Println(totalOnline)
-	fmt.Println(totalOffline)
-	fmt.Println(totalPeople)
-	fmt.Println(totalSignUpOff)
-	fmt.Println(totalPeopleMeet)
-	fmt.Println(totalSignUpOffTime)
-	fmt.Println(totalPeopleMeet / totalSignUpOffTime)
-	return
-
-}
-
 // UserViewRedisData 阅读数据
 type UserViewRedisData struct {
 	Mobile          string `json:"mobile"`
@@ -572,22 +171,12 @@ func PushViewRecordNewRedisData(reportViewRecord *ReportViewRecord, companyId in
 	return false
 }
 
-//func GetCeLueArticlePv() {
-//	sum := 0
-//	for i := 0; i <= 450; i++ {
-//		if i >= 102 {
-//			//GetCeLueArticlePvs(strconv.Itoa(i * 1000))
-//		}
-//	}
-//	fmt.Println(sum)
-//}
-
 // 获取策略平台报告阅读数据
 func GetCeLueArticlePv(cont context.Context) (err error) {
 	//func GetCeLueArticlePv() (err error) {
 	defer func() {
 		if err != nil {
-			go utils.SendAlarmMsg("同步策略平台阅读数据失败", 2)
+			go utils.SendAlarmMsg("同步策略平台阅读数据失败"+err.Error(), 2)
 			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "GetCeLueArticlePv ErrMsg:"+err.Error(), utils.EmailSendToUsers)
 		}
 	}()
@@ -803,22 +392,6 @@ func UpdateArticleByRedis() (err error) {
 	}
 }
 
-//func init() {
-//	// allList, err := models.GetArticleAll()
-//	//
-//	// fmt.Println(err)
-//	//
-//	//	for _, v := range allList {
-//	//		HandleArticleListByApi(v.ArticleId)
-//	//	}
-//
-//	//for i := 8648; i < 9004; i++ {
-//	//	HandleArticleListByApi(9552)
-//	//}
-//	HandleArticleListByApi(10914)
-//	//UpdateArticleResourceData(9551)
-//}
-
 // 处理同步过来的文章
 func HandleArticleListByApi(artcleId int) (err error) {
 	defer func() {
@@ -964,6 +537,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			item.Stock = stock
 		}
 		item.FieldName = articleResult.Field.Name
+		item.SeriesName = articleResult.Series.Name
 		item.TypeName = articleResult.Type.Name
 		item.UpdateDate = articleResult.UpdateDate
 		item.CeLueFieldId = articleResult.Field.Id
@@ -1097,7 +671,17 @@ func HandleArticleListByApi(artcleId int) (err error) {
 				return err
 			}
 			v.CategoryId = detailCategory.CategoryId
-			v.IsSummary = 0
+			matchTypeName = "路演精华"
+			if v.IsClass == 0 {
+				v.IsSummary = 0
+			}
+		}
+		var chartPermissionId int
+		var chartPermissionName string
+		categoryDetail, _ := models.GetdetailByCategoryIdPush(v.CategoryId)
+		if categoryDetail != nil {
+			chartPermissionId = categoryDetail.ChartPermissionId
+			chartPermissionName = categoryDetail.ChartPermissionName
 		}
 
 		if count > 0 {
@@ -1109,13 +693,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			}
 			bodyTextOld, _ := GetReportContentTextSubNew(articleIfoOld.Body)
 			bodyText, _ := GetReportContentTextSubNew(v.Body)
-			if len(bodyText)-len(bodyTextOld) > 100 {
-				//fmt.Println("触发推送规则")
-				//更新字数大于一百字触发推送规则
-				go DoArticleOnenIdWxTemplateMsg(v.ArticleId)
-				go UpdateArticleResourceData(v.ArticleId) //把数据写入 cygx_resource_data 表
-				//go UpdateResourceData(v.ArticleId, "article", "update", time.Now().Format(utils.FormatDateTime))
-			}
+
 			var isCustom bool
 			updateParams := make(map[string]interface{})
 			//updateParams["Title"] = v.Title
@@ -1154,18 +732,29 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			updateParams["FileLink"] = v.File
 			updateParams["Stock"] = v.Stock
 			updateParams["FieldName"] = v.FieldName
+			updateParams["SeriesName"] = v.SeriesName
 			updateParams["Annotation"] = v.Annotation
 			updateParams["TypeName"] = v.TypeName
 			updateParams["ModifyTimeByCl"] = v.UpdateDate
 			updateParams["CeLueFieldId"] = v.CeLueFieldId
 			updateParams["Cover"] = v.Cover
+			updateParams["ChartPermissionId"] = chartPermissionId
+			updateParams["ChartPermissionName"] = chartPermissionName
 			whereParam := map[string]interface{}{"article_id": v.ArticleId}
 			err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
 			if err != nil {
 				fmt.Println("UpdateByExpr Err:" + err.Error())
 				return err
 			}
-
+			if len(bodyText)-len(bodyTextOld) > 100 {
+				//fmt.Println("触发推送规则")
+				//更新字数大于一百字触发推送规则
+				go DoArticleOnenIdWxTemplateMsg(v.ArticleId)
+				UpdateArticleResourceData(v.ArticleId) //把数据写入 cygx_resource_data 表
+				//go UpdateResourceData(v.ArticleId, "article", "update", time.Now().Format(utils.FormatDateTime))
+			} else {
+				models.UpdatecygxResourceDatasearchTitle(v.Title, v.ArticleId)
+			}
 		} else {
 			fmt.Println(k, v.ArticleId, "add")
 			item := new(models.CygxArticle)
@@ -1198,18 +787,23 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			item.MatchTypeName = matchTypeName
 			item.Stock = v.Stock
 			item.FieldName = v.FieldName
+			item.SeriesName = v.SeriesName
 			item.Annotation = v.Annotation
 			item.TypeName = v.TypeName
 			item.ModifyTimeByCl = v.UpdateDate
 			item.CeLueFieldId = v.CeLueFieldId
 			item.Cover = v.Cover
+			item.ChartPermissionId = chartPermissionId
+			item.ChartPermissionName = chartPermissionName
+			item.Cover = v.Cover
+			item.CreateTime = time.Now()
 			newId, err := models.AddCygxArticles(item)
 			if err != nil {
 				fmt.Println("AddCygxArticle Err:", err.Error())
 				return err
 			}
 			//go UpdateResourceData(v.ArticleId, "article", "add", time.Now().Format(utils.FormatDateTime))
-			go UpdateArticleResourceData(v.ArticleId) //把数据写入 cygx_resource_data 表
+			UpdateArticleResourceData(v.ArticleId) //把数据写入 cygx_resource_data 表
 			//fmt.Println(newId)
 			//报告自动归类,以及推送相关模板消息
 			if v.ReportType == 2 {
@@ -1293,6 +887,9 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			go DoArticleOnenIdWxTemplateMsg(v.ArticleId)
 		}
 
+		if v.CategoryName == utils.ZHOU_QI_NAME {
+			UpdateCygxZhouqiArticleMapTime(v.FieldName) //更新周期对应分类下所管理文章的更新时间
+		}
 		//【公司调研】系列纪要发布/更新后 end
 
 		//查研观向6.9模板消息推送规则
@@ -1334,6 +931,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 	}
 
 	AddCygxReportMappingCategoryGroupByArticleId(artcleId)
+
 	return err
 }
 
@@ -1782,58 +1380,6 @@ func GetSpecialArticleDetailUserPower(user *models.WxUserItem, articleInfo *mode
 	return
 }
 
-//func init() {
-//	GetArticNewLabelWhithActivity3Month()
-//}
-
-// 弘则报告发布日期在三个月以内的
-func GetArticNewLabelWhithActivity3Month() (labelMap map[int]bool, err error) {
-	var condition string
-	var pars []interface{}
-	condition += ` AND publish_date  <= ?  AND article_id < ? `
-	pars = append(pars, time.Now().AddDate(0, -3, 0), utils.SummaryArticleId)
-	articleList, e := models.GetArticleList(condition, pars)
-	if e != nil {
-		err = errors.New("GetArticleList, Err: " + e.Error())
-		return
-	}
-	var articleIds []int
-	for _, v := range articleList {
-		articleIds = append(articleIds, v.ArticleId)
-	}
-	if len(articleIds) == 0 {
-		return
-	}
-
-	pars = make([]interface{}, 0)
-	condition = ` AND article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
-	pars = append(pars, articleIds)
-	industrialList, e := models.GetIndustrialArticleGroupManagementList(condition, pars)
-	if e != nil {
-		err = errors.New("GetIndustrialArticleGroupManagementList, Err: " + e.Error())
-		return
-	}
-	labelMap = make(map[int]bool, 0)
-	var industrialIds []int
-	for _, v := range industrialList {
-		industrialIds = append(industrialIds, v.IndustrialManagementId)
-	}
-	// 获取活动关联的产业
-	var groupCond string
-	var groupPars []interface{}
-	groupCond += ` AND b.industrial_management_id IN (` + utils.GetOrmInReplace(len(industrialIds)) + `)  AND b.source = 1  `
-	groupPars = append(groupPars, industrialIds)
-	groups, e := models.GetActivityIndustryRelationList(groupCond, groupPars)
-	if e != nil {
-		err = errors.New("获取活动产业关联列表失败, Err: " + e.Error())
-		return
-	}
-	for _, v := range groups {
-		labelMap[v.ActivityId] = true
-	}
-	return
-}
-
 // HandleArticleCategoryImg 预处理文章的封面图片
 func HandleArticleCategoryImg(list []*models.HomeArticle) (items []*models.HomeArticle, err error) {
 	//研选的五张图片
@@ -2052,12 +1598,6 @@ func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
 	return
 }
 
-//func init() {
-//	strss := AnnotationHtml("")
-//
-//	fmt.Println(strss)
-//}
-
 // 处理核心观点的展示规则
 func AnnotationHtml(bodyText string) (annotation string) {
 	if bodyText == "" {
@@ -2379,841 +1919,3 @@ func GetYxArticleIdMap(articleIds []int) (mapResp map[int]bool) {
 	}
 	return
 }
-
-//func init() {
-//
-//	//listarticle, err := models.GetArticleInit13_5()
-//	//fmt.Println(err)
-//	//fmt.Println("listarticle", len(listarticle))
-//	//
-//	//for _, v := range listarticle {
-//	//	HandleArticleListByApiInit13_5(v.ArticleId)
-//	//}
-//	//HandleArticleListByApiInit13_5(10825)
-//
-//	listarticle, err := models.GetArticleInit13_5GuSHou()
-//	fmt.Println(err)
-//	fmt.Println("listarticle", len(listarticle))
-//
-//	for _, v := range listarticle {
-//		HandleArticleListByApiInit13_5GuShou(v.ArticleId)
-//	}
-//
-//}
-
-// 处理同步过来的文章
-func HandleArticleListByApiInit13_5(artcleId int) (err error) {
-	defer func() {
-		if err != nil {
-			go utils.SendAlarmMsg("处理同步策略平台数据失败"+"GetArticleListByApi ErrMsg:"+err.Error()+"artcleId:"+strconv.Itoa(artcleId), 2)
-			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "GetArticleListByApi ErrMsg:"+err.Error()+"artcleId:"+strconv.Itoa(artcleId), utils.EmailSendToUsers)
-		}
-	}()
-	var clueApiUrl string
-	clueApiUrl = fmt.Sprint(utils.ApiUrl, "articles/", artcleId)
-	fmt.Println(clueApiUrl)
-
-	authorization := utils.ApiAuthorization
-	body, err := PublicGetDate(clueApiUrl, authorization)
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-	var articleResultDate models.ArticleDetailResultApi
-	err = json.Unmarshal(body, &articleResultDate)
-	if err != nil {
-		fmt.Println("Getres.PublicGetDate Err:", err.Error())
-		return err
-	}
-	item := new(models.CygxShanghaiCompanyLog)
-	item.CreateTime = time.Now()
-	item.Url = clueApiUrl
-	item.Body = ""
-	item.Result = string(body)
-
-	articleResult := articleResultDate.Data
-
-	exitMap := make(map[int]int)
-	categoryIdMap := make(map[int]int)
-	classMap := make(map[int]int)
-	reportMap := make(map[int]int)
-	summaryMap := make(map[int]int)
-	listMap, err := models.GetArticleApiMap()
-	if err != nil {
-		fmt.Println("GetlistMap Err:", err.Error())
-		return err
-	}
-
-	//新旧分类 反向隐射,是否归类,是否是报告,是否是纪要库
-	for _, v := range listMap {
-		exitMap[v.SeriesId] = v.OldId
-		categoryIdMap[v.SeriesId] = v.OldIdMap
-		if v.IsClass == 1 {
-			classMap[v.OldId] = 1
-		}
-		if v.IsReport == 1 {
-			reportMap[v.OldId] = 1
-		}
-		if v.IsSummary == 1 {
-			summaryMap[v.OldId] = 1
-		}
-	}
-	var list []*models.Tactics2
-	var listArticleData []*models.CygxArticleData
-	var listAuthor []*models.CygxArticleAuthor
-	//如果是英文报告 ,或者香港类型那么则不同步  publish_area   :all  全部  ;hk 香港
-	if articleResult.TypeId == 9 || articleResult.PublishArea != "all" {
-		// 如果是英文报告,或者是香港报告就进行删除处理
-		err = models.UpdateArticlePublish(artcleId, 0)
-		if err != nil {
-			fmt.Println("UpdateArticlePublish Err:", err.Error())
-			return err
-		}
-		UpdateArticleResourceData(artcleId) //把数据写入 cygx_resource_data 表
-		return
-	}
-
-	var cover string
-	if articleResult.Series.Name == "图解市场" {
-		cover = GetArticleCoverByChartFirst(articleResult.Content.Body)
-	} else if articleResult.Series.Name == "行业深度" {
-		cover = articleResult.Cover
-	}
-	fmt.Println(cover)
-	//return
-	//状态等于 2 跟 4 的进行同步 IsActive 为false 软删除的也不同步
-	if exitMap[articleResult.SeriesId] > 0 && (articleResult.PublishStatus == 2 || articleResult.PublishStatus == 4) && articleResult.IsActive {
-		articleResult.PublishDate = time.Date(articleResult.PublishDate.Year(), articleResult.PublishDate.Month(), articleResult.PublishDate.Day(), articleResult.PublishDate.Hour(), articleResult.PublishDate.Minute(), articleResult.PublishDate.Second(), articleResult.PublishDate.Nanosecond(), time.Local)
-		item := new(models.Tactics2)
-		itemArticleData := new(models.CygxArticleData)
-		itemArticleData.ArticleId = articleResult.ArticleId
-		itemArticleData.Cover = articleResult.Cover
-		itemArticleData.CreateTime = time.Now()
-		listArticleData = append(listArticleData, itemArticleData)
-		itemAuthor := new(models.CygxArticleAuthor)
-		item.ArticleId = articleResult.ArticleId
-		item.Title = articleResult.Title
-		item.TitleEn = articleResult.TitleEn
-		item.File = articleResult.File
-		if articleResult.Frequency == "日度" {
-			item.UpdateFrequency = "daily"
-		} else if articleResult.Frequency == "周度" {
-			item.UpdateFrequency = "weekly"
-		} else if articleResult.Frequency == "月度" {
-			item.UpdateFrequency = "monthly"
-		} else if articleResult.Frequency == "季度" {
-			item.UpdateFrequency = "quarterly"
-		} else if articleResult.Frequency == "年度" {
-			item.UpdateFrequency = "yearly"
-		} else {
-			item.UpdateFrequency = "unknow"
-		}
-		item.CreateDate = articleResult.CreateDate
-		item.PublishDate = articleResult.PublishDate.Add(time.Hour * 8)
-		item.PublishStatus = 1
-		item.Body = articleResult.Content.Body
-		item.Abstract = articleResult.Content.Abstract
-		item.Annotation = articleResult.Content.Annotation
-		item.CategoryName = articleResult.Industry.Name
-		item.CategoryId = categoryIdMap[articleResult.SeriesId]
-		item.CategoryIdTwo = exitMap[articleResult.SeriesId]
-		item.SubCategoryName = articleResult.Series.Name
-		item.Cover = cover
-
-		fmt.Println("item.CategoryIdTwo", item.CategoryIdTwo)
-		fmt.Println("item.CategoryId", item.CategoryId)
-
-		{
-			//这两种情况特殊处理
-			if articleResult.Field.Name == "宏观利率" {
-				item.CategoryId = 10070
-				item.CategoryIdTwo = item.CategoryId
-			}
-			if articleResult.Field.Name == "信用" {
-				item.CategoryId = 10082
-				item.CategoryIdTwo = item.CategoryId
-			}
-		}
-
-		if len(articleResult.Stock) > 0 {
-			var stock string
-			for _, vS := range articleResult.Stock {
-				stock += vS + "/"
-			}
-			stock = strings.TrimRight(stock, "/")
-			item.Stock = stock
-		}
-		item.FieldName = articleResult.Field.Name
-		item.TypeName = articleResult.Type.Name
-		item.UpdateDate = articleResult.UpdateDate
-		item.CeLueFieldId = articleResult.Field.Id
-		list = append(list, item)
-		itemAuthor.ArticleId = articleResult.ArticleId
-		itemAuthor.Name = articleResult.Author.Name
-		itemAuthor.Mobile = articleResult.Author.PhoneNumber
-		fmt.Println(articleResult.Cover)
-		listAuthor = append(listAuthor, itemAuthor)
-	} else {
-		// 如果这篇文章没有发布,那么就不作处理。
-		err = models.UpdateArticlePublish(artcleId, 0)
-		if err != nil {
-			fmt.Println("UpdateArticlePublish Err:", err.Error())
-			return err
-		}
-		UpdateArticleResourceData(artcleId) //把数据写入 cygx_resource_data 表
-		//go UpdateResourceData(artcleId, "article", "delete", time.Now().Format(utils.FormatDateTime))
-		return
-	}
-
-	fmt.Println("同步文章条数:", len(list))
-	listCustomArticle, err := models.GetCustomArticleId() //手动归类的文章,不替换文章类型
-	if err != nil {
-		fmt.Println("GetTacticsList Err:", err.Error())
-		return err
-	}
-	listGetMatchTypeName, errMatch := models.GetMatchTypeNamenNotNull() //手动归类的文章,不替换文章类型
-	if errMatch != nil {
-		fmt.Println("GetTacticsList Err:", errMatch.Error())
-		return err
-	}
-	//mapCategoryIdSet := make(map[int]int)
-	//for _, vMatch := range listGetMatchTypeName {
-	//	mapCategoryIdSet[vMatch.CategoryId] = vMatch.CategoryIdSet
-	//}
-	fmt.Println("list len:", len(list))
-	noSummaryArticleIds := "" //非纪要库类型的文章ID
-	listNoSummaryArticleIds := strings.Split(noSummaryArticleIds, ",")
-	for k, v := range list {
-		//同步匹配类型
-		matchTypeName := ""
-		for _, vMatch := range listGetMatchTypeName {
-			if v.CategoryId == vMatch.CategoryId {
-				matchTypeName = vMatch.MatchTypeName
-			}
-		}
-		//是否属于纪要库的数据
-		//if _, has := summaryMap[v.CategoryId]; has {
-		//	v.IsSummary = 1
-		//}
-		if v.TypeName == "纪要" {
-			v.IsSummary = 1
-		}
-		//排除不属于纪要库类型的文章
-		for _, vArt := range listNoSummaryArticleIds {
-			vArtInt, _ := strconv.Atoi(vArt)
-			if v.ArticleId == vArtInt {
-				v.IsSummary = 0
-			}
-		}
-		if _, has := reportMap[v.CategoryIdTwo]; has {
-			v.IsReport = 1
-			if _, ok := classMap[v.CategoryIdTwo]; ok {
-				v.IsClass = 1
-				v.ReportType = 1 //是否属于行业报告
-			} else {
-				v.ReportType = 2 //是否属于产业报告
-			}
-		}
-		v.Department = "弘则权益研究"
-		//判断是否已经存在
-		if v.ArticleId < 0 {
-			fmt.Println("AddCygxArticle Err:")
-			return err
-		}
-		var count int
-		count, err = models.GetArticleCountById(v.ArticleId)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			fmt.Println("AddCygxArticle Err:", err.Error())
-			return err
-		}
-		v.Body = strings.Replace(v.Body, "http://vmp.hzinsights.com", "https://vmp.hzinsights.com", -1)
-		expertNumStr, expertContentStr, interviewDateStr, _, bodyReturn := BodyAnalysis2(v.Body)
-		if strings.Index(v.Body, "报告全文(") > 0 && strings.Index(v.Body, "PDF格式报告下载.pdf") > 0 {
-			v.Body = strings.Replace(v.Body, "报告全文(", "", -1)
-			v.Body = strings.Replace(v.Body, "PDF格式报告下载.pdf", "", -1)
-			v.Body = strings.Replace(v.Body, "):", "", -1)
-		}
-		var titleNew string
-		titleNew = v.Title
-		// 7资金流向 、11大类资产 、51每日复盘 、80医药周报、9估值研究
-		if v.CategoryId == 7 || v.CategoryId == 11 || v.CategoryId == 51 || v.CategoryId == 9 {
-			if v.UpdateFrequency == "daily" {
-				var daystr string
-				daystr = strconv.Itoa(v.PublishDate.Day())
-				if len(daystr) == 1 {
-					daystr = "0" + daystr
-				}
-				titleNew = v.Title + "(" + strconv.Itoa(v.PublishDate.Year())[2:len(strconv.Itoa(v.PublishDate.Year()))-0] + v.PublishDate.Format("01") + daystr + ")"
-			} else if v.UpdateFrequency == "weekly" {
-				titleNew = v.Title + utils.WeekByDate(v.PublishDate)
-			}
-		}
-		if v.CategoryId == 80 {
-			titleNew = v.Title + utils.WeekByDate(v.PublishDate)
-		}
-
-		//类型是综述报告的,不区分是什么系列,统一归类到对应产业的路演精华
-		if articleResult.Type.Name == "综述报告" {
-			detailCategory, err := models.GetdetailByCategoryIdLyjh(v.CategoryIdTwo)
-			if err != nil && err.Error() != utils.ErrNoRow() {
-				return err
-			}
-			v.CategoryId = detailCategory.CategoryId
-			v.IsSummary = 0
-		}
-
-		if count > 0 {
-			fmt.Println(k, v.ArticleId, "edit")
-
-			bodyText, _ := GetReportContentTextSubNew(v.Body)
-
-			var isCustom bool
-			updateParams := make(map[string]interface{})
-			//updateParams["Title"] = v.Title
-			updateParams["Title"] = titleNew
-			updateParams["TitleEn"] = v.TitleEn
-			updateParams["UpdateFrequency"] = v.UpdateFrequency
-			updateParams["CreateDate"] = v.CreateDate
-			updateParams["PublishDate"] = v.PublishDate
-			//updateParams["Body"] = html.EscapeString(v.Body)
-			updateParams["Body"] = html.EscapeString(bodyReturn)
-			updateParams["BodyText"] = bodyText
-			updateParams["Abstract"] = html.EscapeString(v.Abstract)
-			updateParams["CategoryName"] = v.CategoryName
-			for _, vCustom := range listCustomArticle {
-				if v.ArticleId == vCustom.ArticleId {
-					fmt.Println("手动归类的文章:" + strconv.Itoa(v.ArticleId))
-					isCustom = true
-				}
-			}
-			if isCustom == false {
-				updateParams["CategoryId"] = v.CategoryId
-				updateParams["MatchTypeName"] = matchTypeName
-				updateParams["IsSummary"] = v.IsSummary
-				updateParams["IsReport"] = v.IsReport
-				updateParams["ReportType"] = v.ReportType
-				updateParams["SubCategoryName"] = v.SubCategoryName
-			}
-			//updateParams["CategoryId"] = v.CategoryId
-			updateParams["PublishStatus"] = 1
-			updateParams["ExpertBackground"] = expertContentStr
-			updateParams["ExpertNumber"] = expertNumStr
-			updateParams["InterviewDate"] = interviewDateStr
-			//updateParams["IsClass"] = v.IsClass
-			v.Department = "弘则权益研究"
-			updateParams["Department"] = v.Department
-			updateParams["FileLink"] = v.File
-			updateParams["Stock"] = v.Stock
-			updateParams["FieldName"] = v.FieldName
-			updateParams["Annotation"] = v.Annotation
-			updateParams["TypeName"] = v.TypeName
-			updateParams["ModifyTimeByCl"] = v.UpdateDate
-			updateParams["CeLueFieldId"] = v.CeLueFieldId
-			updateParams["Cover"] = v.Cover
-			//whereParam := map[string]interface{}{"article_id": v.ArticleId}
-			//err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
-			//if err != nil {
-			//	fmt.Println("UpdateByExpr Err:" + err.Error())
-			//	return err
-			//}
-			fmt.Println("v.ReportType", v.ReportType)
-
-			//if v.ReportType == 2 {
-			var subjectStr string
-			var industrialManagementIdStr string
-			var industrialSubjectIdStr string
-
-			sliceSubjects := strings.Split(v.Stock, "/")
-			mapManagementForSubject := make(map[string]string)
-			mapIndustrialId := make(map[int]int)
-			if len(sliceSubjects) > 0 {
-				for _, vSubject := range sliceSubjects {
-					sliceKuohao := strings.Split(vSubject, "(")           //过滤括号
-					sliceXiahuaxian := strings.Split(sliceKuohao[0], "-") //过滤下划线
-					subject := sliceXiahuaxian[0]
-					subjectStr += "'" + subject + "',"
-				}
-				//获取该产业下所对应的行业图片
-				detailCategory, errCategory := models.GetdetailByCategoryIdOne(v.CategoryId)
-				if errCategory != nil {
-					fmt.Println("GetdetailByCategoryIdOne Err:", err.Error())
-					return err
-				}
-				subjectStr = strings.TrimRight(subjectStr, ",")
-				if subjectStr != "" {
-					listIndustrial, err := models.GetIndustrialManagementForSubjecName(subjectStr, detailCategory.ChartPermissionId)
-					if err != nil {
-						fmt.Println("GetIndustrialManagementForSubjecName Err:", err.Error())
-						return err
-					}
-					subjectStr = strings.Replace(subjectStr, "','", "】【", -1)
-					subjectStr = strings.Replace(subjectStr, "'", "", -1)
-					subjectStr = "【" + subjectStr + "】"
-					if len(listIndustrial) > 0 {
-						for _, vIndustrial := range listIndustrial {
-							if _, ok := mapIndustrialId[vIndustrial.IndustrialManagementId]; !ok {
-								industrialManagementIdStr += strconv.Itoa(vIndustrial.IndustrialManagementId) + ","
-							}
-							mapIndustrialId[vIndustrial.IndustrialManagementId] = vIndustrial.IndustrialManagementId
-							industrialSubjectIdStr += strconv.Itoa(vIndustrial.IndustrialSubjectId) + ","
-							mapManagementForSubject[vIndustrial.IndustryName] += vIndustrial.SubjectName + "/"
-							if vIndustrial.LayoutTime == "0000-00-00 00:00:00" {
-								go models.UpdateIndustrialManagementLayoutTime(v.PublishDate.AddDate(0, 0, -10).Format(utils.FormatDateTime), vIndustrial.IndustrialManagementId)
-							}
-						}
-
-						industrialManagementIdStr = strings.TrimRight(industrialManagementIdStr, ",")
-						industrialSubjectIdStr = strings.TrimRight(industrialSubjectIdStr, ",")
-						if industrialManagementIdStr != "" {
-							err = models.ReportArticleClassificationEditNew(artcleId, industrialManagementIdStr, v.ArticleId, industrialSubjectIdStr)
-							if err != nil {
-								fmt.Println("ReportArticleClassificationEditNew Err:", err.Error())
-								return err
-							}
-						}
-					}
-					//}
-				}
-			}
-
-		}
-	}
-
-	AddComprehensiveIndustrialSource("Hz", artcleId) // 同步到综合页面的搜索引擎(添加产业资源包)
-
-	AddCygxReportMappingCategoryGroupByArticleId(artcleId)
-	return err
-}
-
-func HandleArticleListByApiInit13_5GuShou(artcleId int) (err error) {
-	defer func() {
-		if err != nil {
-			go utils.SendAlarmMsg("处理同步策略平台数据失败"+"GetArticleListByApi ErrMsg:"+err.Error()+"artcleId:"+strconv.Itoa(artcleId), 2)
-			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "GetArticleListByApi ErrMsg:"+err.Error()+"artcleId:"+strconv.Itoa(artcleId), utils.EmailSendToUsers)
-		}
-	}()
-	var clueApiUrl string
-	clueApiUrl = fmt.Sprint(utils.ApiUrl, "articles/", artcleId)
-	fmt.Println(clueApiUrl)
-
-	authorization := utils.ApiAuthorization
-	body, err := PublicGetDate(clueApiUrl, authorization)
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-	var articleResultDate models.ArticleDetailResultApi
-	err = json.Unmarshal(body, &articleResultDate)
-	if err != nil {
-		fmt.Println("Getres.PublicGetDate Err:", err.Error())
-		return err
-	}
-	item := new(models.CygxShanghaiCompanyLog)
-	item.CreateTime = time.Now()
-	item.Url = clueApiUrl
-	item.Body = ""
-	item.Result = string(body)
-
-	articleResult := articleResultDate.Data
-
-	exitMap := make(map[int]int)
-	categoryIdMap := make(map[int]int)
-	classMap := make(map[int]int)
-	reportMap := make(map[int]int)
-	summaryMap := make(map[int]int)
-	listMap, err := models.GetArticleApiMap()
-	if err != nil {
-		fmt.Println("GetlistMap Err:", err.Error())
-		return err
-	}
-
-	//新旧分类 反向隐射,是否归类,是否是报告,是否是纪要库
-	for _, v := range listMap {
-		exitMap[v.SeriesId] = v.OldId
-		categoryIdMap[v.SeriesId] = v.OldIdMap
-		if v.IsClass == 1 {
-			classMap[v.OldId] = 1
-		}
-		if v.IsReport == 1 {
-			reportMap[v.OldId] = 1
-		}
-		if v.IsSummary == 1 {
-			summaryMap[v.OldId] = 1
-		}
-	}
-	var list []*models.Tactics2
-	var listArticleData []*models.CygxArticleData
-	var listAuthor []*models.CygxArticleAuthor
-	//如果是英文报告 ,或者香港类型那么则不同步  publish_area   :all  全部  ;hk 香港
-	if articleResult.TypeId == 9 || articleResult.PublishArea != "all" {
-		// 如果是英文报告,或者是香港报告就进行删除处理
-		err = models.UpdateArticlePublish(artcleId, 0)
-		if err != nil {
-			fmt.Println("UpdateArticlePublish Err:", err.Error())
-			return err
-		}
-		UpdateArticleResourceData(artcleId) //把数据写入 cygx_resource_data 表
-		return
-	}
-
-	var cover string
-	if articleResult.Series.Name == "图解市场" {
-		cover = GetArticleCoverByChartFirst(articleResult.Content.Body)
-	} else if articleResult.Series.Name == "行业深度" {
-		cover = articleResult.Cover
-	}
-	fmt.Println(cover)
-	//return
-	//状态等于 2 跟 4 的进行同步 IsActive 为false 软删除的也不同步
-	if exitMap[articleResult.SeriesId] > 0 && (articleResult.PublishStatus == 2 || articleResult.PublishStatus == 4) && articleResult.IsActive {
-		articleResult.PublishDate = time.Date(articleResult.PublishDate.Year(), articleResult.PublishDate.Month(), articleResult.PublishDate.Day(), articleResult.PublishDate.Hour(), articleResult.PublishDate.Minute(), articleResult.PublishDate.Second(), articleResult.PublishDate.Nanosecond(), time.Local)
-		item := new(models.Tactics2)
-		itemArticleData := new(models.CygxArticleData)
-		itemArticleData.ArticleId = articleResult.ArticleId
-		itemArticleData.Cover = articleResult.Cover
-		itemArticleData.CreateTime = time.Now()
-		listArticleData = append(listArticleData, itemArticleData)
-		itemAuthor := new(models.CygxArticleAuthor)
-		item.ArticleId = articleResult.ArticleId
-		item.Title = articleResult.Title
-		item.TitleEn = articleResult.TitleEn
-		item.File = articleResult.File
-		if articleResult.Frequency == "日度" {
-			item.UpdateFrequency = "daily"
-		} else if articleResult.Frequency == "周度" {
-			item.UpdateFrequency = "weekly"
-		} else if articleResult.Frequency == "月度" {
-			item.UpdateFrequency = "monthly"
-		} else if articleResult.Frequency == "季度" {
-			item.UpdateFrequency = "quarterly"
-		} else if articleResult.Frequency == "年度" {
-			item.UpdateFrequency = "yearly"
-		} else {
-			item.UpdateFrequency = "unknow"
-		}
-		item.CreateDate = articleResult.CreateDate
-		item.PublishDate = articleResult.PublishDate.Add(time.Hour * 8)
-		item.PublishStatus = 1
-		item.Body = articleResult.Content.Body
-		item.Abstract = articleResult.Content.Abstract
-		item.Annotation = articleResult.Content.Annotation
-		item.CategoryName = articleResult.Industry.Name
-		item.CategoryId = categoryIdMap[articleResult.SeriesId]
-		item.CategoryIdTwo = exitMap[articleResult.SeriesId]
-		item.SubCategoryName = articleResult.Series.Name
-		item.Cover = cover
-
-		fmt.Println("item.CategoryIdTwo", item.CategoryIdTwo)
-		fmt.Println("item.CategoryId", item.CategoryId)
-
-		{
-			//这两种情况特殊处理
-			if articleResult.Field.Name == "宏观利率" {
-				item.CategoryId = 10070
-				item.CategoryIdTwo = item.CategoryId
-			}
-			if articleResult.Field.Name == "信用" {
-				item.CategoryId = 10082
-				item.CategoryIdTwo = item.CategoryId
-			}
-		}
-
-		if len(articleResult.Stock) > 0 {
-			var stock string
-			for _, vS := range articleResult.Stock {
-				stock += vS + "/"
-			}
-			stock = strings.TrimRight(stock, "/")
-			item.Stock = stock
-		}
-		item.FieldName = articleResult.Field.Name
-		item.TypeName = articleResult.Type.Name
-		item.UpdateDate = articleResult.UpdateDate
-		item.CeLueFieldId = articleResult.Field.Id
-		list = append(list, item)
-		itemAuthor.ArticleId = articleResult.ArticleId
-		itemAuthor.Name = articleResult.Author.Name
-		itemAuthor.Mobile = articleResult.Author.PhoneNumber
-		fmt.Println(articleResult.Cover)
-		listAuthor = append(listAuthor, itemAuthor)
-	} else {
-		// 如果这篇文章没有发布,那么就不作处理。
-		//err = models.UpdateArticlePublish(artcleId, 0)
-		//if err != nil {
-		//	fmt.Println("UpdateArticlePublish Err:", err.Error())
-		//	return err
-		//}
-		//UpdateArticleResourceData(artcleId) //把数据写入 cygx_resource_data 表
-		//go UpdateResourceData(artcleId, "article", "delete", time.Now().Format(utils.FormatDateTime))
-		return
-	}
-
-	fmt.Println("同步文章条数:", len(list))
-	listCustomArticle, err := models.GetCustomArticleId() //手动归类的文章,不替换文章类型
-	if err != nil {
-		fmt.Println("GetTacticsList Err:", err.Error())
-		return err
-	}
-	listGetMatchTypeName, errMatch := models.GetMatchTypeNamenNotNull() //手动归类的文章,不替换文章类型
-	if errMatch != nil {
-		fmt.Println("GetTacticsList Err:", errMatch.Error())
-		return err
-	}
-	//mapCategoryIdSet := make(map[int]int)
-	//for _, vMatch := range listGetMatchTypeName {
-	//	mapCategoryIdSet[vMatch.CategoryId] = vMatch.CategoryIdSet
-	//}
-	fmt.Println("list len:", len(list))
-	noSummaryArticleIds := "" //非纪要库类型的文章ID
-	listNoSummaryArticleIds := strings.Split(noSummaryArticleIds, ",")
-	for k, v := range list {
-		//同步匹配类型
-		matchTypeName := ""
-		for _, vMatch := range listGetMatchTypeName {
-			if v.CategoryId == vMatch.CategoryId {
-				matchTypeName = vMatch.MatchTypeName
-			}
-		}
-		//是否属于纪要库的数据
-		//if _, has := summaryMap[v.CategoryId]; has {
-		//	v.IsSummary = 1
-		//}
-		if v.TypeName == "纪要" {
-			v.IsSummary = 1
-		}
-		//排除不属于纪要库类型的文章
-		for _, vArt := range listNoSummaryArticleIds {
-			vArtInt, _ := strconv.Atoi(vArt)
-			if v.ArticleId == vArtInt {
-				v.IsSummary = 0
-			}
-		}
-		if _, has := reportMap[v.CategoryIdTwo]; has {
-			v.IsReport = 1
-			if _, ok := classMap[v.CategoryIdTwo]; ok {
-				v.IsClass = 1
-				v.ReportType = 1 //是否属于行业报告
-			} else {
-				v.ReportType = 2 //是否属于产业报告
-			}
-		}
-		v.Department = "弘则权益研究"
-		//判断是否已经存在
-		if v.ArticleId < 0 {
-			fmt.Println("AddCygxArticle Err:")
-			return err
-		}
-		var count int
-		count, err = models.GetArticleCountById(v.ArticleId)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			fmt.Println("AddCygxArticle Err:", err.Error())
-			return err
-		}
-		v.Body = strings.Replace(v.Body, "http://vmp.hzinsights.com", "https://vmp.hzinsights.com", -1)
-		expertNumStr, expertContentStr, interviewDateStr, _, bodyReturn := BodyAnalysis2(v.Body)
-		if strings.Index(v.Body, "报告全文(") > 0 && strings.Index(v.Body, "PDF格式报告下载.pdf") > 0 {
-			v.Body = strings.Replace(v.Body, "报告全文(", "", -1)
-			v.Body = strings.Replace(v.Body, "PDF格式报告下载.pdf", "", -1)
-			v.Body = strings.Replace(v.Body, "):", "", -1)
-		}
-		var titleNew string
-		titleNew = v.Title
-		// 7资金流向 、11大类资产 、51每日复盘 、80医药周报、9估值研究
-		if v.CategoryId == 7 || v.CategoryId == 11 || v.CategoryId == 51 || v.CategoryId == 9 {
-			if v.UpdateFrequency == "daily" {
-				var daystr string
-				daystr = strconv.Itoa(v.PublishDate.Day())
-				if len(daystr) == 1 {
-					daystr = "0" + daystr
-				}
-				titleNew = v.Title + "(" + strconv.Itoa(v.PublishDate.Year())[2:len(strconv.Itoa(v.PublishDate.Year()))-0] + v.PublishDate.Format("01") + daystr + ")"
-			} else if v.UpdateFrequency == "weekly" {
-				titleNew = v.Title + utils.WeekByDate(v.PublishDate)
-			}
-		}
-		if v.CategoryId == 80 {
-			titleNew = v.Title + utils.WeekByDate(v.PublishDate)
-		}
-
-		//类型是综述报告的,不区分是什么系列,统一归类到对应产业的路演精华
-		if articleResult.Type.Name == "综述报告" {
-			detailCategory, err := models.GetdetailByCategoryIdLyjh(v.CategoryIdTwo)
-			if err != nil && err.Error() != utils.ErrNoRow() {
-				return err
-			}
-			v.CategoryId = detailCategory.CategoryId
-			v.IsSummary = 0
-		}
-
-		if count > 0 {
-			fmt.Println(k, v.ArticleId, "edit")
-
-			bodyText, _ := GetReportContentTextSubNew(v.Body)
-
-			var isCustom bool
-			updateParams := make(map[string]interface{})
-			//updateParams["Title"] = v.Title
-			updateParams["Title"] = titleNew
-			updateParams["TitleEn"] = v.TitleEn
-			updateParams["UpdateFrequency"] = v.UpdateFrequency
-			updateParams["CreateDate"] = v.CreateDate
-			updateParams["PublishDate"] = v.PublishDate
-			//updateParams["Body"] = html.EscapeString(v.Body)
-			updateParams["Body"] = html.EscapeString(bodyReturn)
-			updateParams["BodyText"] = bodyText
-			updateParams["Abstract"] = html.EscapeString(v.Abstract)
-			updateParams["CategoryName"] = v.CategoryName
-			for _, vCustom := range listCustomArticle {
-				if v.ArticleId == vCustom.ArticleId {
-					fmt.Println("手动归类的文章:" + strconv.Itoa(v.ArticleId))
-					isCustom = true
-				}
-			}
-			if isCustom == false {
-				updateParams["CategoryId"] = v.CategoryId
-				updateParams["MatchTypeName"] = matchTypeName
-				updateParams["IsSummary"] = v.IsSummary
-				updateParams["IsReport"] = v.IsReport
-				updateParams["ReportType"] = v.ReportType
-				updateParams["SubCategoryName"] = v.SubCategoryName
-			}
-			//updateParams["CategoryId"] = v.CategoryId
-			updateParams["PublishStatus"] = 1
-			updateParams["ExpertBackground"] = expertContentStr
-			updateParams["ExpertNumber"] = expertNumStr
-			updateParams["InterviewDate"] = interviewDateStr
-			//updateParams["IsClass"] = v.IsClass
-			v.Department = "弘则权益研究"
-			updateParams["Department"] = v.Department
-			updateParams["FileLink"] = v.File
-			updateParams["Stock"] = v.Stock
-			updateParams["FieldName"] = v.FieldName
-			updateParams["Annotation"] = v.Annotation
-			updateParams["TypeName"] = v.TypeName
-			updateParams["ModifyTimeByCl"] = v.UpdateDate
-			updateParams["CeLueFieldId"] = v.CeLueFieldId
-			updateParams["Cover"] = v.Cover
-			whereParam := map[string]interface{}{"article_id": v.ArticleId}
-			err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
-			if err != nil {
-				fmt.Println("UpdateByExpr Err:" + err.Error())
-				return err
-			}
-			fmt.Println("v.ReportType", v.ReportType)
-
-			if v.ReportType == 2 {
-				var subjectStr string
-				var industrialManagementIdStr string
-				var industrialSubjectIdStr string
-
-				sliceSubjects := strings.Split(v.Stock, "/")
-				mapManagementForSubject := make(map[string]string)
-				mapIndustrialId := make(map[int]int)
-				if len(sliceSubjects) > 0 {
-					for _, vSubject := range sliceSubjects {
-						sliceKuohao := strings.Split(vSubject, "(")           //过滤括号
-						sliceXiahuaxian := strings.Split(sliceKuohao[0], "-") //过滤下划线
-						subject := sliceXiahuaxian[0]
-						subjectStr += "'" + subject + "',"
-					}
-					//获取该产业下所对应的行业图片
-					detailCategory, errCategory := models.GetdetailByCategoryIdOne(v.CategoryId)
-					if errCategory != nil {
-						fmt.Println("GetdetailByCategoryIdOne Err:", err.Error())
-						return err
-					}
-					subjectStr = strings.TrimRight(subjectStr, ",")
-					if subjectStr != "" {
-						listIndustrial, err := models.GetIndustrialManagementForSubjecName(subjectStr, detailCategory.ChartPermissionId)
-						if err != nil {
-							fmt.Println("GetIndustrialManagementForSubjecName Err:", err.Error())
-							return err
-						}
-						subjectStr = strings.Replace(subjectStr, "','", "】【", -1)
-						subjectStr = strings.Replace(subjectStr, "'", "", -1)
-						subjectStr = "【" + subjectStr + "】"
-						if len(listIndustrial) > 0 {
-							for _, vIndustrial := range listIndustrial {
-								if _, ok := mapIndustrialId[vIndustrial.IndustrialManagementId]; !ok {
-									industrialManagementIdStr += strconv.Itoa(vIndustrial.IndustrialManagementId) + ","
-								}
-								mapIndustrialId[vIndustrial.IndustrialManagementId] = vIndustrial.IndustrialManagementId
-								industrialSubjectIdStr += strconv.Itoa(vIndustrial.IndustrialSubjectId) + ","
-								mapManagementForSubject[vIndustrial.IndustryName] += vIndustrial.SubjectName + "/"
-								if vIndustrial.LayoutTime == "0000-00-00 00:00:00" {
-									go models.UpdateIndustrialManagementLayoutTime(v.PublishDate.AddDate(0, 0, -10).Format(utils.FormatDateTime), vIndustrial.IndustrialManagementId)
-								}
-							}
-
-							industrialManagementIdStr = strings.TrimRight(industrialManagementIdStr, ",")
-							industrialSubjectIdStr = strings.TrimRight(industrialSubjectIdStr, ",")
-							if industrialManagementIdStr != "" {
-								err = models.ReportArticleClassificationEditNew(artcleId, industrialManagementIdStr, v.ArticleId, industrialSubjectIdStr)
-								if err != nil {
-									fmt.Println("ReportArticleClassificationEditNew Err:", err.Error())
-									return err
-								}
-							}
-						}
-						//}
-					}
-				}
-
-			}
-		}
-	}
-
-	AddComprehensiveIndustrialSource("Hz", artcleId) // 同步到综合页面的搜索引擎(添加产业资源包)
-
-	AddCygxReportMappingCategoryGroupByArticleId(artcleId)
-	return err
-}
-
-// 需求池972 修改部分报告类型title
-func initweek() {
-	var category_id int
-	//category_id = 52
-	//category_id = 10074
-	//category_id = 1008
-	//category_id = 10071
-	//category_id = 10073
-	//category_id = 50
-	var condition string
-	var pars []interface{}
-	condition += ` AND category_id = ? AND  publish_date  > '2023-12-31'  `
-	pars = append(pars, category_id)
-	articleList, e := models.GetCygxCygxArticleList(condition, pars, 0, 1000)
-	if e != nil {
-		fmt.Println(e)
-		return
-	}
-	var clueApiUrl string
-	for _, v := range articleList {
-
-		clueApiUrl = fmt.Sprint(utils.ApiUrl, "articles/", v.ArticleId)
-		fmt.Println(clueApiUrl)
-
-		authorization := utils.ApiAuthorization
-		body, err := PublicGetDate(clueApiUrl, authorization)
-		if err != nil {
-			fmt.Println(err)
-			return
-		}
-		var articleResultDate models.ArticleDetailResultApi
-		err = json.Unmarshal(body, &articleResultDate)
-		if err != nil {
-			fmt.Println(err)
-			return
-		}
-		articleResult := articleResultDate.Data
-
-		titleWeek := articleResult.Title + utils.WeekByDate(articleResult.PublishDate)
-
-		fmt.Println(titleWeek)
-		e = models.ModifyArticleTitleByarticleId(v.ArticleId, titleWeek)
-		if e != nil {
-			fmt.Println(e)
-			return
-		}
-	}
-}

+ 49 - 0
services/cygx_yanxuan_special.go

@@ -617,3 +617,52 @@ func GetYanxuanSpecialLikeCountDifferent(cont context.Context) (err error) {
 
 	return
 }
+
+//func init() {
+//	need_1006INIT()
+//}
+
+// 获取专栏用户最新的一篇文章信息
+func need_1006INIT() (mapResp map[int]*models.CygxYanxuanSpecialCenterAuthorResp) {
+
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg(fmt.Sprint("获取研选专栏用户信息失败,GetBestNewYanxuanSpecialByUserId Err ", err, "userIds"), 2)
+		}
+	}()
+	var condition string
+	var pars []interface{}
+
+	list, e := models.GetYanxuanSpecialListBycondition(condition, pars, 0, 999)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("GetYanxuanSpecialListBycondition, Err: " + e.Error())
+		return
+	}
+	mapResp = make(map[int]*models.CygxYanxuanSpecialCenterAuthorResp, 0)
+	for _, v := range list {
+		fmt.Println(v.Id)
+		pars = make([]interface{}, 0)
+		condition = " AND  yanxuan_special_id = ?  AND company_id =  16  "
+		pars = append(pars, v.Id)
+		listYanxuanSpecialRecord, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition, pars)
+		if e != nil {
+			fmt.Println(e)
+			return
+		}
+		listYanxuanSpecialRecordUv, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition+"  GROUP BY user_id ", pars)
+		if e != nil {
+			fmt.Println(e)
+			return
+		}
+
+		e = models.Need_1006INIT(len(listYanxuanSpecialRecord), len(listYanxuanSpecialRecordUv), v.Id)
+
+		if e != nil {
+			fmt.Println(e)
+			return
+		}
+	}
+	return
+}

+ 31 - 5
services/cygx_yanxuan_special_company.go

@@ -157,6 +157,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
+				}
+			}
 		}
 	}
 
@@ -197,16 +213,26 @@ 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
 }

+ 69 - 1
services/ficc_report.go

@@ -500,12 +500,17 @@ func GetFiccRreportToCygxArticle(cont context.Context) (err error) {
 			if v.ClassifyNameFirst == "晨会纪要" && v.ClassifyNameSecond == "晨会纪要" {
 				item.Title = "FICC/周期品晨会纪要"
 			}
+			item.CategoryName = utils.ZHOU_QI_NAME
 			item.Body = v.Content
 			item.Abstract = v.Abstract
+			item.FieldName = v.ClassifyNameSecond
 			item.CreateDate = time.Now().Format(utils.FormatDate)
 			item.PublishStatus = 1
 			item.IsReport = 1
 			item.IsClass = 1
+			item.CreateTime = time.Now()
+			item.ChartPermissionName = utils.ZHOU_QI_NAME
+			item.ChartPermissionId = utils.ZHOU_QI_ID
 
 			var haveSet bool
 			for _, vSet := range listFiccSet.List {
@@ -553,6 +558,7 @@ func GetFiccRreportToCygxArticle(cont context.Context) (err error) {
 				updateParams["PublishStatus"] = item.PublishStatus
 				updateParams["SubCategoryName"] = item.SubCategoryName
 				updateParams["MatchTypeName"] = item.MatchTypeName
+				updateParams["FieldName"] = item.FieldName
 				updateParams["CategoryId"] = item.CategoryId
 				updateParams["CategoryIdTwo"] = item.CategoryIdTwo
 				whereParam := map[string]interface{}{"article_id": item.ArticleId}
@@ -565,6 +571,7 @@ func GetFiccRreportToCygxArticle(cont context.Context) (err error) {
 			UpdateFICCReportResourceData(v.Id, listFiccSet)
 
 			AddCygxReportMappingCategoryGroupByArticleId(articleIdMax)
+			UpdateCygxZhouqiArticleMapTime(item.FieldName) //更新周期对应分类下所管理文章的更新时间
 		}
 	}
 
@@ -584,6 +591,16 @@ func GetFiccRreportToCygxArticle(cont context.Context) (err error) {
 	if lenArr == 0 {
 		return
 	}
+	reportByHandList, e := ficc_report.GetCygxFiccReportByHandList() // 手动同步过来的报告
+	if e != nil {
+		err = errors.New("GetCygxFiccReportByHandList, Err: " + e.Error())
+		return
+	}
+	ficcReporIdsHand := make(map[int]bool) // Ficc 研报手动同步过来的报告ID
+	for _, v := range reportByHandList {
+		ficcReporIdsHand[v.FiccReportId] = true
+	}
+
 	condition = ` AND id IN (` + utils.GetOrmInReplace(lenArr) + `) `
 	pars = make([]interface{}, 0)
 	pars = append(pars, cygxFiccReportIds)
@@ -599,7 +616,7 @@ func GetFiccRreportToCygxArticle(cont context.Context) (err error) {
 	}
 
 	for _, v := range listCygxFiccReport {
-		if !ficcReporIdsPush[v.ReportId] {
+		if !ficcReporIdsPush[v.ReportId] && !ficcReporIdsHand[v.ReportId] { // 手动同步过来的报告不做删除处理
 			removeficcReporIds = append(removeficcReporIds, v.ReportId)
 		}
 	}
@@ -684,3 +701,54 @@ func GetFiccReportXcxItem(user *models.WxUserItem) (itemSourceResp *models.CygxR
 	itemSourceResp = itemSource
 	return
 }
+
+//func init() {
+//	strslice := []string{"晨会纪要", "煤炭", "铜行业数据点评", "石油石化", "黑色调研", "宏观G2观察", "黄金月报"}
+//	for _, v := range strslice {
+//		fmt.Println(v)
+//		UpdateCygxZhouqiArticleMapTime(v)
+//	}
+//}
+
+// UpdateCygxZhouqiArticleMapTime 更新周期对应分类下所管理文章的更新时间
+func UpdateCygxZhouqiArticleMapTime(fieldName string) {
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println("err:", err)
+			go utils.SendAlarmMsg(fmt.Sprint("更新周期对应分类下所管理文章的更新时间 失败,UpdateCygxZhouqiArticleMapTime Err:"+err.Error()+"fieldName", fieldName), 3)
+		}
+	}()
+
+	detail, e := models.GetCygxZhouqiArticleMapByMatchTypeName(fieldName)
+	if e != nil {
+		err = errors.New("GetCygxZhouqiArticleMapByMatchTypeName, Err: " + err.Error())
+		return
+	}
+
+	listCategory, e := models.GetCygxZhouqiArticleMapByParentId(detail.ParentId)
+	if e != nil {
+		err = errors.New("GetCygxZhouqiArticleMapByParentId, Err: " + err.Error())
+		return
+	}
+	var matchTypeName = []string{}
+	for _, v := range listCategory {
+		matchTypeName = append(matchTypeName, v.MatchTypeName)
+	}
+
+	var condition string
+	var pars []interface{}
+	condition = "  AND category_name = '周期' AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')  ORDER  BY  publish_date  DESC  "
+	articleList, e := models.GetCygxCygxArticleList(condition, pars, 0, 1)
+	if e != nil {
+		err = errors.New("GetCygxCygxArticleList, Err: " + e.Error())
+		return
+	}
+
+	//就一条数据
+	for _, v := range articleList {
+		e = models.UpdateCygxZhouqiArticleMapTime(v.PublishDate, detail.ParentId)
+	}
+
+	return
+}

+ 2 - 2
services/rai_company_user_bill.go

@@ -79,7 +79,7 @@ func UpdateCygxRaiCompanyUserBill() (err error) {
 	var condition string
 	var pars []interface{}
 
-	condition = " AND  company_id IN  (" + utils.GetOrmInReplace(lencompanyId) + ")  AND create_time > ?  "
+	condition = " AND  art.company_id IN  (" + utils.GetOrmInReplace(lencompanyId) + ")  AND art.create_time > ?  "
 	pars = append(pars, companyIds, startWeekDate)
 
 	fmt.Println("startWeekDate", startWeekDate)
@@ -160,7 +160,7 @@ func UpdateCygxRaiCompanyUserBill() (err error) {
 
 	//文章阅读记录内容
 	{
-		listArticleRecord, e := models.GetCygxArticleHistoryRecordAllListNoLimit(condition+"  GROUP BY user_id, article_id  ORDER BY create_time ASC ", pars)
+		listArticleRecord, e := models.GetCygxArticleHistoryRecordAllListNoLimit(condition+"  GROUP BY art.user_id, art.article_id  ORDER BY art.create_time ASC ", pars)
 		if e != nil {
 			err = errors.New("GetCygxArticleHistoryRecordAllListNoLimit, Err: " + e.Error())
 			return

+ 7 - 7
services/rai_serve_count.go

@@ -31,10 +31,10 @@ import (
 //}
 
 //func init() {
-//	//UpdateRaiServeCompany()              //1
-//	//UpdateCygxRaiServeBillByCompanyIds() //2
-//	//UpdateCygxRaiServeBillWeekTask() // 3
-//	//UpdateWeekAvg()                      // 4
+//	UpdateRaiServeCompany()              //1
+//	UpdateCygxRaiServeBillByCompanyIds() //2
+//	UpdateCygxRaiServeBillWeekTask()     // 3
+//	UpdateWeekAvg()                      // 4
 //}
 
 // 定时任务处理权益服务公司
@@ -462,13 +462,13 @@ func UpdateCygxRaiServeBillByCompanyIds() (err error) {
 	var condition string
 	var pars []interface{}
 
-	condition = " AND  company_id IN  (" + utils.GetOrmInReplace(lencompanyId) + ")  AND create_time > ?  "
+	condition = " AND  art.company_id IN  (" + utils.GetOrmInReplace(lencompanyId) + ")  AND art.create_time > ?  "
 	pars = append(pars, companyIds, startWeekDate)
 
 	fmt.Println("startWeekDate", startWeekDate)
 	//研选专栏阅读记录内容
 	{
-		listYanxuanSpecialRecord, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition+"  GROUP BY user_id, yanxuan_special_id  ORDER BY create_time ASC ", pars)
+		listYanxuanSpecialRecord, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition+"  GROUP BY art.user_id, art.yanxuan_special_id  ORDER BY art.create_time ASC ", pars)
 		if e != nil {
 			err = errors.New("GetCygxYanxuanSpecialRecordRespListAll, Err: " + e.Error())
 			return
@@ -543,7 +543,7 @@ func UpdateCygxRaiServeBillByCompanyIds() (err error) {
 
 	//文章阅读记录内容
 	{
-		listArticleRecord, e := models.GetCygxArticleHistoryRecordAllListNoLimit(condition+"  GROUP BY user_id, article_id  ORDER BY create_time ASC ", pars)
+		listArticleRecord, e := models.GetCygxArticleHistoryRecordAllListNoLimit(condition+"  GROUP BY art.user_id, art.article_id  ORDER BY art.create_time ASC ", pars)
 		if e != nil {
 			err = errors.New("GetCygxArticleHistoryRecordAllListNoLimit, Err: " + e.Error())
 			return

+ 1 - 0
services/resource_data.go

@@ -639,6 +639,7 @@ func Deletenewchart(chartIdsDelete []int) (err error) {
 
 // 更新文章
 func UpdateArticleResourceData(sourceId int) {
+	time.Sleep(1 * time.Second)
 	var err error
 	defer func() {
 		if err != nil {

+ 7 - 7
services/tactics.go

@@ -671,13 +671,13 @@ func BodyAnalysis2(body string) (expertNumStr, expertContentStr, interviewDateSt
 		expertContentStr = expertContentArr[0]
 	}
 	//当处理过之后的专家背景长度大于600的时候,说明他的格式跟之前的不一样,还要做二次处理 600 是一个约值,先运行看看
-	if len(expertContentStr) > 600 {
-		strnum := strings.Index(expertContentStr, "#专家评价:")
-		content := expertContentStr[strnum:len(expertContentStr)]
-		strnum2 := strings.Index(content, "(")
-		content = content[strnum2+9 : len(content)] //中文括号3位 专家编号6位
-		expertContentStr = content
-	}
+	//if len(expertContentStr) > 600 {
+	//	strnum := strings.Index(expertContentStr, "#专家评价:")
+	//	content := expertContentStr[strnum:len(expertContentStr)]
+	//	strnum2 := strings.Index(content, "(")
+	//	content = content[strnum2+9 : len(content)] //中文括号3位 专家编号6位
+	//	expertContentStr = content
+	//}
 	//if strings.Index(body, "报告全文(") > 0 && strings.Index(body, "PDF格式报告下载.pdf") > 0 {
 	//	numStar := strings.Index(body, "http")
 	//	numEnd := strings.Index(body, ".pdf")

+ 12 - 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 {
@@ -184,6 +186,11 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 			}
 			conditionInit += " AND id IN  (" + strings.Join(resourceDataIdStrs, ",") + ")   "
 		}
+
+		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,15 +264,17 @@ 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)
+		articleList, e := models.GetArticleListHomeTag(condition, pars)
 		if e != nil {
 			err = errors.New("GetArticleList, Err: " + e.Error())
 			return

+ 6 - 0
services/task.go

@@ -41,9 +41,15 @@ func Task() {
 		yiDongSignAppointmentsForThird := task.NewTask("yiDongSignAppointmentsForThird", "0 */10 * * * *", YiDongSignAppointmentsForThird) //会前一小时将,报名信息同步到易董
 		task.AddTask("yiDongSignAppointmentsForThird", yiDongSignAppointmentsForThird)
 
+		groupingActivityToYiDong := task.NewTask("groupingActivityToYiDong", "0 00 1 * * *", GroupingActivityToYiDong) //建立与易董的活动关联
+		task.AddTask("groupingActivityToYiDong", groupingActivityToYiDong)
+
 		getYiDongActivity := task.NewTask("getYiDongActivity", "0 */10 * * * *", GetYiDongActivity) //同步易董的活动信息
 		task.AddTask("getYiDongActivity", getYiDongActivity)
 
+		updateYiDongActivityDataToCygx := task.NewTask("updateYiDongActivityDataToCygx", "0 20 1 * * *", UpdateYiDongActivityDataToCygx) // 更新易董活动信息,到会信息到查研观向数据库
+		task.AddTask("updateYiDongActivityDataToCygx", updateYiDongActivityDataToCygx)
+
 		pushVmpRobotMeeting := task.NewTask("pushVmpRobotMeeting", "0 */10 6-23 * * *", PushVmpRobotMeeting) //研选活动会前15分钟推送给上海那边的机器人
 		task.AddTask("pushVmpRobotMeeting", pushVmpRobotMeeting)
 	}

+ 433 - 21
services/yidong.go

@@ -6,6 +6,7 @@ import (
 	"errors"
 	"fmt"
 	"hongze/hongze_cygx/models"
+	"hongze/hongze_cygx/models/yidong"
 	"hongze/hongze_cygx/utils"
 	"io/ioutil"
 	"net/http"
@@ -127,6 +128,8 @@ func GetActivityTypeNameWithYiDong(industrySwName string) (chartPermissionName s
 	return
 }
 
+var yidongHongzeCode = "RI0011" // 弘则在易董那边建会的公司code
+
 // 获取易董token
 func GetYiDongToken() (token string, err error) {
 	defer func() {
@@ -271,6 +274,10 @@ func GetYiDongActivity(cont context.Context) (err error) {
 			if _, ok := yiDongByCygxMap[v.ID]; ok {
 				continue
 			}
+			//fmt.Println(v.CompanyCode)
+			if v.CompanyCode == yidongHongzeCode { //弘则在易董那边建会的公司code,如果是弘则的就不同步
+				continue
+			}
 			var item = new(models.CygxActivity)
 			item.YidongActivityId = v.ID
 			item.ActivityTypeId = 3
@@ -655,7 +662,7 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 				if vresult.PersonTelephone == "" {
 					continue
 				}
-				if vresult.Duration != "" || vresult.DurationReview != "" {
+				if vresult.Duration != "" || vresult.DurationReview != "" || vresult.DurationLive != "" {
 					mobiles = append(mobiles, vresult.PersonTelephone)
 					//err = models.UpdateCygxActivitySignupisMeet(v.ActivityId, vresult.PersonTelephone)
 					//if err != nil {
@@ -663,7 +670,10 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 					//	return err
 					//}
 					var itemDetail = new(models.CygxActivitySignupDetail)
-					if vresult.Duration != "" {
+					if vresult.Duration != "" || vresult.DurationLive != "" {
+						if vresult.Duration == "" {
+							vresult.Duration = vresult.DurationLive
+						}
 						itemDetail.FirstMeetingTime = vresult.StartTime
 						itemDetail.LastMeetingTime = vresult.EndTime
 						itemDetail.Duration = vresult.Duration
@@ -686,34 +696,34 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 					mapActivityAttendanceDetail[vresult.PersonTelephone].LastMeetingTime = vresult.EndTime
 					mapActivityAttendanceDetail[vresult.PersonTelephone].Duration = utils.GetAttendanceDetailSecondsByYiDong(vresult.Duration)
 					itemsUpdate = append(itemsUpdate, itemDetail)
+				} else {
+					continue
 				}
 
 				item := new(models.CygxActivityAttendanceDetail)
 				item.ActivityId = v.ActivityId
 				item.Mobile = vresult.PersonTelephone
 				if vresult.Duration != "" {
-					if vresult.Duration != "" {
-						item.FirstMeetingTime = vresult.StartTime
-						item.LastMeetingTime = vresult.EndTime
-						item.Duration = vresult.Duration
-						item.MeetingStatusStr = "直播"
-					} else if vresult.DurationReview != "" {
-						item.FirstMeetingTime = vresult.StartTimeReview
-						item.LastMeetingTime = vresult.EndTimeReview
-						item.Duration = vresult.DurationReview
-						item.MeetingStatusStr = "回放"
-					}
-					item.Position = vresult.JobName
-					item.RealName = vresult.PersonName
-
 					item.FirstMeetingTime = vresult.StartTime
 					item.LastMeetingTime = vresult.EndTime
 					item.Duration = vresult.Duration
-					item.IsMeetingStr = 1
-					mobileStrMeet += "'" + vresult.PersonTelephone + "'" + ","
-					item.CreateTime = time.Now()
-					needAddAttendanc = append(needAddAttendanc, item)
+					item.MeetingStatusStr = "直播"
+				} else if vresult.DurationReview != "" {
+					item.FirstMeetingTime = vresult.StartTimeReview
+					item.LastMeetingTime = vresult.EndTimeReview
+					item.Duration = vresult.DurationReview
+					item.MeetingStatusStr = "回放"
 				}
+				item.Position = vresult.JobName
+				item.RealName = vresult.PersonName
+
+				item.FirstMeetingTime = vresult.StartTime
+				item.LastMeetingTime = vresult.EndTime
+				item.Duration = vresult.Duration
+				item.IsMeetingStr = 1
+				mobileStrMeet += "'" + vresult.PersonTelephone + "'" + ","
+				item.CreateTime = time.Now()
+				needAddAttendanc = append(needAddAttendanc, item)
 				mobileStr += "'" + vresult.PersonTelephone + "'" + ","
 
 			}
@@ -775,7 +785,7 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 				fmt.Println("AddCygxActivityRestrictSignupByAdmin Err:", err.Error())
 				return err
 			}
-			AddctivitySignupDetailByJmcj(needAddAttendanc, v.ActivityId)
+			AddctivitySignupDetailByJmcjNew(needAddAttendanc, []int{v.ActivityId})
 		}
 	}
 
@@ -975,3 +985,405 @@ type YiDongSignAppointmentsForThirdResp struct {
 	Success   bool    `json:"success"`   // 成功标识,true:成功;false:失败。可作为判断报名是否成功的标识
 	Timestamp float64 `json:"timestamp"` // 时间戳
 }
+
+//func init() {
+//	GroupingActivityToYiDong()
+//}
+
+// GroupingActivityToYiDong 建立与易董的活动关联
+func GroupingActivityToYiDong(cont context.Context) (err error) {
+	//func GroupingActivityToYiDong() (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg("建立与易董的活动关联失败  GroupingActivityToYiDong"+err.Error(), 2)
+		}
+	}()
+	startDate := time.Now().AddDate(0, 0, -2).Format(utils.FormatDate)
+	endDate := time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
+
+	var token string
+	token, _ = GetYiDongToken()
+	url := utils.YiDongZhengTongYunUrl + "interact/activityManageApi/getRoadshowList?access_token=" + token
+	method := "POST"
+	payload := strings.NewReader(`{
+									  "meetingStatus": "2",
+									  "conveneStartStr": "` + startDate + `",
+									  "conveneEndStr":  "` + endDate + `"}`)
+	client := &http.Client{}
+	req, err := http.NewRequest(method, url, payload)
+	if err != nil {
+		fmt.Println(err)
+		utils.FileLog.Info(err.Error())
+		return
+	}
+	req.Header.Add("Content-Type", "application/json")
+
+	res, err := client.Do(req)
+	if err != nil {
+		fmt.Println(err)
+		utils.FileLog.Info(err.Error())
+		return
+	}
+	defer res.Body.Close()
+	var ApifoxModal *models.ApifoxModal
+	body, err := ioutil.ReadAll(res.Body)
+	if err != nil {
+		fmt.Println(err)
+		utils.FileLog.Info(err.Error())
+		return
+	}
+
+	//添加请求日志记录
+	itemApiLog := new(models.CygxThreeApiLog)
+	itemApiLog.CreateTime = time.Now()
+	itemApiLog.Source = 1
+	itemApiLog.Url = url
+	itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(payload))
+	itemApiLog.Result = string(body)
+	go models.AddCygxThreeApiLog(itemApiLog)
+
+	err = json.Unmarshal(body, &ApifoxModal)
+	if err != nil {
+		fmt.Println("Getres.PublicGetDate Err:", err.Error())
+		return
+	}
+
+	//var itemsAdd []*models.CygxActivity
+	if len(ApifoxModal.Result) > 0 {
+		actList := ApifoxModal.Result
+		for _, v := range actList {
+			//同步有效性 1有效,0失效
+			if v.SyncFlag == "0" {
+				continue
+			}
+			var yidongTitle string
+			titleSlice := strings.Split(v.Title, "】")
+
+			for _, vt := range titleSlice {
+				yidongTitle = vt
+			}
+
+			e := models.UpdateCygxActivityyidongActivityId(v.ID, v.Start, yidongTitle)
+			if e != nil {
+				err = errors.New("UpdateCygxActivityyidongActivityId, Err: " + e.Error())
+				return
+			}
+		}
+	}
+
+	return
+
+}
+
+// GetLoginAuthCodeReq 获取登录编码请求体
+type GetYiDongActivityByApiReq struct {
+	MeetingStatus   string `json:"meetingStatus" description:"会议状态必需(0未开始1进行中2已结束)多个逗号分隔"`
+	ConveneStartStr string `json:"conveneStartStr" description:"活动日期范围开始"`
+	ConveneEndStr   string `json:"conveneEndStr" description:"活动日期范围结束"`
+	LastUpdateTime  string `json:"lastUpdateTime" description:"上次同步时间(用于筛选更新时间大于同步时间的活动数据)"`
+}
+
+type GetYiDongActivityMeetByActivityIdReq struct {
+	ActivityId string `json:"activityId" description:"活动ID"`
+}
+
+// 根据条件获取易董建会列表信息
+func GetYiDongActivityListByApi(param *GetYiDongActivityByApiReq) (yiDongResult []models.Result) {
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg(fmt.Sprint("根据条件获取易董建会列表信息  GetYiDongActivityListByApi"+err.Error(), param), 2)
+		}
+	}()
+	var token string
+	token, _ = GetYiDongToken()
+	url := utils.YiDongZhengTongYunUrl + "interact/activityManageApi/getRoadshowList?access_token=" + token
+	method := "POST"
+	data, e := json.Marshal(param)
+	if e != nil {
+		err = errors.New("data json marshal err: " + e.Error())
+		return
+	}
+
+	payload := strings.NewReader(string(data))
+	client := &http.Client{}
+	req, e := http.NewRequest(method, url, payload)
+	if e != nil {
+		err = errors.New(" http.NewRequest err: " + e.Error())
+		return
+	}
+	req.Header.Add("Content-Type", "application/json")
+
+	res, e := client.Do(req)
+	if e != nil {
+		err = errors.New(" client.Do err: " + e.Error())
+		return
+	}
+	defer res.Body.Close()
+	var ApifoxModal *models.ApifoxModal
+	body, e := ioutil.ReadAll(res.Body)
+	if e != nil {
+		err = errors.New("  ioutil.ReadAll: " + e.Error())
+		return
+	}
+
+	//添加请求日志记录
+	itemApiLog := new(models.CygxThreeApiLog)
+	itemApiLog.CreateTime = time.Now()
+	itemApiLog.Source = 1
+	itemApiLog.Url = url
+	itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(payload))
+	itemApiLog.Result = string(body)
+	go models.AddCygxThreeApiLog(itemApiLog)
+
+	err = json.Unmarshal(body, &ApifoxModal)
+	if err != nil {
+		fmt.Println("Getres.PublicGetDate Err:", err.Error())
+		return
+	}
+	if len(ApifoxModal.Result) > 0 {
+		yiDongResult = ApifoxModal.Result
+	} else {
+		yiDongResult = make([]models.Result, 0)
+	}
+	return
+}
+
+// 根据条件获取易董活动ID获取到会信息
+func GetYiDongActivityMeetDataByaAtivityId(ativityId string) (yiDongResult []models.Resultuser) {
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg(fmt.Sprint("根据条件获取易董建会列表信息  GetYiDongActivityListByApi"+err.Error(), ativityId), 2)
+		}
+	}()
+	var token string
+	token, _ = GetYiDongToken()
+	url := utils.YiDongZhengTongYunUrl + "interact/activityManageApi/getAttendPersonList?access_token=" + token
+	method := "POST"
+	param := new(GetYiDongActivityMeetByActivityIdReq)
+	param.ActivityId = ativityId
+	data, e := json.Marshal(param)
+	if e != nil {
+		err = errors.New("data json marshal err: " + e.Error())
+		return
+	}
+
+	payload := strings.NewReader(string(data))
+	client := &http.Client{}
+	req, e := http.NewRequest(method, url, payload)
+	if e != nil {
+		err = errors.New(" http.NewRequest err: " + e.Error())
+		return
+	}
+	req.Header.Add("Content-Type", "application/json")
+	res, e := client.Do(req)
+	if e != nil {
+		err = errors.New(" client.Do err: " + e.Error())
+		return
+	}
+	defer res.Body.Close()
+	var ApifoxModal *models.ApifoxModaluser
+	body, e := ioutil.ReadAll(res.Body)
+	if e != nil {
+		err = errors.New(" ioutil.ReadAll err: " + e.Error())
+		return
+	}
+	e = json.Unmarshal(body, &ApifoxModal)
+	if e != nil {
+		err = errors.New(" json.Unmarshal  err: " + e.Error())
+		return
+	}
+
+	//添加请求日志记录
+	itemApiLog := new(models.CygxThreeApiLog)
+	itemApiLog.CreateTime = time.Now()
+	itemApiLog.Source = 1
+	itemApiLog.Url = url
+	itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(payload))
+	itemApiLog.Result = string(body)
+	go models.AddCygxThreeApiLog(itemApiLog)
+
+	err = json.Unmarshal(body, &ApifoxModal)
+	if err != nil {
+		fmt.Println("Getres.PublicGetDate Err:", err.Error())
+		return
+	}
+	if len(ApifoxModal.Result) > 0 {
+		yiDongResult = ApifoxModal.Result
+	} else {
+		yiDongResult = make([]models.Resultuser, 0)
+	}
+	return
+}
+
+//func init() {
+//	UpdateYiDongActivityDataToCygx()
+//}
+
+// 更新易董活动信息,到会信息到查研观向数据库
+func UpdateYiDongActivityDataToCygx(cont context.Context) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg(fmt.Sprint("更新易董活动信息,到会信息到查研观向数据库  UpdateYiDongActivityDataToCygx"+err.Error()), 2)
+		}
+	}()
+	startDate := time.Now().AddDate(0, 0, -3).Format(utils.FormatDate)
+	endDate := time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
+
+	param := new(GetYiDongActivityByApiReq)
+	param.MeetingStatus = "2"
+	param.ConveneStartStr = startDate
+	param.ConveneEndStr = endDate
+	actList := GetYiDongActivityListByApi(param)
+
+	if len(actList) == 0 {
+		return
+	}
+	var itmes []*yidong.CygxYidongActivity
+	var YidongIds []string
+	for _, v := range actList {
+		YidongIds = append(YidongIds, v.ID)
+	}
+
+	listCygx, e := yidong.GetCygxYidongActivityListByYidongIds(YidongIds)
+	if e != nil {
+		err = errors.New("GetCygxYidongActivityListByYidongIds, Err: " + e.Error())
+		return
+	}
+	mapYidongId := make(map[string]bool)
+	for _, v := range listCygx {
+		mapYidongId[v.YidongId] = true
+	}
+
+	listMeetDataCygx, e := yidong.GetCygxYidongActivityMeetDataListByYidongIds(YidongIds)
+	if e != nil {
+		err = errors.New("GetCygxYidongActivityListByYidongIds, Err: " + e.Error())
+		return
+	}
+	mapMeetData := make(map[string]bool)
+	for _, v := range listMeetDataCygx {
+		mapMeetData[fmt.Sprint("AID_", v.YidongId, "M_", v.PersonTelephone)] = true
+	}
+
+	for _, v := range actList {
+		if mapYidongId[v.ID] {
+			continue
+		}
+		item := new(yidong.CygxYidongActivity)
+		item.YidongId = v.ID
+		item.CompanyInfo = v.CompanyInfo
+		item.Type = v.Type
+		item.IndustrySwName = v.IndustrySwName
+		item.Start = v.Start
+		item.End = v.End
+		item.SignUpStart = v.SignUpStart
+		item.SignUpEnd = v.SignUpEnd
+		item.ActivityJoinType = v.ActivityJoinType
+		item.Banner = v.Banner
+		item.Url = v.URL
+		item.SyncFlag = v.SyncFlag
+		item.BusinessCardOpen = v.BusinessCardOpen
+		item.BusinessCardRequired = v.BusinessCardRequired
+		item.PersonNameOpen = v.PersonNameOpen
+		item.PersonNameRequired = v.PersonNameRequired
+		item.PersonTelephoneOpen = v.PersonTelephoneOpen
+		item.PersonTelephoneRequired = v.PersonTelephoneRequired
+		item.MailOpen = v.MailOpen
+		item.MailRequired = v.MailRequired
+		item.CompanyShortNameOpen = v.CompanyShortNameOpen
+		item.CompanyShortNameRequired = v.CompanyShortNameRequired
+		item.CompanyCodeOpen = v.CompanyCodeOpen
+		item.CompanyCodeRequired = v.CompanyCodeRequired
+		item.JobNameOpen = v.JobNameOpen
+		item.JobNameRequired = v.JobNameRequired
+		item.CertificateInformationOpen = v.CertificateInformationOpen
+		item.CertificateInformationRequired = v.CertificateInformationRequired
+		item.InviteeOpen = v.InviteeOpen
+		item.InviteeRequired = v.InviteeRequired
+		item.CreateTime = time.Now()
+		itmes = append(itmes, item)
+	}
+	//新增记录
+	if len(itmes) > 0 {
+		e = yidong.AddCygxYidongActivityMulti(itmes)
+		if e != nil {
+			err = errors.New("AddCygxYidongActivityMulti, Err: " + e.Error())
+			return
+		}
+	}
+
+	var itmesMdata []*yidong.CygxYidongActivityMeetData
+	for _, v := range actList {
+		meetDataList := GetYiDongActivityMeetDataByaAtivityId(v.ID)
+		for _, mdata := range meetDataList {
+			if mapMeetData[fmt.Sprint("AID_", v.ID, "M_", mdata.PersonTelephone)] || mdata.PersonTelephone == "" {
+				continue
+			}
+			itmemdata := new(yidong.CygxYidongActivityMeetData)
+			itmemdata.YidongMeetDataId = mdata.ID
+			itmemdata.Title = v.Title
+			itmemdata.YidongId = v.ID
+			itmemdata.UserId = mdata.UserID
+			itmemdata.PersonTelephone = mdata.PersonTelephone
+			itmemdata.Duration = mdata.Duration
+			itmemdata.StartTime = mdata.StartTime
+			itmemdata.EndTime = mdata.EndTime
+			itmemdata.DeviceType = mdata.DeviceType
+			itmemdata.Status = mdata.Status
+			itmemdata.PersonName = mdata.PersonName
+			itmemdata.JobName = mdata.JobName
+			itmemdata.Mail = mdata.Mail
+			itmemdata.CompanyName = mdata.CompanyName
+			itmemdata.MobileCountryCode = mdata.MobileCountryCode
+			itmemdata.SignUpStatus = mdata.SignUpStatus
+			itmemdata.DurationLive = mdata.DurationLive
+			itmemdata.StartTimeLive = mdata.StartTimeLive
+			itmemdata.EndTimeLive = mdata.EndTimeLive
+			itmemdata.DurationReview = mdata.DurationReview
+			itmemdata.StartTimeInteract = mdata.StartTimeInteract
+			itmemdata.EndTimeInteract = mdata.EndTimeInteract
+			itmemdata.CreateTime = time.Now()
+			itmesMdata = append(itmesMdata, itmemdata)
+		}
+	}
+
+	// 写入到会信息
+	if len(itmesMdata) > 0 {
+		e = yidong.AddCygxYidongActivityMeetDataMulti(itmesMdata)
+		if e != nil {
+			err = errors.New("AddCygxYidongActivityMeetDataMulti, Err: " + e.Error())
+			return
+		}
+	}
+	//fmt.Println("end")
+	return
+}
+
+//func init() {
+//	//param := new(GetYiDongActivityByApiReq)
+//	//param.MeetingStatus = "2"
+//	//param.ConveneStartStr = "2024-10-28"
+//	//param.ConveneEndStr = "2024-10-30"
+//	actList := GetYiDongActivityMeetDataByaAtivityId("1180584155007237390")
+//
+//	for _, v := range actList {
+//		//同步有效性 1有效,0失效
+//		//if v.SyncFlag == "0" {
+//		//	continue
+//		//}
+//		//var yidongTitle string
+//		//titleSlice := strings.Split(v.Title, "】")
+//		//
+//		//for _, vt := range titleSlice {
+//		//	yidongTitle = vt
+//		//}
+//
+//		fmt.Println(v.PersonTelephone)
+//		fmt.Println(v.PersonName)
+//	}
+//}

+ 29 - 1
utils/config.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"github.com/beego/beego/v2/server/web"
 	"github.com/rdlucklib/rdluck_tools/cache"
+	"strconv"
 )
 
 var (
@@ -118,6 +119,19 @@ var (
 	FiccYbEtaHubSecret       string
 )
 
+// 日志配置
+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 {
@@ -312,6 +326,20 @@ func init() {
 		RAI_MOBILE_GE_LIN = "18258485832"     // 权益葛琳手机号
 	}
 
+	//日志配置
+	{
+		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()
 	ChartPermissionId()
@@ -335,7 +363,7 @@ func YiDongApiConfig() {
 	}
 }
 
-// 行业ID信息 易董开放api配置
+// 行业ID信息
 func ChartPermissionId() {
 	if RunMode == "release" {
 		ZHOU_QI_ID = 62

+ 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_cygx.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_cygx.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:     "",
+	}
 }