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

关于优惠券金额分摊算法的误差 #356

Open
WellJay opened this issue Jun 4, 2020 · 2 comments
Open

关于优惠券金额分摊算法的误差 #356

WellJay opened this issue Jun 4, 2020 · 2 comments

Comments

@WellJay
Copy link

WellJay commented Jun 4, 2020

OmsPortalOrderServiceImpl.calcPerCouponAmount()
特殊情况无法分摊平均,

商品 10、10、10
总价 30元
优惠金额10元;

(10 / 30) * 10 = 3.330

三个优惠加起来9.990元。

@freepcbird
Copy link

加一小段逻辑,分配之后,如果分摊金额不足优惠金额,把差值加到某个商品上,比如第一个,或者最后一个

@wangjia2016
Copy link

他这里面都是满减券,正常应该还有折扣券,抵扣券这种

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

3 participants