Эх сурвалжийг харах

fix 订单优惠码对应优惠券id记录

zoujiajian 2 жил өмнө
parent
commit
c91509f292

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/OrderDon.java

@@ -125,6 +125,11 @@ public class OrderDon extends BaseEntity implements Serializable {
      */
     private Long couponUserId;
 
+    /**
+     * 优惠券id
+     */
+    private Long couponId;
+
     /**
      * 购买数量
      */

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/views/OrderDonBackView.java

@@ -165,6 +165,9 @@ public class OrderDonBackView {
 	@DbField("o.coupon_user_id")
 	private Long couponUserId;
 
+	@DbField("o.coupon_id")
+	private Long couponId;
+
 	@DbIgnore
 	private String couponName;
 

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

@@ -2298,6 +2298,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			}
 			orderDon.setCouponMoney(couponMoney);
 			orderDon.setCouponUserId(couponUser.getId());
+			orderDon.setCouponId(couponUser.getCouponId());
 		}
 		//特殊渠道推广优惠. 360
 		if (subsidyId == null && orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0L) {

+ 3 - 3
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -571,9 +571,6 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		if (StrUtil.hasEmpty(account, password)) {
 			throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
 		}
-		if (cuiQiuMailService.isCuiQiuEmail(renewalView.getAccount())) {
-			return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId(), type, loginReq.getLinkType());
-		}
 		if (renewalView.getGoodsId() == 1l) {
 			Integer linkType = loginReq.getLinkType();
 			if (type == null && linkType == null) {
@@ -590,6 +587,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				redisService.incr(key, 1L);
 			}
 		}
+		if (cuiQiuMailService.isCuiQiuEmail(renewalView.getAccount())) {
+			return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId(), type, loginReq.getLinkType());
+		}
 		//银河域名邮件
 		String code = yhMailService.getVerifyCode(account, renewalView.getGoodsId(), type, loginReq.getLinkType());
 		GroupsRelationLoginCodeRecord record = new GroupsRelationLoginCodeRecord();

+ 6 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsOrderController.java

@@ -195,6 +195,12 @@ public class CmsOrderController {
 				}
 			}
 
+			//使用优惠码
+			if (data.getCouponId() != null) {
+				Optional.ofNullable(couponMapper.selectById(data.getCouponId())).ifPresent(coupon -> data.setCouponName(coupon.getName()));
+				data.setCouponMoney(data.getCouponMoney() == null ? BigDecimal.ZERO : data.getCouponMoney());
+			}
+
 			if (data.getCouponUserId() != 0) {
 				data.setCouponName(couponMapper.getCouponNameByCouponUserId(data.getCouponUserId()));
 				data.setCouponMoney(data.getCouponMoney() == null ? BigDecimal.ZERO : data.getCouponMoney());