删除日志

This commit is contained in:
邹宗楠
2022-10-24 11:22:38 +08:00
parent 5a47102894
commit 5d6a5a3226
139 changed files with 17 additions and 787 deletions

View File

@@ -100,7 +100,6 @@ func act2EbaiActivity(act *model.Act2, actOrderRules []*model.ActOrderRule) (act
}
func createOneShopAct(act *model.Act2, shopID string, oneStoreActSku []*model.ActStoreSku2) (ebaiActIDStr string, err error) {
globals.SugarLogger.Debugf("ebai createOneShopAct")
activity := act2EbaiActivity(act, nil)
if globals.EnableEbaiStoreWrite {
ebaiActID, err2 := api.EbaiAPI.ActivityCreate(shopID, 0, 0, activity)
@@ -117,7 +116,6 @@ func createOneShopAct(act *model.Act2, shopID string, oneStoreActSku []*model.Ac
}
func ActivitySkuAddBatch(activityID int64, shopID string, baiduShopID int64, activityType int, skuList []*ebaiapi.ActivitySkuInfo4Add, isSkuIDCustom bool) (successIDs []string, err error) {
globals.SugarLogger.Debugf("ebai ActivitySkuAddBatch")
if globals.EnableEbaiStoreWrite {
successIDs, err = api.EbaiAPI.ActivitySkuAddBatch(activityID, shopID, baiduShopID, activityType, skuList, isSkuIDCustom)
} else {
@@ -129,7 +127,6 @@ func ActivitySkuAddBatch(activityID int64, shopID string, baiduShopID int64, act
}
func ActivitySkuDeleteBatch(activityID int64, shopID string, baiduShopID int64, skuIDs []string, isSkuIDCustom bool) (successIDs []string, err error) {
globals.SugarLogger.Debugf("ebai ActivitySkuDeleteBatch")
if globals.EnableEbaiStoreWrite {
successIDs, err = api.EbaiAPI.ActivitySkuDeleteBatch(activityID, shopID, baiduShopID, skuIDs, isSkuIDCustom)
} else {
@@ -139,7 +136,6 @@ func ActivitySkuDeleteBatch(activityID int64, shopID string, baiduShopID int64,
}
func ActivitySkuUpdateBatch(activityID int64, actSkuInfoList []*ebaiapi.ActivitySkuInfo4Update) (faildInfoList []string, err error) {
globals.SugarLogger.Debugf("ebai ActivitySkuUpdateBatch")
if globals.EnableEbaiStoreWrite {
faildInfoList, err = api.EbaiAPI.ActivitySkuUpdateBatch(activityID, actSkuInfoList)
}
@@ -147,7 +143,6 @@ func ActivitySkuUpdateBatch(activityID int64, actSkuInfoList []*ebaiapi.Activity
}
func ActivityDisable(activityID int64, shopID string, baiduShopID, supplierID int64) (err error) {
globals.SugarLogger.Debugf("ebai ActivityDisable")
if globals.EnableEbaiStoreWrite {
err = api.EbaiAPI.ActivityDisable(activityID, shopID, baiduShopID, supplierID)
}
@@ -163,7 +158,6 @@ func getActStoreSkuFromTaskResult(taskReslt []interface{}) (list []*model.ActSto
}
func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (createdList []*model.ActStoreSku2, err error) {
globals.SugarLogger.Debugf("ebai createSkuAct")
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
task := tasksch.NewParallelTask("ebai createSkuAct", nil, ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
@@ -183,7 +177,6 @@ func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.A
}
func cancelSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, actStoreSkuMap map[string][]*model.ActStoreSku2) (canceledList []*model.ActStoreSku2, err error) {
globals.SugarLogger.Debugf("ebai cancelSkuAct")
var vendorActIDs []string
for k := range actStoreSkuMap {
vendorActIDs = append(vendorActIDs, k)
@@ -206,7 +199,6 @@ func cancelSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, actStoreSkuM
}
func deleteSkuActSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, actStoreSkuMap, vendorActInfoMap map[string][]*model.ActStoreSku2) (deletedList []*model.ActStoreSku2, err error) {
globals.SugarLogger.Debugf("ebai deleteSkuActSkus")
var vendorActIDs []string
for k := range actStoreSkuMap {
if k != "" {
@@ -240,7 +232,6 @@ func deleteSkuActSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, actStore
}
func addSkuActSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2, vendorActIDMap map[int]string) (addedList []*model.ActStoreSku2, err error) {
globals.SugarLogger.Debugf("ebai addSkuActSkus, actID:%d", act.ID)
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
if len(actStoreSkuListList) > 0 {
task := tasksch.NewParallelTask("ebai addSkuActSkus", nil, ctx,
@@ -271,7 +262,6 @@ func addSkuActSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.
}
func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actOrderRules []*model.ActOrderRule, actStoreSkuList []*model.ActStoreSku2) (err error) {
globals.SugarLogger.Debugf("ebai SyncAct, actID:%d", act.ID)
vendorActInfoMap := make(map[string][]*model.ActStoreSku2)
deleteActInfoMap := make(map[string][]*model.ActStoreSku2)
vendorActIDMap := make(map[int]string)
@@ -310,7 +300,6 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagNewMask))
}
} else if model.IsSyncStatusUpdate(act.SyncStatus) {
// globals.SugarLogger.Debug(utils.Format4Output(updateItems, false))
if len(actStoreSkuList4Create) > 0 {
addedList, err2 := addSkuActSkus(ctx, nil, act, actStoreSkuList4Create, vendorActIDMap)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, addedList, model.SyncFlagNewMask)...)