- jdapi.OrderShoudSettlementService2

- mtwmapi.PoiReceiveDetailInfo
This commit is contained in:
gazebo
2019-06-18 10:13:36 +08:00
parent 8e6d720d47
commit 3a3734a788
3 changed files with 69 additions and 1 deletions

View File

@@ -149,6 +149,34 @@ type VenderAfsSkuDTO struct {
PromotionType int `json:"promotionType"`
}
type OrderSettlementInfo struct {
AllAfterSaleFreight int64 `json:"allAfterSaleFreight"`
AllAfterSalePackageMoney int64 `json:"allAfterSalePackageMoney"`
BillTime *utils.JavaDate `json:"billTime"`
DistanceFreightMoney int64 `json:"distanceFreightMoney"`
FreightCommission int64 `json:"freightCommission"`
GoodsCommission int64 `json:"goodsCommission"`
GuaranteedCommission int64 `json:"guaranteedCommission"`
OrderCashOnDeliveryMoney int64 `json:"orderCashOnDeliveryMoney"`
OrderGiftCardMoney int64 `json:"orderGiftCardMoney"`
OrderID int64 `json:"orderId"`
OrgCode string `json:"orgCode"`
PackageCommission int64 `json:"packageCommission"`
PackageMoney int64 `json:"packageMoney"`
PlatDeliveryFreight int64 `json:"platDeliveryFreight"`
PlatFreightDiscountMoney int64 `json:"platFreightDiscountMoney"`
PlatOrderGoodsDiscountMoney int64 `json:"platOrderGoodsDiscountMoney"`
PlatSkuGoodsDiscountMoney int64 `json:"platSkuGoodsDiscountMoney"`
SettlementAmount int64 `json:"settlementAmount"`
StationNo string `json:"stationNo"`
UserActualPaidGoodsMoney int64 `json:"userActualPaidGoodsMoney"`
VenderDeliveryFreight int64 `json:"venderDeliveryFreight"`
VenderFreightDiscountMoney int64 `json:"venderFreightDiscountMoney"`
VenderOrderGoodsDiscountMoney int64 `json:"venderOrderGoodsDiscountMoney"`
VenderPaidTips int64 `json:"venderPaidTips"`
VenderSkuGoodsDiscountMoney int64 `json:"venderSkuGoodsDiscountMoney"`
}
var (
ErrCanNotFindOrder = errors.New("can not find order")
)
@@ -298,6 +326,14 @@ func (a *API) OrderShoudSettlementService(orderId string) (map[string]interface{
return result.(map[string]interface{}), nil
}
func (a *API) OrderShoudSettlementService2(orderId string) (orderSettlement *OrderSettlementInfo, err error) {
result, err := a.OrderShoudSettlementService(orderId)
if err == nil {
err = utils.Map2StructByJson(result, &orderSettlement, false)
}
return orderSettlement, err
}
// 查询售后单详情接口
// https://openo2o.jddj.com/staticnew/widgets/resources.html?groupid=170&apiid=6805ed690b7b4776b058067312c57d98
func (a *API) GetAfsService(orderId string) (map[string]interface{}, error) {

View File

@@ -171,7 +171,7 @@ func TestOrderJDZBDelivery(t *testing.T) {
}
func TestModifySellerDelivery(t *testing.T) {
result, err := api.ModifySellerDelivery("813344594000041", "")
result, err := api.ModifySellerDelivery("914376668000422", "")
if err != nil {
t.Fatal(err.Error())
}
@@ -209,3 +209,11 @@ func TestGetAfsService2(t *testing.T) {
}
sugarLogger.Debug(utils.Format4Output(result, false))
}
func TestOrderShoudSettlementService2(t *testing.T) {
result, err := api.OrderShoudSettlementService2("914508761000241")
if err != nil {
t.Fatal(err.Error())
}
sugarLogger.Debug(utils.Format4Output(result, false))
}

View File

@@ -185,6 +185,22 @@ type SkuBenefitDetailInfo struct {
WmAppOrderActDetails []*WmAppOrderActDetailInfo `json:"wmAppOrderActDetails"`
}
type ActOrderChargeInfo struct {
Comment string `json:"comment"`
FeeTypeDesc string `json:"feeTypeDesc"`
FeeTypeID int `json:"feeTypeId"`
MoneyCent int64 `json:"moneyCent"`
}
type PoiReceiveDetailInfo struct {
ActOrderChargeByMt []*ActOrderChargeInfo `json:"actOrderChargeByMt"`
ActOrderChargeByPoi []*ActOrderChargeInfo `json:"actOrderChargeByPoi"`
FoodShareFeeChargeByPoi int64 `json:"foodShareFeeChargeByPoi"`
LogisticsFee int64 `json:"logisticsFee"`
OnlinePayment int64 `json:"onlinePayment"`
WmPoiReceiveCent int64 `json:"wmPoiReceiveCent"`
}
type OrderInfo struct {
AppOrderCode string `json:"app_order_code"`
AppPoiCode string `json:"app_poi_code"`
@@ -219,6 +235,7 @@ type OrderInfo struct {
PayType int `json:"pay_type"`
PickType int `json:"pick_type"`
PoiReceiveDetail string `json:"poi_receive_detail"`
PoiReceiveDetailPtr *PoiReceiveDetailInfo `json:"poi_receive_detail_ptr"`
RecipientAddress string `json:"recipient_address"`
RecipientName string `json:"recipient_name"`
RecipientPhone string `json:"recipient_phone"`
@@ -387,6 +404,13 @@ func (a *API) OrderGetOrderDetail2(orderID int64, isMTLogistics bool) (orderInfo
if orderInfo.SkuBenefitDetail != "" {
err = utils.UnmarshalUseNumber([]byte(orderInfo.SkuBenefitDetail), &orderInfo.SkuBenefitDetailList)
}
if err != nil {
return nil, err
}
if orderInfo.PoiReceiveDetail != "" {
err = utils.UnmarshalUseNumber([]byte(orderInfo.PoiReceiveDetail), &orderInfo.PoiReceiveDetailPtr)
}
}
}
return orderInfo, err