Эх сурвалжийг харах

[fix]
首页更改,增加返回项目的图集字段

chenchen 3 сар өмнө
parent
commit
756fdd6104

+ 15 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/service/impl/TourismProjectToWebServiceImpl.java

@@ -76,6 +76,8 @@ public class TourismProjectToWebServiceImpl implements TourismProjectToWebServic
     private RedissonClient redissonClient;
     @Autowired
     private DirectoryInfoService directoryInfoService;
+    @Autowired
+    private TourismFileService tourismFileService;
 
 
     @Override
@@ -132,6 +134,19 @@ public class TourismProjectToWebServiceImpl implements TourismProjectToWebServic
         List<TourismProjectVo> dataList = tourismProjectVoMyPageData.getDataList();
         //先把imgUrl由jaon转换为List<FileUrlObject>
         dataList.stream().forEach(item ->{
+            //遍历查询关联的tourismFile
+            TourismFile tourismFile = new TourismFile();
+            tourismFile.setAssociationTableId(item.getId());
+            List<TourismFile> tourismFileListWithRelation = tourismFileService.getTourismFileList(tourismFile, "");
+            //判断是否为空
+            if(tourismFileListWithRelation != null && tourismFileListWithRelation.size() > 0){
+                //不为空则进行转换,提取数据
+                TourismFile tourismFile1 = tourismFileListWithRelation.get(0);
+                String fileUrl = tourismFile1.getFileUrl();
+                //进行转换url
+                List<String> fileUrlList = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), fileUrl);
+                item.setFileUrlList(fileUrlList);
+            }
             List<String> urlList = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), item.getHomeHotPicture());
             item.setHomeHotPicturesAfterConvert(urlList);
             List<String> arrayList = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), item.getTourismUrl());

+ 3 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismFileMapper.xml

@@ -57,6 +57,9 @@
     <!-- 这里仅包含调用接口输入的主表过滤条件 -->
     <sql id="inputFilterRef">
         <if test="tourismFileFilter != null">
+            <if test="tourismFileFilter.associationTableId != null and tourismFileFilter.associationTableId != ''">
+                AND tour_tourism_file.association_table_id = #{tourismFileFilter.associationTableId}
+            </if>
         </if>
     </sql>
 

+ 6 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectVo.java

@@ -260,5 +260,11 @@ public class TourismProjectVo extends BaseVo {
     @Schema(description = "isWinnowDestination 常量字典关联数据")
     private Map<String, Object> isWinnowDestinationDictMap;
 
+    /**
+     * fileUrlList 旅游项目图集转换后的图片对象。
+     */
+    @Schema(description = "fileUrl旅游项目图集转换后的图片对象")
+    private List<String> fileUrlList;
+
 
 }