This commit is contained in:
邹宗楠
2024-10-23 14:55:27 +08:00
parent 1d35e43ee6
commit 8a262667f1

View File

@@ -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"` // 订单流水号