根据skuID更新
This commit is contained in:
@@ -876,10 +876,10 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = OnUpdateThing(ctx, db, nil, int64(v.ID), model.ThingTypeSku); err != nil {
|
// if err = OnUpdateThing(ctx, db, nil, int64(v.ID), model.ThingTypeSku); err != nil {
|
||||||
dao.Rollback(db)
|
// dao.Rollback(db)
|
||||||
return 0, err
|
// return 0, err
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
skuIDs, err2 := dao.GetSkuIDByNames(db, []int{nameID})
|
skuIDs, err2 := dao.GetSkuIDByNames(db, []int{nameID})
|
||||||
@@ -1409,7 +1409,7 @@ func UpdateSkuNamesExPrefix(ctx *jxcontext.Context, nameIDs []int, exPrefix, fro
|
|||||||
for _, v := range skuList {
|
for _, v := range skuList {
|
||||||
skuIDs = append(skuIDs, v.ID)
|
skuIDs = append(skuIDs, v.ID)
|
||||||
}
|
}
|
||||||
CurVendorSync.SyncStoresSkus2(ctx, db, partner.GetSingleStoreVendorIDs(), nil, false, skuIDs, nil, 0, true, true)
|
// CurVendorSync.SyncStoresSkus2(ctx, db, partner.GetSingleStoreVendorIDs(), nil, false, skuIDs, nil, model.SyncFlagModifiedMask, true, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2758,13 +2758,13 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
storeIDs []int
|
storeIDs []int
|
||||||
skuIDs []int
|
skuIDs []int
|
||||||
price int
|
|
||||||
)
|
)
|
||||||
sheetParam := &SheetParam{
|
sheetParam := &SheetParam{
|
||||||
OutSkuIDCol: 1,
|
OutSkuIDCol: 1,
|
||||||
SkuPriceCol: 3,
|
SkuPriceCol: 3,
|
||||||
SkuRow: 1,
|
SkuRow: 1,
|
||||||
}
|
}
|
||||||
|
// xlsx, err := excelize.OpenFile("111.xlsx")
|
||||||
xlsx, err := excelize.OpenReader(reader)
|
xlsx, err := excelize.OpenReader(reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@@ -2784,8 +2784,19 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, v := range skuList {
|
for _, v := range skuList {
|
||||||
|
var (
|
||||||
|
price int
|
||||||
|
specQuality float64
|
||||||
|
)
|
||||||
if v.Unit == model.SpecialUnit {
|
if v.Unit == model.SpecialUnit {
|
||||||
price = model.SpecialSpecQuality / int(utils.Float64TwoInt64(float64(v.SpecQuality))) * skuMap[v.ID]
|
if v.SpecUnit == model.SpecUnitNames[1] || v.SpecUnit == model.SpecUnitNames[2] {
|
||||||
|
specQuality = float64(v.SpecQuality) * 1000
|
||||||
|
} else {
|
||||||
|
specQuality = float64(v.SpecQuality)
|
||||||
|
}
|
||||||
|
price = int(utils.Float64TwoInt64(utils.Int2Float64(model.SpecialSpecQuality) / specQuality * utils.Int2Float64(skuMap[v.ID])))
|
||||||
|
} else {
|
||||||
|
price = skuMap[v.ID]
|
||||||
}
|
}
|
||||||
if skuNameMap[v.NameID] < price {
|
if skuNameMap[v.NameID] < price {
|
||||||
skuNameMap[v.NameID] = price
|
skuNameMap[v.NameID] = price
|
||||||
|
|||||||
Reference in New Issue
Block a user