This commit is contained in:
richboo111
2023-09-04 17:34:37 +08:00
6 changed files with 32 additions and 25 deletions

View File

@@ -13,7 +13,7 @@ func TestCancelOrder(t *testing.T) {
} }
func TestOrderGet(t *testing.T) { func TestOrderGet(t *testing.T) {
result, err := api.OrderGet("4055150105296238277") result, err := api.OrderGet("4085900049668072177")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} else { } else {
@@ -23,15 +23,14 @@ func TestOrderGet(t *testing.T) {
func TestOrderAgreePartRefund(t *testing.T) { func TestOrderAgreePartRefund(t *testing.T) {
param := &RefundOrderExamine{ param := &RefundOrderExamine{
ReverseOrderId: "2308279044977730245", OrderId: "4015750049354953219",
OrderId: "4015750049354953219", IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()), ActionType: RefundTypeAgree,
ActionType: RefundTypeAgree, ReasonCode: "",
ReasonCode: "", ReasonRemarks: "",
ReasonRemarks: "",
} }
refundProductList := make([]*RefundProductList, 0, 0) refundProductList := make([]*RefundProductList, 0, 0)
date, _ := api.GetReverseOrder("4015750049354953219") date, _ := api.GetReverseOrder("4035480124822912660")
for _, v := range date { for _, v := range date {
v2 := v.(map[string]interface{}) v2 := v.(map[string]interface{})
refundProduct := &RefundProductList{ refundProduct := &RefundProductList{
@@ -44,6 +43,9 @@ func TestOrderAgreePartRefund(t *testing.T) {
case 1: case 1:
refundProduct.RefundAmount = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_user_amount"])) refundProduct.RefundAmount = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_user_amount"]))
} }
if param.ReverseOrderId == "" {
param.ReverseOrderId = utils.Int64ToStr(utils.Interface2Int64WithDefault(v2["refund_order_id"], 0))
}
refundProductList = append(refundProductList, refundProduct) refundProductList = append(refundProductList, refundProduct)
} }
param.RefundProductList = refundProductList param.RefundProductList = refundProductList
@@ -63,7 +65,7 @@ func TestOrderAgreeRefund(t *testing.T) {
} }
func TestGetReverseOrder(t *testing.T) { func TestGetReverseOrder(t *testing.T) {
date, _ := api.GetReverseOrder("4099660048407490187") date, _ := api.GetReverseOrder("4035480124822912660")
for _, v := range date { for _, v := range date {
fmt.Println(v) fmt.Println(v)
} }

View File

@@ -16,5 +16,5 @@ func TestFoodList(t *testing.T) {
} }
func TestGetSkuPurchasePrice(t *testing.T) { func TestGetSkuPurchasePrice(t *testing.T) {
api.GetSkuPurchasePrice("18048546", "16295939515") api.GetSkuPurchasePrice("18048546", "305011066")
} }

View File

@@ -20,14 +20,13 @@ func init() {
baseapi.Init(sugarLogger) baseapi.Init(sugarLogger)
// 菜市 // 菜市
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
// 果园 // 果园
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超 //商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_ovSLnyKTsMNx0RxMzJ1C7w") //token_n4TwqCntWWuvQwAawzxC0w api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
cookieStr := ` cookieStr := `
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
` `

View File

@@ -7,12 +7,12 @@ import (
"testing" "testing"
) )
var token = `{"access_token":"4a1ac795-50a7-4f83-8b13-a0ee30d93456","expires_in":1692502247,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"b1892379-82b9-4636-91a3-2bff32d164ca","authority_id":""}` var token = `{"access_token":"4a543151-f8fd-43d5-9c34-d19fe11fc51c","expires_in":1694069036,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"5a2aaca1-42f7-4b83-9358-8ed5d1d4bcd6","authority_id":""}`
var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token) var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token)
// 查询售后单详情 // 查询售后单详情
func TestAfsOrder(t *testing.T) { func TestAfsOrder(t *testing.T) {
a.QueryAfsOrderDetail("7165706329204670732", true) a.QueryAfsOrderDetail("6921428072500696298", true)
} }
// 同意/拒绝售后单 // 同意/拒绝售后单

View File

@@ -82,17 +82,23 @@ func TestApplyMarketAfterSale(t *testing.T) {
} }
func TestOrderStatusAndPsInfo(t *testing.T) { func TestOrderStatusAndPsInfo(t *testing.T) {
a := NewExpress("7153997323561879075", "3517d3ea-b96b-4379-a7a4-2d9389e8ffeb", "") //appKey := `7152420904331429407` // 暂时定死
//appSecret := `cc7ba367-2394-4cbb-81c6-26f0e929d1c6` //暂时定死
token := `{"access_token":"4a543151-f8fd-43d5-9c34-d19fe11fc51c","expires_in":1694069036,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"5a2aaca1-42f7-4b83-9358-8ed5d1d4bcd6","authority_id":""}`
a := NewExpress("7152420904331429407", "cc7ba367-2394-4cbb-81c6-26f0e929d1c6", token)
a.CreateToken() a.CreateToken()
param := make(map[string]interface{}, 0) param := make(map[string]interface{}, 0)
param["third_carrier_order_id"] = "4996521792598113690" param["third_carrier_order_id"] = "6921428072500696298"
param["logistics_context"] = "呼叫骑手" param["logistics_context"] = "JIEDAN"
param["opcode"] = "CALL_RIDER" param["opcode"] = "DELIVERED"
param["courier_name"] = "" param["courier_name"] = "刘磊"
param["courier_phone"] = "" param["courier_phone"] = "18981810340"
a.OrderStatusAndPsInfo(param) a.OrderStatusAndPsInfo(param)
} }
func TestMap(t *testing.T) { //
fmt.Println((57 & 2) != 0) //
} //TiktokLogisticsORDERRECEIVED = "ORDER_RECEIVED" // 已接单
//TiktokLogisticsRIDERARRIVED = "RIDER_ARRIVED" // 已到店
//TiktokLogisticsRIDERPICKUP = "RIDER_PICK_UP" // 已取货
//TiktokLogisticsDELIVERED = "DELIVERED" // 已送达

View File

@@ -37,7 +37,7 @@ func Test(t *testing.T) {
} }
func TestGetShipmentInfo(t *testing.T) { func TestGetShipmentInfo(t *testing.T) {
a.GetShipmentInfo(5030299715093774047, 0, ShipmentTypeInvoice) a.GetShipmentInfo(6921428072500696298, 0, ShipmentTypeInvoice)
} }
func TestGetStoreAutoCallRiderInfo(t *testing.T) { func TestGetStoreAutoCallRiderInfo(t *testing.T) {