添加抖音授权登录,国美测试接口,修改运单重复骑手,添加推送骑手信息

This commit is contained in:
邹宗楠
2022-05-13 16:05:19 +08:00
parent 977d11ed9c
commit a91f46207f
49 changed files with 3355 additions and 254 deletions

View File

@@ -1,7 +1,10 @@
package mtwm
import (
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"testing"
"time"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
@@ -24,5 +27,23 @@ func TestGetVendorCategories(t *testing.T) {
if err != nil {
t.Fatal(err)
}
for _, v := range result {
data := model.SkuVendorCategory{
ModelIDCUL: model.ModelIDCUL{
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
LastOperator: "刘磊",
},
VendorCategoryID: v.VendorCategoryID,
VendorID: v.VendorID,
Name: v.Name,
IsLeaf: v.IsLeaf,
Level: v.Level,
ParentID: v.ParentID,
}
if err := dao.CreateEntity(dao.GetDB(),&data);err != nil {
t.Log(utils.Format4Output(err, false))
}
}
t.Log(utils.Format4Output(result, false))
}

View File

@@ -61,7 +61,7 @@ type tEbaiStoreInfo struct {
DistrictID int `orm:"column(district_id)"`
}
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string) (retVal *dao.StoreDetail, err error) {
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID,vendorStoreName string) (retVal *dao.StoreDetail, err error) {
result, err := getAPIWithoutToken(vendorOrgCode).PoiGet(vendorStoreID)
if err == nil {
// globals.SugarLogger.Debug(utils.Format4Output(result, false))
@@ -252,7 +252,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
// name = jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM)
// }
}
store := fmt.Sprintf("门店id:%d,门店名称:%s,第三方门店状态:%d,本地修改前门店状态%d,本地门店修改后状态:%d,第三方平台Id(美团):%d", storeID, remoteStoreInfo.Name, remoteStoreInfo.IsOnline, storeDetail.Status, mergedStoreStatus, storeDetail.VendorOrgCode)
store := fmt.Sprintf("门店id:%d,门店名称:%s,第三方门店状态:%d,本地修改前门店状态%d,本地门店修改后状态:%d,第三方平台Id(美团):%s", storeID, remoteStoreInfo.Name, remoteStoreInfo.IsOnline, storeDetail.Status, mergedStoreStatus, storeDetail.VendorOrgCode)
event.AddOperateEvent(jxcontext.AdminCtx, jxcontext.AdminCtx.GetTrackInfo(), store, "", "", 10, "UpdateStore")
// openLevel, isOnline := bizStatusJX2Mtwm(mergedStoreStatus)
//TODO 美团暂时不用那个电话
@@ -353,7 +353,7 @@ func (p *PurchaseHandler) onStoreStatusChanged(msg *mtwmapi.CallbackMsg) (respon
response = mtwmapi.Err2CallbackResponse(err, "")
// 操作日志(美团外卖)
ctx := jxcontext.AdminCtx
store := fmt.Sprintf("美团外卖回调门店改变回调(营业状态/审核状态):门店id:%s,美团门店状态:%d.[121营业,120休息,18上线,19下线],本地修改后状态[%s]", vendorStoreID, int(utils.Str2Int64(msg.FormData.Get("poi_status"))), storeStatus)
store := fmt.Sprintf("美团外卖回调门店改变回调(营业状态/审核状态):门店id:%s,美团门店状态:%d.[121营业,120休息,18上线,19下线],本地修改后状态[%d]", vendorStoreID, int(utils.Str2Int64(msg.FormData.Get("poi_status"))), storeStatus)
event.AddOperateEvent(ctx, ctx.GetTrackInfo(), store, "", "", 10, "UpdateStore")
return response
}
@@ -390,7 +390,7 @@ func (c *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, vendorOrgCod
} else {
err = errors.New("门店还未上线,不能修改营业状态")
}
store := fmt.Sprintf("美团外卖回调门店改变回调(营业状态/审核状态):门店id:%s,美团门店状态:%d.[121营业,120休息,18上线,19下线],本地修改后状态[%s]", vendorStoreID, remoteStoreInfo.OpenLevel, openLevel)
store := fmt.Sprintf("美团外卖回调门店改变回调(营业状态/审核状态):门店id:%s,美团门店状态:%d.[121营业,120休息,18上线,19下线],本地修改后状态[%d]", vendorStoreID, remoteStoreInfo.OpenLevel, openLevel)
event.AddOperateEvent(ctx, ctx.GetTrackInfo(), store, "", "", 10, "UpdateStore")
}
}

View File

@@ -3,20 +3,18 @@ package mtwm
import (
"testing"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
// _ "git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
)
func TestReadStore(t *testing.T) {
store, err := CurPurchaseHandler.ReadStore(jxcontext.AdminCtx, "", "4351018")
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(store, false))
}
//func TestReadStore(t *testing.T) {
// store, err := CurPurchaseHandler.ReadStore(jxcontext.AdminCtx, "", "4351018")
// if err != nil {
// t.Fatal(err)
// }
// t.Log(utils.Format4Output(store, false))
//}
func TestUpdateStore(t *testing.T) {
err := CurPurchaseHandler.UpdateStore(nil, 100002, "test")