Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master' into chart/10.5

Roc 2 anni fa
parent
commit
2ad69c482f

+ 11 - 0
controller/response/base.go

@@ -152,3 +152,14 @@ func FailMsg(msg, errMsg string, c *gin.Context) {
 	}
 	result(200, resultData, c)
 }
+
+type BaseResponse struct {
+	Ret         int
+	Msg         string
+	ErrMsg      string
+	ErrCode     string
+	Data        interface{}
+	Success     bool `description:"true 执行成功,false 执行失败"`
+	IsSendEmail bool `json:"-" description:"true 发送邮件,false 不发送邮件"`
+	IsAddLog    bool `json:"-" description:"true 新增操作日志,false 不新增操作日志" `
+}

+ 1 - 0
models/tables/voice_broadcast_statistics/voice_broadcast_statistics.go

@@ -9,6 +9,7 @@ type VoiceBroadcastStatistics struct {
 	Mobile        string `description:"用户手机号"`
 	Email         string `description:"电子邮箱"`
 	CompanyStatus string `description:"客户状态"`
+	SellerId      int    `description:"销售id"`
 	Source        int    `description:"点击来源,1手机小程序,2pc小程序,3web端"`
 	BroadcastId   int    `description:"语音ID"`
 	BroadcastName string `description:"语音名称"`

+ 6 - 4
models/tables/yb_community_audio_listen_log/entity.go

@@ -8,13 +8,15 @@ type YbCommunityAudioListenLog struct {
 	CommunityQuestionAudioID int       `gorm:"column:community_question_audio_id;type:int(10) unsigned;not null" json:"community_question_audio_id"` //问答音频ID
 	CommunityQuestionID      int       `gorm:"column:community_question_id;type:int(10) unsigned;not null;default:0" json:"community_question_id"`   // 社区问题ID
 	UserID                   int       `gorm:"index:idx_user_id;column:user_id;type:int(10) unsigned;not null;default:0" json:"user_id"`             // 点击音频的用户ID
-	SourceAgent              int       `gorm:"column:source_agent;type:tinyint(4);default:1" json:"source_agent"`                                    // 操作来源,1:小程序,2:小程序 pc 3:弘则研究公众号,4:web pc
-	CreateTime               time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"create_time"`                        // 创建日志时间
+	CompanyID                int       `gorm:"column:company_id;type:int(10) unsigned;not null;default:0" json:"companyId"`                          // 客户ID
+	CompanyName              string    `gorm:"column:company_name;type:varchar(100);not null;default:''" json:"companyName"`
+	CompanyStatus            string    `gorm:"column:company_status;type:varchar(30);not null;default:''" json:"companyStatus"`
+	SellerID                 int       `gorm:"column:seller_id;type:int(11)" json:"sellerId"`
+	SourceAgent              int       `gorm:"column:source_agent;type:tinyint(4);default:1" json:"source_agent"`             // 操作来源,1:小程序,2:小程序 pc 3:弘则研究公众号,4:web pc
+	CreateTime               time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"create_time"` // 创建日志时间
 }
 
 // TableName get sql table name.获取数据库表名
 func (l *YbCommunityAudioListenLog) TableName() string {
 	return "yb_community_audio_listen_log"
 }
-
-

+ 2 - 1
models/tables/yb_community_video_play_log/entity.go

@@ -14,7 +14,8 @@ type YbCommunityVideoPlayLog struct {
 	CompanyName      string    `gorm:"column:company_name;type:varchar(100);not null;default:''" json:"companyName"`                                  // 客户名称
 	CompanyStatus    string    `gorm:"column:company_status;type:varchar(30);not null;default:''" json:"companyStatus"`                               // 客户状态
 	SourceAgent      int       `gorm:"column:source_agent;type:tinyint(4) unsigned;not null;default:1" json:"sourceAgent"`                            // 操作来源,1:小程序,2:小程序 pc 3:弘则研究公众号,4:web pc
-	CreateTime       time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createTime"`                                  // 创建时间
+	SellerID         int       `gorm:"column:seller_id;type:int(11)" json:"sellerId"`
+	CreateTime       time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createTime"` // 创建时间
 }
 
 // TableName get sql table name.获取数据库表名

+ 27 - 0
services/activity/activity.go

@@ -8,6 +8,8 @@ import (
 	"hongze/hongze_yb/models/response"
 	"hongze/hongze_yb/models/response/purchase"
 	"hongze/hongze_yb/models/tables/company_product"
+	"hongze/hongze_yb/models/tables/rddp/report"
+	"hongze/hongze_yb/models/tables/research_report"
 	"hongze/hongze_yb/models/tables/yb_activity"
 	"hongze/hongze_yb/models/tables/yb_activity_permission"
 	"hongze/hongze_yb/models/tables/yb_activity_register"
@@ -143,6 +145,31 @@ func GetActivityDetail(activityId, userId int) (detail *yb_activity.ActivityDeta
 	if registerErr != gorm.ErrRecordNotFound {
 		detail.RegisterState = 1
 	}
+	// 判断报告链接对应的报告发布状态,若为未发布则报告链接置空
+	if detail.ReportId > 0 && detail.ReportLink != "" {
+		if detail.IsNewReport == 1 {
+			// 去新报告表中查询
+			newReport, e := report.GetByReportId(detail.ReportId)
+			if e != nil {
+				err = errors.New("获取新报告详情失败, Err: " + e.Error())
+				return
+			}
+			if newReport.State != 2 {
+				detail.ReportLink = ""
+			}
+		} else {
+			// 查询老报告表
+			oldReport, e := research_report.GetByResearchReportId(uint64(detail.ReportId))
+			if e != nil {
+				err = errors.New("获取老报告详情失败, Err: " + e.Error())
+				return
+			}
+			if oldReport.Status != "report" {
+				detail.ReportLink = ""
+			}
+		}
+	}
+
 	return
 }
 

+ 15 - 0
services/community/question.go

@@ -476,11 +476,26 @@ func AddAudioListenLog(userInfo user.UserInfo, audioId int, sourceAgent int) (er
 		err = errors.New("音频不存在")
 		return
 	}
+	companyInfo, e := company_product.GetByCompany2ProductId(userInfo.CompanyID, 1)
+	if e != nil && e != utils.ErrNoRow {
+		err = errors.New("获取客户信息失败")
+		return
+	}
+	companyName := "潜在客户"
+	companyStatus := "潜在"
+	if companyInfo != nil && companyInfo.CompanyID > 0 {
+		companyName = companyInfo.CompanyName
+		companyStatus = companyInfo.Status
+	}
 	//3. 添加点击日志
 	item := &yb_community_audio_listen_log.YbCommunityAudioListenLog{
 		CommunityQuestionAudioID: audio.CommunityQuestionAudioID,
 		CommunityQuestionID:      audio.CommunityQuestionID,
 		UserID:                   int(userInfo.UserID),
+		CompanyID:                int(userInfo.CompanyID),
+		CompanyName:              companyName,
+		CompanyStatus:            companyStatus,
+		SellerID:                 companyInfo.SellerID,
 		SourceAgent:              sourceAgent,
 	}
 	if err = item.Create(); err != nil {

+ 1 - 0
services/community/video.go

@@ -84,6 +84,7 @@ func SaveVideoPlayLog(userInfo user.UserInfo, videoId, sourceAgent int) (errMsg
 		CompanyName:      companyName,
 		CompanyStatus:    companyStatus,
 		SourceAgent:      sourceAgent,
+		SellerID:         companyInfo.SellerID,
 		CreateTime:       time.Now().Local(),
 	}
 	if e = item.Create(); e != nil {

+ 2 - 1
services/voice_broadcast.go

@@ -155,6 +155,7 @@ func AddBroadcastRecord(userinfo user.UserInfo, source, broadcastId int) {
 		Mobile:        userinfo.Mobile,
 		Email:         userinfo.Email,
 		CompanyStatus: companyProduct.Status,
+		SellerId:      companyProduct.SellerID,
 		Source:        source,
 		BroadcastId:   broadcastId,
 		BroadcastName: broadcast.BroadcastName,
@@ -467,4 +468,4 @@ func GetMyVoiceBroadcastListCount(authorId, sectionId int) (resp response.Broadc
 	}
 	resp.All = resp.Unpublished + resp.Published
 	return
-}
+}

+ 182 - 46
services/wechat/template_msg.go

@@ -6,14 +6,17 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
+	"hongze/hongze_yb/controller/response"
 	"hongze/hongze_yb/global"
 	"hongze/hongze_yb/models/tables/user_record"
 	"hongze/hongze_yb/models/tables/user_template_record"
 	"hongze/hongze_yb/models/tables/wx_user"
 	"hongze/hongze_yb/services/alarm_msg"
+	"hongze/hongze_yb/services/wx_app"
 	"hongze/hongze_yb/utils"
 	"io/ioutil"
 	"net/http"
+	"strings"
 	"time"
 )
 
@@ -43,6 +46,60 @@ type OpenIdList struct {
 	UserId int
 }
 
+type SendWxTemplate struct {
+	First          string   `description:"模板消息first字段"`
+	Keyword1       string   `description:"模板消息keyword1字段"`
+	Keyword2       string   `description:"模板消息keyword2字段"`
+	Keyword3       string   `description:"模板消息keyword3字段"`
+	Keyword4       string   `description:"模板消息keyword4字段"`
+	Remark         string   `description:"模板消息remark字段"`
+	TemplateId     string   `description:"模板id"`
+	RedirectUrl    string   `description:"跳转地址"`
+	RedirectTarget int      `description:"小程序跳转目标:1:弘则研报小程序,2:随手办公小程序"`
+	Resource       string   `description:"资源唯一标识"`
+	SendType       int      `description:"发送的消息类型:1:报告,2:指标更新提醒,3:审批通知,4:销售领取客户通知,5:活动取消通知,6活动更改时间通知,7:关注的作者发布报告通知,8:发送日报(周报、双周报、月报)模板消息,9:活动预约/报名时间通知"`
+	OpenIdArr      []string `description:"消息接收者openid"`
+}
+
+//推送模板消息
+func SendTemplateMsg(sendInfo *SendWxTemplate) (err error) {
+	postData, err := json.Marshal(sendInfo)
+	if err != nil {
+		alarm_msg.SendAlarmMsg("SendTemplateMsg json.Marshal Err:"+err.Error(), 1)
+		return err
+	}
+	body := ioutil.NopCloser(strings.NewReader(string(postData)))
+	client := &http.Client{}
+	req, err := http.NewRequest("POST", wx_app.SendWxTemplateMsgUrl, body)
+	if err != nil {
+		alarm_msg.SendAlarmMsg("SendTemplateMsg http.NewRequest Err:"+err.Error(), 1)
+		return err
+	}
+	contentType := "application/json;charset=utf-8"
+	req.Header.Set("Content-Type", contentType)
+	req.Header.Set("Authorization", utils.SendTemplateMsgAuthorization)
+	resp, err := client.Do(req)
+	if err != nil {
+		fmt.Println("http client.Do Err:" + err.Error())
+		return err
+	}
+	defer resp.Body.Close()
+	b, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		return err
+	}
+	result := new(response.BaseResponse)
+	err = json.Unmarshal(b, &result)
+	if err != nil {
+		return err
+	}
+	if result.Ret != 200 {
+		err = errors.New(string(b))
+		return err
+	}
+	return
+}
+
 // TemplateMsgSendClient.SendMsg 推送消息
 func (c *TemplateMsgSendClient) SendMsg() (sendRes *SendTemplateResponse, err error) {
 	// 请求接口
@@ -208,31 +265,51 @@ func SendQuestionReplyWxMsg(questionId, userId int, questionTitle string) (err e
 		UserId: userId,
 	})
 
-	sendMap := make(map[string]interface{})
-	sendData := make(map[string]interface{})
+	//sendMap := make(map[string]interface{})
+	//sendData := make(map[string]interface{})
 
 	first := "您好,您的提问已被回复"
 	keyword1 := questionTitle
 	keyword2 := "待查看"
 	remark := "请点击详情查看回复"
 
-	sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
-	sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
-	sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
-	sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
-
-	sendMap["template_id"] = TemplateIdWithCommunityQuestion
-	sendMap["data"] = sendData
-
+	//sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
+	//sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
+	//sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
+	//sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
+	//
+	//sendMap["template_id"] = TemplateIdWithCommunityQuestion
+	//sendMap["data"] = sendData
+	//
 	wxAppPath := fmt.Sprintf("pages-question/answerDetail?id=%d", questionId)
 	if global.CONFIG.Serve.RunMode == "debug" {
 		// 仅测试环境测试用
 		wxAppPath = "pages-report/reportDetail?reportId=3800"
 	}
-	if wxAppPath != "" {
-		sendMap["miniprogram"] = map[string]interface{}{"appid": WxYbAppId, "pagepath": wxAppPath}
+	//if wxAppPath != "" {
+	//	sendMap["miniprogram"] = map[string]interface{}{"appid": WxYbAppId, "pagepath": wxAppPath}
+	//}
+	//err = SendMultiTemplateMsg(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION)
+
+	openIdArr := make([]string, len(openIdList))
+	for i, v := range openIdList {
+		openIdArr[i] = v.OpenId
 	}
-	err = SendMultiTemplateMsg(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION)
+
+	sendInfo := new(SendWxTemplate)
+	sendInfo.First = first
+	sendInfo.Keyword1 = keyword1
+	sendInfo.Keyword2 = keyword2
+	sendInfo.Remark = remark
+	sendInfo.RedirectUrl = wxAppPath
+	sendInfo.TemplateId = TemplateIdWithCommunityQuestion
+	sendInfo.RedirectTarget = 1
+	sendInfo.Resource = wxAppPath
+	sendInfo.SendType = utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION
+	sendInfo.OpenIdArr = openIdArr
+
+	err = SendTemplateMsg(sendInfo)
+
 	return
 }
 
@@ -261,31 +338,51 @@ func SendVoiceBroadcastWxMsg(broadcastId int, sectionName, broadcastName string)
 	//			OpenId: "oN0jD1cuiBLxV1IRpu74_oHnoOjk",
 	//			UserId: 52709,
 	//		})
-	sendMap := make(map[string]interface{})
-	sendData := make(map[string]interface{})
+	//sendMap := make(map[string]interface{})
+	//sendData := make(map[string]interface{})
 
 	first := "您好,有新的语音播报待查看"
 	keyword1 := sectionName + ":" + broadcastName
 	keyword2 := "待查看"
 	remark := "请点击详情查看"
 
-	sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
-	sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
-	sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
-	sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
+	//sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
+	//sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
+	//sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
+	//sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
 
-	sendMap["template_id"] = TemplateIdWithCommunityQuestion
-	sendMap["data"] = sendData
+	//sendMap["template_id"] = TemplateIdWithCommunityQuestion
+	//sendMap["data"] = sendData
 
 	wxAppPath := fmt.Sprintf("pages-voice/voiceDetail?voiceId=%d", broadcastId)
 	if global.CONFIG.Serve.RunMode == "debug" {
 		// 仅测试环境测试用
 		wxAppPath = "pages-report/reportDetail?reportId=3800"
 	}
-	if wxAppPath != "" {
-		sendMap["miniprogram"] = map[string]interface{}{"appid": WxYbAppId, "pagepath": wxAppPath}
+	//if wxAppPath != "" {
+	//	sendMap["miniprogram"] = map[string]interface{}{"appid": WxYbAppId, "pagepath": wxAppPath}
+	//}
+	//err = SendMultiTemplateMsgNoReturn(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_VOICE_BROADCAST)
+
+	openIdArr := make([]string, len(openIdList))
+	for i, v := range openIdList {
+		openIdArr[i] = v.OpenId
 	}
-	err = SendMultiTemplateMsgNoReturn(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_VOICE_BROADCAST)
+
+	sendInfo := new(SendWxTemplate)
+	sendInfo.First = first
+	sendInfo.Keyword1 = keyword1
+	sendInfo.Keyword2 = keyword2
+	sendInfo.Remark = remark
+	sendInfo.RedirectUrl = wxAppPath
+	sendInfo.TemplateId = TemplateIdWithCommunityQuestion
+	sendInfo.RedirectTarget = 1
+	sendInfo.Resource = wxAppPath
+	sendInfo.SendType = utils.TEMPLATE_MSG_YB_VOICE_BROADCAST
+	sendInfo.OpenIdArr = openIdArr
+
+	err = SendTemplateMsg(sendInfo)
+
 	return
 }
 
@@ -362,31 +459,51 @@ func SendQuestionToAdmin(questionId, userId int, questionTitle string) (err erro
 		UserId: userId,
 	})
 
