diff --git a/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java b/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java index 51f5130f..a851c88b 100644 --- a/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java +++ b/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java @@ -2,6 +2,7 @@ package com.ycwl.basic.service.mobile.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.http.HttpUtil; +import com.ycwl.basic.integration.common.manager.ScenicConfigManager; import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2DTO; import com.ycwl.basic.utils.JacksonUtil; import com.ycwl.basic.biz.CouponBiz; @@ -147,27 +148,32 @@ public class GoodsServiceImpl implements GoodsService { sourceReqQuery.setMemberId(Long.valueOf(BaseContextHandler.getUserId())); //查询源素材 List sourceList = sourceMapper.queryByRelation(sourceReqQuery); - ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(scenicId); + ScenicConfigManager scenicConfig = scenicRepository.getScenicConfigManager(scenicId); List sourceGoods = sourceList.stream().collect(Collectors.groupingBy(SourceRespVO::getFaceId)).entrySet().stream().flatMap((faceEntry) -> { Long faceId = faceEntry.getKey(); List goods = faceEntry.getValue(); return goods.stream().collect(Collectors.groupingBy(SourceRespVO::getType)).keySet().stream().filter(type -> { if (Integer.valueOf(1).equals(type)) { - return !Boolean.TRUE.equals(scenicConfig.getDisableSourceVideo()); + return !Boolean.TRUE.equals(scenicConfig.getBoolean("disable_source_video")); } else if (Integer.valueOf(2).equals(type)) { - return !Boolean.TRUE.equals(scenicConfig.getDisableSourceImage()); + return !Boolean.TRUE.equals(scenicConfig.getBoolean("disable_source_image")); } return true; }).map(type -> { GoodsPageVO goodsPageVO = new GoodsPageVO(); - goodsPageVO.setTemplateCoverUrl(goods.getFirst().getUrl()); goodsPageVO.setFaceId(faceId); + goodsPageVO.setGoodsType(type); if (type == 1) { goodsPageVO.setGoodsName("录像集"); - goodsPageVO.setGoodsType(1); - } else { + goodsPageVO.setTemplateCoverUrl(scenicConfig.getString("video_cover_url")); + } else if (type == 2) { goodsPageVO.setGoodsName("照片集"); - goodsPageVO.setGoodsType(2); + goodsPageVO.setTemplateCoverUrl(scenicConfig.getString("photo_cover_url")); + } else { + goodsPageVO.setGoodsName("未知商品"); + } + if (StringUtils.isBlank(goodsPageVO.getTemplateCoverUrl())) { + goodsPageVO.setTemplateCoverUrl(goods.getFirst().getUrl()); } goodsPageVO.setScenicId(query.getScenicId()); return goodsPageVO;