log delete

This commit is contained in:
richboo111
2022-10-24 14:37:32 +08:00
153 changed files with 44 additions and 858 deletions

View File

@@ -38,7 +38,6 @@ var (
)
func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int) (err error) {
globals.SugarLogger.Debugf("CreateStoreCategoryByStoreSku vendorID:%d, storeID:%d", vendorID, storeID)
db := dao.GetDB()
txDB, _ := dao.Begin(db)
defer func() {
@@ -70,7 +69,6 @@ func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int
}
func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
globals.SugarLogger.Debugf("SyncStoreCategories %s storeID:%d, %s, userName:%s", model.VendorChineseNames[vendorID], storeID, vendorStoreID, ctx.GetUserName())
handler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
num := 0
db := dao.GetDB()
@@ -388,12 +386,6 @@ func sku2Update(vendorID int, sku *dao.StoreSkuSyncInfo, syncStatus int8) (item
func updateStoreSku(db *dao.DaoDB, vendorID int, storeSkuList []*dao.StoreSkuSyncInfo, syncStatus int8) (num int64, err error) {
if len(storeSkuList) > 0 {
// defer func() {
// if r := recover(); r != nil {
// globals.SugarLogger.Debugf("updateStoreSku panic, vendorID:%d, len:%d, storeID0:%d, skuID0:%d, syncStatus:%d", vendorID, len(storeSkuList), storeSkuList[0].StoreID, storeSkuList[0].SkuID, syncStatus)
// panic(r)
// }
// }()
if vendorID == model.VendorIDJDShop {
if syncStatus != model.SyncFlagPriceMask && syncStatus != model.SyncFlagSaleMask && syncStatus != model.SyncFlagStockMask {
for _, v := range storeSkuList {
@@ -441,7 +433,6 @@ func isSkuLockTimeValid(sku *dao.StoreSkuSyncInfo) bool {
}
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, isFull bool, vendorID, storeID int, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isContinueWhenError bool) (err error) {
globals.SugarLogger.Debugf("syncStoreSkuNew causeFlag:%d ,vendorOrgCode:%s", causeFlag, vendorOrgCode)
db := dao.GetDB()
storeDetail, err := dao.GetStoreDetail(db, storeID, vendorID, vendorOrgCode)
if err != nil {
@@ -562,7 +553,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB {
// globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d但没有平台分类ID", storeID, sku.SkuID)
globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d但没有平台分类ID", storeID, sku.SkuID)
} else {
isAdded2Update = true
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
@@ -1113,8 +1104,6 @@ func AddCreateFlagForJxStoreSku(ctx *jxcontext.Context, parentTask tasksch.ITask
}
func ClearRemoteStoreStuffAndSetNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, isAsync, isContinueWhenError bool) (hint string, err error) {
userName := ctx.GetUserName()
globals.SugarLogger.Debugf("ClearRemoteStoreStuffAndSetNew storeID:%d, isContinueWhenError:%t, userName:%s", storeID, isContinueWhenError, userName)
handler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
if handler == nil {
return "", fmt.Errorf("平台:%s不支持此操作", model.VendorChineseNames[vendorID])
@@ -1272,7 +1261,6 @@ func parseStoreSkuActList(isCreateAct bool, storeSkuList []*partner.StoreSkuInfo
}
func createStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo, isChangePrice bool) (err error) {
globals.SugarLogger.Debugf("createStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
skuIDs := putils.StoreSkuList2IDs(storeSkuList)
db := dao.GetDB()
storeSkuActList, err := dao.GetStoresSkusAct(db, 0, false, []int{storeID}, skuIDs, []int{vendorID}, false, 1, 0)
@@ -1286,7 +1274,6 @@ func createStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendor
}
func cancelStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo, isChangePrice bool) (err error) {
globals.SugarLogger.Debugf("cancelStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
skuIDs := putils.StoreSkuList2IDs(storeSkuList)
db := dao.GetDB()
storeSkuActList, err := dao.GetStoresSkusAct(db, 0, false, []int{storeID}, skuIDs, []int{vendorID}, true, 0, 0)
@@ -1301,7 +1288,6 @@ func cancelStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendor
func createStoreSkuActs2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string,
storeSkuList []*partner.StoreSkuInfo, storeSkuActList []*model.StoreSkuAct) (err error) {
globals.SugarLogger.Debugf("createStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
storeSkuList2, storeSkuActMap := parseStoreSkuActList(true, storeSkuList, storeSkuActList)
if len(storeSkuList2) > 0 {
storeSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
@@ -1323,7 +1309,6 @@ func createStoreSkuActs2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
func cancelStoreSkuActs2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string,
storeSkuList []*partner.StoreSkuInfo, storeSkuActList []*model.StoreSkuAct) (err error) {
globals.SugarLogger.Debugf("cancelStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
storeSkuList2, storeSkuActMap := parseStoreSkuActList(false, storeSkuList, storeSkuActList)
if len(storeSkuList2) > 0 {
storeSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)