This commit is contained in:
2025-01-14 11:26:37 +08:00
parent 02548a3028
commit f2f7fa22c9
10 changed files with 129 additions and 73 deletions

View File

@@ -144,41 +144,50 @@ public class AppScenicServiceImpl implements AppScenicService {
sourceReqQuery.setMemberId(userId);
//查询源素材
List<SourceRespVO> sourceList = sourceMapper.queryByRelation(sourceReqQuery);
ContentPageVO sourceVideoContent = new ContentPageVO();
ContentPageVO sourceImageContent = new ContentPageVO();
sourceVideoContent.setName("原片集");
sourceImageContent.setName("照片集");
sourceVideoContent.setScenicId(faceRespVO.getScenicId());
sourceImageContent.setScenicId(faceRespVO.getScenicId());
sourceVideoContent.setContentType(2);
sourceImageContent.setContentType(2);
sourceVideoContent.setLockType(1);
sourceImageContent.setLockType(1);
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(faceRespVO.getScenicId());
sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).keySet()
.stream()
.filter(type -> {
if (Integer.valueOf(1).equals(type)) {
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo())) {
return false;
}
} else if (Integer.valueOf(2).equals(type)) {
if (Integer.valueOf(1).equals(scenicConfig.getDisableSourceImage())) {
return false;
}
}
return true;
})
.forEach(type -> {
ContentPageVO contentPageVO = new ContentPageVO();
if (type == 1) {
contentPageVO.setName("原片集");
} else {
contentPageVO.setName("照片集");
}
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(userId, faceRespVO.getScenicId(), type, faceId);
contentPageVO.setSourceType(isBuyRespVO.getGoodsType());
contentPageVO.setContentId(isBuyRespVO.getGoodsId());
if (isBuyRespVO.isBuy()) {
contentPageVO.setIsBuy(1);
} else {
contentPageVO.setIsBuy(0);
}
contentPageVO.setScenicId(faceRespVO.getScenicId());
contentPageVO.setTemplateCoverUrl(sourceList.get(0).getUrl());
contentPageVO.setContentType(2);
contentList.add(contentPageVO);
});
if (!Integer.valueOf(1).equals(scenicConfig.getDisableSourceVideo())) {
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(userId, faceRespVO.getScenicId(), 1, faceId);
sourceVideoContent.setSourceType(isBuyRespVO.getGoodsType());
sourceVideoContent.setContentId(isBuyRespVO.getGoodsId());
if (isBuyRespVO.isBuy()) {
sourceVideoContent.setIsBuy(1);
} else {
sourceVideoContent.setIsBuy(0);
}
contentList.add(sourceVideoContent);
}
if (!Integer.valueOf(1).equals(scenicConfig.getDisableSourceImage())) {
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(userId, faceRespVO.getScenicId(), 2, faceId);
sourceImageContent.setSourceType(isBuyRespVO.getGoodsType());
sourceImageContent.setContentId(isBuyRespVO.getGoodsId());
if (isBuyRespVO.isBuy()) {
sourceImageContent.setIsBuy(1);
} else {
sourceImageContent.setIsBuy(0);
}
contentList.add(sourceImageContent);
}
sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).forEach((type, list) -> {
ContentPageVO contentPageVO = new ContentPageVO();
if (type == 1) {
sourceVideoContent.setLockType(0);
sourceVideoContent.setTemplateCoverUrl(list.get(0).getUrl());
} else {
sourceImageContent.setLockType(0);
sourceImageContent.setTemplateCoverUrl(list.get(0).getUrl());
}
});
return ApiResponse.success(contentList);
}