合并
This commit is contained in:
@@ -2,15 +2,16 @@ package cms
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"github.com/astaxie/beego"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
@@ -472,10 +473,10 @@ func CompareJxAndVendor(vendorID int, storeIDStr, vendorStoreID, storeName strin
|
||||
diffData.AppendData(vendorID, outPutData)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("CompareJxAndVendor vendorSkuInfo.SkuList:%d is nil", skuID)
|
||||
globals.SugarLogger.Debugf("CompareJxAndVendor vendorSkuInfo.SkuList:%d is nil", skuID)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("CompareJxAndVendor skuID:%d is nil", skuID)
|
||||
globals.SugarLogger.Debugf("CompareJxAndVendor skuID:%d is nil", skuID)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -555,10 +556,10 @@ func CompareJxAndMultiVenderDepot(ctx *jxcontext.Context, vendorMap map[int]bool
|
||||
depotDiffData.AppendData2(vendorID, outPutData)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("CompareJxAndMultiVenderDepot vendorSkuInfo.SkuList:%d is nil", skuID)
|
||||
globals.SugarLogger.Debugf("CompareJxAndMultiVenderDepot vendorSkuInfo.SkuList:%d is nil", skuID)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("CompareJxAndMultiVenderDepot skuID:%d is nil", skuID)
|
||||
globals.SugarLogger.Debugf("CompareJxAndMultiVenderDepot skuID:%d is nil", skuID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,9 +219,16 @@ func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
}
|
||||
|
||||
func isStoreSkuSyncNeedDelete(storeSku *dao.StoreSkuSyncInfo) bool {
|
||||
return model.IsSyncStatusDelete(storeSku.SkuSyncStatus) ||
|
||||
if model.IsSyncStatusDelete(storeSku.SkuSyncStatus) ||
|
||||
storeSku.BindDeletedAt != utils.DefaultTimeValue || storeSku.BindID == 0 ||
|
||||
storeSku.NameID == 0 || storeSku.NameStatus != model.SkuStatusNormal || storeSku.Status != model.SkuStatusNormal
|
||||
storeSku.NameID == 0 || storeSku.NameStatus != model.SkuStatusNormal {
|
||||
return true
|
||||
}
|
||||
if storeSku.Status != model.SkuStatusNormal {
|
||||
storeSku.IsDeletedBySku = true
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSkuInfo) {
|
||||
@@ -238,6 +245,7 @@ func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSk
|
||||
JxUnitPrice: inSku.UnitPrice,
|
||||
VendorSkuID2: utils.Int64ToStr(inSku.JdsWareID),
|
||||
JdsStockSwitch: inSku.JdsStockSwitch,
|
||||
IsDeletedBySku: inSku.IsDeletedBySku,
|
||||
}
|
||||
if !isStoreSkuSyncNeedDelete(inSku) {
|
||||
outSku.Stock = model.MaxStoreSkuStockQty
|
||||
@@ -914,9 +922,6 @@ func amendAndPruneStoreStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, v
|
||||
})
|
||||
}
|
||||
}
|
||||
if storeID == 103075 {
|
||||
fmt.Println("sku2Delete", utils.Format4Output(sku2Delete, false))
|
||||
}
|
||||
if opType == AmendPruneOnlyAmend || opType == AmendPruneAll {
|
||||
for _, v := range localSkuList {
|
||||
if !model.IsSyncStatusDelete(v.SkuSyncStatus) && v.BindID != 0 {
|
||||
|
||||
Reference in New Issue
Block a user