duxin il y a 11 mois
Parent
commit
aea2532a65

+ 4 - 2
rpc/internal/common/newSendMsgService.go

@@ -197,7 +197,9 @@ func Update(ids []string, msgLogId int64) {
 	for row.Next() {
 		var userId string
 		_ = row.Scan(&userId)
-		userMap[userId] = true
+		if userId != "" {
+			userMap[userId] = true
+		}
 	}
 
 	if len(userMap) == len(ids) {
@@ -320,7 +322,7 @@ func SentWxTmplAndAppPush(this WxTmplAndPush, v string, group_id int, equityName
 			err = p.SendMsg(this.WxPushUrl, this.Title, this.Content, nTime, this.Row4, "")
 		}
 		if err != nil {
-			logx.Error(fmt.Sprintf("SendWxTmplMsg uId %s  Error %s", v, err.Error()))
+			logx.Error(fmt.Sprintf("SendWxTmplMsg uId %s  Error %s this.MsgType:%d", v, err.Error(), this.MsgType))
 		} else {
 			logx.Infof("SendWxTmplMsg uId success %s ", v)
 		}

+ 2 - 1
rpc/internal/common/sendWxTmplMsg.go

@@ -128,7 +128,8 @@ func GetWxTmplConfig(msgType int64) (*WxTmplConfig, error) {
 
 func (stm *WxTmplPush) SendMsg(link, title, detail, date, row4 string, note string) error {
 	if stm.Config == nil || stm.Config.TmplId == "" || (stm.MgoId != "" && stm.OpenId != "" && stm.Position != "") || link == "" {
-		return fmt.Errorf("缺少参数 stm.Config.TmplId:%v stm.MgoId:%v  stm.OpenId:%v stm.Position:%v link:%v ", stm.Config.TmplId, stm.MgoId, stm.OpenId, stm.Position, link)
+		log.Println("err=====", stm.Config, stm.MgoId, stm.OpenId, link, AllMsgType())
+		return fmt.Errorf("缺少参数 stm.Config:%v stm.MgoId:%v  stm.OpenId:%v stm.Position:%v link:%v ", stm.Config, stm.MgoId, stm.OpenId, stm.Position, link)
 	}
 	// 校验推送是否开启
 	if err := stm.getUserOpenIdAndWxPushState(); err != nil {