-	sendMap := make(map[string]interface{})
-	sendData := make(map[string]interface{})
+	//sendMap := make(map[string]interface{})
+	//sendData := make(map[string]interface{})
 
 	first := "您好,有新的提问待分配"
 	keyword1 := questionTitle
 	keyword2 := "待查看"
 	remark := "请点击详情查看回复"
 
-	sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
-	sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
-	sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
-	sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
+	//sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
+	//sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
+	//sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
+	//sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
 
-	sendMap["template_id"] = TemplateIdWithCommunityQuestion
-	sendMap["data"] = sendData
+	//sendMap["template_id"] = TemplateIdWithCommunityQuestion
+	//sendMap["data"] = sendData
 
 	wxAppPath := fmt.Sprintf("/pages-question/detail/index?type=question&id=%d", questionId)
 	if global.CONFIG.Serve.RunMode == "debug" {
 		// 仅测试环境测试用
 		wxAppPath = "pages-approve/seal/list"
 	}
-	if wxAppPath != "" {
-		sendMap["miniprogram"] = map[string]interface{}{"appid": WxMobileCrmAppId, "pagepath": wxAppPath}
+	//if wxAppPath != "" {
+	//	sendMap["miniprogram"] = map[string]interface{}{"appid": WxMobileCrmAppId, "pagepath": wxAppPath}
+	//}
+	//err = SendMultiTemplateMsg(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION)
+
+	openIdArr := make([]string, len(openIdList))
+	for i, v := range openIdList {
+		openIdArr[i] = v.OpenId
 	}
-	err = SendMultiTemplateMsg(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION)
+
+	sendInfo := new(SendWxTemplate)
+	sendInfo.First = first
+	sendInfo.Keyword1 = keyword1
+	sendInfo.Keyword2 = keyword2
+	sendInfo.Remark = remark
+	sendInfo.RedirectUrl = wxAppPath
+	sendInfo.TemplateId = TemplateIdWithCommunityQuestion
+	sendInfo.RedirectTarget = 2
+	sendInfo.Resource = wxAppPath
+	sendInfo.SendType = utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION
+	sendInfo.OpenIdArr = openIdArr
+
+	err = SendTemplateMsg(sendInfo)
+
 	return
 }
 
