添加app消息推送
This commit is contained in:
@@ -74,25 +74,12 @@ func NotifyNewOrder(order *model.GoodsOrder) {
|
||||
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeId, 0, "")
|
||||
if err != nil || storeDetail == nil {
|
||||
msg.MsgType = "新订单错误"
|
||||
msg.VendorName = "错误消息通知"
|
||||
msg.OrderSqs = "1"
|
||||
msg.StoreTitle = "根据门店id获取门店详情错误"
|
||||
msg.Context = err.Error()
|
||||
context, _ := json.Marshal(msg)
|
||||
pushMsgByUniApp(99999, "门店用户cid获取错误", []string{"212db7816d26e0c603518091b96d3554"}, string(context))
|
||||
return
|
||||
}
|
||||
|
||||
cid, err := GetStoreBoosCID(storeId)
|
||||
if err != nil {
|
||||
msg.MsgType = "新订单错误"
|
||||
msg.VendorName = "错误消息通知"
|
||||
msg.OrderSqs = "1"
|
||||
msg.StoreTitle = "错误日志通知"
|
||||
msg.Context = err.Error()
|
||||
context, _ := json.Marshal(msg)
|
||||
pushMsgByUniApp(99999, "门店用户cid获取错误", []string{"212db7816d26e0c603518091b96d3554"}, string(context))
|
||||
globals.SugarLogger.Errorf("新订单推送,获取门店老板CID错误:%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -138,25 +125,12 @@ func NotifyAfsOrder(afsOrder *model.AfsOrder) (err error) {
|
||||
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeId, 0, "")
|
||||
if err != nil || storeDetail == nil {
|
||||
msg.MsgType = "售后单错误"
|
||||
msg.VendorName = "错误消息通知"
|
||||
msg.OrderSqs = "1"
|
||||
msg.StoreTitle = "根据门店id获取门店详情错误"
|
||||
msg.Context = err.Error()
|
||||
context, _ := json.Marshal(msg)
|
||||
pushMsgByUniApp(99999, "门店用户cid获取错误", []string{"212db7816d26e0c603518091b96d3554"}, string(context))
|
||||
return
|
||||
}
|
||||
|
||||
cid, err := GetStoreBoosCID(storeId)
|
||||
if err != nil {
|
||||
msg.MsgType = "售后单错误"
|
||||
msg.VendorName = "错误消息通知"
|
||||
msg.OrderSqs = "1"
|
||||
msg.StoreTitle = "错误日志通知"
|
||||
msg.Context = err.Error()
|
||||
context, _ := json.Marshal(msg)
|
||||
pushMsgByUniApp(99999, "门店用户cid获取错误", []string{"212db7816d26e0c603518091b96d3554"}, string(context))
|
||||
globals.SugarLogger.Errorf("售后单,获取门店老板CID错误:%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -180,29 +154,16 @@ func NotifyOrderCanceled(order *model.GoodsOrder) (err error) {
|
||||
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeId, 0, "")
|
||||
if err != nil || storeDetail == nil {
|
||||
msg.MsgType = "取消单错误"
|
||||
msg.VendorName = "错误消息通知"
|
||||
msg.OrderSqs = "1"
|
||||
msg.StoreTitle = "根据门店id获取门店详情错误"
|
||||
msg.Context = err.Error()
|
||||
context, _ := json.Marshal(msg)
|
||||
pushMsgByUniApp(99999, "门店用户cid获取错误", []string{"212db7816d26e0c603518091b96d3554"}, string(context))
|
||||
return
|
||||
}
|
||||
|
||||
cid, err := GetStoreBoosCID(storeId)
|
||||
if err != nil {
|
||||
msg.MsgType = "取消单错误"
|
||||
msg.VendorName = "错误消息通知"
|
||||
msg.OrderSqs = "1"
|
||||
msg.StoreTitle = "错误日志通知"
|
||||
msg.Context = err.Error()
|
||||
context, _ := json.Marshal(msg)
|
||||
pushMsgByUniApp(99999, "门店用户cid获取错误", []string{"212db7816d26e0c603518091b96d3554"}, string(context))
|
||||
globals.SugarLogger.Errorf("取消单,获取门店老板CID错误:%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
msg.MsgType = "售后订单"
|
||||
msg.MsgType = "取消订单"
|
||||
msg.VendorName = model.VendorChineseNames[order.VendorID]
|
||||
msg.OrderSqs = "0"
|
||||
msg.StoreTitle = storeDetail.Name
|
||||
|
||||
Reference in New Issue
Block a user