storedetail

This commit is contained in:
苏尹岚
2020-11-18 10:22:12 +08:00
parent 5a6dae8d53
commit d14bb10be7
29 changed files with 81 additions and 76 deletions

View File

@@ -1077,7 +1077,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
}()
for _, storeID := range storeIDs {
// todo 可以考虑在需要更新价格再获取
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDJX)
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDJX, "")
if err != nil || storeDetail == nil {
continue
}
@@ -2290,7 +2290,7 @@ func RefreshStoresSkuByVendor(ctx *jxcontext.Context, storeIDs []int, vendorID i
if v.VendorID != vendorID {
return "", fmt.Errorf("门店%d绑定的不是京东", v.StoreID)
}
storeMap[v.StoreID], err = dao.GetStoreDetail(db, v.StoreID, v.VendorID)
storeMap[v.StoreID], err = dao.GetStoreDetail(db, v.StoreID, v.VendorID, "")
if err != nil {
return "", err
}
@@ -2522,7 +2522,7 @@ func ReCalculateJxPrice(db *dao.DaoDB, ctx *jxcontext.Context, storeIDs []int) (
task := tasksch.NewParallelTask("刷新京西平台价格", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeID := batchItemList[0].(int)
if storeDetail, err := dao.GetStoreDetail(db, storeID, model.VendorIDJX); err == nil {
if storeDetail, err := dao.GetStoreDetail(db, storeID, model.VendorIDJX, ""); err == nil {
if storeSkuList, err := dao.GetStoresSkusInfo(db, []int{storeID}, nil); err == nil {
for _, skuBind := range storeSkuList {
skuBind.JxPrice = jxutils.CaculatePriceByPricePack(storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage), skuBind.Price)
@@ -2543,7 +2543,7 @@ func ReCalculateJxPrice(db *dao.DaoDB, ctx *jxcontext.Context, storeIDs []int) (
func ReCalculateJxPriceLight(db *dao.DaoDB, ctx *jxcontext.Context, storeID int) (err error) {
if storeID != 0 {
if storeDetail, err := dao.GetStoreDetail(db, storeID, model.VendorIDJX); err == nil {
if storeDetail, err := dao.GetStoreDetail(db, storeID, model.VendorIDJX, ""); err == nil {
if storeSkuList, err := dao.GetStoresSkusInfo(db, []int{storeID}, nil); err == nil {
for _, skuBind := range storeSkuList {
skuBind.JxPrice = jxutils.CaculatePriceByPricePack(storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage), skuBind.Price)
@@ -2635,7 +2635,7 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
for _, v := range skuNameList {
skuNameMap[v.ID] = v
}
store, err := dao.GetStoreDetail(db, storeID, -1)
store, err := dao.GetStoreDetail(db, storeID, -1, "")
if err != nil {
return nil, err
}
@@ -2752,7 +2752,7 @@ func RefershStoreSkusMidPrice(ctx *jxcontext.Context, storeIDs []int, isCountry
}
for _, v := range storeIDs {
var skuBindInfos []*StoreSkuBindInfo
store, err := dao.GetStoreDetail(db, v, -1)
store, err := dao.GetStoreDetail(db, v, -1, "")
if err != nil {
return err
}
@@ -3124,7 +3124,7 @@ func GetVendorStoreSkuPrice(ctx *jxcontext.Context, vendorIDs []int, skuID int,
inStoreSku.SkuID = skuID
}
inStoreSkuList = append(inStoreSkuList, inStoreSku)
storeDetail2, err := dao.GetStoreDetailByVendorStoreID(db, vendorStoreID, vendorID)
storeDetail2, err := dao.GetStoreDetailByVendorStoreID(db, vendorStoreID, vendorID, "")
if storeDetail2 != nil {
outStoreSkuList, err = handler.GetStoreSkusBareInfo(ctx, v, task, storeDetail2.ID, vendorStoreID, inStoreSkuList)
} else {
@@ -3375,7 +3375,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuBindInfos []*StoreSkuBindInf
skuBindInfo := batchItemList[0].(*StoreSkuBindInfo)
storeID := skuBindInfo.StoreID
skuID := skuBindInfo.Skus[0].SkuID
store, err := dao.GetStoreDetail(db, storeID, -1)
store, err := dao.GetStoreDetail(db, storeID, -1, "")
if len(skuBindInfos) > 1 {
if store.StoreLevel == "D" || store.StoreLevel == "E" {
return retVal, err
@@ -3665,7 +3665,7 @@ func UpdateStoreSkusSpecTagBin(ctx *jxcontext.Context, reader io.Reader, vendorI
results[len(results)-i-1] = tmp
}
for _, v := range results {
store, err := dao.GetStoreDetail(db, v.StoreID, model.VendorIDMTWM)
store, err := dao.GetStoreDetail(db, v.StoreID, model.VendorIDMTWM, "")
if err != nil || store == nil {
continue
}
@@ -3775,7 +3775,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
}
}
if type1 < type1Count || type2 < type2Count {
storeDetail, _ := dao.GetStoreDetail(db, store.StoreID, store.VendorID)
storeDetail, _ := dao.GetStoreDetail(db, store.StoreID, store.VendorID, "")
var (
type1Str = "爆品数量低于8个"
type2Str = "爆品价格小于1元的爆品数量低于5个"
@@ -3895,7 +3895,7 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
} else {
return result, fmt.Errorf("没有找到该京东skuID对应的京西skuID,京东skuID :[%v]", v.JdSkuID)
}
store, err := dao.GetStoreDetailByVendorStoreID(db, utils.Int2Str(v.JdStoreID), vendorID)
store, err := dao.GetStoreDetailByVendorStoreID(db, utils.Int2Str(v.JdStoreID), vendorID, "")
if err != nil || store == nil {
return result, fmt.Errorf("没有找到该京东门店对应的京西门店!,京东门店ID :[%v]", v.JdStoreID)
}
@@ -3967,7 +3967,7 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
if len(skus) == 0 {
continue
}
store, _ := dao.GetStoreDetail(db, v.JdStoreID, vendorID)
store, _ := dao.GetStoreDetail(db, v.JdStoreID, vendorID, "")
err = jxutils.Strings2Objs(store.PricePercentagePackStr, &pricePercentagePack)
if skus[0].Unit == model.SpecialUnit {
if skus[0].SpecUnit == model.SpecUnitNames[1] || skus[0].SpecUnit == model.SpecUnitNames[2] {
@@ -4055,7 +4055,7 @@ func RefreshJxPriceByVendor2(ctx *jxcontext.Context, storeIDs []int, vendorID in
pricePercentagePack []*model.PricePercentageItem
skuNameMap = make(map[int]int64)
)
storeDetail, _ := dao.GetStoreDetail(db, storeID, vendorID)
storeDetail, _ := dao.GetStoreDetail(db, storeID, vendorID, "")
err = jxutils.Strings2Objs(storeDetail.PricePercentagePackStr, &pricePercentagePack)
if partner.IsMultiStore(vendorID) {
mulitStoreSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
@@ -4312,7 +4312,7 @@ func buildStoreSkuBindInfosAndFocus(ctx *jxcontext.Context, db *dao.DaoDB, store
skus, _ := dao.GetSkus(db, nil, []int{nameID}, nil, nil, nil)
err = jxutils.Strings2Objs(store.PricePercentagePackStr, &pricePercentagePack)
price := jxutils.CaculateJxPriceByPricePack(pricePercentagePack, 0, int(v.SkuList[0].VendorPrice))
store2, _ := dao.GetStoreDetail(db, store.ID, model.VendorIDJX)
store2, _ := dao.GetStoreDetail(db, store.ID, model.VendorIDJX, "")
if store2 != nil {
err = jxutils.Strings2Objs(store2.PricePercentagePackStr, &pricePercentagePack2)
jxPrice = jxutils.CaculatePriceByPricePack(pricePercentagePack2, 0, price)
@@ -4950,7 +4950,7 @@ func GetSpecialtyStoreSkus(ctx *jxcontext.Context, storeIDs, vendorIDs []int) (e
)
for _, v := range vendorIDs {
for _, vv := range storeIDs {
storeDetail, err := dao.GetStoreDetail(db, vv, v)
storeDetail, err := dao.GetStoreDetail(db, vv, v, "")
if err != nil || storeDetail == nil {
continue
}