...
|
...
|
@@ -393,7 +393,9 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
|
|
e := fmt.Sprintf("获取管理员用户(id=%d)数据失败,%s", adminId, err)
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
|
|
|
}
|
|
|
var payEvents []event.PayOrderGoodBonus
|
|
|
var (
|
|
|
payEvents []event.PayOrderGoodBonus
|
|
|
)
|
|
|
for _, orderId := range orderIds {
|
|
|
var oldOrder *domain.OrderBase
|
|
|
oldOrder, err = orderBaseReponsitory.FindOne(domain.OrderBaseFindOneQuery{OrderId: orderId})
|
...
|
...
|
@@ -440,17 +442,19 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
|
|
if err != nil {
|
|
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
//构建事件
|
|
|
payEvent := event.PayOrderGoodBonus{
|
|
|
OrderBase: oldOrder,
|
|
|
Goods: updateGoods,
|
|
|
Admin: &adminUser,
|
|
|
}
|
|
|
payEvents = append(payEvents, payEvent)
|
|
|
}
|
|
|
//构建事件
|
|
|
payEvent := event.PayOrderGoodBonus{
|
|
|
OrderBase: oldOrder,
|
|
|
Goods: updateGoods,
|
|
|
Admin: &adminUser,
|
|
|
}
|
|
|
payEvents = append(payEvents, payEvent)
|
|
|
}
|
|
|
if err = serve.Publish(event.BatchPayOrderGoodBonus(payEvents)); err != nil {
|
|
|
return err
|
|
|
if len(payEvents) > 0 {
|
|
|
if err = serve.Publish(event.BatchPayOrderGoodBonus(payEvents)); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
}
|
|
|
return nil
|
|
|
} |
...
|
...
|
|