瀏覽代碼

Merge branch 'sys_coupon' of http://git.dayaedu.com/yonge/mec

zouxuan 4 年之前
父節點
當前提交
ef297a5eaa
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -211,9 +211,9 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(studentGoodsSell.getCouponIdList(),amount,studentGoodsSell.getType() != 1);
         amount = studentPaymentOrder.getActualAmount();
         // 判断金额是否正确
-//        if (studentGoodsSell.getTotalAmount().compareTo(amount) != 0) {
-//            throw new BizException("非法请求");
-//        }
+        if (studentGoodsSell.getTotalAmount().compareTo(amount) != 0) {
+            throw new BizException("非法请求");
+        }
         studentGoodsSell.setCouponMarketAmount(studentPaymentOrder.getCouponRemitFee());
         studentGoodsSell.setOrganId(student.getOrganId());
         studentGoodsSell.setTotalAmount(amount);
@@ -464,9 +464,9 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             }
         }
         List<Integer> couponIdList = repairInfo.getCouponIdList();
+        BigDecimal totalAmount = amount;
         StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(couponIdList,amount,repairInfo.getType() != 1);
-        amount = studentPaymentOrder.getActualAmount();
-        amount = amount.subtract(repairInfo.getExemptionAmount());
+        amount = totalAmount.subtract(repairInfo.getExemptionAmount());
         if (amount.compareTo(BigDecimal.ZERO) < 0) {
             throw new BizException("特权减免金额不能大于总金额");
         }