Explorar o código

Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_cygx into need/cygx_1012

zhangchuanxing hai 2 meses
pai
achega
9b8377e818

+ 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/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
+}

+ 18 - 0
controllers/chart_permission.go

@@ -229,6 +229,24 @@ func (this *ChartPermissionAuthController) StrategyDetail() {
 			resp.List = append(resp.List, item)
 		}
 	}
+
+	cfGushou, err := models.GetConfigByCode(utils.CYGX_GUSHOU_TIME_LINE_STATUS)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取数据失败,Err:" + err.Error()
+		return
+	}
+
+	if chartPermissionId == utils.GU_SHOU_ID_CHART {
+		if cfGushou.ConfigValue == "1" || user.CompanyId == utils.HZ_COMPANY_ID {
+			item := new(models.ReportMappingHome)
+			item.CategoryId = utils.TIME_LINE_ID
+			item.SubCategoryName = utils.TIME_LINE_NAME
+			item.MatchTypeName = utils.TIME_LINE_NAME
+			item.ListGroup = 1
+			resp.List = append(resp.List, item)
+		}
+	}
 	for _, v := range list {
 		resp.List = append(resp.List, v)
 	}

+ 146 - 0
controllers/gushou.go

@@ -0,0 +1,146 @@
+package controllers
+
+import (
+	"encoding/json"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"hongze/hongze_cygx/models"
+	"hongze/hongze_cygx/models/time_line"
+	"hongze/hongze_cygx/services"
+	"hongze/hongze_cygx/utils"
+	"time"
+)
+
+// 固收
+type GushouController struct {
+	BaseAuthController
+}
+
+// @Title 固收时间线列表
+// @Description 固收时间线列表接口
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Success 200 {object} models.GetCygxGushouTimeLineResp
+// @router /gushouTimeLine/list [get]
+func (this *GushouController) GushouTimeLineList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+
+	resp := new(time_line.GetCygxGushouTimeLineResp)
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = utils.StartIndex(currentIndex, pageSize)
+	var condition string
+	var pars []interface{}
+	condition += ` AND art.status = 1 `
+	total, err := time_line.GetCygxGushouTimeLineCount(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	condition += "	ORDER BY art.publish_time DESC , art.time_line_id DESC "
+	list, err := time_line.GetCygxGushouTimeLineList(condition, pars, startSize, pageSize)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	for _, v := range list {
+		v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
+		v.Resource = 1
+		v.Content = services.AnnotationHtml(v.Content)
+		v.ChartPermissionName = utils.GU_SHOU_NAME
+	}
+	if len(list) == 0 {
+		list = make([]*time_line.CygxGushouTimeLineResp, 0)
+	}
+	cf, err := models.GetConfigByCode(utils.CYGX_GUSHOU_TIME_LINE_STATUS)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取数据失败,Err:" + err.Error()
+		return
+	}
+	//如果不是弘则用户,并且设置了内部可见,那么数据就隐藏
+	if user.CompanyId != utils.HZ_COMPANY_ID && cf.ConfigValue != "1" {
+		list = make([]*time_line.CygxGushouTimeLineResp, 0)
+	}
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp.List = list
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// @Title 固收时间线点击记录
+// @Description 固收时间线点击记录接口
+// @Param	request	body models.GushouTimeLineTimeLineIdReq true "type json string"
+// @Success Ret=200 新增成功
+// @router /gushouTimeLine/history [post]
+func (this *GushouController) History() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+	var req models.TacticsTimeLineTimeLineIdReq
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+	timeLineId := req.TimeLineId
+	if timeLineId == 0 {
+		br.Msg = "时间线ID错误"
+		return
+	}
+	var sellerName string
+	sellerName, err = models.GetCompanySellerNameRai(user.CompanyId)
+	if err != nil {
+		br.Msg = "记录失败!"
+		br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
+		return
+	}
+	item := time_line.CygxGushouTimeLineHistory{
+		TimeLineId:  timeLineId,
+		UserId:      user.UserId,
+		Mobile:      user.Mobile,
+		Email:       user.Email,
+		CompanyId:   user.CompanyId,
+		CompanyName: user.CompanyName,
+		RealName:    user.RealName,
+		SellerName:  sellerName,
+		CreateTime:  time.Now(),
+		ModifyTime:  time.Now(),
+	}
+	err = time_line.AddCygxGushouTimeLineHistory(&item)
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 467 - 420
controllers/report.go


+ 13 - 26
controllers/report_selection.go

@@ -172,16 +172,24 @@ func (this *ReportSelectionController) Detail() {
 						v2.ShowName = v2.SubjectName
 					}
 				}
+				if v2.ThirdName != "" {
+					v2.ShowName = v2.ThirdName
+				}
 				subjectItem := new(models.ReportSelectionChartLogSubjectName)
 				subjectItem.SubjectName = v2.SubjectName
 				subjectItem.IsNew = v2.IsNew
 				subjectItem.IndustrialSubjectId = v2.IndustrialSubjectId
 				subjectItem.IndustrialManagementId, _ = strconv.Atoi(v2.IndustrialManagementId)
 				subjectItem.IndustrialManagementName = v2.IndustrialManagementNames
-				if subjectItem.SubjectName == "" {
-					subjectItem.SubjectName = subjectItem.IndustrialManagementName
+				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))
+				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})
@@ -196,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
@@ -255,7 +241,7 @@ func (this *ReportSelectionController) ClickHistory() {
 		br.ErrMsg = "文章不存在,文章ID错误"
 		return
 	}
