This commit is contained in:
邹宗楠
2023-02-24 16:59:07 +08:00
parent 6eac242b06
commit 719507863a
4 changed files with 38 additions and 40 deletions

View File

@@ -4,6 +4,7 @@ package jdapi
import (
"encoding/json"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
)
const (
@@ -337,6 +338,8 @@ func (a *API) GetStoreInfoByStationNo2(storeNo string) (storeDetail *StoreDetail
// }
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)
mapData := utils.Struct2MapByJson(updateParams)
if !modifyCloseStatus {
@@ -357,6 +360,7 @@ func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStat
delete(mapData, "serviceTimeEnd1")
}
_, err = a.AccessAPINoPage("store/updateStoreInfo4Open", mapData, nil, nil, nullResultParser)
globals.SugarLogger.Debugf("=err=========: %s", utils.Format4Output(err, false))
return err
}

View File

@@ -49,36 +49,36 @@ func TestGetStoreInfoByStationNo(t *testing.T) {
}
//
//func TestUpdateStoreInfo4Open(t *testing.T) {
// result, err := api.GetStoreInfoByStationNo2(mustExistStoreID)
// if err != nil {
// t.Fatal(err)
// }
// oldAddress := result.StationAddress
// params := &OpStoreParams{
// StationNo: mustExistStoreID,
// Operator: "test",
// StationAddress: oldAddress + "T",
// }
// err = api.UpdateStoreInfo4Open2(params, false)
// if err != nil {
// t.Fatal(err)
// }
//
// result, err = api.GetStoreInfoByStationNo2(mustExistStoreID)
// newAddress := result.StationAddress
// if newAddress != params.StationAddress {
// t.Fatalf("address not match, newAddress:%s, oldAddress:%s", newAddress, oldAddress)
// }
//
// params.StationAddress = oldAddress
// api.UpdateStoreInfo4Open2(params, false)
// if err != nil {
// t.Fatal(err)
// }
//}
//
func TestUpdateStoreInfo4Open(t *testing.T) {
params := &OpStoreParams{
StationNo: "12664100",
StationName: "",
OutSystemID: "",
Mobile: "",
Phone: "",
Lat: 43.622098,
Lng: 122.275918,
StationAddress: "内蒙古自治区通辽市科尔沁区百花新城",
Operator: "liulei",
ServiceTimeEnd1: 0,
ServiceTimeStart1: 0,
ServiceTimeEnd2: 0,
ServiceTimeStart2: 0,
DeliveryRangeType: 0,
CoordinateType: 0,
DeliveryRangeRadius: 0,
CoordinatePoints: "",
CloseStatus: 0,
StoreNotice: "",
StandByPhone: "",
}
err := api.UpdateStoreInfo4Open2(params, false)
if err != nil {
t.Fatal(err)
}
}
//func TestGetCommentByOrderId(t *testing.T) {
// testOrderID := int64(922520919000622)
// result, err := api.GetCommentByOrderId2(testOrderID)

View File

@@ -150,18 +150,12 @@ func (a *APIExpress) OrderStatusAndPsInfo(param map[string]interface{}) error {
request.Param = psInfo
if a.accessTokenObj == nil || a.accessTokenObj.CreateTokenData.AccessToken == "" {
_, createTokenErr := a.CreateToken()
globals.SugarLogger.Debugf("'==============createTokenErr : %s", utils.Format4Output(createTokenErr, false))
a.CreateToken()
} else if a.expiresIn < time.Now().Unix() {
_, RefreshToken := a.RefreshToken()
globals.SugarLogger.Debugf("'==============RefreshToken : %s", utils.Format4Output(RefreshToken, false))
a.RefreshToken()
}
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 {
return err
}

View File

@@ -311,8 +311,8 @@ func (a *API) OrderDelivering(param *order_logisticsAdd_request.OrderLogisticsAd
request.Param = param
result, err := request.Execute(a.accessTokenObj)
globals.SugarLogger.Debugf("订单发货=========:%s", request.GetUrlPath())
globals.SugarLogger.Debugf("订单发货:=%s", utils.Format4Output(result, false))
//globals.SugarLogger.Debugf("订单发货=========:%s", request.GetUrlPath())
//globals.SugarLogger.Debugf("订单发货:=%s", utils.Format4Output(result, false))
if err != nil {
return err
}