diff --git a/platformapi/sfps2/callback.go b/platformapi/sfps2/callback.go index 36a780fd..38284583 100644 --- a/platformapi/sfps2/callback.go +++ b/platformapi/sfps2/callback.go @@ -147,17 +147,21 @@ func (a *API) GetCallbackUrlIndex(request *http.Request) (map[string]interface{} } var ( - urlIndex = "" - temp = map[string]interface{}{} + urlIndex = "" + orderStatus float64 + temp = map[string]interface{}{} ) if err = json.Unmarshal(data, &temp); err == nil { globals.SugarLogger.Debugf("GetCallbackUrlIndex temp=%s", utils.Format4Output(temp, false)) urlIndex = temp["url_index"].(string) - fmt.Println(urlIndex) + orderStatus = temp["order_status"].(float64) + globals.SugarLogger.Debugf("GetCallbackUrlIndex urlIndex=%s,orderStatus=%d", urlIndex, orderStatus) } result := make(map[string]interface{}, 0) - + if orderStatus == OrderStatusFinished { + urlIndex = UrlIndexOrderComplete + } switch urlIndex { case UrlIndexRiderStatus: retVal := RiderStatus{} diff --git a/platformapi/sfps2/sf_test.go b/platformapi/sfps2/sf_test.go index cba6cf29..0dcaaef7 100644 --- a/platformapi/sfps2/sf_test.go +++ b/platformapi/sfps2/sf_test.go @@ -65,12 +65,12 @@ func TestCreateOrder(t *testing.T) { DevId: AppID, ShopId: TestSFStoreID, ShopType: 1, - ShopOrderId: "20230908Test", + ShopOrderId: "20230908-2", OrderSequence: "测试", OrderSource: OrderSourceELM, - OrderTime: 1694163550, + OrderTime: 1694165402, LbsType: LbsTypeGD, - PushTime: 1694163550, + PushTime: 1694165402, Version: 19, ReturnFlag: 511, Receive: &ReceiveAddress{