1
This commit is contained in:
@@ -231,7 +231,6 @@ func (v *VendorSync) SyncReorderCategories(ctx *jxcontext.Context, db *dao.DaoDB
|
||||
// }
|
||||
|
||||
func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs, storeIDs []int, mustDirty, isAsync bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("进入SyncStore2了")
|
||||
userName := ctx.GetUserName()
|
||||
isManageIt := len(storeIDs) == 0 || len(storeIDs) > 5
|
||||
_, hint, err = v.LoopStoresMap2(ctx, nil, db, fmt.Sprintf("同步门店信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, mustDirty, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) {
|
||||
@@ -258,7 +257,6 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
}
|
||||
} else if model.IsSyncStatusDelete(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debugf("2.IsSyncStatusDelete(storeMap.SyncStatus)")
|
||||
if err = handler.DeleteStore(db2, storeMap.StoreID, userName); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
@@ -274,12 +272,10 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
}
|
||||
if err == nil {
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debug("进入 model.IsSyncStatusNew(storeMap.SyncStatus)")
|
||||
storeMap.VendorStoreID = vendorStoreID
|
||||
storeMap.SyncStatus = 0
|
||||
_, err = dao.UpdateEntity(db, storeMap, "VendorStoreID", model.FieldSyncStatus)
|
||||
} else {
|
||||
globals.SugarLogger.Debug("进入 model.IsSyncStatusNew(storeMap.SyncStatus) else")
|
||||
storeMap.SyncStatus = 0
|
||||
_, err = dao.UpdateEntity(db, storeMap, model.FieldSyncStatus)
|
||||
}
|
||||
@@ -302,7 +298,6 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, model.VendorChineseNames[storeMap.VendorID], "创建门店")
|
||||
}
|
||||
} else if model.IsSyncStatusDelete(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debug("进入handler.DeleteStore")
|
||||
if err = handler.DeleteStore(db2, storeMap.StoreID, userName); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
} else {
|
||||
@@ -496,8 +491,6 @@ func (v *VendorSync) SyncStoresCategory(ctx *jxcontext.Context, db *dao.DaoDB, v
|
||||
//
|
||||
func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, skuIDs, excludeSkuIDs []int, setSyncStatus int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
isManageIt := len(storeIDs) != 1 || len(skuIDs) == 0 || len(skuIDs) > 8
|
||||
globals.SugarLogger.Debugf("============2")
|
||||
|
||||
funcParam := func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
|
||||
|
||||
@@ -103,7 +103,6 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
}
|
||||
}
|
||||
if model.IsSyncStatusDelete(catInfo.CatSyncStatus) { // 删除 4
|
||||
globals.SugarLogger.Debugf("============5:删除")
|
||||
if model.IsSyncStatusDelete(catInfo.CatSyncStatus) && !dao.IsVendorThingIDEmpty(catInfo.VendorCatID) {
|
||||
err = handler.DeleteStoreCategory(ctx, storeID, vendorStoreID, catInfo.VendorCatID, level)
|
||||
if err != nil && handler.IsErrCategoryNotExist(err) {
|
||||
@@ -113,7 +112,6 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
}
|
||||
}
|
||||
} else if model.IsSyncStatusNew(catInfo.CatSyncStatus) { // 新增 2
|
||||
globals.SugarLogger.Debugf("============6:新增")
|
||||
err = handler.CreateStoreCategory(ctx, storeID, vendorStoreID, catInfo)
|
||||
if err != nil && handler.IsErrCategoryExist(err) {
|
||||
if cat, err2 := handler.GetStoreCategory(ctx, storeID, vendorStoreID, catInfo.Name); err2 == nil {
|
||||
@@ -176,7 +174,6 @@ func SyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
|
||||
func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, vendorID, storeID int, vendorStoreID, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debugf("============4")
|
||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
if singleStoreHandler != nil { // 本地创建商品分类
|
||||
if err = CreateStoreCategoryByStoreSku(ctx, vendorID, storeID, vendorStoreID, nameIDs, skuIDs); err != nil {
|
||||
@@ -503,12 +500,9 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
if sku.Status != model.SkuStatusNormal {
|
||||
sku.MergedStatus = model.SkuStatusDontSale
|
||||
}
|
||||
globals.SugarLogger.Debugf("==========sku.MergedStatus := %d", sku.MergedStatus)
|
||||
|
||||
var bareSku *partner.StoreSkuInfo
|
||||
isNeedReorder := false
|
||||
if isStoreSkuSyncNeedDelete(sku) {
|
||||
globals.SugarLogger.Debugf("==========isStoreSkuSyncNeedDelete := %d", 222)
|
||||
if !dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
||||
bareSku = storeSkuSyncInfo2Bare(sku)
|
||||
if singleStoreHandler == nil {
|
||||
|
||||
@@ -154,6 +154,12 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
// 是否支持七天无理由
|
||||
if api.GetProductUpdateRule(param.CategoryLeafId) {
|
||||
param.Supply7dayReturn = 1
|
||||
} else {
|
||||
param.Supply7dayReturn = 0
|
||||
}
|
||||
|
||||
// 获取上传图,商品轮播图
|
||||
img, detailImg, err := GetTiktokImgList(api, utils.Int2Str(storeSku.StoreID), storeDetail.VendorOrgCode, storeSku.DescImg, storeSku.ImgOrigin, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5, storeSku.DescImg)
|
||||
|
||||
Reference in New Issue
Block a user