- up
This commit is contained in:
@@ -18,7 +18,7 @@ func (p *PurchaseHandler) GetStoreSkusBatchSize(funcID int) (batchSize int) {
|
||||
case partner.FuncUpdateStoreSkusStock, partner.FuncUpdateStoreSkusStatus, partner.FuncUpdateStoreSkusPrice:
|
||||
batchSize = mtwmapi.MaxStoreSkuBatchSize
|
||||
case partner.FuncGetStoreSkusBareInfo:
|
||||
batchSize = 1
|
||||
batchSize = partner.UnlimitedBatchSize
|
||||
case partner.FuncDeleteStoreSkus:
|
||||
batchSize = 1 // 可考虑用批量操作
|
||||
case partner.FuncCreateStoreSkus, partner.FuncUpdateStoreSkus:
|
||||
@@ -246,8 +246,14 @@ func mtwmSkuStatus2Jx(mtwmSkuStatus int) (jxSkuStatus int) {
|
||||
return jxSkuStatus
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, skuIDs []int) (skuNameList []*partner.SkuNameInfo, err error) {
|
||||
if len(skuIDs) == 0 {
|
||||
func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (skuNameList []*partner.SkuNameInfo, err error) {
|
||||
if len(storeSkuList) == 1 {
|
||||
skuInfo, err := api.MtwmAPI.RetailGet(vendorStoreID, utils.Int2Str(storeSkuList[0].SkuID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
skuNameList = append(skuNameList, vendorSku2Jx(skuInfo))
|
||||
} else {
|
||||
for {
|
||||
result, err := api.MtwmAPI.RetailList(vendorStoreID, len(skuNameList), mtwmapi.GeneralMaxLimit)
|
||||
if err != nil {
|
||||
@@ -258,12 +264,6 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
skuInfo, err := api.MtwmAPI.RetailGet(vendorStoreID, utils.Int2Str(skuIDs[0]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
skuNameList = append(skuNameList, vendorSku2Jx(skuInfo))
|
||||
}
|
||||
return skuNameList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user