From 8a262667f1d32a000351c99e31a692ff18be76d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 23 Oct 2024 14:55:27 +0800 Subject: [PATCH] 1 --- business/jxutils/unipush/push.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/business/jxutils/unipush/push.go b/business/jxutils/unipush/push.go index bc63351de..57c729826 100644 --- a/business/jxutils/unipush/push.go +++ b/business/jxutils/unipush/push.go @@ -52,8 +52,9 @@ func NotifyNewOrder(order *model.GoodsOrder) { msg.StoreTitle = storeDetail.Name msg.Context = "老板,你有新的订单了!" msg.VendorOrderId = order.VendorOrderID + msg.StoreId = storeId context, _ := json.Marshal(msg) - body := fmt.Sprintf(msg.Context+"门店ID:%d"+"(%s)", storeId, model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单") + body := msg.Context + fmt.Sprintf("门店ID:%d(%s)", storeId, model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单") pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder, FlagOrder) } @@ -82,8 +83,9 @@ func NotifyAdjustOrder(order *model.GoodsOrder) { msg.StoreTitle = storeDetail.Name msg.Context = "老板,用户修改订单信息!" msg.VendorOrderId = order.VendorOrderID + msg.StoreId = storeId context, _ := json.Marshal(msg) - body := fmt.Sprintf("用户调整了:"+msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单,请注意拣货") + body := "用户调整了:" + msg.Context + fmt.Sprintf("(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单,请注意拣货") pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder, FlagOrder) } @@ -110,8 +112,9 @@ func NotifyAfsOrder(afsOrder *model.AfsOrder) (err error) { msg.OrderSqs = afsOrder.VendorOrderID msg.StoreTitle = storeDetail.Name msg.Context = "老板订单申请退款了!" + msg.StoreId = storeId context, _ := json.Marshal(msg) - body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[afsOrder.VendorID]+"#"+msg.OrderSqs+"号订单") + body := msg.Context + fmt.Sprintf("(%s)", model.VendorChineseNames[afsOrder.VendorID]+"#"+msg.OrderSqs+"号订单") pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewAfsOrder, FlagOrder) return err } @@ -139,8 +142,9 @@ func NotifyOrderCanceled(order *model.GoodsOrder) (err error) { msg.OrderSqs = utils.Int2Str(order.OrderSeq) msg.StoreTitle = storeDetail.Name msg.Context = "老板订单被取消了!" + msg.StoreId = storeId context, _ := json.Marshal(msg) - body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单") + body := msg.Context + fmt.Sprintf("(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单") pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewCancelOrder, FlagOrder) return err } @@ -167,8 +171,9 @@ func NotifyImNewMessage(vendorStoreID string, vendorID int, offMsg string) error msg.VendorName = model.VendorChineseNames[vendorID] msg.StoreTitle = store.Name msg.Context = offMsg + msg.StoreId = store.ID context, _ := json.Marshal(msg) - body := fmt.Sprintf("老板,你有新的用户消息,请及时查看!"+"(%s)", model.VendorChineseNames[vendorID]) + body := "老板,你有新的用户消息,请及时查看!" + fmt.Sprintf("(%s)", model.VendorChineseNames[vendorID]) pushMsgByUniApp(store.ID, store.Name, cid, string(context), body, SoundsFileNewImMsg, FlagIm) return err } @@ -203,6 +208,7 @@ func GetStoreBoosCID(storeId int) ([]string, error) { type MsgContext struct { MsgType string `json:"msg_type"` // 订单类型[新订单/售后单/取消单] StoreTitle string `json:"store_title"` // 门店名称 + StoreId int `json:"store_id"` // 门店ID Context string `json:"context"` // 消息文本 VendorName string `json:"vendor_name"` // 平台名称 OrderSqs string `json:"order_sqs"` // 订单流水号