Browse Source

智能研报

ziwen 1 year ago
parent
commit
e45350a08b

+ 4 - 1
controllers/base_auth.go

@@ -3,6 +3,7 @@ package controllers
 import (
 	"encoding/json"
 	"eta/eta_hub/models"
+	"eta/eta_hub/services/alarm_msg"
 	"eta/eta_hub/utils"
 	"fmt"
 	"github.com/beego/beego/v2/server/web"
@@ -134,7 +135,9 @@ func (c *BaseAuthController) ServeJSON(encoding ...bool) {
 		hasEncoding = true
 	}
 	if c.Data["json"] == nil {
-		go utils.SendEmail("异常提醒:", "接口:"+"URI:"+c.Ctx.Input.URI()+";无返回值", utils.EmailSendToUsers)
+		//go utils.SendEmail("异常提醒:", "接口:"+"URI:"+c.Ctx.Input.URI()+";无返回值", utils.EmailSendToUsers)
+		body := "接口:" + "URI:" + c.Ctx.Input.URI() + ";无返回值"
+		go alarm_msg.SendAlarmMsg(body, 1)
 		return
 	}
 

+ 22 - 2
controllers/report_approval.go

@@ -3,6 +3,7 @@ package controllers
 import (
 	"encoding/json"
 	"eta/eta_hub/models"
+	"eta/eta_hub/services"
 	"eta/eta_hub/utils"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"html"
@@ -102,7 +103,7 @@ func (this *ReportController) ListReport() {
 	//	condition += ` AND state = ? `
 	//	pars = append(pars, state)
 	//}
-	condition += ` AND state = 2 `
+	condition += ` AND state <> 2 `
 
 	total, err := models.GetReportListCount(condition, pars, "")
 	if err != nil {
@@ -160,6 +161,10 @@ func (this *ReportController) PublishReport() {
 		br.ErrMsg = "参数错误,报告id不可为空"
 		return
 	}
+	if req.State != 3 && req.State != 4 {
+		br.Msg = "参数有误"
+		return
+	}
 
 	reportArr := strings.Split(reportIds, ",")
 	for _, v := range reportArr {
@@ -179,7 +184,11 @@ func (this *ReportController) PublishReport() {
 			br.Msg = "报告不存在"
 			return
 		}
-
+		if report.State != 2 {
+			br.Msg = "报告状态错误"
+			br.ErrMsg = "报告状态非待审核状态,Err:" + err.Error()
+			return
+		}
 		publishTime := time.Now()
 		var tmpErr error
 		if report.Content == "" {
@@ -192,6 +201,10 @@ func (this *ReportController) PublishReport() {
 			br.ErrMsg = "报告审核失败, Err:" + tmpErr.Error() + ", report_id:" + strconv.Itoa(report.Id)
 			return
 		}
+		go func() {
+			// 更新报告Es
+			_ = services.UpdateReportEs(report.Id, req.State)
+		}()
 	}
 
 	br.Ret = 200
@@ -232,6 +245,13 @@ func (this *ReportController) Detail() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
+
+	// 报告状态 2待审核 3已驳回 4已审批
+	if  !utils.InArrayByInt([]int{2,3,4}, item.State) {
+		br.Msg = "报告状态错误"
+		br.ErrMsg = "报告状态错误"
+		return
+	}
 	item.Content = html.UnescapeString(item.Content)
 	item.ContentSub = html.UnescapeString(item.ContentSub)
 

+ 280 - 0
controllers/smart_report_approval.go

@@ -0,0 +1,280 @@
+package controllers
+
+import (
+	"encoding/json"
+	"eta/eta_hub/models"
+	"eta/eta_hub/services"
+	"eta/eta_hub/utils"
+	"fmt"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// SmartReportController 智能研报
+type SmartReportController struct {
+	BaseAuthController
+}
+
+// List
+// @Title 报告列表
+// @Description 报告列表
+// @Param   PageSize			query	int		true	"每页数据条数"
+// @Param   CurrentIndex		query	int		true	"当前页页码"
+// @Param   TimeType			query	string	false	"筛选的时间类别: publish_time-发布时间, modify_time-更新时间"
+// @Param   StartDate			query   string  false	"开始时间"
+// @Param   EndDate				query   string  false	"结束时间"
+// @Param   Frequency			query   string  false	"频度"
+// @Param   ClassifyIdFirst		query	int		false	"一级分类ID"
+// @Param   ClassifyIdSecond	query	int		false	"二级分类ID"
+// @Param   State				query	int		false	"发布状态: 1-待发布; 2-已发布"
+// @Param   Keyword				query	string	false	"搜索关键词"
+// @Success 200 {object} models.SmartReportListResp
+// @router /list [get]
+func (this *SmartReportController) List() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+
+	type SmartReportListReq struct {
+		PageSize         int    `form:"PageSize"`
+		CurrentIndex     int    `form:"CurrentIndex"`
+		TimeType         string `form:"TimeType"`
+		StartDate        string `form:"StartDate"`
+		EndDate          string `form:"EndDate"`
+		Frequency        string `form:"Frequency"`
+		ClassifyIdFirst  int    `form:"ClassifyIdFirst"`
+		ClassifyIdSecond int    `form:"ClassifyIdSecond"`
+		State            int    `form:"State"`
+		Keyword          string `form:"Keyword"`
+	}
+	params := new(SmartReportListReq)
+	if e := this.ParseForm(params); e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "入参解析失败, Err: " + e.Error()
+		return
+	}
+	if params.TimeType == "" {
+		params.TimeType = "publish_time"
+	}
+	if params.TimeType != "publish_time" && params.TimeType != "modify_time" {
+		br.Msg = "请选择正确的时间类型"
+		return
+	}
+	// 更新时间指的是内容更新时间
+	if params.TimeType == "modify_time" {
+		params.TimeType = "content_modify_time"
+	}
+
+	var condition string
+	var pars []interface{}
+	// 筛选项
+	{
+		keyword := strings.TrimSpace(params.Keyword)
+		if keyword != "" {
+			kw := fmt.Sprint("%", keyword, "%")
+			condition += fmt.Sprintf(` AND (title LIKE ? OR admin_real_name LIKE ? OR last_modify_admin_name LIKE ?)`)
+			pars = append(pars, kw, kw, kw)
+		}
+		if params.StartDate != "" && params.EndDate != "" {
+			st := fmt.Sprintf("%s 00:00:00", params.StartDate)
+			ed := fmt.Sprintf("%s 23:59:59", params.EndDate)
+			condition += fmt.Sprintf(` AND %s >= ? AND %s <= ?`, params.TimeType, params.TimeType)
+			pars = append(pars, st, ed)
+		}
+		if params.Frequency != "" {
+			condition += ` AND frequency = ?`
+			pars = append(pars, params.Frequency)
+		}
+		if params.ClassifyIdFirst > 0 {
+			condition += ` AND classify_id_first = ?`
+			pars = append(pars, params.ClassifyIdFirst)
+		}
+		if params.ClassifyIdSecond > 0 {
+			condition += ` AND classify_id_second = ?`
+			pars = append(pars, params.ClassifyIdSecond)
+		}
+		if params.State > 0 {
+			condition += ` AND state = ?`
+			pars = append(pars, params.State)
+		}
+	}
+
+	resp := new(models.SmartReportListResp)
+	reportOB := new(models.SmartReport)
+	total, e := reportOB.GetCountByCondition(condition, pars)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取报告总数失败, Err:" + e.Error()
+		return
+	}
+	if total <= 0 {
+		page := paging.GetPaging(params.CurrentIndex, params.PageSize, total)
+		resp.Paging = page
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		return
+	}
+
+	// 分页列表
+	var startSize int
+	if params.PageSize <= 0 {
+		params.PageSize = utils.PageSize20
+	}
+	if params.CurrentIndex <= 0 {
+		params.CurrentIndex = 1
+	}
+	startSize = utils.StartIndex(params.CurrentIndex, params.PageSize)
+
+	// 列表查询过滤掉富文本内容
+	fields := []string{
+		"smart_report_id", "report_code", "classify_id_first", "classify_name_first", "classify_id_second", "classify_name_second", "add_type",
+		"title", "abstract", "author", "frequency", "stage", "video_url", "video_name", "video_play_seconds", "video_size", "detail_img_url", "detail_pdf_url",
+		"admin_id", "admin_real_name", "state", "publish_time", "pre_publish_time", "pre_msg_send", "msg_is_send", "msg_send_time", "create_time", "modify_time",
+		"last_modify_admin_id", "last_modify_admin_name", "content_modify_time", "pv", "uv",
+	}
+	list, e := reportOB.GetPageItemsByCondition(condition, pars, fields, "", startSize, params.PageSize)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取报告分页列表失败, Err:" + e.Error()
+		return
+	}
+	resp.List = list
+
+	page := paging.GetPaging(params.CurrentIndex, params.PageSize, total)
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// Detail
+// @Title 详情
+// @Description 详情
+// @Param   SmartReportId	query	int	true	"智能研报ID"
+// @Success 200 {object} models.SmartReportItem
+// @router /detail [get]
+func (this *SmartReportController) Detail() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+
+	reportId, _ := this.GetInt("SmartReportId")
+	if reportId <= 0 {
+		br.Msg = "参数有误"
+		br.ErrMsg = "报告ID有误"
+		return
+	}
+
+	ob := new(models.SmartReport)
+	item, e := ob.GetItemById(reportId)
+	if e != nil {
+		if e.Error() == utils.ErrNoRow() {
+			br.Msg = "报告不存在, 请刷新页面"
+			return
+		}
+		br.Msg = "操作失败"
+		br.ErrMsg = "获取研报失败, Err: " + e.Error()
+		return
+	}
+	// 报告状态 2待审核 3已驳回 4已审批
+	if !utils.InArrayByInt([]int{models.SmartReportStatePublished, models.SmartReportStateRejected, models.SmartReportStateApprovaled}, item.State) {
+		br.Msg = "报告状态错误"
+		br.ErrMsg = "报告状态错误"
+		return
+	}
+	resp := models.FormatSmartReport2Item(item)
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// Publish
+// @Title 发布/取消发布
+// @Description 发布/取消发布
+// @Param	request	body models.SmartReportPublishReq true "type json string"
+// @Success 200 string "操作成功"
+// @router /publish [post]
+func (this *SmartReportController) Publish() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+
+	var req models.SmartReportPublishReq
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+	if req.SmartReportIds == "" {
+		br.Msg = "参数有误"
+		br.ErrMsg = "报告ID为空"
+		return
+	}
+	if req.PublishState != models.SmartReportStateRejected && req.PublishState != models.SmartReportStateApprovaled {
+		br.Msg = "参数有误"
+		return
+	}
+
+	reportArr := strings.Split(req.SmartReportIds, ",")
+	for _, v := range reportArr {
+		vint, err := strconv.Atoi(v)
+		if err != nil {
+			br.Msg = "参数错误"
+			br.ErrMsg = "参数错误,Err:" + err.Error()
+			return
+		}
+		ob := new(models.SmartReport)
+		item, e := ob.GetItemById(vint)
+		if e != nil {
+			if e.Error() == utils.ErrNoRow() {
+				br.Msg = "报告不存在, 请刷新页面"
+				return
+			}
+			br.Msg = "操作失败"
+			br.ErrMsg = "获取研报失败, Err: " + e.Error()
+			return
+		}
+
+		cols := []string{"State", "ModifyTime"}
+		item.State = req.PublishState
+		item.ModifyTime = time.Now().Local()
+
+		if e = item.Update(cols); e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "更新研报失败, Err: " + e.Error()
+			return
+		}
+
+		// ES更新报告
+		go func() {
+			_ = services.SmartReportElasticUpsert(item.SmartReportId, req.PublishState)
+		}()
+	}
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "操作成功"
+}

+ 3 - 0
go.mod

@@ -6,6 +6,7 @@ require (
 	github.com/beego/bee/v2 v2.1.0
 	github.com/beego/beego/v2 v2.1.3
 	github.com/go-sql-driver/mysql v1.7.1
+	github.com/olivere/elastic/v7 v7.0.32
 	github.com/rdlucklib/rdluck_tools v1.0.3
 	github.com/shopspring/decimal v1.3.1
 	github.com/sirupsen/logrus v1.9.3
@@ -18,6 +19,8 @@ require (
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
 	github.com/golang/protobuf v1.5.3 // indirect
 	github.com/hashicorp/golang-lru v0.5.4 // indirect
+	github.com/josharian/intern v1.0.0 // indirect
+	github.com/mailru/easyjson v0.7.7 // indirect
 	github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
 	github.com/mitchellh/mapstructure v1.5.0 // indirect
 	github.com/pkg/errors v0.9.1 // indirect

+ 7 - 0
go.sum

@@ -34,6 +34,7 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt
 github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
 github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
 github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE03qmvRTNfbw=
+github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/garyburd/redigo v1.6.3/go.mod h1:rTb6epsqigu3kYKBnaF028A7Tf/Aw5s0cqA47doKKqw=
 github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
@@ -73,6 +74,8 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
 github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
+github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
@@ -87,6 +90,8 @@ github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDu
 github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
+github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
+github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
 github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
 github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
@@ -100,6 +105,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/olivere/elastic/v7 v7.0.32 h1:R7CXvbu8Eq+WlsLgxmKVKPox0oOwAE/2T9Si5BnvK6E=
+github.com/olivere/elastic/v7 v7.0.32/go.mod h1:c7PVmLe3Fxq77PIfY/bZmxY/TAamBhCzZ8xDOE09a9k=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=

+ 1 - 0
models/db.go

@@ -31,5 +31,6 @@ func init() {
 	//注册对象
 	orm.RegisterModel(
 		new(Report),
+		new(SmartReport),
 	)
 }

+ 17 - 0
models/report.go

@@ -395,3 +395,20 @@ func GetReportByCondition(condition string, pars []interface{}, fieldArr []strin
 	}
 	return
 }
+
+type ElasticReportDetail struct {
+	ReportId           int    `description:"报告ID"`
+	ReportChapterId    int    `description:"报告章节ID"`
+	Title              string `description:"标题"`
+	Abstract           string `description:"摘要"`
+	BodyContent        string `description:"内容"`
+	PublishTime        string `description:"发布时间"`
+	PublishState       int    `description:"发布状态 1-未发布 2-已发布"`
+	Author             string `description:"作者"`
+	ClassifyIdFirst    int    `description:"一级分类ID"`
+	ClassifyNameFirst  string `description:"一级分类名称"`
+	ClassifyIdSecond   int    `description:"二级分类ID"`
+	ClassifyNameSecond string `description:"二级分类名称"`
+	Categories         string `description:"关联的品种名称(包括品种别名)"`
+	StageStr           string `description:"报告期数"`
+}

+ 347 - 0
models/smart_report.go

@@ -0,0 +1,347 @@
+package models
+
+import (
+	"eta/eta_hub/utils"
+	"fmt"
+	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"html"
+	"strings"
+	"time"
+)
+
+const (
+	SmartReportStateWaitPublish = 1
+	SmartReportStatePublished   = 2
+	SmartReportStateRejected   = 3
+	SmartReportStateApprovaled   = 4
+)
+
+// SmartReport 智能研报
+type SmartReport struct {
+	SmartReportId       int       `orm:"column(smart_report_id);pk" description:"智能研报ID"`
+	ReportCode          string    `description:"报告唯一编码"`
+	ClassifyIdFirst     int       `description:"一级分类ID"`
+	ClassifyNameFirst   string    `description:"一级分类名称"`
+	ClassifyIdSecond    int       `description:"二级分类ID"`
+	ClassifyNameSecond  string    `description:"二级分类名称"`
+	AddType             int       `description:"新增方式:1-新增报告;2-继承报告"`
+	Title               string    `description:"标题"`
+	Abstract            string    `description:"摘要"`
+	Author              string    `description:"作者"`
+	Frequency           string    `description:"频度"`
+	Stage               int       `description:"期数"`
+	Content             string    `description:"内容"`
+	ContentSub          string    `description:"内容前两个章节"`
+	ContentStruct       string    `description:"内容组件"`
+	VideoUrl            string    `description:"音频文件URL"`
+	VideoName           string    `description:"音频文件名称"`
+	VideoPlaySeconds    float64   `description:"音频播放时长"`
+	VideoSize           string    `description:"音频文件大小,单位M"`
+	AdminId             int       `description:"创建者ID"`
+	AdminRealName       string    `description:"创建者姓名"`
+	State               int       `description:"发布状态:1-待发布;2-已发布"`
+	LastModifyAdminId   int       `description:"最后更新人ID"`
+	LastModifyAdminName string    `description:"最后更新人姓名"`
+	ContentModifyTime   time.Time `description:"内容更新时间"`
+	Pv                  int       `description:"pv"`
+	Uv                  int       `description:"uv"`
+	PublishTime         time.Time `description:"发布时间"`
+	PrePublishTime      time.Time `description:"预发布时间"`
+	PreMsgSend          int       `description:"定时发布后是否推送模版消息:0-否;1-是"`
+	MsgIsSend           int       `description:"消息是否已发送:0-否;1-是"`
+	MsgSendTime         time.Time `description:"模版消息发送时间"`
+	DetailImgUrl        string    `description:"报告详情长图地址"`
+	DetailPdfUrl        string    `description:"报告详情PDF地址"`
+	CreateTime          time.Time `description:"创建时间"`
+	ModifyTime          time.Time `description:"修改时间"`
+}
+
+func (m *SmartReport) TableName() string {
+	return "smart_report"
+}
+
+func (m *SmartReport) PrimaryId() string {
+	return "smart_report_id"
+}
+
+func (m *SmartReport) Create() (err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	id, err := o.Insert(m)
+	if err != nil {
+		return
+	}
+	m.SmartReportId = int(id)
+	return
+}
+
+func (m *SmartReport) CreateMulti(items []*SmartReport) (err error) {
+	if len(items) == 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("rddp")
+	_, err = o.InsertMulti(len(items), items)
+	return
+}
+
+func (m *SmartReport) Update(cols []string) (err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	_, err = o.Update(m, cols...)
+	return
+}
+
+func (m *SmartReport) Del() (err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	sql := fmt.Sprintf(`DELETE FROM %s WHERE %s = ? LIMIT 1`, m.TableName(), m.PrimaryId())
+	_, err = o.Raw(sql, m.SmartReportId).Exec()
+	return
+}
+
+func (m *SmartReport) MultiDel(menuIds []int) (err error) {
+	if len(menuIds) == 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("rddp")
+	sql := fmt.Sprintf(`DELETE FROM %s WHERE %s IN (%s)`, m.TableName(), m.PrimaryId(), utils.GetOrmInReplace(len(menuIds)))
+	_, err = o.Raw(sql, menuIds).Exec()
+	return
+}
+
+func (m *SmartReport) GetItemById(id int) (item *SmartReport, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	sql := fmt.Sprintf(`SELECT * FROM %s WHERE %s = ? LIMIT 1`, m.TableName(), m.PrimaryId())
+	err = o.Raw(sql, id).QueryRow(&item)
+	return
+}
+
+func (m *SmartReport) GetItemByCondition(condition string, pars []interface{}, orderRule string) (item *SmartReport, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	order := ``
+	if orderRule != "" {
+		order = ` ORDER BY ` + orderRule
+	}
+	sql := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s %s LIMIT 1`, m.TableName(), condition, order)
+	err = o.Raw(sql, pars).QueryRow(&item)
+	return
+}
+
+func (m *SmartReport) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
+	err = o.Raw(sql, pars).QueryRow(&count)
+	return
+}
+
+func (m *SmartReport) GetItemsByCondition(condition string, pars []interface{}, fieldArr []string, orderRule string) (items []*SmartReport, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	fields := strings.Join(fieldArr, ",")
+	if len(fieldArr) == 0 {
+		fields = `*`
+	}
+	order := `ORDER BY create_time DESC`
+	if orderRule != "" {
+		order = ` ORDER BY ` + orderRule
+	}
+	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s`, fields, m.TableName(), condition, order)
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}
+
+func (m *SmartReport) GetPageItemsByCondition(condition string, pars []interface{}, fieldArr []string, orderRule string, startSize, pageSize int) (items []*SmartReport, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	fields := strings.Join(fieldArr, ",")
+	if len(fieldArr) == 0 {
+		fields = `*`
+	}
+	order := `ORDER BY create_time DESC`
+	if orderRule != "" {
+		order = ` ORDER BY ` + orderRule
+	}
+	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+func (m *SmartReport) GetMaxStageByClassifyId(classifyId int) (stage int, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	sql := fmt.Sprintf(`SELECT MAX(stage) AS max_stage FROM %s WHERE classify_id_second = ?`, m.TableName())
+	err = o.Raw(sql, classifyId).QueryRow(&stage)
+	return
+}
+
+// SmartReportItem 智能研报信息
+type SmartReportItem struct {
+	SmartReportId       int     `description:"智能研报ID"`
+	ReportCode          string  `description:"报告唯一编码"`
+	ClassifyIdFirst     int     `description:"一级分类ID"`
+	ClassifyNameFirst   string  `description:"一级分类名称"`
+	ClassifyIdSecond    int     `description:"二级分类ID"`
+	ClassifyNameSecond  string  `description:"二级分类名称"`
+	AddType             int     `description:"新增方式:1-新增报告;2-继承报告"`
+	Title               string  `description:"标题"`
+	Abstract            string  `description:"摘要"`
+	Author              string  `description:"作者"`
+	Frequency           string  `description:"频度"`
+	Stage               int     `description:"期数"`
+	Content             string  `description:"内容"`
+	ContentSub          string  `description:"内容前两个章节"`
+	ContentStruct       string  `description:"内容组件"`
+	VideoUrl            string  `description:"音频文件URL"`
+	VideoName           string  `description:"音频文件名称"`
+	VideoPlaySeconds    float64 `description:"音频播放时长"`
+	VideoSize           string  `description:"音频文件大小,单位M"`
+	AdminId             int     `description:"创建者姓名"`
+	AdminRealName       string  `description:"创建者姓名"`
+	LastModifyAdminId   int     `description:"最后更新人ID"`
+	LastModifyAdminName string  `description:"最后更新人姓名"`
+	ContentModifyTime   string  `description:"内容更新时间"`
+	Pv                  int     `description:"pv"`
+	Uv                  int     `description:"uv"`
+	State               int     `description:"发布状态:1-待发布;2-已发布"`
+	PublishTime         string  `description:"发布时间"`
+	PrePublishTime      string  `description:"预发布时间"`
+	MsgIsSend           int     `description:"消息是否已发送:0-否;1-是"`
+	MsgSendTime         string  `description:"模版消息发送时间"`
+	DetailImgUrl        string  `description:"报告详情长图地址"`
+	DetailPdfUrl        string  `description:"报告详情PDF地址"`
+	CreateTime          string  `description:"创建时间"`
+	ModifyTime          string  `description:"修改时间"`
+	CanEdit             bool    `description:"是否可编辑"`
+	Editor              string  `description:"当前编辑人"`
+}
+
+// FormatSmartReport2Item 格式化智能研报数据格式
+func FormatSmartReport2Item(origin *SmartReport) (item *SmartReportItem) {
+	item = new(SmartReportItem)
+	if origin == nil {
+		return
+	}
+	item.SmartReportId = origin.SmartReportId
+	item.ReportCode = origin.ReportCode
+	item.ClassifyIdFirst = origin.ClassifyIdFirst
+	item.ClassifyNameFirst = origin.ClassifyNameFirst
+	item.ClassifyIdSecond = origin.ClassifyIdSecond
+	item.ClassifyNameSecond = origin.ClassifyNameSecond
+	item.AddType = origin.AddType
+	item.Title = origin.Title
+	item.Abstract = origin.Abstract
+	item.Author = origin.Author
+	item.Frequency = origin.Frequency
+	item.Stage = origin.Stage
+	item.Content = html.UnescapeString(origin.Content)
+	item.ContentSub = html.UnescapeString(origin.ContentSub)
+	item.ContentStruct = html.UnescapeString(origin.ContentStruct)
+	item.VideoUrl = origin.VideoUrl
+	item.VideoName = origin.VideoName
+	item.VideoPlaySeconds = origin.VideoPlaySeconds
+	item.VideoSize = origin.VideoSize
+	item.AdminId = origin.AdminId
+	item.AdminRealName = origin.AdminRealName
+	item.LastModifyAdminId = origin.LastModifyAdminId
+	item.LastModifyAdminName = origin.LastModifyAdminName
+	item.ContentModifyTime = utils.TimeTransferString(utils.FormatDateTime, origin.ContentModifyTime)
+	item.Pv = origin.Pv
+	item.Uv = origin.Uv
+	item.State = origin.State
+	item.PublishTime = utils.TimeTransferString(utils.FormatDateTime, origin.PublishTime)
+	item.PrePublishTime = utils.TimeTransferString(utils.FormatDateTime, origin.PrePublishTime)
+	item.MsgIsSend = origin.MsgIsSend
+	item.MsgSendTime = utils.TimeTransferString(utils.FormatDateTime, origin.MsgSendTime)
+	item.DetailImgUrl = origin.DetailImgUrl
+	item.DetailPdfUrl = origin.DetailPdfUrl
+	item.CreateTime = utils.TimeTransferString(utils.FormatDateTime, origin.CreateTime)
+	item.ModifyTime = utils.TimeTransferString(utils.FormatDateTime, origin.ModifyTime)
+	return
+}
+
+// SmartReportAddReq 新增智能研报请求体
+type SmartReportAddReq struct {
+	AddType            int    `description:"新增方式:1:新增报告,2:继承报告"`
+	ClassifyIdFirst    int    `description:"一级分类ID"`
+	ClassifyNameFirst  string `description:"一级分类名称"`
+	ClassifyIdSecond   int    `description:"二级分类ID"`
+	ClassifyNameSecond string `description:"二级分类名称"`
+	Title              string `description:"标题"`
+	Abstract           string `description:"摘要"`
+	Author             string `description:"作者"`
+	Frequency          string `description:"频度"`
+}
+
+// SmartReportEditReq 编辑智能研报请求体
+type SmartReportEditReq struct {
+	SmartReportAddReq
+	SmartReportId int    `description:"智能研报ID"`
+	Content       string `description:"内容"`
+	ContentStruct string `description:"内容结构"`
+}
+
+// SmartReportRemoveReq 删除智能研报请求体
+type SmartReportRemoveReq struct {
+	SmartReportId int `description:"智能研报ID"`
+}
+
+// SmartReportPublishReq 审核智能研报请求体
+type SmartReportPublishReq struct {
+	SmartReportIds string `description:"智能研报ID,多个用英文逗号隔开"`
+	PublishState  int `description:"3-驳回; 4-审核"`
+}
+
+// SmartReportPrePublishReq 预发布智能研报请求体
+type SmartReportPrePublishReq struct {
+	SmartReportId  int    `description:"智能研报ID"`
+	PrePublishTime string `description:"预发布时间"`
+	PreMsgSend     int    `description:"定时发布成功后是否立即推送模版消息:0否,1是"`
+}
+
+// SmartReportSaveContentReq 保存草稿请求体
+type SmartReportSaveContentReq struct {
+	SmartReportId int    `description:"智能研报ID"`
+	Content       string `description:"内容"`
+	ContentStruct string `description:"内容结构"`
+	NoChange      int    `description:"内容是否未改变:1:内容未改变"`
+}
+
+// SmartReportSaveContentResp 保存草稿响应体
+type SmartReportSaveContentResp struct {
+	SmartReportId int `description:"智能研报ID"`
+}
+
+// SmartReportSendMsgReq 消息推送请求体
+type SmartReportSendMsgReq struct {
+	SmartReportId int `description:"智能研报ID"`
+}
+
+// SmartReportMarkEditReq 标记编辑英文研报的请求数据
+type SmartReportMarkEditReq struct {
+	SmartReportId int `description:"智能研报ID"`
+	Status        int `description:"标记状态: 1-编辑中; 2-编辑完成"`
+}
+
+// SmartReportListResp 智能研报
+type SmartReportListResp struct {
+	List   []*SmartReport
+	Paging *paging.PagingItem `description:"分页数据"`
+}
+
+// ElasticSmartReport 智能研报es
+type ElasticSmartReport struct {
+	SmartReportId      int    `description:"智能研报ID"`
+	Title              string `description:"标题"`
+	Abstract           string `description:"摘要"`
+	BodyContent        string `description:"内容"`
+	PublishTime        string `description:"发布时间"`
+	PublishState       int    `description:"发布状态 1-未发布 2-已发布"`
+	Author             string `description:"作者"`
+	ClassifyIdFirst    int    `description:"一级分类ID"`
+	ClassifyNameFirst  string `description:"一级分类名称"`
+	ClassifyIdSecond   int    `description:"二级分类ID"`
+	ClassifyNameSecond string `description:"二级分类名称"`
+	StageStr           string `description:"报告期数"`
+	Frequency          string `description:"频度"`
+}
+
+// Report2ImgQueueReq 报告详情生成长图队列请求体
+type Report2ImgQueueReq struct {
+	ReportType int    `description:"报告类型: 1-研报; 2-智能研报"`
+	ReportCode string `description:"报告唯一编码"`
+}

+ 27 - 0
routers/commentsRouter.go

@@ -34,4 +34,31 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_hub/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta/eta_hub/controllers:SmartReportController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_hub/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta/eta_hub/controllers:SmartReportController"],
+        beego.ControllerComments{
+            Method: "List",
+            Router: `/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_hub/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta/eta_hub/controllers:SmartReportController"],
+        beego.ControllerComments{
+            Method: "Publish",
+            Router: `/publish`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
 }

+ 5 - 0
routers/router.go

@@ -19,6 +19,11 @@ func init() {
 				&controllers.ReportController{},
 			),
 		),
+		web.NSNamespace("/smart_report",
+			web.NSInclude(
+				&controllers.SmartReportController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }

+ 139 - 0
services/elastic.go

@@ -0,0 +1,139 @@
+package services
+
+import (
+	"context"
+	"eta/eta_hub/models"
+	"eta/eta_hub/utils"
+	"fmt"
+	"github.com/olivere/elastic/v7"
+	"strings"
+)
+
+func NewClient() (client *elastic.Client, err error) {
+	client, err = elastic.NewClient(
+		elastic.SetURL(utils.ES_URL),
+		elastic.SetBasicAuth(utils.ES_USERNAME, utils.ES_PASSWORD),
+		elastic.SetSniff(false))
+	return
+}
+
+
+
+// EsAddOrEditReport 新增编辑es报告
+func EsAddOrEditReport(indexName, docId string, item *models.ElasticReportDetail) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println("EsAddOrEditReport Err:", err.Error())
+		}
+	}()
+	client, err := NewClient()
+	if err != nil {
+		return
+	}
+	// docId为报告ID+章节ID
+	searchById, err := client.Get().Index(indexName).Id(docId).Do(context.Background())
+	if err != nil && !strings.Contains(err.Error(), "404") {
+		fmt.Println("Get Err" + err.Error())
+		return
+	}
+	if searchById != nil && searchById.Found {
+		resp, err := client.Update().Index(indexName).Id(docId).Doc(map[string]interface{}{
+			"ReportId":           item.ReportId,
+			"ReportChapterId":    item.ReportChapterId,
+			"Title":              item.Title,
+			"Abstract":           item.Abstract,
+			"BodyContent":        item.BodyContent,
+			"PublishTime":        item.PublishTime,
+			"PublishState":       item.PublishState,
+			"Author":             item.Author,
+			"ClassifyIdFirst":    item.ClassifyIdFirst,
+			"ClassifyNameFirst":  item.ClassifyNameFirst,
+			"ClassifyIdSecond":   item.ClassifyIdSecond,
+			"ClassifyNameSecond": item.ClassifyNameSecond,
+			"Categories":         item.Categories,
+			"StageStr":           item.StageStr,
+		}).Do(context.Background())
+		if err != nil {
+			return err
+		}
+		//fmt.Println(resp.Status, resp.Result)
+		if resp.Status == 0 {
+			fmt.Println("修改成功" + docId)
+			err = nil
+		} else {
+			fmt.Println("EditData", resp.Status, resp.Result)
+		}
+	} else {
+		resp, err := client.Index().Index(indexName).Id(docId).BodyJson(item).Do(context.Background())
+		if err != nil {
+			fmt.Println("新增失败:", err.Error())
+			return err
+		}
+		if resp.Status == 0 && resp.Result == "created" {
+			fmt.Println("新增成功" + docId)
+			return nil
+		} else {
+			fmt.Println("AddData", resp.Status, resp.Result)
+		}
+	}
+	return
+}
+
+// EsAddOrEditSmartReport 新增编辑es智能研报
+func EsAddOrEditSmartReport(indexName, docId string, item *models.ElasticSmartReport) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println("EsAddOrEditSmartReport Err:", err.Error())
+		}
+	}()
+	client, err := NewClient()
+	if err != nil {
+		return
+	}
+	// docId为报告ID
+	searchById, err := client.Get().Index(indexName).Id(docId).Do(context.Background())
+	if err != nil && !strings.Contains(err.Error(), "404") {
+		fmt.Println("Get Err" + err.Error())
+		return
+	}
+	if searchById != nil && searchById.Found {
+		resp, err := client.Update().Index(indexName).Id(docId).Doc(map[string]interface{}{
+			"SmartReportId":      item.SmartReportId,
+			"Title":              item.Title,
+			"Abstract":           item.Abstract,
+			"BodyContent":        item.BodyContent,
+			"PublishTime":        item.PublishTime,
+			"PublishState":       item.PublishState,
+			"Author":             item.Author,
+			"ClassifyIdFirst":    item.ClassifyIdFirst,
+			"ClassifyNameFirst":  item.ClassifyNameFirst,
+			"ClassifyIdSecond":   item.ClassifyIdSecond,
+			"ClassifyNameSecond": item.ClassifyNameSecond,
+			"StageStr":           item.StageStr,
+			"Frequency":          item.Frequency,
+		}).Do(context.Background())
+		if err != nil {
+			return err
+		}
+		//fmt.Println(resp.Status, resp.Result)
+		if resp.Status == 0 {
+			fmt.Println("修改成功" + docId)
+			err = nil
+		} else {
+			fmt.Println("EditData", resp.Status, resp.Result)
+		}
+	} else {
+		resp, err := client.Index().Index(indexName).Id(docId).BodyJson(item).Do(context.Background())
+		if err != nil {
+			fmt.Println("新增失败:", err.Error())
+			return err
+		}
+		if resp.Status == 0 && resp.Result == "created" {
+			fmt.Println("新增成功" + docId)
+			return nil
+		} else {
+			fmt.Println("AddData", resp.Status, resp.Result)
+		}
+	}
+	return
+}

+ 46 - 0
services/report.go

@@ -0,0 +1,46 @@
+package services
+
+import (
+	"eta/eta_hub/models"
+	"eta/eta_hub/utils"
+	"fmt"
+	"html"
+	"strconv"
+)
+
+// UpdateReportEs 更新报告/章节Es
+func UpdateReportEs(reportId int, publishState int) (err error) {
+	if reportId <= 0 {
+		return
+	}
+	reportInfo, err := models.GetReportByReportId(reportId)
+	if err != nil {
+		return
+	}
+	categories := ""
+
+
+	// 新增报告ES
+	esReport := &models.ElasticReportDetail{
+		ReportId:           reportInfo.Id,
+		ReportChapterId:    0,
+		Title:              reportInfo.Title,
+		Abstract:           reportInfo.Abstract,
+		BodyContent:        utils.TrimHtml(html.UnescapeString(reportInfo.Content)),
+		PublishTime:        reportInfo.PublishTime.Format(utils.FormatDateTime),
+		PublishState:       publishState,
+		Author:             reportInfo.Author,
+		ClassifyIdFirst:    reportInfo.ClassifyIdFirst,
+		ClassifyNameFirst:  reportInfo.ClassifyNameFirst,
+		ClassifyIdSecond:   reportInfo.ClassifyIdSecond,
+		ClassifyNameSecond: reportInfo.ClassifyNameSecond,
+		Categories:         categories,
+		StageStr:           strconv.Itoa(reportInfo.Stage),
+	}
+	docId := fmt.Sprintf("%d-%d", reportInfo.Id, 0)
+	if err = EsAddOrEditReport(utils.EsReportIndexName, docId, esReport); err != nil {
+		return
+	}
+
+	return
+}

+ 46 - 0
services/smart_report.go

@@ -0,0 +1,46 @@
+package services
+
+import (
+	"eta/eta_hub/models"
+	"eta/eta_hub/utils"
+	"fmt"
+	"html"
+	"strconv"
+)
+
+// SmartReportElasticUpsert 新增/编辑报告es
+func SmartReportElasticUpsert(smartReportId int, state int) (err error) {
+	if smartReportId <= 0 {
+		return
+	}
+
+	reportOB := new(models.SmartReport)
+	item, e := reportOB.GetItemById(smartReportId)
+	if e != nil {
+		if e.Error() == utils.ErrNoRow() {
+			// 可能被删了就直接忽略掉
+			return
+		}
+		err = fmt.Errorf("获取报告失败, Err: %s", e.Error())
+		return
+	}
+
+	esReport := new(models.ElasticSmartReport)
+	esReport.SmartReportId = item.SmartReportId
+	esReport.Title = item.Title
+	esReport.Abstract = item.Abstract
+	esReport.BodyContent = utils.TrimHtml(html.UnescapeString(item.Content))
+	esReport.PublishTime = item.PublishTime.Format(utils.FormatDateTime)
+	esReport.PublishState = state
+	esReport.Author = item.Author
+	esReport.ClassifyIdFirst = item.ClassifyIdFirst
+	esReport.ClassifyNameFirst = item.ClassifyNameFirst
+	esReport.ClassifyIdSecond = item.ClassifyIdSecond
+	esReport.ClassifyNameSecond = item.ClassifyNameSecond
+	esReport.StageStr = strconv.Itoa(item.Stage)
+	esReport.Frequency = item.Frequency
+	if err = EsAddOrEditSmartReport(utils.SmartReportIndexName, strconv.Itoa(item.SmartReportId), esReport); err != nil {
+		return
+	}
+	return
+}

+ 9 - 1
utils/common.go

@@ -1005,4 +1005,12 @@ func GetLikeKeywordPars(pars []interface{}, keyword string, num int) (newPars []
 		newPars = append(newPars, `%`+keyword+`%`)
 	}
 	return
-}
+}
+
+func TimeTransferString(format string, t time.Time) string {
+	str := t.Format(format)
+	if t.IsZero() {
+		return ""
+	}
+	return str
+}

+ 29 - 0
utils/config.go

@@ -24,6 +24,20 @@ var (
 	LogMaxDays int //日志最大保留天数
 )
 
+
+// ES索引配置
+var (
+	EsReportIndexName              string //研报ES索引
+	SmartReportIndexName           string //智能研报ES索引
+)
+
+// ES配置
+var (
+	ES_URL      string // ES服务器地址
+	ES_USERNAME string // ES账号
+	ES_PASSWORD string // ES密码
+)
+
 // BusinessCode 商家编码
 var BusinessCode string
 
@@ -75,4 +89,19 @@ func init() {
 
 	// 商家编码
 	BusinessCode = config["business_code"]
+
+
+	// ES 索引
+	{
+		EsReportIndexName = config["es_report_index_name"]
+		SmartReportIndexName = config["es_smart_report_index_name"]
+	}
+
+	// ES配置
+	{
+		ES_URL = config["es_url"]
+		ES_USERNAME = config["es_username"]
+		ES_PASSWORD = config["es_password"]
+	}
+
 }

+ 1 - 2
utils/constants.go

@@ -21,6 +21,5 @@ const (
 )
 
 const (
-	APPNAME          = "弘则-数据爬虫"
-	EmailSendToUsers = "glji@hzinsights.com;pyan@hzinsights.com;cxzhang@hzinsights.com;zwxi@hzinsights.com;"
+	APPNAME          = "弘则-对外API"
 )