zoujiajian 1 vuosi sitten
vanhempi
sitoutus
d725a710fe

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/GiftCardGoodsSku.java

@@ -19,7 +19,7 @@ public class GiftCardGoodsSku extends BaseEntity{
 	private Long goodsId;
 
 	/**
-	 * 礼品卡类型 1现金卡、2虚拟卡
+	 * 礼品卡类型 1现金卡、2AI 3.流媒体
 	 */
 	private Integer gcType;
 

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/GiftCardUserRecord.java

@@ -20,7 +20,7 @@ public class GiftCardUserRecord extends BaseEntity{
 	private Long orderId;
 
 	/**
-	 * 礼品卡类型
+	 * 礼品卡类型 1现金卡、2AI 3.流媒体
 	 */
 	private Integer gcType;
 

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/request/GiftCardGoodsSkuReq.java

@@ -21,7 +21,7 @@ public class GiftCardGoodsSkuReq {
 	private Long goodsId;
 
 	/**
-	 * 礼品卡类型 1现金卡、2虚拟卡
+	 * 礼品卡类型 1现金卡、2.AI 3.流媒体
 	 */
 	private Integer gcType;
 

+ 1 - 2
netflix-service/src/main/java/com/cyksj/service/giftcard/impl/GiftCardGoodsSkuServiceImpl.java

@@ -76,11 +76,10 @@ public class GiftCardGoodsSkuServiceImpl extends ServiceImpl<GiftCardGoodsSkuMap
 			if (!sku.getStatus()) {
 				throw BusinessRuntimeException.getInstance("存在下架的虚拟卡规格,请重新选择");
 			}
-			gcType = 2;
 			data.setGcGoodsId(sku.getGoodsId());
 		}
 		data.setGcType(gcType);
-		if (gcType == 2 && data.getId() == null) {
+		if (gcType != 1 && data.getId() == null) {
 			GiftCardGoodsSku one = this.getOne(Wrappers.lambdaQuery(GiftCardGoodsSku.class)
 					.eq(GiftCardGoodsSku::getGcSkuId, gcSkuId).last("limit 1"));
 			if (one != null) {

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -591,7 +591,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		}
 		giftCardUserRecord.setToUserId(userId);
 		int update = giftCardUserRecordMapper.update(null, Wrappers.lambdaUpdate(GiftCardUserRecord.class)
-				.set(giftCardUserRecord.getGcType() == 2, GiftCardUserRecord::getIsUsed, true)
+				.set(giftCardUserRecord.getGcType() != 1, GiftCardUserRecord::getIsUsed, true)
 				.set(GiftCardUserRecord::getToUserId, userId)
 				.set(GiftCardUserRecord::getIsSend, true)
 				.set(GiftCardUserRecord::getReceivedTime, DateTime.now())
@@ -601,7 +601,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		if (update > 0) {
 			//虚拟卡
 			//直接发送 对应规格车票
-			if (giftCardUserRecord.getGcType() == 2) {
+			if (giftCardUserRecord.getGcType() != 1) {
 				Long gcSkuId = giftCardUserRecord.getGcSkuId();
 				log.info("用户userId:{}领取礼品卡id:{},开始发放虚拟车票skuId:{}", userId, giftCardUserRecord.getId(), gcSkuId);
 				GoodsDonSku sku = goodsDonSkuMapper.selectById(gcSkuId);

+ 10 - 11
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/GiftCardController.java

@@ -1,6 +1,5 @@
 package com.cyksj.web.controller.manage.goods;
 
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
@@ -86,16 +85,16 @@ public class GiftCardController {
 		if (byId == null) {
 			return GatewayResponse.SUCCESS.newBuilder().toResult();
 		}
-		if (!byId.getStatus()) {
-			//校验礼品卡已上架多少个 最多上架三个
-			int count = giftCardGoodsSkuService.count(Wrappers.lambdaQuery(GiftCardGoodsSku.class)
-					.eq(GiftCardGoodsSku::getStatus, true)
-					.eq(GiftCardGoodsSku::getDeleted, true)
-					.eq(GiftCardGoodsSku::getGcType, byId.getGcType()));
-			if (count > 2) {
-				throw BusinessRuntimeException.getInstance(String.format("%s最多上架三个", byId.getGcType() == 1 ? "现金卡" : "虚拟卡"));
-			}
-		}
+//		if (!byId.getStatus()) {
+//			//校验礼品卡已上架多少个 最多上架三个
+//			int count = giftCardGoodsSkuService.count(Wrappers.lambdaQuery(GiftCardGoodsSku.class)
+//					.eq(GiftCardGoodsSku::getStatus, true)
+//					.eq(GiftCardGoodsSku::getDeleted, true)
+//					.eq(GiftCardGoodsSku::getGcType, byId.getGcType()));
+//			if (count > 2) {
+//				throw BusinessRuntimeException.getInstance(String.format("%s最多上架三个", byId.getGcType() == 1 ? "现金卡" : "虚拟卡"));
+//			}
+//		}
 		byId.setStatus(!byId.getStatus());
 		giftCardGoodsSkuService.updateById(byId);
 		//设置对应礼品卡平台 最低价格

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/user/UserController.java

@@ -397,7 +397,7 @@ public class UserController {
     public Result<SearchResult<GiftCardUserPayFrontView>> getGiftCard() {
         long userId = StpUserUtil.getLoginIdAsLong();
         String condition = String.format("and (user_id = %s or to_user_id = %s)", userId, userId);
-        SearchResult<GiftCardUserPayFrontView> view = beanSearcher.search(GiftCardUserPayFrontView.class, MapUtils.builder()
+        SearchResult<GiftCardUserPayFrontView> view = beanSearcher.search(GiftCardUserPayFrontView.class, MapUtils.flatBuilder(request.getParameterMap())
                 .put("condition", condition)
                 .put("uid", userId)
                 .orderBy(GiftCardUserRecordView::getIsUsed).asc()