-	if req.IndustrialSubjectId+req.IndustrialManagementId <= 0 {
+	if req.IndustrialSubjectId+req.IndustrialManagementId+req.ThirdId <= 0 {
 		br.Msg = "标的ID不存在"
 		br.ErrMsg = "产业或标的ID不存在"
 		return
@@ -271,6 +257,7 @@ func (this *ReportSelectionController) ClickHistory() {
 		CompanyName:            user.CompanyName,
 		IndustrialSubjectId:    req.IndustrialSubjectId,
 		IndustrialManagementId: req.IndustrialManagementId,
+		ThirdId:                req.ThirdId,
 		RegisterPlatform:       utils.REGISTER_PLATFORM,
 	}
 	err = models.AddCygxReportSelectionSubjectHistory(&item)

+ 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

+ 12 - 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
@@ -1401,3 +1405,11 @@ func UpdateCygxActivityyidongActivityId(yidongActivityId, activityTime, yidongTi
 	_, err = o.Raw(sql, yidongActivityId, activityTime, yidongTitle).Exec()
 	return
 }
+
+// 获取所有未开始、进行中的活动ID
+func GetActivityIdListNoEnd() (items []*CygxActivity, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT activity_id  FROM cygx_activity WHERE  active_state IN (1,2) `
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}

+ 70 - 47
models/article.go

@@ -8,53 +8,54 @@ 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:"产业标签"`
-	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:"行业名称"`
+	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:"行业名称"`
+	ArticleSearchContent string    `description:"搜索匹配用的内容"`
 }
 
 type CygxArticleEs struct {
@@ -131,6 +132,7 @@ type HomeArticle struct {
 	Resource            int                  `description:"来源类型,1:文章、2:产品内测"`
 	IsCollect           bool                 `description:"本人是否收藏"`
 	CollectNum          int                  `description:"收藏人数"`
+	IsShowAbstract      bool                 `description:"是否展示摘要"`
 	List                []*IndustrialManagementIdInt
 }
 
@@ -193,6 +195,7 @@ type ArticleDetail struct {
 	MatchTypeName            string `description:"匹配类型"`
 	Stock                    string `description:"个股标签"`
 	Frequency                string `description:"更新周期(策略平台字段)"`
+	SeriesName               string `description:"系列名称(策略平台字段)"`
 }
 
 type ArticleDetailFileLink struct {
@@ -454,6 +457,7 @@ type ReportArticle struct {
 	IsCollect        bool   `description:"本人是否收藏"`
 	Pv               int    `description:"PV"`
 	CollectNum       int    `description:"收藏人数"`
+	IsShowAbstract   bool   `description:"是否展示摘要"`
 }
 
 type ReportMappingCategoryRep struct {
@@ -1064,3 +1068,22 @@ func GetCygxCygxArticleFiccReportList() (items []*CygxArticle, err error) {
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }
+
+// UpdateCygxCygxArticleBillMulti  批量修改文章搜索内容字段
+func UpdateCygxCygxArticleBillMulti(items []*CygxArticle) (err error) {
+	o := orm.NewOrm()
+	p, err := o.Raw("UPDATE cygx_article SET article_search_content = ? WHERE article_id = ?  ").Prepare()
+	if err != nil {
+		return
+	}
+	defer func() {
+		_ = p.Close() // 别忘记关闭 statement
+	}()
+	for _, v := range items {
+		_, err = p.Exec(v.ArticleSearchContent, v.ArticleId)
+		if err != nil {
+			return
+		}
+	}
+	return
+}

+ 20 - 6
models/article_history_record.go

@@ -27,7 +27,7 @@ type CygxArticleHistoryResp struct {
 	Num       int `description:"数量"`
 }
 
-//添加历史信息
+// 添加历史信息
 func AddCygxArticleHistoryRecord(item *CygxArticleHistoryRecord) (lastId int64, err error) {
 	o, err := orm.NewOrm().Begin()
 	if err != nil {
@@ -62,7 +62,7 @@ func AddCygxArticleHistoryRecord(item *CygxArticleHistoryRecord) (lastId int64,
 	return
 }
 
-//获取用户阅读记录
+// 获取用户阅读记录
 func GetUserToArticleCount(uid, articleId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_article_history_record WHERE user_id=? AND article_id=? `
 	o := orm.NewOrm()
@@ -107,7 +107,7 @@ func UpdateArticleStopTime(item *AddStopTimeNewRep) (err error) {
 	return
 }
 
-//获取最新的一条阅读记录
+// 获取最新的一条阅读记录
 func GetNewArticleHistoryRecord(uid, articleId int) (item *AddStopTimeNewRep, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT * FROM  cygx_article_history_record WHERE user_id = ? AND article_id = ? ORDER BY id DESC LIMIT 1;`
@@ -115,7 +115,7 @@ func GetNewArticleHistoryRecord(uid, articleId int) (item *AddStopTimeNewRep, er
 	return
 }
 
-//获取用户阅读记录
+// 获取用户阅读记录
 func GetNoAddStoptimeArticleCount(uid, articleId int) (count int, err error) {
 	sqlCount := `SELECT COUNT(1) AS count FROM cygx_article_history_record WHERE user_id=? AND article_id=? AND create_time > '` + utils.OnlineTime + `' AND stop_time = 0 `
 	o := orm.NewOrm()
@@ -123,7 +123,7 @@ func GetNoAddStoptimeArticleCount(uid, articleId int) (count int, err error) {
 	return
 }
 
-//最新标的列表
+// 最新标的列表
 func GetArticleHistoryList() (items []*CygxArticleHistoryRecordNewpv, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT *  FROM cygx_article_history_record WHERE company_id != 16 `
@@ -131,7 +131,7 @@ func GetArticleHistoryList() (items []*CygxArticleHistoryRecordNewpv, err error)
 	return
 }
 
-//获取用户阅读记录
+// 获取用户阅读记录
 func GetUserToArticleHistory(uid int, articleIdArr []int) (items []*CygxArticleHistoryResp, err error) {
 	arrLen := len(articleIdArr)
 	if arrLen == 0 {
@@ -151,3 +151,17 @@ func GetUserToArticleHistory(uid int, articleIdArr []int) (items []*CygxArticleH
 	_, err = o.Raw(sql, uid, articleIdArr).QueryRows(&items)
 	return
 }
+
+// GetArticleHistoryRecord 或用户阅读过的文章ID
+func GetArticleHistoryRecord(condition string, pars []interface{}) (item []*CygxArticleHistoryRecord, err error) {
+	if condition == "" {
+		return
+	}
+	o := orm.NewOrm()
+	sql := `SELECT *
+			FROM
+			cygx_article_history_record  
+			WHERE 1 = 1 ` + condition + `  GROUP BY article_id`
+	_, err = o.Raw(sql, pars).QueryRows(&item)
+	return
+}

+ 14 - 0
models/company.go

@@ -215,6 +215,7 @@ func GetSellerDetailAllByCompanyId(companyId int) (item *CompanyDetail, err erro
 	return
 }
 
+// 获取FICC与权益销售
 func GetCompanySellerName(companyId int) (sellerName string, err error) {
 	sql := ` SELECT
 			GROUP_CONCAT( DISTINCT p.seller_name SEPARATOR '/' ) AS sellerName 
@@ -227,6 +228,19 @@ func GetCompanySellerName(companyId int) (sellerName string, err error) {
 	return
 }
 
+// 获取权益销售
+func GetCompanySellerNameRai(companyId int) (sellerName string, err error) {
+	sql := ` SELECT
+			seller_name  AS sellerName 
+		FROM
+			company_product AS p
+		WHERE
+			p.company_id = ?  AND  product_id = 2 `
+	o := orm.NewOrmUsingDB("weekly_report")
+	err = o.Raw(sql, companyId).QueryRow(&sellerName)
+	return
+}
+
 type CompanyProductStatus struct {
 	IsSuspend int `description:"1:暂停,0:启用"`
 }

+ 4 - 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() {
@@ -193,6 +193,7 @@ func init() {
 		new(CygxArticleAndYanxuanRecord),
 		new(CygxTimelineLog),
 		new(CygxActivitySpecialPermissionPoints),
+		new(time_line.CygxGushouTimeLineHistory),
 	)
 
 	initOrder()      // 订单模块
@@ -202,7 +203,7 @@ func init() {
 
 	// 记录ORM查询日志
 	orm.Debug = true
-	orm.DebugLog = orm.NewLog(utils.BinLog)
+	orm.DebugLog = orm.NewLog(utils.Binlog)
 
 }
 

+ 25 - 0
models/industrial_article_group_management.go

@@ -101,3 +101,28 @@ func GetIndustrialArticleGroupManagementListByArticleId(articleId int) (items []
 	_, err = o.Raw(sql, articleId).QueryRows(&items)
 	return
 }
+
+type CygxIndustrialArticleGroupManagementResp struct {
+	ArticleId              int       `description:"文章ID"`
+	IndustrialManagementId int       `description:"cygx_industrial_management表的主键ID"`
+	PublishDate            time.Time `description:"发布时间"`
+}
+
+// GetCygxIndustrialArticleGroupManagement  获取产业关联的所有文章
+func GetCygxIndustrialArticleGroupManagement(condition string, pars []interface{}) (list []*CygxIndustrialArticleGroupManagementResp, err error) {
+	sql := `SELECT
+			mg.industrial_management_id,
+			a.article_id,
+			a.publish_date
+		FROM
+			cygx_industrial_article_group_management AS mg
+			INNER JOIN cygx_article AS a ON a.article_id = mg.article_id 
+		WHERE
+			1 = 1 
+			AND a.publish_status = 1 `
+	if condition != `` {
+		sql += condition
+	}
+	_, err = orm.NewOrm().Raw(sql, pars).QueryRows(&list)
+	return
+}

+ 53 - 0
models/industrial_management.go

@@ -874,3 +874,56 @@ func UpdateIndustrialManagementOneMonthFollowNumMulti(items []*CygxIndustryFllow
 	}
 	return
 }
+
+// 标的列表
+func GetIndustrialSubjectAllByIndustrialIdcondition(pars []interface{}, condition string) (items []*IndustrialSubject, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			m.subject_name,
+			m.industrial_management_id,
+			m.industrial_subject_id 
+		FROM
+			cygx_article AS a
+			INNER JOIN cygx_industrial_article_group_subject AS mg ON mg.article_id = a.article_id
+			INNER JOIN cygx_industrial_subject AS m ON m.industrial_subject_id = mg.industrial_subject_id 
+		WHERE
+			1 = 1
+			AND a.publish_status = 1  ` + condition + `
+		GROUP BY
+			m.industrial_subject_id 
+ORDER BY
+	a.publish_date DESC  `
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}
+
+// 获取该产业下最新的文章详情
+func GetNewArticleDetailByIndustrialIdscondition(pars []interface{}, condition string) (items []*IndustrialManagementArticle, err error) {
+	//arrLen := len(industrialIdArr)
+	//if arrLen == 0 {
+	//	return
+	//}
+	o := orm.NewOrm()
+	sql := `SELECT
+			mg.industrial_management_id,
+			MAX( a.article_id ) AS article_id,
+			a.title,
+			MAX( a.publish_date ) AS publish_date 
+		FROM
+			cygx_industrial_article_group_management AS mg
+			INNER JOIN cygx_article AS a ON mg.article_id = a.article_id 
+		WHERE
+			1 = 1   ` + condition + `
+		GROUP BY
+			mg.industrial_management_id `
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}
+
+// UpdateIndustrialManagementTimeLineData   更新时间线关联对应最新文章的数据信息
+func UpdateIndustrialManagementTimeLineData(industrialManagementId int, timeLineData string) (err error) {
+	o := orm.NewOrm()
+	sql := `UPDATE cygx_industrial_management SET time_line_data = ? WHERE  industrial_management_id = ?   `
+	_, err = o.Raw(sql, timeLineData, industrialManagementId).Exec()
+	return
+}

+ 43 - 5
models/report.go

@@ -20,6 +20,7 @@ type IndustrialManagement struct {
 	CategoryId             int                  `description:"文章分类ID"`
 	LayoutTime             string               `description:"布局时间"`
 	UpdateTime             string               `description:"更新时间"`
+	PublishDate            string               `description:"更新时间"`
 	MinReportTime          string               `description:"报告最早发布时间"`
 	IsRed                  bool                 `description:"是否标记红点"`
 	IsTop                  bool                 `description:"是否置顶"`
@@ -33,12 +34,19 @@ type IndustrialManagement struct {
 	IndustrialSubjectList  []*IndustrialSubject `description:"标的列表"`
 	ChartPermissionId      int                  `description:"行业ID"`
 	PermissionName         string               `description:"行业名称"`
+	TimeLineData           string               `description:"时间线所关联最新三篇文章的json数据"`
+	ListTimeLine           []TimeLineReportResp `description:"时间线所关联最新三篇文章列表"`
 	IndustryVideo          *MicroVideoSimpleInfo
 	AuthInfo               *UserPermissionAuthInfo
 	ArticleId              int `description:"文章id"`
 	Source                 int `description:"来源 1:弘则资源包(报告)、2:研选主题(报告)"`
 }
 
+type TimeLineReportResp struct {
+	Title       string `description:"标题"`
+	PublishDate string `description:"发布时间"`
+}
+
 type MicroVideoSimpleInfo struct {
 	Id                  int    `description:"视频ID"`
 	Title               string `description:"标题"`
@@ -520,6 +528,7 @@ type ArticleCollectionResp struct {
 	TopTime                int                         `description:"置顶时间"`
 	ReportId               int                         `description:"FICC研报ID"`
 	Resource               int                         `description:"来源类型,1:文章、2:产品内测、3:FICC研报"`
+	ResourceObj            string                      `description:"articleficc:FICC研报、articlevmp:上海策略平台报告、articleyx:研选报告、articlespecial:研选专栏"`
 }
 
 type IndustrialManagementResp struct {
@@ -584,9 +593,9 @@ func GetArticleCollectionList(condition string, userId int) (items []*ArticleCol
 			( SELECT count( 1 ) FROM cygx_article_collect AS ac WHERE ac.article_id = a.article_id  AND user_id = ? ) AS my_collect_num
 		FROM
 			cygx_article AS a
-			INNER JOIN cygx_industrial_article_group_management AS mg ON mg.article_id = a.article_id
-			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id
-			INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id 
+			LEFT JOIN cygx_industrial_article_group_management AS mg ON mg.article_id = a.article_id
+			LEFT  JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id
+			LEFT JOIN cygx_article_department AS d ON d.department_id = a.department_id 
 		WHERE
 			1 = 1  AND a.publish_status = 1  `
 	if condition != "" {
@@ -674,7 +683,7 @@ func GetArticleAndYxSpecialList(condition, conditionSpecial string, userId int)
 			'' AS create_time 
 		FROM
 			cygx_article AS a
-			INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id 
+			LEFT  JOIN cygx_article_department AS d ON d.department_id = a.department_id 
 		WHERE
 			1 = 1 
 			AND a.publish_status = 1 ` + condition + `  GROUP BY article_id 
@@ -883,6 +892,8 @@ type IndustrialManagementHotResp struct {
 	MinReportTime          string                `description:"报告最早发布时间"`
 	ArticleReadNum         int                   `description:"文章阅读数量"`
 	Source                 int                   `description:"来源 1:弘则资源包(报告)、2:研选主题(报告)"`
+	TimeLineData           string                `description:"时间线所关联最新三篇文章的json数据"`
+	ListTimeLine           []TimeLineReportResp  `description:"时间线所关联最新三篇文章列表"`
 	IndustrialSubjectList  []*IndustrialSubject  `description:"标的列表"`
 	IndustryVideo          *MicroVideoSimpleInfo `description:"产业视频"`
 	AuthInfo               *UserPermissionAuthInfo
@@ -1231,7 +1242,7 @@ type SearchResourceResp struct {
 
 // 搜索资源包 start
 type SearchReportAndResourceResp struct {
-	ListHzResource []*IndustrialManagementHotResp `description:"弘则资源包"`
+	ListHzResource []*IndustrialManagement        `description:"弘则资源包"`
 	ListYxResource []*IndustrialManagementHotResp `description:"研选资源包"`
 	ListYxReport   []*ArticleCollectionResp       `description:"研选报告"`
 	ListHzReport   []*ArticleCollectionResp       `description:"弘则报告"`
@@ -1241,6 +1252,7 @@ type SearchReportAndResourceResp struct {
 func GetSearchResourceList(userId int, condition string, startSize, pageSize int) (items []*IndustrialManagementHotResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
+   			m.time_line_data,
 			m.industry_name,
 			m.industrial_management_id,
  			MAX( a.publish_date ) as publish_date_order,
@@ -1262,6 +1274,32 @@ func GetSearchResourceList(userId int, condition string, startSize, pageSize int
 	return
 }
 
+// 列表
+func GetSearchResourceListcondition(condition string, startSize, pageSize int) (items []*IndustrialManagement, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			m.time_line_data,
+			m.industry_name,
+			m.chart_permission_id,
+			m.industrial_management_id,
+ 			MAX( a.publish_date ) as publish_date_order,
+			MIN( a.publish_date ) AS min_report_time,
+			date_format( MAX( a.publish_date ), '%Y-%m-%d' ) AS publish_date 
+		FROM
+			cygx_industrial_management AS m
+			INNER JOIN cygx_industrial_article_group_management AS mg ON mg.industrial_management_id = m.industrial_management_id
+			INNER JOIN cygx_article AS a ON a.article_id = mg.article_id  AND  a.article_type != 'lyjh'
+		WHERE
+			1 = 1
+			AND publish_status = 1 ` + condition + `  GROUP BY m.industrial_management_id  ORDER BY publish_date_order DESC `
+
+	if startSize > 0 || pageSize > 0 {
+		sql += ` LIMIT ` + strconv.Itoa(startSize) + "," + strconv.Itoa(pageSize)
+	}
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
 // 切换列表
 type ReportBillboardTableResp struct {
 	Name   string `description:"名称"`

+ 4 - 0
models/report_selection.go

@@ -71,6 +71,8 @@ type ReportSelectionChartLogSubjectName struct {
 	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唯一标识"`
 }
@@ -87,6 +89,8 @@ type CygxReportSelectionLogDetail struct {
 	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

+ 2 - 0
models/report_selection_subject_history.go

@@ -18,12 +18,14 @@ type CygxReportSelectionSubjectHistory struct {
 	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"`
 	IndustrialManagementId int `description:"产业Id"`
+	ThirdId                int `description:"类似产业、标的的三方ID"`
 }
 
 // 添加

+ 14 - 1
models/resource_data.go

@@ -22,6 +22,7 @@ type CygxResourceData struct {
 	SearchContent     string    `description:"搜索匹配用的内容"`
 	SearchOrderTime   string    `description:"搜索排序时间"`
 	TagName           string    `description:"标签名"`
+	Sort              int       `description:"排序"`
 }
 
 // FICC研报小程序
@@ -90,7 +91,7 @@ func GetResourceDataListCondition(condition string, pars []interface{}, startSiz
 	if condition != "" {
 		sql += condition
 	}
-	sql += `  ORDER BY search_order_time DESC   LIMIT ?,? `
+	sql += `  ORDER BY  sort DESC , search_order_time DESC   LIMIT ?,? `
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	return
 }
@@ -218,3 +219,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
+}

+ 9 - 8
models/tactics_time_line.go

@@ -36,14 +36,15 @@ type GetCygxTacticsTimeLineResp struct {
 }
 
 type CygxTacticsTimeLineResp struct {
-	TimeLineId  int    `description:"ID"`
-	PublishTime string `description:"发布日期"`
-	Status      int    `description:"0:未发布,1:已发布"`
-	Content     string `description:"内容"`
-	ArticleId   int    `description:"文章ID"`
-	ChartId     int    `description:"图表ID"`
-	Link        string `description:"文章或图表链接"`
-	Resource    int    `description:"来源类型,1:文章、2:产品内测、3:晨报点评"`
+	TimeLineId          int    `description:"ID"`
+	PublishTime         string `description:"发布日期"`
+	Status              int    `description:"0:未发布,1:已发布"`
+	Content             string `description:"内容"`
+	ArticleId           int    `description:"文章ID"`
+	ChartId             int    `description:"图表ID"`
+	Link                string `description:"文章或图表链接"`
+	Resource            int    `description:"来源类型,1:文章、2:产品内测、3:晨报点评"`
+	ChartPermissionName string `description:"行业名称"`
 }
 
 // 获取数量

+ 83 - 0
models/time_line/gushou_time_line.go

@@ -0,0 +1,83 @@
+package time_line
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"time"
+)
+
+type CygxGushouTimeLine struct {
+	TimeLineId  int       `orm:"column(time_line_id);pk"`
+	PublishTime time.Time `description:"发布日期"`
+	CreateTime  time.Time `description:"创建时间"`
+	ModifyTime  time.Time `description:"更新时间"`
+	Status      int       `description:"0:未发布,1:已发布"`
+	Content     string    `description:"内容"`
+	ArticleId   int       `description:"文章ID"`
+	ChartId     int       `description:"图表ID"`
+	Link        string    `description:"文章或图表链接"`
+	AdminId     int       `description:"管理员ID"`
+}
+
+type AddGushouTimeLineReq struct {
+	TimeLineId  int    `orm:"column(time_line_id);pk"`
+	PublishTime string `description:"发布日期"`
+	Content     string `description:"内容"`
+	Link        string `description:"文章或图表链接"`
+}
+type GushouTimeLineTimeLineIdReq struct {
+	TimeLineId int `description:"ID"`
+}
+
+type GetCygxGushouTimeLineResp struct {
+	Status int                `description:"0:内部可见,1:全部可见"`
+	Paging *paging.PagingItem `description:"分页数据"`
+	List   []*CygxGushouTimeLineResp
+}
+
+type CygxGushouTimeLineResp struct {
+	TimeLineId          int    `description:"ID"`
+	PublishTime         string `description:"发布日期"`
+	Status              int    `description:"0:未发布,1:已发布"`
+	Content             string `description:"内容"`
+	ArticleId           int    `description:"文章ID"`
+	ChartId             int    `description:"图表ID"`
+	Link                string `description:"文章或图表链接"`
+	Resource            int    `description:"来源类型,1:文章、2:产品内测、3:晨报点评"`
+	ChartPermissionName string `description:"行业名称"`
+}
+
+// 获取数量
+func GetCygxGushouTimeLineCount(condition string, pars []interface{}) (count int, err error) {
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_gushou_time_line as art WHERE 1= 1  `
+	if condition != "" {
+		sqlCount += condition
+	}
+	o := orm.NewOrm()
+	err = o.Raw(sqlCount, pars).QueryRow(&count)
+	return
+}
+
+// 列表
+func GetCygxGushouTimeLineList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxGushouTimeLineResp, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_gushou_time_line as art WHERE 1= 1 `
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` LIMIT ?,?  `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+type GetCygxGushouTimeLineDetailResp struct {
+	Detail *CygxGushouTimeLineResp
+}
+
+// 通过ID获取详情
+func GetCygxGushouTimeLineDetail(timeLineId int) (item *CygxGushouTimeLineResp, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_gushou_time_line  WHERE time_line_id=? `
+	err = o.Raw(sql, timeLineId).QueryRow(&item)
+	return
+}

+ 38 - 0
models/time_line/gushou_time_line_history.go

@@ -0,0 +1,38 @@
+package time_line
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type CygxGushouTimeLineHistory struct {
+	Id          int `orm:"column(id);pk"`
+	TimeLineId  int
+	UserId      int
+	CreateTime  time.Time
+	Mobile      string    `description:"手机号"`
+	Email       string    `description:"邮箱"`
+	CompanyId   int       `description:"公司id"`
+	CompanyName string    `description:"公司名称"`
+	ModifyTime  time.Time `description:"修改时间"`
+	RealName    string    `description:"用户实际名称"`
+	SellerName  string    `description:"所属销售"`
+}
+
+// 列表
+func GetCygxGushouTimeLineHistoryList(condition string, pars []interface{}) (items []*CygxGushouTimeLineHistory, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_gushou_time_line_history as art WHERE 1= 1 `
+	if condition != "" {
+		sql += condition
+	}
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}
+
+// 添加
+func AddCygxGushouTimeLineHistory(item *CygxGushouTimeLineHistory) (err error) {
+	o := orm.NewOrm()
+	_, err = o.Insert(item)
+	return
+}

+ 12 - 0
models/zhouqi_article_map.go

@@ -12,6 +12,10 @@ type CygxZhouqiArticleMap struct {
 	ArticleUpdateTime string `description:"对应文章的更新时间"`
 }
 
+type CygxZhouqiArticleDetail struct {
+	FiccReportId string `description:"Ficc研报单一篇报告,多个地方展示配置项"`
+}
+
 // 获取周期下面的一级分类
 func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
 	o := orm.NewOrm()
@@ -65,3 +69,11 @@ func UpdateCygxZhouqiArticleMapTime(articleUpdateTime string, categoryId int) (e
 	_, 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

@@ -799,6 +799,24 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:GushouController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:GushouController"],
+        beego.ControllerComments{
+            Method: "History",
+            Router: `/gushouTimeLine/history`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:GushouController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:GushouController"],
+        beego.ControllerComments{
+            Method: "GushouTimeLineList",
+            Router: `/gushouTimeLine/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:HomeController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:HomeController"],
         beego.ControllerComments{
             Method: "ListHomeArtAndChart",

+ 6 - 0
routers/router.go

@@ -87,6 +87,12 @@ func init() {
 				&controllers.TacticsController{},
 			),
 		),
+
+		web.NSNamespace("/gushou",
+			web.NSInclude(
+				&controllers.GushouController{},
+			),
+		),
 		web.NSNamespace("/report",
 			web.NSInclude(
 				&controllers.ReportController{},

+ 13 - 0
services/activity.go

@@ -2250,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
@@ -2374,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

+ 83 - 8
services/article.go

@@ -693,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)
-				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
@@ -752,7 +746,15 @@ func HandleArticleListByApi(artcleId int) (err error) {
 				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)
@@ -870,6 +872,11 @@ func HandleArticleListByApi(artcleId int) (err error) {
 							keyword3 = v.Title
 							keyword4 = v.PublishDate.Format(utils.FormatDateTime)
 							SendWxMsgWithArticleClassToAdmin(keyword1, keyword2, keyword3, keyword4, openIdList, articleIdInt)
+
+							for _, vIndustrial := range listIndustrial {
+								IndustrialManagementTimeLineDateList3(vIndustrial.IndustrialManagementId) // 更新时间线报告内容
+							}
+
 						} else {
 							keyword1 = "新报告产业标签:【" + v.FieldName + "】,个股标签:" + subjectStr
 							keyword2 = "未归类"
@@ -1917,3 +1924,71 @@ func GetYxArticleIdMap(articleIds []int) (mapResp map[int]bool) {
 	}
 	return
 }
+
+// GetUserArticleHistoryRecord 获取用户已经阅读的文章ID
+func GetUserArticleHistoryRecord(user *models.WxUserItem) (articleIdMap map[int]bool, err error) {
+	var condition string
+	var pars []interface{}
+	condition = " AND user_id = ? "
+	pars = append(pars, user.UserId)
+	articleIdMap = make(map[int]bool, 0)
+	list, err := models.GetArticleHistoryRecord(condition, pars)
+	if err != nil && err.Error() != utils.ErrNoRow() {
+		return
+	}
+	for _, v := range list {
+		articleIdMap[v.ArticleId] = true
+	}
+	return
+}
+
+// GetUserArticleHistoryIndustrialNewPublishDate  获取产业关联的的文章用户是否阅读
+func GetUserArticleHistoryIndustrialNewPublishDate(user *models.WxUserItem, industrialIdArr []int, articleTypeIds, resource string) (mapIndustrialArticleHistory map[int]bool, err error) {
+	if len(industrialIdArr) == 0 {
+		return
+	}
+	var condition string
+	var pars []interface{}
+	articleIdMap, err := GetUserArticleHistoryRecord(user)
+	if err != nil {
+		return
+	}
+	if resource == utils.REOURCE_YX {
+		condition = ` AND a.publish_status = 1 AND a.article_type_id  IN (` + articleTypeIds + `)	`
+	} else {
+		condition = ` AND a.article_type_id  = 0	 AND  a.article_id < ` + strconv.Itoa(utils.SummaryArticleId)
+	}
+	var startTime time.Time
+	if utils.StrTimeToTime(utils.OnlineTime).After(user.CreatedTime) {
+		startTime = utils.StrTimeToTime(utils.OnlineTime)
+	} else {
+		startTime = user.CreatedTime
+	}
+
+	condition += ` AND mg.industrial_management_id  IN (` + utils.GetOrmInReplace(len(industrialIdArr)) + `) AND a.publish_date > ? `
+	pars = append(pars, industrialIdArr, startTime)
+
+	list, err := models.GetCygxIndustrialArticleGroupManagement(condition, pars)
+	if err != nil {
+		return
+	}
+	mapIndustrialArticle := make(map[int][]*models.CygxIndustrialArticleGroupManagementResp)
+	//mapIndustrialArticleMax := make(map[int]int, 0)
+	mapIndustrialArticleHistory = make(map[int]bool, 0)
+	//mapIndustrialArticleMaxTime := make(map[int]time.Time)
+	for _, v := range list {
+		item := new(models.CygxIndustrialArticleGroupManagementResp)
+		item.IndustrialManagementId = v.IndustrialManagementId
+		item.ArticleId = v.ArticleId
+		item.PublishDate = v.PublishDate
+		mapIndustrialArticle[v.IndustrialManagementId] = append(mapIndustrialArticle[v.IndustrialManagementId], item)
+	}
+	for k, v := range mapIndustrialArticle {
+		for _, item := range v {
+			if !articleIdMap[item.ArticleId] {
+				mapIndustrialArticleHistory[k] = true
+			}
+		}
+	}
+	return
+}

+ 18 - 2
services/es_comprehensive.go

@@ -1282,6 +1282,14 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 			}
 		}
 		for _, v := range listIndustrialResourceIds {
+			if v.TimeLineData == "" {
+				v.ListTimeLine = make([]models.TimeLineReportResp, 0)
+			} else {
+				if err = json.Unmarshal([]byte(v.TimeLineData), &v.ListTimeLine); err != nil {
+					e = errors.New("Unmarshal, Err: " + e.Error())
+					//return
+				}
+			}
 			v.Source = 1
 			mapItems[fmt.Sprint("industrialsourceHz", v.IndustrialManagementId)].IndustrialResource = v
 		}
@@ -1560,10 +1568,18 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 }
 
 func SqlComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*SearchComprehensiveItem, total int, err error) {
+	listListNoEnd, e := models.GetActivityIdListNoEnd()
+	var activityIds []string
+	for _, v := range listListNoEnd {
+		activityIds = append(activityIds, strconv.Itoa(v.ActivityId))
+	}
+	activityIds = append(activityIds, "0")
+
+	conditionActivity := " AND IF   ( source IN('activity') , source_id IN (" + strings.Join(activityIds, ",") + ")  ,1=1 )"
 	keyWord = "%" + keyWord + "%"
 	var conditionTitle string
 	var parsTitle []interface{}
-	conditionTitle = " AND is_hide = 0  AND search_title LIKE ? AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) "
+	conditionTitle = " AND is_hide = 0  AND search_title LIKE ? AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) " + conditionActivity
 	parsTitle = append(parsTitle, keyWord)
 	totalTitle, e := models.GetResourceDataCount(conditionTitle, parsTitle)
 	if e != nil {
@@ -1574,7 +1590,7 @@ func SqlComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*
 	var conditionContent string
 	var parsContent []interface{}
 
-	conditionContent = " AND is_hide = 0 AND search_content LIKE ? AND search_title  NOT LIKE ?  AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) "
+	conditionContent = " AND is_hide = 0 AND search_content LIKE ? AND search_title  NOT LIKE ?  AND IF   ( source IN('activityvoice','activityvideo') , chart_permission_id != 31 ,1=1 ) " + conditionActivity
 	parsContent = append(parsContent, keyWord, keyWord)
 	totalContent, e := models.GetResourceDataCount(conditionContent, parsContent)
 	if e != nil {

+ 428 - 0
services/industrial_management.go

@@ -2,8 +2,10 @@ package services
 
 import (
 	"context"
+	"encoding/json"
 	"errors"
 	"fmt"
+	"golang.org/x/net/html"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
 	"strconv"
@@ -612,6 +614,295 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
 	return
 }
 
+// HandleIndustryList预处理产业列表字段
+func HandleIndustryListResource(list []*models.IndustrialManagement, user *models.WxUserItem, resource string) (items []*models.IndustrialManagement, err error) {
+	userId := user.UserId
+	fllowList, err := models.GetUserFllowIndustrialList(userId)
+	if err != nil {
+		return
+	}
+	fllowMap := make(map[int]int)
+	if len(fllowList) > 0 {
+		for _, v := range fllowList {
+			fllowMap[v.IndustrialManagementId] = v.IndustrialManagementId
+		}
+	}
+
+	hotMap, e := IndustrialManagementHotMapGropuPermission()
+	if e != nil {
+		err = errors.New("获取hot标签失败,IndustrialManagementHotMapGropuPermission " + e.Error())
+		return
+	}
+	var condition string
+	var pars []interface{}
+	articleTypeIds, _ := GetYanXuanArticleTypeIds()
+	//给默认值
+	if resource != "Yx" {
+		resource = "Hz"
+	}
+	if articleTypeIds != "" {
+		if resource == "Yx" {
+			condition = ` AND a.publish_status = 1 AND a.article_type_id  IN (` + articleTypeIds + `)	`
+		} else {
+			condition = ` AND a.article_type_id  NOT  IN (` + articleTypeIds + `)  	`
+		}
+	}
+
+	mapindustrialId, e := GetMicroRoadshowVideoMap()
+	if e != nil {
+		err = e
+		return
+	}
+	//合并产业关联的标的
+	listSubjcet, err := models.GetThemeHeatSubjectList("")
+	if err != nil {
+		return
+	}
+	industrialIdArr := make([]int, 0)
+	for k, v := range list {
+		list[k].Source = 1
+		if fllowMap[v.IndustrialManagementId] > 0 {
+			list[k].IsFollow = 1
+		}
+		v.IsHot = hotMap[v.IndustrialManagementId]
+		industrialIdArr = append(industrialIdArr, v.IndustrialManagementId)
+		if _, ok := mapindustrialId[v.IndustrialManagementId]; !ok {
+			continue
+		}
+		videoSimple, au, e := GetindustryVideo(user, v.IndustrialManagementId)
+		if e != nil {
+			err = errors.New("获取产业关联的视频失败,GetindustryVideo " + e.Error())
+			return
+		}
+		if videoSimple != nil && videoSimple.Id > 0 {
+			v.IndustryVideo = videoSimple
+		}
+		v.AuthInfo = au
+		v.PublishDate = v.UpdateTime
+	}
+	if len(industrialIdArr) > 0 {
+		//合并产业关联的标的
+		conditionSubject := condition + ` AND 	m.industrial_management_id  IN (` + utils.GetOrmInReplace(len(industrialIdArr)) + `)`
+		pars = append(pars, industrialIdArr)
+		listSubjcet, err = models.GetIndustrialSubjectAllByIndustrialIdcondition(pars, conditionSubject)
+		if err != nil {
+			return
+		}
+		mapIndustrial := make(map[string]int)
+		for _, v := range listSubjcet {
+			for k2, v2 := range list {
+				if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, "Hz", v.SubjectName)] == 0 {
+					list[k2].IndustrialSubjectList = append(list[k2].IndustrialSubjectList, v)
+					mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, "Hz", v.SubjectName)] = v2.IndustrialManagementId
+				}
+			}
+		}
+	}
+	//获取产业关联的的文章用户是否阅读
+	mapIndustrialArticleHistory, err := GetUserArticleHistoryIndustrialNewPublishDate(user, industrialIdArr, articleTypeIds, resource)
+	if err != nil {
+		err = errors.New("获取产业关联的的文章用户是否阅读失败 " + err.Error())
+		return
+	}
+	mapUPdateTime := make(map[int]string)
+	articleIdArr := make([]int, 0)
+	//获取这些产业下最新更新的文章
+	var conditionindustrial string
+	var parsindustrial []interface{}
+	var industrialIds string
+	if len(industrialIdArr) > 0 {
+		conditionindustrial = condition + ` AND mg.industrial_management_id  IN (` + utils.GetOrmInReplace(len(industrialIdArr)) + `)`
+		parsindustrial = append(parsindustrial, industrialIdArr)
+		listUpdateTime, e := models.GetNewArticleDetailByIndustrialIdscondition(parsindustrial, conditionindustrial)
+		if e != nil && e.Error() != utils.ErrNoRow() {
+			err = errors.New("GetNewArticleDetailByIndustrialIds Err " + e.Error())
+			return
+		}
+		for _, v := range listUpdateTime {
+			mapUPdateTime[v.IndustrialManagementId] = v.PublishDate
+			articleIdArr = append(articleIdArr, v.ArticleId)
+		}
+		//时间线的更新时间
+		//	maptimelineUPdateTime := make(map[int]string)
+		listtimelinePublishdate, e := models.GetTimeLineReportIndustrialPublishdateList(industrialIdArr)
+		if e != nil && e.Error() != utils.ErrNoRow() {
+			err = e
+			return
+		}
+		for _, v := range listtimelinePublishdate {
+			if mapUPdateTime[v.IndustrialManagementId] != "" {
+				if utils.StrTimeToTime(v.PublishDate).After(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
+					mapUPdateTime[v.IndustrialManagementId] = v.PublishDate
+				}
+			}
+		}
+		//产品内测的更新时间线
+		listtProductInterior, e := models.GetNewProductInteriorByIndustrialIds(industrialIdArr)
+		if e != nil && e.Error() != utils.ErrNoRow() {
+			err = e
+			return
+		}
+		for _, v := range listtProductInterior {
+			if mapUPdateTime[v.IndustrialManagementId] != "" {
+				if utils.StrTimeToTime(v.PublishDate).After(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
+					mapUPdateTime[v.IndustrialManagementId] = v.PublishDate
+				}
+			}
+		}
+		for _, id := range industrialIdArr {
+			industrialIds += strconv.Itoa(id) + ","
+		}
+		industrialIds = strings.TrimRight(industrialIds, ",")
+		articleList, e := models.GetReportIndustrialReadNumList(userId, industrialIds, user.CreatedTime)
+		if e != nil && e.Error() != utils.ErrNoRow() {
+			err = e
+			return
+		}
+		mapHistroyindustrialId := make(map[int]int)
+		for _, v := range articleList {
+			mapHistroyindustrialId[v.IndustrialManagementId] = v.Readnum
+		}
+	}
+	nowTime := time.Now().Local()
+	threeMonBefore := nowTime.AddDate(0, -3, 0)
+
+	//查询用户今天是否看过时间线
+	//haveMorningMeeting := false
+	//var morningMeetingTime string
+	recrodList, err := models.GetCygxTimelineLogCount(user.UserId, industrialIdArr)
+	if err != nil && err.Error() != utils.ErrNoRow() {
+		return
+	}
+	var industrialManagementIdstr string
+	industrialIdMap := make(map[string]time.Time)
+	for _, v := range recrodList {
+		//fmt.Println(v.Router)
+		//sliceindustrial := strings.Split(v.Router, "=")
+		//industrialManagementIdstr = strings.TrimLeft(v.Router, utils.TIME_LINE_ROUTE)
+		industrialManagementIdstr = strconv.Itoa(v.IndustrialManagementId)
+		industrialIdMap[industrialManagementIdstr] = v.ModifyTime
+		//fmt.Println(industrialManagementIdstr)
+		//if createTime, ok := industrialIdMap[industrialManagementIdstr]; ok {
+		//	if createTime.Before(v.CreateTime) {
+		//		industrialIdMap[industrialManagementIdstr] = v.CreateTime
+		//	}
+		//} else {
+		//	industrialIdMap[industrialManagementIdstr] = v.CreateTime
+		//}
+	}
+	morningMeetingTimeMap := make(map[int]time.Time)
+	if industrialIds != "" {
+		mmList, e := models.GetCygxMorningMeetingReviewsListByIndustrialIds(industrialIds)
+		if e != nil {
+			err = e
+			return
+		}
+		for _, v := range mmList {
+			morningMeetingTimeMap[v.IndustryId] = v.CreateTime
+		}
+	}
+	timeLineRedMap := make(map[int]bool, 0)
+	for _, industrialId := range industrialIdArr {
+		//if createTime, ok := industrialIdMap[strconv.Itoa(industrialId)]; ok {
+		//	if createTime.Before(morningMeetingTimeMap[industrialId]) {
+		//		timeLineRedMap[industrialId] = true
+		//	}
+		//}
+		if industrialIdMap[strconv.Itoa(industrialId)].Before(morningMeetingTimeMap[industrialId]) {
+			timeLineRedMap[industrialId] = true
+		}
+	}
+	//fmt.Println(industrialIdMap["90"])
+	//fmt.Println(timeLineRedMap[90])
+	//fmt.Println(mapIndustrialArticleHistory[90])
+	for k, v := range list {
+		list[k].UpdateTime = utils.TimeRemoveHms(mapUPdateTime[v.IndustrialManagementId])
+		if userId > 0 {
+			//如果文章没有阅读,而且,文章的发布时间晚于项目的上线时间,而且文章的发布时间晚于用户的注册时间,就进行标红处理
+			if mapIndustrialArticleHistory[v.IndustrialManagementId] || timeLineRedMap[v.IndustrialManagementId] {
+				//if mapHistroyindustrialId[v.IndustrialManagementId] == 0 || timeLineRedMap[v.IndustrialManagementId] {
+				if user.CreatedTime.Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
+					list[k].IsRed = true
+				}
+			}
+		} else {
+			if utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
+				list[k].IsRed = true
+			}
+			list[k].IsFollow = 1
+		}
+		list[k].UpdateTime = utils.TimeRemoveHms(mapUPdateTime[v.IndustrialManagementId])
+
+		if resource == "Yx" {
+			list[k].IsRed = false
+		}
+		// 关联报告发布时间均在3个月内则标记New
+		if v.MinReportTime != "" {
+			t, e := time.Parse(utils.FormatDateTime, v.MinReportTime)
+			if e != nil {
+				err = errors.New("报告最早发布时间有误,GetindustryVideo " + e.Error())
+				return
+			}
+			if t.After(threeMonBefore) {
+				list[k].IsNew = true
+			}
+		}
+		if v.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+			v.Source = 2
+		} else {
+			v.Source = 1
+		}
+
+		if v.TimeLineData == "" {
+			v.ListTimeLine = make([]models.TimeLineReportResp, 0)
+		} else {
+			if err = json.Unmarshal([]byte(v.TimeLineData), &v.ListTimeLine); err != nil {
+				e = errors.New("Unmarshal, Err: " + e.Error())
+				return
+			}
+		}
+	}
+	items = list
+	return
+}
+
+func HandleIndustryListHzAndYx(list []*models.IndustrialManagement, user *models.WxUserItem, resource string) (items []*models.IndustrialManagement, err error) {
+	var listHz []*models.IndustrialManagement
+	var lisYx []*models.IndustrialManagement
+	for _, v := range list {
+		if v.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+			lisYx = append(lisYx, v)
+		} else {
+			listHz = append(listHz, v)
+		}
+	}
+	listHz, err = HandleIndustryListResource(listHz, user, "Hz")
+	if err != nil {
+		return
+	}
+	lisYx, err = HandleIndustryListResource(lisYx, user, "Yx")
+	if err != nil {
+		return
+	}
+	maplistHz := make(map[int]*models.IndustrialManagement)
+	maplistYx := make(map[int]*models.IndustrialManagement)
+	for _, v := range listHz {
+		maplistHz[v.IndustrialManagementId] = v
+	}
+	for _, v := range lisYx {
+		maplistYx[v.IndustrialManagementId] = v
+	}
+	for _, v := range list {
+		if maplistHz[v.IndustrialManagementId] != nil {
+			items = append(items, maplistHz[v.IndustrialManagementId])
+		}
+		if maplistYx[v.IndustrialManagementId] != nil {
+			items = append(items, maplistYx[v.IndustrialManagementId])
+		}
+	}
+	return
+}
+
 // 通过文章ID获取文章所关联的产业
 func GetArticleIndustrialByArticleId(articleIds []int) (itemMap map[int][]*models.IndustrialManagementResp, err error) {
 	lenarticleIds := len(articleIds)
@@ -852,3 +1143,140 @@ func UpdateIndustrialManagementOneMonthFollowNum(cont context.Context) (err erro
 	}
 	return
 }
+
+//func init_14-2() {
+//	//IndustrialManagementTimeLineDateList3(127)
+//
+//	list, err := models.IndustrialManagementAll()
+//	if err != nil {
+//		fmt.Println("Error marshaling to JSON:", err)
+//		return
+//	}
+//	fmt.Println(len(list))
+//	for k, v := range list {
+//		fmt.Println(k)
+//		time.Sleep(200 * time.Millisecond)
+//		if v.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+//			continue
+//		}
+//		IndustrialManagementTimeLineDateList3(v.IndustrialManagementId)
+//	}
+//}
+
+//func init() {
+//	init_14_2()
+//}
+
+//初始化文章搜索匹配内容
+//func init_14_2() {
+//	//IndustrialManagementTimeLineDateList3(127)
+//	var conditionContent string
+//	var parsContent []interface{}
+//
+//	conditionContent = "   AND source = 'article'  "
+//	list, e := models.GetResourceDataListCondition(conditionContent, parsContent, 0, 99999)
+//	if e != nil && e.Error() != utils.ErrNoRow() {
+//		fmt.Println(e)
+//		return
+//	}
+//
+//	var itemsUpdate []*models.CygxArticle
+//	for k, v := range list {
+//		fmt.Println(k)
+//		item := new(models.CygxArticle)
+//		item.ArticleId = v.SourceId
+//		item.ArticleSearchContent = v.SearchContent
+//		itemsUpdate = append(itemsUpdate, item)
+//	}
+//	e = models.UpdateCygxCygxArticleBillMulti(itemsUpdate)
+//	if e != nil && e.Error() != utils.ErrNoRow() {
+//		fmt.Println(e)
+//		return
+//	}
+//	fmt.Println("end")
+//}
+
+// 时间线关联文章的三条数据
+func IndustrialManagementTimeLineDateList3(industrialManagementId int) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg("修改时间线关联文章的三条数据信息失败"+err.Error(), 2)
+		}
+	}()
+
+	list, e := models.GetTimeLineReportIndustrialList(0, industrialManagementId, 0, 3)
+	if e != nil {
+		err = errors.New("GetCompanySellerAndShareMobileByRai, Err: " + e.Error())
+		return
+	}
+
+	type TimeLineReportItem struct {
+		Title       string `description:"标题"`
+		PublishDate string `description:"发布时间"`
+	}
+
+	var listData []*TimeLineReportItem
+	for _, v := range list {
+		item := new(TimeLineReportItem)
+		if v.Resource == 3 {
+			item.Title, _ = extractTextBeforePeriodOrNewline(v.Content)
+			fmt.Println("Title", item.Title)
+		} else {
+			item.Title = v.Title
+		}
+		item.PublishDate = utils.TimeRemoveHms2(v.PublishTime)
+		listData = append(listData, item)
+	}
+
+	jsonData, err := json.Marshal(listData)
+	if err != nil {
+		fmt.Println("Error marshaling to JSON:", err)
+		return
+	}
+	err = models.UpdateIndustrialManagementTimeLineData(industrialManagementId, string(jsonData))
+	return err
+}
+
+func extractTextBeforePeriodOrNewline(htmlContent string) (string, error) {
+	var builder strings.Builder
+	reader := strings.NewReader(htmlContent)
+	z := html.NewTokenizer(reader)
+
+	for {
+		tokenType := z.Next()
+		switch tokenType {
+		case html.ErrorToken:
+			// End of document
+			return builder.String(), nil
+		case html.TextToken:
+			text := string(z.Text())
+			//fmt.Println("text", text)
+			if idx := strings.Index(text, "。"); idx != -1 {
+				builder.WriteString(text[:idx+len("。")])
+				return builder.String(), nil
+			} else {
+				return text, nil
+			}
+			builder.WriteString(text)
+		}
+	}
+}
+
+// 处理产业管理时间线相关内容的数据
+func UpdateIndustrialManagementTimeLineDateList3ByRedis() (err error) {
+	for {
+		utils.Rc.Brpop(utils.CYGX_ARTICLE_TIME_LINE_KEY, func(b []byte) {
+			var log models.IndustrialManagementCount
+			if err := json.Unmarshal(b, &log); err != nil {
+				fmt.Println("json unmarshal wrong!")
+				go utils.SendAlarmMsg("处理产业管理时间线相关内容的数据处理Redis队列消息失败: UpdateIndustrialManagementTimeLineDateList3ByRedis "+err.Error()+string(b), 2)
+			}
+			IndustrialManagementTimeLineDateList3(log.IndustrialManagementId)
+		})
+	}
+}
+
+//func init_14_2() {
+//SELECT  * FROM cygx_resource_data WHERE  source_id  IN (SELECT article_id  FROM   cygx_article WHERE series_name IN ('行业深度','季度策略') )   AND source = 'article'
+//}

+ 3 - 4
services/resource_data.go

@@ -633,10 +633,6 @@ func Deletenewchart(chartIdsDelete []int) (err error) {
 	return
 }
 
-//func init() {
-//	UpdateArticleResourceData(9050)
-//}
-
 // 更新文章
 func UpdateArticleResourceData(sourceId int) {
 	time.Sleep(1 * time.Second)
@@ -726,6 +722,9 @@ func UpdateArticleResourceData(sourceId int) {
 		item.PublishDate = publishDate
 		item.CreateTime = time.Now()
 		item.SearchTitle = detail.Title
+		if detail.SeriesName == "行业深度" || detail.SeriesName == "季度策略" {
+			item.Sort = 100 // 这两个类型优先展示
+		}
 		annotation, e := utils.GetHtmlContentText(detail.Annotation)
 		if e != nil && e.Error() != utils.ErrNoRow() {
 			err = errors.New("GetHtmlContentText, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))

+ 4 - 3
services/task.go

@@ -178,9 +178,10 @@ func Task() {
 	//	task.AddTask("getArticleListByApi", getArticleListByApi)
 	//}
 
-	//go UserLabelLogReduce()              // 处理用户标签的队列消息
-	//go YanXuanActivityPointsBillReduce() // 处理研选活动扣点
-	//go UpdateArticleByRedis()            // 处理策略平台同步过来的文章
+	//go UserLabelLogReduce()                                 // 处理用户标签的队列消息
+	//go YanXuanActivityPointsBillReduce()                    // 处理研选活动扣点
+	//go UpdateArticleByRedis()                               // 处理策略平台同步过来的文章
+	//go UpdateIndustrialManagementTimeLineDateList3ByRedis() // 处理产业管理时间线相关内容的数据
 
 	//GetCygxActivityAttendanceDetail()
 	//CreateIndexNameArticleHistory()

+ 1 - 1
services/yidong.go

@@ -702,7 +702,7 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 
 				item := new(models.CygxActivityAttendanceDetail)
 				item.ActivityId = v.ActivityId
-
+				item.Mobile = vresult.PersonTelephone
 				if vresult.Duration != "" {
 					item.FirstMeetingTime = vresult.StartTime
 					item.LastMeetingTime = vresult.EndTime

+ 28 - 0
utils/config.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"github.com/beego/beego/v2/server/web"
 	"github.com/rdlucklib/rdluck_tools/cache"
+	"strconv"
 )
 
 var (
@@ -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()

+ 3 - 0
utils/constants.go

@@ -113,11 +113,13 @@ const (
 	YAN_XUAN_ARTICLE_TYPE_IDS        string = "1,2,12"                        // 属于研选的报告类型ID
 	NO_YAN_XUAN_ARTICLE_TYPE_IDS     string = "13"                            // 不属于研选的报告类型ID
 	CYGX_TACTICS_TIME_LINE_STATUS    string = "cygx_tactics_time_line_status" // 策略时间线是否对外开放
+	CYGX_GUSHOU_TIME_LINE_STATUS     string = "cygx_gushou_time_line_status"  // 固收时间线是否对外开放
 	TIME_LINE_ID                     int    = 99999                           // 策略时间线的值
 	TIME_LINE_NAME                   string = "时间线"                           // 策略时间线的名称
 	ACTEGORY_ID_AI_QY                int    = 61                              // AI前沿自定义ID
 	ZHUAN_JIA_NAME                   string = "专家"
 	ZHUAN_JIA_ID                     int    = 29
+	REOURCE_YX                       string = "Yx"
 )
 
 const (
@@ -135,6 +137,7 @@ const (
 	CYGX_USER_KEY_LABEL              = "CYGX_USER_KEY_LABEL"              //查研观向用户标签
 	CYGX_YANXUAN_POINTS_KEY          = "CYGX_YANXUAN_POINTS_KEY"          //查研观向研选活动扣点KEY
 	CYGX_ARTICLE_UPDATE_KEY          = "CYGX_ARTICLE_UPDATE_KEY"          //策略平台更新文章key
+	CYGX_ARTICLE_TIME_LINE_KEY       = "CYGX_ARTICLE_TIME_LINE_KEY"       //产业时间线关联的文章key
 	//CYGX_RAI_SERVE_BILL_KEY          = "CYGX_RAI_SERVE_BILL_KEY"          //权益服务记录明细key
 )
 

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

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio