From b21846f0d3f9a13084bd30b73dc7a1a248a3de30 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 8 May 2019 09:48:04 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=8E=BB=E6=8E=89order=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E6=97=A0=E7=94=A8=E7=9A=84=E4=B8=80=E4=BA=9B=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/order.go | 9 --------- business/partner/purchase/ebai/order.go | 1 - business/partner/purchase/elm/order.go | 21 --------------------- business/partner/purchase/jd/order.go | 7 ------- business/partner/purchase/mtwm/order.go | 1 - 5 files changed, 39 deletions(-) diff --git a/business/model/order.go b/business/model/order.go index ba182961e..a85fbfa45 100644 --- a/business/model/order.go +++ b/business/model/order.go @@ -50,13 +50,6 @@ type GoodsOrder struct { OriginalData string `orm:"-" json:"-"` // 只是用于传递数据 Skus []*OrderSku `orm:"-" json:"-"` Flag int8 `json:"flag"` //非运单调整相关的其它状态 - SkuPmFee int64 `json:"-"` //门店商品活动总支出 - OrderPmFee int64 `json:"-"` //门店订单活动支出 - SkuPmSubsidy int64 `json:"-"` //平台商品活动总补贴 - OrderPmSubsidy int64 `json:"-"` //平台订单活动补贴 - BoxFee int64 `json:"-"` //餐盒费 - PlatformFeeRate int16 `json:"-"` //平台费 - BillStoreFreightFee int64 `json:"-"` //需要回调,门店所承担的运费 } func (o *GoodsOrder) TableUnique() [][]string { @@ -98,8 +91,6 @@ type OrderSku struct { SkuType int `json:"skuType"` // 当前如果为gift就为1,否则缺省为0 PromotionType int `json:"promotionType"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换 OrderCreatedAt time.Time `orm:"type(datetime);index" json:"-"` // 分区考虑 - SkuPmSubsidy int64 `json:"-"` //平台商品活动补贴 - SkuPmFee int64 `json:"-"` //门店商品活动支出 } // 同样商品在一个订单中可能重复出现(比如搞活动时,相同商品价格不一样,第一个有优惠) diff --git a/business/partner/purchase/ebai/order.go b/business/partner/purchase/ebai/order.go index 2776bf49a..ba892870f 100644 --- a/business/partner/purchase/ebai/order.go +++ b/business/partner/purchase/ebai/order.go @@ -214,7 +214,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo order.Skus = append(order.Skus, sku) } jxutils.RefreshOrderSkuRelated(order) - // setOrederDetailFee(result, order) return order } diff --git a/business/partner/purchase/elm/order.go b/business/partner/purchase/elm/order.go index 039482988..fb3c1cd35 100644 --- a/business/partner/purchase/elm/order.go +++ b/business/partner/purchase/elm/order.go @@ -193,30 +193,9 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo } } jxutils.RefreshOrderSkuRelated(order) - setOrederDetailFee(result, order) return order } -func setOrederDetailFee(result map[string]interface{}, order *model.GoodsOrder) { - orderActivities, ok := result["orderActivities"].([]interface{}) - if ok { - for _, value := range orderActivities { - activity := value.(map[string]interface{}) - categoryId := utils.MustInterface2Int64(activity["categoryId"]) - restaurantPart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["restaurantPart"])) - elemePart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["elemePart"])) - if _, ok := model.ElmSkuPromotion[int(categoryId)]; ok { - order.SkuPmFee += restaurantPart - order.SkuPmSubsidy += elemePart - } else { - order.OrderPmFee += restaurantPart - order.OrderPmSubsidy += elemePart - } - } - } - order.PlatformFeeRate = int16(utils.MustInterface2Float64(result["serviceRate"])) -} - // func (c *PurchaseHandler) onOrderNew(msg map[string]interface{}) (response *elmapi.CallbackResponse) { // todo 这里应该可以直接用msg里的内容,而不用再次去查 diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index e7776ceca..aa3f178ad 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -155,16 +155,9 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo order.Skus = append(order.Skus, sku) } jxutils.RefreshOrderSkuRelated(order) - setOrederDetailFee(result, order) return order } -func setOrederDetailFee(result map[string]interface{}, order *model.GoodsOrder) { - order.BoxFee = utils.Interface2Int64WithDefault(result["packagingMoney"], 0) - order.PlatformFeeRate = model.JdPlatformFeeRate - order.BillStoreFreightFee = utils.Interface2Int64WithDefault(result["merchantPaymentDistanceFreightMoney"], 0) + utils.Interface2Int64WithDefault(result["tips"], 0) -} - // func (c *PurchaseHandler) onOrderNew(msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) { order, orderMap, err := c.getOrder(msg.BillID) diff --git a/business/partner/purchase/mtwm/order.go b/business/partner/purchase/mtwm/order.go index 9ed533bb7..070d03d1b 100644 --- a/business/partner/purchase/mtwm/order.go +++ b/business/partner/purchase/mtwm/order.go @@ -148,7 +148,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo order.Skus = append(order.Skus, sku) } jxutils.RefreshOrderSkuRelated(order) - // setOrederDetailFee(result, order) return order }