Ver Fonte

金额校验

liujunchi há 3 anos atrás
pai
commit
c31c1c4eb1

+ 3 - 2
cooleshow-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/service/impl/OmsPortalOrderServiceImpl.java

@@ -260,10 +260,11 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
             order.setIntegrationAmount(calcIntegrationAmount(orderItemList));
         }
         BigDecimal payAmount = calcPayAmount(order);
-        if (payAmount.compareTo(order.getTotalAmount().subtract(couponAmount)) != 0) {
+        LOG.info("payAmount:{},totalAmount:{},couponAmount:{}",payAmount,order.getTotalAmount(),couponAmount);
+        if (orderParam.getOrderAmount().compareTo(order.getTotalAmount().subtract(couponAmount)) != 0) {
             throw new BizException("订单金额校验不通过");
         }
-        order.setPayAmount(payAmount);
+        order.setPayAmount(orderParam.getOrderAmount());
         //转化为订单信息并插入数据库
         order.setMemberId(currentMember.getId());
         order.setCreateTime(new Date());