关联关系修改

This commit is contained in:
2024-12-30 14:37:27 +08:00
parent fd7511ad55
commit aa7d1fab52
17 changed files with 154 additions and 71 deletions

View File

@@ -26,6 +26,7 @@ import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @Author:longbinbin
@@ -54,14 +55,12 @@ public class GoodsServiceImpl implements GoodsService {
videoReqQuery.setIsBuy(query.getIsBuy());
videoReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
//查询成片vlog
List<VideoRespVO> videoList = videoMapper.list(videoReqQuery);
List<VideoRespVO> videoList = videoMapper.queryByRelation(videoReqQuery);
videoList.forEach(videoRespVO -> {
GoodsPageVO goodsPageVO = new GoodsPageVO();
goodsPageVO.setGoodsName(videoRespVO.getTemplateName());
goodsPageVO.setScenicId(videoRespVO.getScenicId());
goodsPageVO.setScenicName(videoRespVO.getScenicName());
goodsPageVO.setLongitude(videoRespVO.getLongitude());
goodsPageVO.setLatitude(videoRespVO.getLatitude());
goodsPageVO.setGoodsType(1);
goodsPageVO.setGoodsId(videoRespVO.getId());
goodsPageVO.setTemplateName(videoRespVO.getTemplateName());
@@ -73,21 +72,17 @@ public class GoodsServiceImpl implements GoodsService {
SourceReqQuery sourceReqQuery = new SourceReqQuery();
sourceReqQuery.setScenicId(query.getScenicId());
sourceReqQuery.setIsBuy(query.getIsBuy());
sourceReqQuery.setMemberId(query.getMemberId());
sourceReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId()));
//查询源素材
List<SourceRespVO> sourceList = sourceMapper.listGroupByType(sourceReqQuery);
sourceList.forEach(sourceRespVO -> {
List<SourceRespVO> sourceList = sourceMapper.queryByRelation(sourceReqQuery);
sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).forEach((type, value) -> {
GoodsPageVO goodsPageVO = new GoodsPageVO();
Integer type = sourceRespVO.getType();
if(type==1){
if (type == 1) {
goodsPageVO.setGoodsName("原片集");
}else {
} else {
goodsPageVO.setGoodsName("照片集");
}
goodsPageVO.setScenicId(sourceRespVO.getScenicId());
goodsPageVO.setScenicName(sourceRespVO.getScenicName());
goodsPageVO.setLongitude(sourceRespVO.getLongitude());
goodsPageVO.setLatitude(sourceRespVO.getLatitude());
goodsPageVO.setScenicId(query.getScenicId());
goodsPageVO.setGoodsType(2);
goodsPageVO.setSourceType(type);
goodsList.add(goodsPageVO);
@@ -187,8 +182,6 @@ public class GoodsServiceImpl implements GoodsService {
goodsDetailVO.setGoodsName(videoRespVO.getTemplateName());
goodsDetailVO.setScenicId(videoRespVO.getScenicId());
goodsDetailVO.setScenicName(videoRespVO.getScenicName());
goodsDetailVO.setLongitude(videoRespVO.getLongitude());
goodsDetailVO.setLatitude(videoRespVO.getLatitude());
goodsDetailVO.setGoodsType(1);
goodsDetailVO.setGoodsId(videoRespVO.getId());
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());

View File

@@ -27,11 +27,17 @@ import com.ycwl.basic.enums.BizCodeEnum;
import com.ycwl.basic.enums.OrderStateEnum;
import com.ycwl.basic.enums.StatisticEnum;
import com.ycwl.basic.exception.AppException;
import com.ycwl.basic.mapper.OrderMapper;
import com.ycwl.basic.mapper.PaymentMapper;
import com.ycwl.basic.mapper.SourceMapper;
import com.ycwl.basic.mapper.StatisticsMapper;
import com.ycwl.basic.mapper.VideoMapper;
import com.ycwl.basic.model.mobile.statistic.req.StatisticsRecordAddReq;
import com.ycwl.basic.model.pc.order.entity.OrderItemEntity;
import com.ycwl.basic.model.pc.order.resp.OrderRespVO;
import com.ycwl.basic.model.pc.payment.entity.PaymentEntity;
import com.ycwl.basic.model.pc.source.entity.MemberSourceEntity;
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;
@@ -88,6 +94,12 @@ public class WxPayServiceImpl implements WxPayService {
private PaymentMapper paymentMapper;
@Autowired
private StatisticsMapper statisticsMapper;
@Autowired
private OrderMapper orderMapper;
@Autowired
private SourceMapper sourceMapper;
@Autowired
private VideoMapper videoMapper;
@Override
public WxPayRespVO createOrder(WXPayOrderReqVO req) {
@@ -196,7 +208,31 @@ public class WxPayServiceImpl implements WxPayService {
}catch (Exception e) {
log.error("[微信支付回调]更新订单状态失败", e);
}
OrderRespVO byId = orderMapper.getById(orderId);
List<OrderItemEntity> orderItemList = orderMapper.listOrderItemByOrderId(orderId);
orderItemList.forEach(orderItemVO -> {
switch (orderItemVO.getGoodsType()) {
case 1: // 成片
MemberVideoEntity memberVideoEntity = new MemberVideoEntity();
memberVideoEntity.setMemberId(byId.getMemberId());
memberVideoEntity.setVideoId(orderItemVO.getGoodsId());
memberVideoEntity.setIsBuy(1);
memberVideoEntity.setOrderId(orderId);
videoMapper.updateRelation(memberVideoEntity);
break;
case 2: // 源素材
MemberSourceEntity memberSourceEntity = new MemberSourceEntity();
memberSourceEntity.setMemberId(byId.getMemberId());
memberSourceEntity.setSourceId(orderItemVO.getGoodsId());
memberSourceEntity.setType(orderItemVO.getGoodsType());
memberSourceEntity.setIsBuy(1);
memberSourceEntity.setOrderId(orderId);
sourceMapper.updateRelation(memberSourceEntity);
break;
default:
break;
}
});
}
}).start();