@@ -423,30 +540,49 @@ func SendQuestionCommentToAdmin(commentId, userId int, commentContent string) (e
 		UserId: userId,
 	})
 
-	sendMap := make(map[string]interface{})
-	sendData := make(map[string]interface{})
+	//sendMap := make(map[string]interface{})
+	//sendData := make(map[string]interface{})
 
 	first := "您好,有新的评论待查看"
 	keyword1 := commentContent
 	keyword2 := "待查看"
 	remark := "请点击详情查看回复"
 
-	sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
-	sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
-	sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
-	sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
+	//sendData["first"] = map[string]interface{}{"value": first, "color": "#173177"}
+	//sendData["keyword1"] = map[string]interface{}{"value": keyword1, "color": "#173177"}
+	//sendData["keyword2"] = map[string]interface{}{"value": keyword2, "color": "#173177"}
+	//sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
 
-	sendMap["template_id"] = TemplateIdWithCommunityQuestion
-	sendMap["data"] = sendData
+	//sendMap["template_id"] = TemplateIdWithCommunityQuestion
+	//sendMap["data"] = sendData
 
 	wxAppPath := fmt.Sprintf("/pages-question/detail/index?type=comment&id=%d", commentId)
 	if global.CONFIG.Serve.RunMode == "debug" {
 		// 仅测试环境测试用
 		wxAppPath = "pages-approve/seal/list"
 	}
