Commit 711000c4 by Huang Linyu

老版本兼容bug 订单金额计算有误 修复

parent 76be5195
......@@ -745,7 +745,7 @@ public abstract class AbstractOrderService<H extends AbstractOrderBean<T>, T> ex
*/
protected void checkTotalAmount(H abstractOrderBean) {
BigDecimal totAmount = getTotalAmount(abstractOrderBean);
if (totAmount.compareTo(abstractOrderBean.getAmount()) != 0) {
if (totAmount.compareTo(abstractOrderBean.getAmount()) != 1) {
throw new OrderException(-5, "订单金额计算有误");
}
}
......
......@@ -796,7 +796,7 @@ public class EventActivityOrderService extends
(BigDecimal.valueOf(resourcePrice.getCommuneGuestPrice())
.subtract(BigDecimal.valueOf(resourcePrice
.getCommuneGuestMinus()))))).doubleValue();
if (resourceInfo.getAmount().compareTo(BigDecimal.valueOf(amount)) != 0) {
if (resourceInfo.getAmount().compareTo(BigDecimal.valueOf(amount)) != -1) { //如果金额大于或者等于实际金额正常
throw new OrderException(-5, "订单金额计算有误");
} else if (!resourcePrice.getCommunePrice().equals(resourceInfo.getCommunePrice())
|| !resourcePrice.getCommuneMinus().equals(resourceInfo.getCommuneMinus())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment