This commit is contained in:
2025-05-30 10:31:21 +08:00
parent 115edc19fa
commit 80f4491836
73 changed files with 310 additions and 485 deletions

View File

@@ -166,15 +166,11 @@ public class OrderBiz {
}
// 免费送逻辑,之前已经赠送了的
if (!isBuy) {
switch (goodsType) {
case 0:
isBuy = videoRepository.getUserIsBuy(userId, goodsId);
break;
case 1:
case 2:
isBuy = sourceRepository.getUserIsBuy(userId, goodsType, goodsId);
break;
}
isBuy = switch (goodsType) {
case 0 -> videoRepository.getUserIsBuy(userId, goodsId);
case 1, 2 -> sourceRepository.getUserIsBuy(userId, goodsType, goodsId);
default -> false;
};
} else {
OrderEntity orderEntity = orderRepository.getUserBuyItem(userId, goodsType, goodsId);
if (orderEntity != null) {
@@ -257,7 +253,7 @@ public class OrderBiz {
//商品创建时间
Date goodsCreateTime = new Date();
if (!orderDetail.getOrderItemList().isEmpty()) {
OrderItemVO orderItemVO = orderDetail.getOrderItemList().get(0);
OrderItemVO orderItemVO = orderDetail.getOrderItemList().getFirst();
switch (orderItemVO.getGoodsType()) {
case 0:
VideoEntity video = videoRepository.getVideo(orderItemVO.getGoodsId());