1
This commit is contained in:
@@ -214,7 +214,7 @@ func (w *OrderManager) addWaybillStatus(bill *model.Waybill, db *dao.DaoDB, addP
|
|||||||
"status_time": bill.StatusTime,
|
"status_time": bill.StatusTime,
|
||||||
}, addParams)
|
}, addParams)
|
||||||
utils.CallFuncLogError(func() error {
|
utils.CallFuncLogError(func() error {
|
||||||
_, err = db.Db.QueryTable("waybill").Filter("vendor_waybill_id", bill.VendorWaybillID).Filter("waybill_vendor_id", bill.WaybillVendorID).Filter("status__lte", bill.Status).Update(params)
|
_, err = db.Db.QueryTable("waybill").Filter("vendor_waybill_id", bill.VendorWaybillID).Filter("waybill_vendor_id", bill.WaybillVendorID).Filter("status", bill.Status).Update(params)
|
||||||
return err
|
return err
|
||||||
}, "addWaybillStatus update waybill status, bill:%v", bill)
|
}, "addWaybillStatus update waybill status, bill:%v", bill)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package ebai
|
package ebai
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
@@ -658,9 +659,16 @@ func (c *PurchaseHandler) GetOrderRealMobile(ctx *jxcontext.Context, order *mode
|
|||||||
|
|
||||||
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool, reason string) (err error) {
|
func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool, reason string) (err error) {
|
||||||
if globals.EnableEbaiStoreWrite {
|
if globals.EnableEbaiStoreWrite {
|
||||||
|
var afsOrderInfo *model.AfsOrder
|
||||||
|
result, err := api.EbaiAPI.OrderPartRefundGet(order.VendorOrderID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
afsOrderInfo = CurPurchaseHandler.AfsOrderDetail2Financial(result)
|
||||||
|
|
||||||
if isAcceptIt {
|
if isAcceptIt {
|
||||||
err = api.EbaiAPI.OrderAgreeRefund(&ebaiapi.RefundOrderExamine{
|
err = api.EbaiAPI.OrderAgreeRefund(&ebaiapi.RefundOrderExamine{
|
||||||
ReverseOrderId: "",
|
ReverseOrderId: afsOrderInfo.AfsOrderID,
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
||||||
ActionType: ebaiapi.RefundTypeAgree,
|
ActionType: ebaiapi.RefundTypeAgree,
|
||||||
@@ -670,16 +678,28 @@ func (c *PurchaseHandler) AgreeOrRefuseCancel(ctx *jxcontext.Context, order *mod
|
|||||||
if reason == "" {
|
if reason == "" {
|
||||||
return fmt.Errorf("拒绝退单时,请填写拒单原因")
|
return fmt.Errorf("拒绝退单时,请填写拒单原因")
|
||||||
}
|
}
|
||||||
|
param := &ebaiapi.RefundOrderExamine{
|
||||||
err = api.EbaiAPI.OrderDisagreeRefund(&ebaiapi.RefundOrderExamine{
|
ReverseOrderId: afsOrderInfo.AfsOrderID,
|
||||||
ReverseOrderId: "",
|
|
||||||
OrderId: order.VendorOrderID,
|
OrderId: order.VendorOrderID,
|
||||||
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
||||||
ActionType: ebaiapi.RefundTypeAgree,
|
ActionType: ebaiapi.RefundTypeRefuse,
|
||||||
ReasonCode: "7001",
|
ReasonCode: "7001",
|
||||||
ReasonRemarks: reason,
|
ReasonRemarks: reason,
|
||||||
RefundProductList: "",
|
RefundProductList: "",
|
||||||
})
|
}
|
||||||
|
refundProductList := make([]*ebaiapi.RefundProductList, 0, 0)
|
||||||
|
date, _ := api.EbaiAPI.GetReverseOrder(order.VendorOrderID)
|
||||||
|
for _, v := range date {
|
||||||
|
refundProduct := &ebaiapi.RefundProductList{
|
||||||
|
SubBizOrderId: v.(map[string]interface{})["sub_biz_order_id"].(string),
|
||||||
|
PlatformSkuId: utils.Int64ToStr(utils.Interface2Int64WithDefault(v.(map[string]interface{})["platform_sku_id"], 0)),
|
||||||
|
}
|
||||||
|
|
||||||
|
refundProductList = append(refundProductList, refundProduct)
|
||||||
|
}
|
||||||
|
refundProductListStr, _ := json.Marshal(refundProductList)
|
||||||
|
param.RefundProductList = string(refundProductListStr)
|
||||||
|
err = api.EbaiAPI.OrderDisagreeRefund(param)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package ebai
|
package ebai
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -238,6 +239,19 @@ func (c *PurchaseHandler) AgreeOrRefuseRefund(ctx *jxcontext.Context, order *mod
|
|||||||
ReasonRemarks: reason,
|
ReasonRemarks: reason,
|
||||||
RefundProductList: "",
|
RefundProductList: "",
|
||||||
}
|
}
|
||||||
|
refundProductList := make([]*ebaiapi.RefundProductList, 0, 0)
|
||||||
|
date, _ := api.EbaiAPI.GetReverseOrder(order.VendorOrderID)
|
||||||
|
for _, v := range date {
|
||||||
|
refundProduct := &ebaiapi.RefundProductList{
|
||||||
|
SubBizOrderId: v.(map[string]interface{})["sub_biz_order_id"].(string),
|
||||||
|
PlatformSkuId: utils.Int64ToStr(utils.Interface2Int64WithDefault(v.(map[string]interface{})["platform_sku_id"], 0)),
|
||||||
|
}
|
||||||
|
|
||||||
|
refundProductList = append(refundProductList, refundProduct)
|
||||||
|
}
|
||||||
|
refundProductListStr, _ := json.Marshal(refundProductList)
|
||||||
|
param.RefundProductList = string(refundProductListStr)
|
||||||
|
|
||||||
err = api.EbaiAPI.OrderDisagreeReturnGoods(param)
|
err = api.EbaiAPI.OrderDisagreeReturnGoods(param)
|
||||||
} else if approveType == partner.AfsApproveTypeRefusedToRefundMoney {
|
} else if approveType == partner.AfsApproveTypeRefusedToRefundMoney {
|
||||||
return errors.New("此平台暂时不支持")
|
return errors.New("此平台暂时不支持")
|
||||||
|
|||||||
Reference in New Issue
Block a user