1
This commit is contained in:
@@ -4,6 +4,7 @@ package jdapi
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -337,6 +338,8 @@ func (a *API) GetStoreInfoByStationNo2(storeNo string) (storeDetail *StoreDetail
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStatus bool) (err error) {
|
func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStatus bool) (err error) {
|
||||||
|
globals.SugarLogger.Debugf("=updateParams=========: %s", utils.Format4Output(updateParams, false))
|
||||||
|
globals.SugarLogger.Debugf("=modifyCloseStatus=========: %s", utils.Format4Output(modifyCloseStatus, false))
|
||||||
updateParams.Operator = utils.GetAPIOperator(updateParams.Operator)
|
updateParams.Operator = utils.GetAPIOperator(updateParams.Operator)
|
||||||
mapData := utils.Struct2MapByJson(updateParams)
|
mapData := utils.Struct2MapByJson(updateParams)
|
||||||
if !modifyCloseStatus {
|
if !modifyCloseStatus {
|
||||||
@@ -357,6 +360,7 @@ func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStat
|
|||||||
delete(mapData, "serviceTimeEnd1")
|
delete(mapData, "serviceTimeEnd1")
|
||||||
}
|
}
|
||||||
_, err = a.AccessAPINoPage("store/updateStoreInfo4Open", mapData, nil, nil, nullResultParser)
|
_, err = a.AccessAPINoPage("store/updateStoreInfo4Open", mapData, nil, nil, nullResultParser)
|
||||||
|
globals.SugarLogger.Debugf("=err=========: %s", utils.Format4Output(err, false))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,36 +49,36 @@ func TestGetStoreInfoByStationNo(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
func TestUpdateStoreInfo4Open(t *testing.T) {
|
||||||
//func TestUpdateStoreInfo4Open(t *testing.T) {
|
params := &OpStoreParams{
|
||||||
// result, err := api.GetStoreInfoByStationNo2(mustExistStoreID)
|
StationNo: "12664100",
|
||||||
// if err != nil {
|
StationName: "",
|
||||||
// t.Fatal(err)
|
OutSystemID: "",
|
||||||
// }
|
Mobile: "",
|
||||||
// oldAddress := result.StationAddress
|
Phone: "",
|
||||||
// params := &OpStoreParams{
|
Lat: 43.622098,
|
||||||
// StationNo: mustExistStoreID,
|
Lng: 122.275918,
|
||||||
// Operator: "test",
|
StationAddress: "内蒙古自治区通辽市科尔沁区百花新城",
|
||||||
// StationAddress: oldAddress + "T",
|
Operator: "liulei",
|
||||||
// }
|
ServiceTimeEnd1: 0,
|
||||||
// err = api.UpdateStoreInfo4Open2(params, false)
|
ServiceTimeStart1: 0,
|
||||||
// if err != nil {
|
ServiceTimeEnd2: 0,
|
||||||
// t.Fatal(err)
|
ServiceTimeStart2: 0,
|
||||||
// }
|
DeliveryRangeType: 0,
|
||||||
//
|
CoordinateType: 0,
|
||||||
// result, err = api.GetStoreInfoByStationNo2(mustExistStoreID)
|
DeliveryRangeRadius: 0,
|
||||||
// newAddress := result.StationAddress
|
CoordinatePoints: "",
|
||||||
// if newAddress != params.StationAddress {
|
CloseStatus: 0,
|
||||||
// t.Fatalf("address not match, newAddress:%s, oldAddress:%s", newAddress, oldAddress)
|
StoreNotice: "",
|
||||||
// }
|
StandByPhone: "",
|
||||||
//
|
}
|
||||||
// params.StationAddress = oldAddress
|
err := api.UpdateStoreInfo4Open2(params, false)
|
||||||
// api.UpdateStoreInfo4Open2(params, false)
|
if err != nil {
|
||||||
// if err != nil {
|
t.Fatal(err)
|
||||||
// t.Fatal(err)
|
}
|
||||||
// }
|
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
//func TestGetCommentByOrderId(t *testing.T) {
|
//func TestGetCommentByOrderId(t *testing.T) {
|
||||||
// testOrderID := int64(922520919000622)
|
// testOrderID := int64(922520919000622)
|
||||||
// result, err := api.GetCommentByOrderId2(testOrderID)
|
// result, err := api.GetCommentByOrderId2(testOrderID)
|
||||||
|
|||||||
@@ -150,18 +150,12 @@ func (a *APIExpress) OrderStatusAndPsInfo(param map[string]interface{}) error {
|
|||||||
request.Param = psInfo
|
request.Param = psInfo
|
||||||
|
|
||||||
if a.accessTokenObj == nil || a.accessTokenObj.CreateTokenData.AccessToken == "" {
|
if a.accessTokenObj == nil || a.accessTokenObj.CreateTokenData.AccessToken == "" {
|
||||||
_, createTokenErr := a.CreateToken()
|
a.CreateToken()
|
||||||
globals.SugarLogger.Debugf("'==============createTokenErr : %s", utils.Format4Output(createTokenErr, false))
|
|
||||||
} else if a.expiresIn < time.Now().Unix() {
|
} else if a.expiresIn < time.Now().Unix() {
|
||||||
_, RefreshToken := a.RefreshToken()
|
a.RefreshToken()
|
||||||
globals.SugarLogger.Debugf("'==============RefreshToken : %s", utils.Format4Output(RefreshToken, false))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := request.Execute(a.accessTokenObj)
|
result, err := request.Execute(a.accessTokenObj)
|
||||||
//globals.SugarLogger.Debugf("'==============param : %s", utils.Format4Output(request.Param, false))
|
|
||||||
//globals.SugarLogger.Debugf("'==============result : %s", utils.Format4Output(result, false))
|
|
||||||
//globals.SugarLogger.Debugf("'==============param : %s", utils.Format4Output(err, false))
|
|
||||||
//globals.SugarLogger.Debugf("key:%s,sercet:%s,expiresIn:%d,tokenObj :%s", a.appKey, a.appSecret, a.expiresIn, utils.Format4Output(a.accessTokenObj, false))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,8 +311,8 @@ func (a *API) OrderDelivering(param *order_logisticsAdd_request.OrderLogisticsAd
|
|||||||
request.Param = param
|
request.Param = param
|
||||||
|
|
||||||
result, err := request.Execute(a.accessTokenObj)
|
result, err := request.Execute(a.accessTokenObj)
|
||||||
globals.SugarLogger.Debugf("订单发货=========:%s", request.GetUrlPath())
|
//globals.SugarLogger.Debugf("订单发货=========:%s", request.GetUrlPath())
|
||||||
globals.SugarLogger.Debugf("订单发货:=%s", utils.Format4Output(result, false))
|
//globals.SugarLogger.Debugf("订单发货:=%s", utils.Format4Output(result, false))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user