Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,关于SKU算法的一点建议 #2

Open
WoKee opened this issue May 10, 2019 · 0 comments
Open

你好,关于SKU算法的一点建议 #2

WoKee opened this issue May 10, 2019 · 0 comments

Comments

@WoKee
Copy link

WoKee commented May 10, 2019

算法入口 skuCollection 不应该遍历initData的key去获取组合列表,遇到initData库存组合过多的情况,这种方法效率不是很理想。

建议:
skuCollection 新增参数String[][] lables 标签类目。如 : [["蓝色,“红色"],[“XL”,"L"],["优质","一般"]];

skuCollection(String[][] lables , Map<String, BaseSkuModel> initData ){ ...}

由lables 去建立一次组合数,获取所有的组合列表Map<String, BaseSkuModel> result。

`initData遍历key去设置result的库存以及价格信息,如此可以减少每次去获取组合列表的耗时。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant