Procházet zdrojové kódy

fix 优惠金额错误

zoujiajian před 3 roky
rodič
revize
4956ee8b20

+ 4 - 0
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -1927,6 +1927,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 	 * 使用优惠营销 订单金额抵扣
 	 */
 	public void deductOrderMoney(OrderDon orderDon, CouponUser couponUser, BigDecimal balance, User user, BigDecimal skuMoney, Integer goodsType) {
+		BigDecimal first_money = orderDon.getMoney();
 		//存在优惠券
 		if (couponUser != null) {
 			Long couponId = couponUser.getCouponId();
@@ -1946,6 +1947,9 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 				orderDon.setMoney(subtractMoney);
 				couponMoney = orderDon.getRealMoney().subtract(subtractMoney);
 			}
+			if (couponMoney != null && couponMoney.compareTo(first_money) >= 0) {
+				throw BusinessRuntimeException.getInstance(I18nMessageUtil.getI18nMsg("coupon_money_error"));
+			}
 			orderDon.setCouponMoney(couponMoney);
 			orderDon.setCouponUserId(couponUser.getId());
 		}

+ 2 - 1
netflix-web/src/main/resources/i18n/yhlx.properties

@@ -116,4 +116,5 @@ required_info_error=请输入必填信息
 bind_account_phone_change_has_registered=您更换的手机号已注册,无法更换
 bind_account_detail_not_exist=您未有绑定账号信息
 coupon_sku_not_available_renew_error=不能用于该规格续费
-coupon_sku_not_available_order_error=不能用于该规格下单
+coupon_sku_not_available_order_error=不能用于该规格下单
+coupon_money_error=支付金额不能小于优惠金额

+ 1 - 0
netflix-web/src/main/resources/i18n/yhlx_en_US.properties

@@ -117,3 +117,4 @@ bind_account_phone_change_has_registered=The phone number for login is already r
 bind_account_detail_not_exist=You have not bound your account information
 coupon_sku_not_available_renew_error=Cannot be used for renewal of this specification
 coupon_sku_not_available_order_error=Cannot be used to place an order for this specification
+coupon_money_error=The payment amount cannot be less than the discounted amount

+ 1 - 0
netflix-web/src/main/resources/i18n/yhlx_ja_JP.properties

@@ -117,3 +117,4 @@ bind_account_phone_change_has_registered=ログイン用の電話番号が既に
 bind_account_detail_not_exist=アカウント情報が関連付けられていない
 coupon_sku_not_available_renew_error=本仕様の更新には使用できません
 coupon_sku_not_available_order_error=この仕様の注文には使用できません
+coupon_money_error=支払額が割引額を下回ることはない

+ 1 - 0
netflix-web/src/main/resources/i18n/yhlx_ko_KR.properties

@@ -117,3 +117,4 @@ bind_account_phone_change_has_registered=로그인용 휴대폰 번호가 이미
 bind_account_detail_not_exist=계정 정보가 없습니다.
 coupon_sku_not_available_renew_error=이 사양의 갱신에는 사용할 수 없습니다
 coupon_sku_not_available_order_error=이 사양을 주문하는 데 사용할 수 없습니다
+coupon_money_error=결제 금액은 할인된 금액보다 작을 수 없습니다

+ 2 - 1
netflix-web/src/main/resources/i18n/yhlx_zh_CN.properties

@@ -116,4 +116,5 @@ required_info_error=请输入必填信息
 bind_account_phone_change_has_registered=您更换的手机号已注册,无法更换
 bind_account_detail_not_exist=您未有绑定账号信息
 coupon_sku_not_available_renew_error=不能用于该规格续费
-coupon_sku_not_available_order_error=不能用于该规格下单
+coupon_sku_not_available_order_error=不能用于该规格下单
+coupon_money_error=支付金额不能小于优惠金额

+ 2 - 1
netflix-web/src/main/resources/i18n/yhlx_zh_HK.properties

@@ -116,4 +116,5 @@ required_info_error=請輸入必填信息
 bind_account_phone_change_has_registered=你更換的手機號已註冊,無法更換
 bind_account_detail_not_exist=您未有綁定賬號信息
 coupon_sku_not_available_renew_error=不能用于該規格續費
-coupon_sku_not_available_order_error=不能用于該規格下單
+coupon_sku_not_available_order_error=不能用于該規格下單
+coupon_money_error=支付金額不能小于優惠金額