From acacc7a1b2f09a72acb569545f9422ee001da153 Mon Sep 17 00:00:00 2001 From: gazebo Date: Sat, 11 May 2019 14:06:36 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BB=8EOrderSkuFinancial=E4=B8=AD?= =?UTF-8?q?=E7=A7=BB=E9=99=A4VendorOrderID2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order_afs.go | 2 +- business/model/order_financial.go | 9 ++++----- business/partner/purchase/ebai/financial.go | 12 +++++------- business/partner/purchase/jd/order_afs.go | 3 +++ business/partner/purchase/mtwm/financial.go | 5 ++--- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/business/jxcallback/orderman/order_afs.go b/business/jxcallback/orderman/order_afs.go index 419eb1fd6..2e5b1632a 100644 --- a/business/jxcallback/orderman/order_afs.go +++ b/business/jxcallback/orderman/order_afs.go @@ -49,7 +49,7 @@ func (c *OrderManager) onAfsOrderNew(afsOrder *model.AfsOrder, orderStatus *mode } return err } - if afsOrder.Status == model.AfsOrderStatusNew { + if orderStatus.Status == model.AfsOrderStatusNew { if _, err = c.loadAfsOrder(db, afsOrder.AfsOrderID, afsOrder.VendorID); err != nil { if !dao.IsNoRowsError(err) { return err diff --git a/business/model/order_financial.go b/business/model/order_financial.go index 9da67285f..a57a08dee 100644 --- a/business/model/order_financial.go +++ b/business/model/order_financial.go @@ -115,11 +115,10 @@ func (o *AfsOrder) TableUnique() [][]string { type OrderSkuFinancial struct { ModelIDCUL - VendorID int `orm:"column(vendor_id)" json:"vendorID"` // 平台id - VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"` // 关联原始订单ID - VendorOrderID2 string `orm:"column(vendor_order_id2);size(48);index" json:"vendorOrderID2"` // 关联原始订单ID2,饿百独有 - AfsOrderID string `orm:"column(afs_order_id);size(48)" json:"afsOrderID"` // 售后单ID - IsAfsOrder int8 `json:"isAfsOrder"` // 0--正向单, 1--售后单 + VendorID int `orm:"column(vendor_id)" json:"vendorID"` // 平台id + VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"` // 关联原始订单ID + AfsOrderID string `orm:"column(afs_order_id);size(48)" json:"afsOrderID"` // 售后单ID + IsAfsOrder int8 `json:"isAfsOrder"` // 0--正向单, 1--售后单 // ConfirmTime time.Time `orm:"type(datetime)" json:"confirmTime"` // 订单生成/完成时间 VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` // 外部系统里记录的storeid diff --git a/business/partner/purchase/ebai/financial.go b/business/partner/purchase/ebai/financial.go index df69fbb89..66c13c6d6 100644 --- a/business/partner/purchase/ebai/financial.go +++ b/business/partner/purchase/ebai/financial.go @@ -86,10 +86,9 @@ func (p *PurchaseHandler) OrderFinancialDetail2Refund(orderFinancial *model.Orde } for _, sku := range orderFinancial.Skus { orderSkuFinancial := &model.OrderSkuFinancial{ - VendorID: sku.VendorID, - VendorOrderID: sku.VendorOrderID, - VendorOrderID2: sku.VendorOrderID2, - AfsOrderID: sku.VendorOrderID, + VendorID: sku.VendorID, + VendorOrderID: sku.VendorOrderID, + AfsOrderID: sku.VendorOrderID, // ConfirmTime: afsOrder.AfsCreateAt, VendorStoreID: afsOrder.VendorStoreID, StoreID: afsOrder.StoreID, @@ -232,9 +231,8 @@ func (p *PurchaseHandler) OrderDetail2Financial(result map[string]interface{}) ( for _, y := range x.([]interface{}) { product := y.(map[string]interface{}) orderSkuFinancial := &model.OrderSkuFinancial{ - VendorID: orderFinancial.VendorID, - VendorOrderID: orderFinancial.VendorOrderID, - VendorOrderID2: orderFinancial.VendorOrderID2, + VendorID: orderFinancial.VendorID, + VendorOrderID: orderFinancial.VendorOrderID, // OrderFinancialID: orderFinancial.VendorOrderID, // ConfirmTime: getTimeFromInterface(order1["create_time"]), VendorStoreID: utils.Interface2String(shop["baidu_shop_id"]), diff --git a/business/partner/purchase/jd/order_afs.go b/business/partner/purchase/jd/order_afs.go index a8dcac394..3645b7737 100644 --- a/business/partner/purchase/jd/order_afs.go +++ b/business/partner/purchase/jd/order_afs.go @@ -135,6 +135,7 @@ func (c *PurchaseHandler) buildAfsOrder(afsInfo *jdapi.AfsServiceResponse) (afsO TongchengFreightMoney: afsInfo.TongchengFreightMoney, SkuBoxMoney: afsInfo.MealBoxMoney, + VendorStatus: utils.Int2Str(afsInfo.AfsServiceState), VendorReasonType: utils.Int2Str(afsInfo.QuestionTypeCid), ReasonType: c.convertAfsReasonType(afsInfo.QuestionTypeCid), ReasonDesc: utils.LimitUTF8StringLen(afsInfo.QuestionDesc, 1024), @@ -142,6 +143,8 @@ func (c *PurchaseHandler) buildAfsOrder(afsInfo *jdapi.AfsServiceResponse) (afsO VendorAppealType: afsInfo.ApplyDeal, AppealType: c.convertAfsAppealType(afsInfo.ApplyDeal), } + afsOrder.Status = c.GetAfsStatusFromVendorStatus(afsOrder.VendorStatus) + for _, x := range afsInfo.AfsDetailList { orderSku := &model.OrderSkuFinancial{ VendorID: model.VendorIDJD, diff --git a/business/partner/purchase/mtwm/financial.go b/business/partner/purchase/mtwm/financial.go index 410c6b556..a806b70ba 100644 --- a/business/partner/purchase/mtwm/financial.go +++ b/business/partner/purchase/mtwm/financial.go @@ -64,9 +64,8 @@ func (p *PurchaseHandler) OrderFinancialDetail2Refund(orderFinancial *model.Orde } for _, sku := range orderFinancial.Skus { orderSkuFinancial := &model.OrderSkuFinancial{ - VendorID: sku.VendorID, - VendorOrderID: sku.VendorOrderID, - VendorOrderID2: sku.VendorOrderID2, + VendorID: sku.VendorID, + VendorOrderID: sku.VendorOrderID, // OrderFinancialID: sku.VendorOrderID, // ConfirmTime: afsOrder.AfsCreateAt, VendorStoreID: afsOrder.VendorStoreID,