Browse Source

添加通知邮箱

xingzai 3 năm trước cách đây
mục cha
commit
75d43c2bc5
5 tập tin đã thay đổi với 29 bổ sung28 xóa
  1. 1 0
      controllers/article.go
  2. 12 12
      models/article.go
  3. 2 2
      services/activity.go
  4. 1 1
      services/article.go
  5. 13 13
      services/task.go

+ 1 - 0
controllers/article.go

@@ -911,6 +911,7 @@ func (this *ArticleCommonController) ListApi() {
 		this.ServeJSON()
 	}()
 	url := "https://vmp.hzinsights.com/v2api/articles/mp?take=20&skip=0&publish_status=1"
+	url = ""
 	method := "GET"
 	client := &nhttp.Client{}
 	req, err := nhttp.NewRequest(method, url, nil)

+ 12 - 12
models/article.go

@@ -152,21 +152,21 @@ func GetArticleDetailById(articleId int) (item *ArticleDetail, err error) {
 
 func GetSellerList(articleId int) (items []*SellerRep, err error) {
 	o := orm.NewOrm()
-	//o.Using("tactics")
-	//sql := `SELECT
-	//	ac.phone_number as  seller_mobile,
-	//	ac.name as  seller_name
-	//	FROM
-	//	article_author AS au
-	//	INNER JOIN account_client as ac ON au.author_id = ac.phone_number
-	//	WHERE article_id = ?`
-
+	o.Using("tactics")
 	sql := `SELECT
-		au.mobile as  seller_mobile,
-		au.name as  seller_name
+		ac.phone_number as  seller_mobile,
+		ac.name as  seller_name
 		FROM
-		cygx_article_author AS au
+		article_author AS au
+		INNER JOIN account_client as ac ON au.author_id = ac.phone_number
 		WHERE article_id = ?`
+
+	//sql := `SELECT
+	//	au.mobile as  seller_mobile,
+	//	au.name as  seller_name
+	//	FROM
+	//	cygx_article_author AS au
+	//	WHERE article_id = ?`
 	_, err = o.Raw(sql, articleId).QueryRows(&items)
 	return
 }

+ 2 - 2
services/activity.go

@@ -490,7 +490,7 @@ func SendEmailFileForAskMsgResearch(cont context.Context) (err error) {
 		content := "活动带问详情"
 		fileName := downLoadnFilePath
 		if utils.WxMsgTemplateIdAskMsgMobile == "" {
-			touser = "cxzhang@hzinsights.com;ywang@hzinsights.com"
+			touser = "cxzhang@hzinsights.com;ywang@hzinsights.com;tshen@hzinsights.com"
 		} else {
 			touser = "cxzhang@hzinsights.com;jhwang@hzinsights.com;tshen@hzinsights.com"
 		}
@@ -564,7 +564,7 @@ func SendEmailFileForAskMsg(cont context.Context) (err error) {
 			}
 		}
 		if touser != "" {
-			touser = strings.TrimRight(touser, ";")
+			touser += "tshen@hzinsights.com;cxzhang@hzinsights.com"
 		} else {
 			fmt.Println("没有对应的邮箱")
 			return

+ 1 - 1
services/article.go

@@ -274,7 +274,7 @@ func FixArticleContent(articleId int) {
 }
 
 func GetArticleListByApi(cont context.Context) (err error) {
-	url := "https://vmp.hzinsights.com/v2api/articles/mp?take=20&skip=0&publish_status=1"
+	url := "https://vmp.hzinsights.com/v2api/articles/mp?take=100&skip=0&publish_status=1"
 	method := "GET"
 	client := &nhttp.Client{}
 	req, err := nhttp.NewRequest(method, url, nil)

+ 13 - 13
services/task.go

@@ -18,9 +18,12 @@ func Task() {
 	if utils.RunMode == "release" {
 		syncTacticsListAddreport := task.NewTask("syncTacticsListAddreport", "0 */5 * * * *", SyncTacticsListAddreport) //同步文章
 		task.AddTask("syncTacticsListAddreport", syncTacticsListAddreport)
-		//同步纪要库中的Es
+
 		getSummarytoEs := task.NewTask("getSummarytoEs", "0 */30 * * * *", GetSummarytoEs) //同步纪要库内容到Es
 		task.AddTask("getSummarytoEs", getSummarytoEs)
+	} else {
+		getArticleListByApi := task.NewTask("getArticleListByApi", "0 */5 * * * *", GetArticleListByApi) //通过三方接口获取策略平台上的文章
+		task.AddTask("getArticleListByApi", getArticleListByApi)
 	}
 	//修改任务状态
 	updateActivitySattus := task.NewTask("syncTacticsListAddreport", "0 */1 8-22 * * *", UpdateActivitySattus)
@@ -45,10 +48,6 @@ func Task() {
 	sendEmailFileForAskMsg := task.NewTask("sendEmailFileForAskMsg", "0 */5 8-22 * * *", SendEmailFileForAskMsg) //非研选系列专家电话会,根据主持人姓名,会前15分钟将问题列表发送给至该主持人对应邮箱
 	task.AddTask("sendEmailFileForAskMsg", sendEmailFileForAskMsg)
 
-	////白名单发送
-	//sendEmailUserWhiteList := task.NewTask("sendEmailUserWhiteList", "0 27 17 * * *", SendEmailUserWhiteList) //白名单发送
-	//task.AddTask("sendEmailUserWhiteList", sendEmailUserWhiteList)
-
 	//白名单发送2
 	sendEmailUserWhiteListChange := task.NewTask("sendEmailUserWhiteListChange", "0 00 17 * * *", SendEmailUserWhiteListChange) //新增 和冻结的客户白名单
 	task.AddTask("sendEmailUserWhiteListChange", sendEmailUserWhiteListChange)
@@ -57,14 +56,6 @@ func Task() {
 	chageIndustrialArticleNum := task.NewTask("chageIndustrialArticleNum", "0 01 00 * * *", ChageIndustrialArticleNum) //更改对应产业的文章阅读数量
 	task.AddTask("chageIndustrialArticleNum", chageIndustrialArticleNum)
 
-	getArticleListByApi := task.NewTask("getArticleListByApi", "0 */5 * * * *", GetArticleListByApi) //更改对应产业的文章阅读数量
-	task.AddTask("getArticleListByApi", getArticleListByApi)
-
-	//editOutboundMobile := task.NewTask("editOutboundMobile", "0 */1 8-22 * * *", EditOutboundMobile) //同步外呼号码与手机号
-	//task.AddTask("sendEmailFileToExpert", editOutboundMobile)
-	//editUserOutboundMobile := task.NewTask("editUserOutboundMobile", "0 27 14 * * *   ", EditUserOutboundMobile) //同步外呼号码与手机号
-	//task.AddTask("editUserOutboundMobile", editUserOutboundMobile)
-
 	//IndustrialArticleNum()
 
 	//GetAddpArticle() //同步日度点评数据
@@ -72,6 +63,15 @@ func Task() {
 	fmt.Println("end")
 }
 
+////白名单发送
+//sendEmailUserWhiteList := task.NewTask("sendEmailUserWhiteList", "0 27 17 * * *", SendEmailUserWhiteList) //白名单发送
+//task.AddTask("sendEmailUserWhiteList", sendEmailUserWhiteList)
+
+//editOutboundMobile := task.NewTask("editOutboundMobile", "0 */1 8-22 * * *", EditOutboundMobile) //同步外呼号码与手机号
+//task.AddTask("sendEmailFileToExpert", editOutboundMobile)
+//editUserOutboundMobile := task.NewTask("editUserOutboundMobile", "0 27 14 * * *   ", EditUserOutboundMobile) //同步外呼号码与手机号
+//task.AddTask("editUserOutboundMobile", editUserOutboundMobile)
+
 func ElasticOption() {
 	//SyncTacticsList()
 	//toolbox.StartTask()