Browse Source

Merge remote-tracking branch 'origin/eta/1.8.3' into debug

Roc 7 months ago
parent
commit
50fae091a1
2 changed files with 13 additions and 3 deletions
  1. 1 2
      controllers/report.go
  2. 12 1
      services/wechat_send_msg.go

+ 1 - 2
controllers/report.go

@@ -1910,11 +1910,10 @@ func (this *ReportController) SendMsg() {
 		return
 	}
 
-	fmt.Println("reportInfo.MsgIsSend :", reportInfo.MsgIsSend)
 	// 可能存在历史数据两个只推了一个所以此处加个判断
 	// 推送模板消息
 	if reportInfo.MsgIsSend == 0 {
-		services.SendMiniProgramReportWxMsg(reportInfo.Id)
+		go services.SendMiniProgramReportWxMsg(reportInfo.Id)
 	}
 
 	// 更新推送消息状态

+ 12 - 1
services/wechat_send_msg.go

@@ -15,6 +15,17 @@ import (
 	"strings"
 )
 
+type SendTemplateResponse struct {
+	Errcode int    `json:"errcode"`
+	Errmsg  string `json:"errmsg"`
+	MsgID   int    `json:"msgid"`
+}
+
+type ClearQuotaResponse struct {
+	Errcode int    `json:"errcode"`
+	Errmsg  string `json:"errmsg"`
+}
+
 // SendMiniProgramReportWxMsg 推送报告微信模板消息-小程序链接
 func SendMiniProgramReportWxMsg(reportId int) (err error) {
 	fmt.Println("推送模板消息1 services SendMsg:", reportId)
@@ -32,7 +43,7 @@ func SendMiniProgramReportWxMsg(reportId int) (err error) {
 			//go utils.SendEmail("SendMiniProgramReportWxMsg发送报告模版消息失败"+"【"+utils.APPNAME+"】"+"【"+utils.RunMode+"】"+time.Now().Format("2006-01-02 15:04:05"), "ReportId:"+reportIdStr+";"+msg+";Err:"+err.Error(), toUser)
 		}
 	}()
-	fmt.Println("推送模板消息2 services SendMsg:", reportId)
+	fmt.Println("推送模板消息 services SendMsg:", reportId)
 
 	report, err := models.GetReportByReportId(reportId)
 	if err != nil {