- 调价包改为按SKU的价格来使用(GetPricePercentage)
This commit is contained in:
@@ -223,7 +223,7 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
task := tasksch.NewParallelTask("SyncStoreSkus饿百2", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
storeSku := batchItemList[0].(*tStoreSkuFullInfo)
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, storeSku.UnitPrice, int(storeDetail.PricePercentage))
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, storeSku.Price, int(storeDetail.PricePercentage))
|
||||
// globals.SugarLogger.Debugf("skuID:%d, price:%d, pricePercentage:%d", storeSku.SkuID, storeSku.Price, pricePercentage)
|
||||
// globals.SugarLogger.Debugf(utils.Format4Output(storeDetail.PricePercentagePackObj, false))
|
||||
updateFields := []string{model.FieldEbaiSyncStatus}
|
||||
|
||||
@@ -65,7 +65,7 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
}
|
||||
if storeSku.StoreSkuSyncStatus&(model.SyncFlagPriceMask|model.SyncFlagNewMask) != 0 {
|
||||
vendorSkuID4Price = storeSku.VendorSkuID
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, int(storeSku.UnitPrice), int(storeDetail.PricePercentage))
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, int(storeSku.Price), int(storeDetail.PricePercentage))
|
||||
skuPriceInfoList = append(skuPriceInfoList, &jdapi.SkuPriceInfo{
|
||||
OutSkuId: utils.Int2Str(storeSku.SkuID),
|
||||
Price: constrainPrice(jxutils.CaculateSkuVendorPrice(int(storeSku.Price), pricePercentage, storeSku.CatPricePercentage)),
|
||||
|
||||
@@ -308,7 +308,7 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
if skuItem.Img == "" {
|
||||
err = fmt.Errorf("SKUNAME%d:%s没有图片,同步失败", skuItem.NameID, skuItem.Name)
|
||||
} else {
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, int(skuItem.UnitPrice), int(storeDetail.PricePercentage))
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, int(skuItem.Price), int(storeDetail.PricePercentage))
|
||||
// globals.SugarLogger.Debugf("skuID:%d, price:%d, pricePercentage:%d", skuItem.SkuID, skuItem.Price, pricePercentage)
|
||||
// globals.SugarLogger.Debugf(utils.Format4Output(storeDetail.PricePercentagePackObj, false))
|
||||
foodData["name"] = jxutils.ComposeSkuName(skuItem.Prefix, skuItem.Name, skuItem.Comment, skuItem.Unit, skuItem.SpecQuality, skuItem.SpecUnit, mtwmapi.MaxSkuNameCharCount)
|
||||
|
||||
@@ -184,7 +184,7 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
func(rootTask *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
v := batchItemList[0]
|
||||
skuItem := v.(*dao.StoreSkuSyncInfo)
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, int(skuItem.UnitPrice), int(storeDetail.PricePercentage))
|
||||
pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, int(skuItem.Price), int(storeDetail.PricePercentage))
|
||||
updateFields := []string{model.FieldWscSyncStatus}
|
||||
storeSkuBind := &model.StoreSkuBind{}
|
||||
storeSkuBind.ID = skuItem.BindID
|
||||
|
||||
Reference in New Issue
Block a user