-	if wxAppPath != "" {
-		sendMap["miniprogram"] = map[string]interface{}{"appid": WxMobileCrmAppId, "pagepath": wxAppPath}
+	//if wxAppPath != "" {
+	//	sendMap["miniprogram"] = map[string]interface{}{"appid": WxMobileCrmAppId, "pagepath": wxAppPath}
+	//}
+	//err = SendMultiTemplateMsg(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION)
+
+	openIdArr := make([]string, len(openIdList))
+	for i, v := range openIdList {
+		openIdArr[i] = v.OpenId
 	}
-	err = SendMultiTemplateMsg(sendMap, openIdList, wxAppPath, utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION)
+
+	sendInfo := new(SendWxTemplate)
+	sendInfo.First = first
+	sendInfo.Keyword1 = keyword1
+	sendInfo.Keyword2 = keyword2
+	sendInfo.Remark = remark
+	sendInfo.RedirectUrl = wxAppPath
+	sendInfo.TemplateId = TemplateIdWithCommunityQuestion
+	sendInfo.RedirectTarget = 2
+	sendInfo.Resource = wxAppPath
+	sendInfo.SendType = utils.TEMPLATE_MSG_YB_COMMUNITY_QUESTION
+	sendInfo.OpenIdArr = openIdArr
+
+	err = SendTemplateMsg(sendInfo)
 	return
 }

+ 3 - 0
services/wx_app/wx_app.go

@@ -20,6 +20,7 @@ var (
 	WxAppSecret string
 	WxPlatform  int    //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1
 	EnvVersion  string // 小程序版本, release-正式版; trial-体验版; develop-开发版
+	SendWxTemplateMsgUrl string
 )
 
 func init() {
@@ -29,8 +30,10 @@ func init() {
 	WxPlatform = 6 //弘则研报来源
 	if global.CONFIG.Serve.RunMode == "release" {
 		EnvVersion = "release"
+		SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
 	} else {
 		EnvVersion = "trial"
+		SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
 	}
 }
 

+ 4 - 0
utils/constants.go

@@ -189,3 +189,7 @@ var SystemSourceList = []int{
 	DATA_SOURCE_PYTHON,               //python代码->27
 	DATA_SOURCE_PREDICT,              //预测指标->30
 }
+
+const (
+	SendTemplateMsgAuthorization = "dc855fce962a639faa779cbdd4cd332f"
+)