作者 唐旭辉

更新

... ... @@ -15,10 +15,13 @@ var _ domain.DomainEventSubscriber = (*OrderLogSubscriber)(nil)
func (subscriber *OrderLogSubscriber) HandleEvent(domainEvent domain.DomainEvent) error {
switch domainEvent.EventType() {
//订单分红因为货品的数量变动而发送改变
case event.UPDATE_BONUS_BY_GOOD_NUMBER_EVENT:
//订单分红因为合伙人分红比例变动而发送改变
case event.UPDATE_BONUS_BY_PARTENT_BONUS_PERCENT_EVENT:
//更新订单的备注
case event.UPDATE_ORDER_REMARK:
// 支付订单中货品的分红
case event.PAY_ORDER_GOOD_BONUS_EVENT:
}
return nil
... ...
... ... @@ -915,6 +915,10 @@ func (service OrderInfoService) buildOrderBestshopInfoData(orderBase *domain.Ord
"phone": orderBestshop.BuyerPhone,
"orderTime": orderBestshop.OrderTime,
"shippingStatus": orderBestshop.DeliveryState,
"partnerDividends": orderBase.GetCurrentPartnerBonus(),
"receivedDividends": orderBase.OrderCompute.PartnerBonusHas,
"notReceivedDividend": orderBase.OrderCompute.PartnerBonusNot,
"dividendSpending": orderBase.OrderCompute.PartnerBonusExpense,
}
//订单中的商品
product := map[string]interface{}{
... ...
package event
const (
//支付订单中货品的分红
PAY_ORDER_GOOD_BONUS_EVENT string = "PayOrderGoodBonus"
)
... ...
... ... @@ -72,7 +72,7 @@ type OrderCompute struct {
}
type OrderBaseRemark struct {
Remark string
RemarkBonus string `json:"remarkBonus"`
}
//OrderBase 订单基础
... ...
package service
type OrderBonusService interface {
UpdateBounsByGoodNumber(orderId int64, adminId int64, goodWithNumber map[int64]int) error
UpdateBounsByPartnerBonusPercent(orderId int64, adminId int64, goodWithPercent map[int]float64) error
UpdateBounsByGoodNumber(orderId int64, adminId int64, goodWithNumber int) error
UpdateBounsByPartnerBonusPercent(orderId int64, adminId int64, partnerPercent float64) error
UpdateOrderRemark(orderId int64, adminId int64, remark string) error
PayOrderGoodBonus(orderId int64, goodId int64, adminId int64) error
}
... ...
... ... @@ -6,6 +6,7 @@ import (
coreDomain "github.com/linmadan/egglib-go/core/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain/event"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain/service"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/repository"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib"
... ... @@ -17,8 +18,10 @@ type OrderBonusServices struct {
transactionContext *transaction.TransactionContext
}
var _ service.OrderBonusService = (*OrderBonusServices)(nil)
//UpdateBounsWithGoodNumber 分红时,因修改订单中商品的数量发生分红变动
func (serve OrderBonusServices) UpdateBounsByGoodNumber(orderId int64, adminId int64, goodWithNumber map[int64]int) error {
func (serve *OrderBonusServices) UpdateBounsByGoodNumber(orderId int64, adminId int64, goodWithNumber int) error {
var (
userRepository domain.UsersRepository
orderBaseReponsitory domain.OrderBaseRepository
... ... @@ -66,7 +69,7 @@ func (serve OrderBonusServices) UpdateBounsByGoodNumber(orderId int64, adminId i
}
//UpdateBounsByPartnerBonusPercent 分红时,因修改订单中商品的合伙人分行比例发生分红变动
func (serve OrderBonusServices) UpdateBounsByPartnerBonusPercent(orderId int64, adminId int64, goodWithPercent map[int]float64) error {
func (serve *OrderBonusServices) UpdateBounsByPartnerBonusPercent(orderId int64, adminId int64, partnerPercent float64) error {
var (
userRepository domain.UsersRepository
orderBaseReponsitory domain.OrderBaseRepository
... ... @@ -114,7 +117,7 @@ func (serve OrderBonusServices) UpdateBounsByPartnerBonusPercent(orderId int64,
}
//PayOrderGoodBonus 支付订单中货品的分红
func (serve OrderBonusServices) PayOrderGoodBonus(orderId int64, goodId int64, adminId int64) error {
func (serve *OrderBonusServices) PayOrderGoodBonus(orderId int64, goodId int64, adminId int64) error {
var (
userRepository domain.UsersRepository
orderBaseReponsitory domain.OrderBaseRepository
... ... @@ -158,3 +161,7 @@ func (serve OrderBonusServices) PayOrderGoodBonus(orderId int64, goodId int64, a
}
return nil
}
func (serve *OrderBonusServices) UpdateOrderRemark(orderId int64, adminId int64, remark string) error {
return nil
}
... ...
... ... @@ -79,7 +79,7 @@ func (c *OrderDividendController) PageListOrderDividend() {
"id": orderinfo.Id,
"shipmentsId": orderinfo.DeliveryCode,
"partner": orderinfo.PartnerInfo.PartnerName,
"dividendsReceivable": orderinfo.OrderCompute.PlanPartnerBonus,
"dividendsReceivable": orderinfo.GetCurrentPartnerBonus(),
"dividendSpending": orderinfo.OrderCompute.PartnerBonusExpense,
"receiveDividends": orderinfo.OrderCompute.PartnerBonusHas,
"uncollectedDividends": orderinfo.OrderCompute.PartnerBonusNot,
... ... @@ -88,9 +88,6 @@ func (c *OrderDividendController) PageListOrderDividend() {
"orderTypeName": domain.GetOrderBaseTypeName(orderinfo.OrderType),
"orderNumber": orderinfo.OrderCode,
}
if orderinfo.OrderCompute.UsePartnerBonus >= 0 {
m["dividendsReceivable"] = orderinfo.OrderCompute.UsePartnerBonus
}
rsp = append(rsp, m)
}
c.ResponsePageList(rsp, cnt, param.PageNumber)
... ...