|
@@ -2,6 +2,7 @@ package common
|
|
|
|
|
|
import (
|
|
import (
|
|
"app.yhyue.com/moapp/MessageCenter/entity"
|
|
"app.yhyue.com/moapp/MessageCenter/entity"
|
|
|
|
+ "app.yhyue.com/moapp/MessageCenter/rpc/internal/config"
|
|
"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
|
|
"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"context"
|
|
"context"
|
|
@@ -94,7 +95,7 @@ func NewUserSendMsg(in *message.NewUserInsertMsgReq) string {
|
|
OrderMoney: in.OrderMoney,
|
|
OrderMoney: in.OrderMoney,
|
|
Row4: in.Row4,
|
|
Row4: in.Row4,
|
|
}
|
|
}
|
|
- SentWxTmplAndAppPush(pushData, v, group_id)
|
|
|
|
|
|
+ SentWxTmplAndAppPush(pushData, v, group_id, "", "")
|
|
}(userIdArr[i], positionId)
|
|
}(userIdArr[i], positionId)
|
|
}
|
|
}
|
|
wg.Wait()
|
|
wg.Wait()
|
|
@@ -121,6 +122,18 @@ func UpdateUserMsgSummary(in *message.BitmapSaveMsgReq) error {
|
|
if err1 != nil {
|
|
if err1 != nil {
|
|
return err1
|
|
return err1
|
|
}
|
|
}
|
|
|
|
+ //p459 特殊处理 传过来的消息内容格式为 消息内容#jy#微信模板项目名称#jy#服务地址
|
|
|
|
+ equityName, equityAddr := "", ""
|
|
|
|
+ if in.MsgType == config.ConfigJson.EquityInfoMsgType {
|
|
|
|
+ equityRs := strings.Split(in.Content, "#jy#")
|
|
|
|
+ if len(equityRs) != 3 {
|
|
|
|
+ log.Println("消息内容格式有误:", in.Content)
|
|
|
|
+ return errors.New("无效的消息内容格式")
|
|
|
|
+ }
|
|
|
|
+ in.Content = equityRs[0]
|
|
|
|
+ equityName = equityRs[1]
|
|
|
|
+ equityAddr = equityRs[2]
|
|
|
|
+ }
|
|
for i := 0; i < len(userIdArr); i++ {
|
|
for i := 0; i < len(userIdArr); i++ {
|
|
if userIdArr[i] == "" {
|
|
if userIdArr[i] == "" {
|
|
continue
|
|
continue
|
|
@@ -149,7 +162,7 @@ func UpdateUserMsgSummary(in *message.BitmapSaveMsgReq) error {
|
|
OrderMoney: in.OrderMoney,
|
|
OrderMoney: in.OrderMoney,
|
|
Row4: in.Row4,
|
|
Row4: in.Row4,
|
|
}
|
|
}
|
|
- SentWxTmplAndAppPush(pushData, v, group_id)
|
|
|
|
|
|
+ SentWxTmplAndAppPush(pushData, v, group_id, equityName, equityAddr)
|
|
}(userIdArr[i])
|
|
}(userIdArr[i])
|
|
}
|
|
}
|
|
wg.Wait()
|
|
wg.Wait()
|
|
@@ -180,7 +193,7 @@ type WxTmplAndPush struct {
|
|
SendUserId string
|
|
SendUserId string
|
|
}
|
|
}
|
|
|
|
|
|
-func SentWxTmplAndAppPush(this WxTmplAndPush, v string, group_id int) {
|
|
|
|
|
|
+func SentWxTmplAndAppPush(this WxTmplAndPush, v string, group_id int, equityName, equityAddr string) {
|
|
nTime := time.Now().Format("2006-01-02 15:04:05")
|
|
nTime := time.Now().Format("2006-01-02 15:04:05")
|
|
//发送消息成功,推送微信、app
|
|
//发送消息成功,推送微信、app
|
|
//fmt.Println("this.MsgType", this.MsgType)
|
|
//fmt.Println("this.MsgType", this.MsgType)
|
|
@@ -199,7 +212,12 @@ func SentWxTmplAndAppPush(this WxTmplAndPush, v string, group_id int) {
|
|
}
|
|
}
|
|
// 消息模版 工单类型 {{thing19.DATA}} 工单标题 {{thing6.DATA}} 项目名称 {{thing13.DATA}} 服务时间 {{time25.DATA}} 服务地址 {{thing26.DATA}}
|
|
// 消息模版 工单类型 {{thing19.DATA}} 工单标题 {{thing6.DATA}} 项目名称 {{thing13.DATA}} 服务时间 {{time25.DATA}} 服务地址 {{thing26.DATA}}
|
|
if this.MsgType != 1 && this.MsgType != 10 {
|
|
if this.MsgType != 1 && this.MsgType != 10 {
|
|
- err = p.SendMsg(this.WxPushUrl, this.Title, this.Content, nTime, this.Row4)
|
|
|
|
|
|
+ if this.MsgType == config.ConfigJson.EquityInfoMsgType {
|
|
|
|
+ // p459 服务地址特殊处理
|
|
|
|
+ err = p.SendMsg(this.WxPushUrl, this.Title, equityName, nTime, this.Row4, equityAddr)
|
|
|
|
+ } else {
|
|
|
|
+ err = p.SendMsg(this.WxPushUrl, this.Title, this.Content, nTime, this.Row4, "")
|
|
|
|
+ }
|
|
if err != nil {
|
|
if err != nil {
|
|
logx.Error(fmt.Sprintf("SendWxTmplMsg uId %s Error %s", v, err.Error()))
|
|
logx.Error(fmt.Sprintf("SendWxTmplMsg uId %s Error %s", v, err.Error()))
|
|
} else {
|
|
} else {
|