This commit is contained in:
邹宗楠
2024-07-19 14:46:43 +08:00
parent 07306f4c11
commit 556a0c63f0

View File

@@ -179,7 +179,7 @@ func MtWmSyncSkuPriceAndStatus(db *dao.DaoDB, sm *model.StoreMap, skuMap map[str
func EBaiSyncSkuPriceAndStatus(db *dao.DaoDB, sm *model.StoreMap, skuMap map[string]*model.StoreSkuBind) (err error) { func EBaiSyncSkuPriceAndStatus(db *dao.DaoDB, sm *model.StoreMap, skuMap map[string]*model.StoreSkuBind) (err error) {
var ( var (
ebaiApi = apimanager.CurAPIManager.GetAPI(sm.VendorID, sm.VendorOrgCode).(*ebaiapi.API) ebaiApi = apimanager.CurAPIManager.GetAPI(sm.VendorID, sm.VendorOrgCode).(*ebaiapi.API)
skuIdOffset = 0 //skuIdOffset = 0
foodListData = make([]*ebaiapi.SkuInfo, 0, 0) foodListData = make([]*ebaiapi.SkuInfo, 0, 0)
errs = make([]string, 0, 0) errs = make([]string, 0, 0)
) )
@@ -193,7 +193,7 @@ func EBaiSyncSkuPriceAndStatus(db *dao.DaoDB, sm *model.StoreMap, skuMap map[str
param := &ebaiapi.SkuListParams{ param := &ebaiapi.SkuListParams{
Page: page, Page: page,
PageSize: 100, PageSize: 100,
SkuIdOffset: skuIdOffset, //SkuIdOffset: skuIdOffset,
} }
foodList, err := ebaiApi.SkuList(utils.Int2Str(sm.StoreID), param) foodList, err := ebaiApi.SkuList(utils.Int2Str(sm.StoreID), param)
if err != nil { if err != nil {
@@ -205,7 +205,7 @@ func EBaiSyncSkuPriceAndStatus(db *dao.DaoDB, sm *model.StoreMap, skuMap map[str
if len(foodList.List) < 100 { if len(foodList.List) < 100 {
break break
} }
skuIdOffset = foodList.SkuIdOffset //skuIdOffset = foodList.SkuIdOffset
page += 1 page += 1
} }
globals.SugarLogger.Debugf("======len foodListData:= %d", len(foodListData)) globals.SugarLogger.Debugf("======len foodListData:= %d", len(foodListData))
@@ -238,7 +238,9 @@ func EBaiSyncSkuPriceAndStatus(db *dao.DaoDB, sm *model.StoreMap, skuMap map[str
} }
} else { } else {
globals.SugarLogger.Debugf("=========vsl.CustomSkuId := %s", vsl.CustomSkuId) globals.SugarLogger.Debugf("=========vsl.CustomSkuId := %s", vsl.CustomSkuId)
err = ebaiApi.SkuOfflineOne(jxcontext.AdminCtx.GetTrackInfo(), utils.Int2Str(sm.StoreID), utils.Str2Int64(vsl.CustomSkuId), "", "") _, err = ebaiApi.SkuDelete(jxcontext.AdminCtx.GetTrackInfo(), utils.Int2Str(sm.StoreID), nil, []string{vsl.CustomSkuId})
//err = ebaiApi.SkuOfflineOne(jxcontext.AdminCtx.GetTrackInfo(), utils.Int2Str(sm.StoreID), utils.Str2Int64(vsl.CustomSkuId), "", "")
if err != nil { if err != nil {
errs = append(errs, fmt.Sprintf("skuCode:%d,修改饿百不可售状态错误%v", sku.SkuID, err)) errs = append(errs, fmt.Sprintf("skuCode:%d,修改饿百不可售状态错误%v", sku.SkuID, err))
} }