This commit is contained in:
邹宗楠
2024-07-24 15:25:26 +08:00
parent f09cc25e07
commit 9d73cf1cd0
4 changed files with 71 additions and 14 deletions

View File

@@ -57,6 +57,36 @@ func NotifyNewOrder(order *model.GoodsOrder) {
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder, FlagOrder)
}
// NotifyAdjustOrder 推送调整订单
func NotifyAdjustOrder(order *model.GoodsOrder) {
storeId := order.StoreID
if storeId <= model.NO {
storeId = order.JxStoreID
}
msg := MsgContext{}
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeId, 0, "")
if err != nil || storeDetail == nil {
return
}
cid, err := GetStoreBoosCID(storeId)
if err != nil {
globals.SugarLogger.Errorf("新订单推送,获取门店老板CID错误:%v", err)
return
}
msg.MsgType = "newOrder"
msg.VendorName = model.VendorChineseNames[order.VendorID]
msg.OrderSqs = utils.Int2Str(order.OrderSeq)
msg.StoreTitle = storeDetail.Name
msg.Context = "老板,用户修改订单信息!"
msg.VendorOrderId = order.VendorOrderID
context, _ := json.Marshal(msg)
body := fmt.Sprintf("用户调整了:"+msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"号订单,请注意拣货")
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder, FlagOrder)
}
func NotifyAfsOrder(afsOrder *model.AfsOrder) (err error) {
storeId := afsOrder.StoreID
if storeId <= model.NO {