|
|
@ -25,6 +25,30 @@ func HandleSuccess(param *OrderDelayQueueParam) (err error) { |
|
|
|
if err != nil { |
|
|
|
return errors.New("更新状态发送错误") |
|
|
|
} |
|
|
|
customerOrder.GetByOutTradeNO(param.Order.OutTradeNo) |
|
|
|
if customerOrder.Status != 1 { |
|
|
|
return errors.New("商品订单状态信息出现异常") |
|
|
|
} |
|
|
|
subs, err := models.GetCustomerOrderSubsByOrderNos(customerOrder.OrderNo) |
|
|
|
if err != nil { |
|
|
|
logger.Error("商品子订单查询异常", err) |
|
|
|
return err |
|
|
|
} |
|
|
|
for _, sub := range subs { |
|
|
|
err = im_service.SendGroupCustomMessage(customerOrder.BuyerId, param.Order.ActivityId, im_service.NoticeLiveGoodBuy, |
|
|
|
map[string]interface{}{ |
|
|
|
"goods_pic_url": sub.GoodsPicUrl, |
|
|
|
"goods_num": sub.GoodsNum, |
|
|
|
"good_name": sub.GoodName, |
|
|
|
"good_price": sub.GoodPrice, |
|
|
|
"goods_id": sub.GoodsId, |
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
logger.Error("直播商品子订单信息发送异常异常", err) |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
|
exist, err = models.GetById(activity, param.Order.ActivityId) |
|
|
@ -47,6 +71,7 @@ func HandleSuccess(param *OrderDelayQueueParam) (err error) { |
|
|
|
prize.PrizeImg = gift.GiftPicUrl |
|
|
|
prize.PrizeType = 4 |
|
|
|
prize.IsDelete = false |
|
|
|
prize.Status = 1 |
|
|
|
prize.CreatedAt = time.Now() |
|
|
|
prize.UpdatedAt = time.Now() |
|
|
|
if exist { |
|
|
@ -86,15 +111,6 @@ func HandleSuccess(param *OrderDelayQueueParam) (err error) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
user := new(models.User) |
|
|
|
exist, err = models.GetById(user, info.UserId) |
|
|
|
if err != nil || !exist { |
|
|
|
err = fmt.Errorf("直播红包用户信息异常: err-> %v, exist->%v, status->%v, out_trade_no->%v", |
|
|
|
err, exist, info.Status, param.Order.OutTradeNo) |
|
|
|
logger.Error(err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
err = im_service.SendGroupCustomMessage(info.UserId, param.Order.ActivityId, im_service.NoticeLiveRedPackStart, |
|
|
|
map[string]interface{}{ |
|
|
|
"live_red_envelope_rule_id": info.Id, |
|
|
|