作者 唐旭辉

bug 修复

... ... @@ -201,10 +201,10 @@ func (service OrderInfoService) CreateNewOrder(cmd command.CreateOrderCommand) (
newOrder := &domain.OrderBase{
OrderType: cmd.OrderType, OrderCode: cmd.OrderCode,
DeliveryCode: cmd.DeliveryCode,
Buyer: &domain.Buyer{
Buyer: domain.Buyer{
BuyerName: cmd.BuyerName,
},
RegionInfo: &domain.RegionInfo{
RegionInfo: domain.RegionInfo{
RegionName: cmd.OrderRegion,
},
PartnerId: cmd.PartnerId,
... ...
... ... @@ -37,9 +37,9 @@ type OrderBase struct {
//交货编号
DeliveryCode string `json:"deliveryCode"`
//买家
Buyer *Buyer `json:"buyer"`
Buyer Buyer `json:"buyer"`
//订单区域信息
RegionInfo *RegionInfo `json:"regionInfo"`
RegionInfo RegionInfo `json:"regionInfo"`
//订单对应的合伙人
PartnerId int64 `json:"partnerId"`
PartnerInfo Partner `json:"partnerInfo"`
... ...
... ... @@ -20,9 +20,9 @@ type OrderBase struct {
//交货编号
DeliveryCode string
//买家
Buyer *domain.Buyer
Buyer domain.Buyer
//订单区域信息
RegionInfo *domain.RegionInfo
RegionInfo domain.RegionInfo
//订单对应的合伙人
PartnerId int64
//业务员抽成比例
... ...
... ... @@ -104,5 +104,8 @@ func (gateway MmmUserCenterServiceGateway) RequestUCenterLoginBySecret(secret st
}
respData := &ResponseLogin{}
err = json.Unmarshal(byteData, respData)
return respData, err
if err != nil {
return nil, fmt.Errorf("body data %s; err:%s", string(byteData), err)
}
return respData, nil
}
... ...
... ... @@ -63,8 +63,8 @@ func (c *BusinessBonusController) ListBusinessBonus() {
func (c *BusinessBonusController) UpdateBusinessBonus() {
type Parameter struct {
Id int64 `json:"id"`
DividendsReceivable string `json:"dividendsReceivable"`
StateOfPayment string `json:"stateOfPayment"`
DividendsReceivable float64 `json:"dividendsReceivable"`
StateOfPayment int8 `json:"stateOfPayment"`
}
var (
param Parameter
... ... @@ -79,6 +79,9 @@ func (c *BusinessBonusController) UpdateBusinessBonus() {
srv := businessService.NewBusinessBonusService(nil)
err = srv.UpdateBusinessBonus(businessCommand.UpdateBusinessBonusCommand{
CompanyId: companyId,
Id: param.Id,
Bonus: param.DividendsReceivable,
BonusStatus: param.StateOfPayment,
})
if err != nil {
c.ResponseError(err)
... ...
... ... @@ -33,9 +33,9 @@ func init() {
beego.NSRouter("/edit", &controllers.OrderDividendController{}, "POST:EditOrderDividend"),
beego.NSRouter("/detail", &controllers.OrderDividendController{}, "POST:OrderDividendDetail"),
beego.NSRouter("business/detail", &controllers.BusinessBonusController{}, "POST:GetBusinessBonus"),
beego.NSRouter("business/edit", &controllers.BusinessBonusController{}, "POST:UpdateBusinessBonus"),
beego.NSRouter("business/list", &controllers.BusinessBonusController{}, "POST:ListBusinessBonus"),
beego.NSRouter("/business/detail", &controllers.BusinessBonusController{}, "POST:GetBusinessBonus"),
beego.NSRouter("/business/edit", &controllers.BusinessBonusController{}, "POST:UpdateBusinessBonus"),
beego.NSRouter("/business/list", &controllers.BusinessBonusController{}, "POST:ListBusinessBonus"),
),
beego.NSNamespace("/order",
beego.NSRouter("/purpose/list", &controllers.OrderInfoController{}, "POST:PageListOrderPurpose"),
... ...