0元购逻辑,直接送

This commit is contained in:
2025-01-05 14:20:24 +08:00
parent 7befe07e70
commit 3907b5eb7a
19 changed files with 231 additions and 26 deletions

View File

@@ -41,6 +41,7 @@ import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
import com.ycwl.basic.model.wx.WXPayOrderReqVO;
import com.ycwl.basic.model.wx.WxPayRespVO;
import com.ycwl.basic.model.wx.WxchatCallbackSuccessData;
import com.ycwl.basic.repository.OrderRepository;
import com.ycwl.basic.service.HttpService;
import com.ycwl.basic.service.mobile.WxPayService;
import com.ycwl.basic.service.pc.OrderService;
@@ -100,6 +101,8 @@ public class WxPayServiceImpl implements WxPayService {
private SourceMapper sourceMapper;
@Autowired
private VideoMapper videoMapper;
@Autowired
private OrderRepository orderRepository;
@Override
public WxPayRespVO createOrder(WXPayOrderReqVO req) {
@@ -211,6 +214,7 @@ public class WxPayServiceImpl implements WxPayService {
OrderRespVO byId = orderMapper.getById(orderId);
List<OrderItemEntity> orderItemList = orderMapper.listOrderItemByOrderId(orderId);
orderItemList.forEach(orderItemVO -> {
orderRepository.clearUserBuyItemCache(byId.getMemberId(), orderItemVO.getGoodsType(), orderItemVO.getGoodsId());
switch (orderItemVO.getGoodsType()) {
case 0: // 成片
MemberVideoEntity memberVideoEntity = new MemberVideoEntity();
@@ -224,7 +228,8 @@ public class WxPayServiceImpl implements WxPayService {
case 2: // 源素材
MemberSourceEntity memberSourceEntity = new MemberSourceEntity();
memberSourceEntity.setMemberId(byId.getMemberId());
memberSourceEntity.setSourceId(orderItemVO.getGoodsId());
// 源素材的goodsId是人脸ID
memberSourceEntity.setFaceId(orderItemVO.getGoodsId());
memberSourceEntity.setType(orderItemVO.getGoodsType());
memberSourceEntity.setIsBuy(1);
memberSourceEntity.setOrderId(orderId);