|
@@ -393,7 +393,9 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
|
@@ -393,7 +393,9 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
393
|
e := fmt.Sprintf("获取管理员用户(id=%d)数据失败,%s", adminId, err)
|
393
|
e := fmt.Sprintf("获取管理员用户(id=%d)数据失败,%s", adminId, err)
|
394
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
|
394
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
|
395
|
}
|
395
|
}
|
396
|
- var payEvents []event.PayOrderGoodBonus
|
396
|
+ var (
|
|
|
397
|
+ payEvents []event.PayOrderGoodBonus
|
|
|
398
|
+ )
|
397
|
for _, orderId := range orderIds {
|
399
|
for _, orderId := range orderIds {
|
398
|
var oldOrder *domain.OrderBase
|
400
|
var oldOrder *domain.OrderBase
|
399
|
oldOrder, err = orderBaseReponsitory.FindOne(domain.OrderBaseFindOneQuery{OrderId: orderId})
|
401
|
oldOrder, err = orderBaseReponsitory.FindOne(domain.OrderBaseFindOneQuery{OrderId: orderId})
|
|
@@ -440,7 +442,6 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
|
@@ -440,7 +442,6 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
440
|
if err != nil {
|
442
|
if err != nil {
|
441
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
443
|
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
442
|
}
|
444
|
}
|
443
|
- }
|
|
|
444
|
//构建事件
|
445
|
//构建事件
|
445
|
payEvent := event.PayOrderGoodBonus{
|
446
|
payEvent := event.PayOrderGoodBonus{
|
446
|
OrderBase: oldOrder,
|
447
|
OrderBase: oldOrder,
|
|
@@ -449,8 +450,11 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
|
@@ -449,8 +450,11 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i |
449
|
}
|
450
|
}
|
450
|
payEvents = append(payEvents, payEvent)
|
451
|
payEvents = append(payEvents, payEvent)
|
451
|
}
|
452
|
}
|
|
|
453
|
+ }
|
|
|
454
|
+ if len(payEvents) > 0 {
|
452
|
if err = serve.Publish(event.BatchPayOrderGoodBonus(payEvents)); err != nil {
|
455
|
if err = serve.Publish(event.BatchPayOrderGoodBonus(payEvents)); err != nil {
|
453
|
return err
|
456
|
return err
|
454
|
}
|
457
|
}
|
|
|
458
|
+ }
|
455
|
return nil
|
459
|
return nil
|
456
|
} |
460
|
} |