|
@@ -108,6 +108,15 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
108
|
108
|
|
109
|
109
|
List<TaBuildingImg> buildingImg = taBuildingImgMapper.selectList(queryWrapper);
|
110
|
110
|
taBuilding.setBuildingImg(buildingImg);
|
|
111
|
+
|
|
112
|
+ //查询封面当前图片
|
|
113
|
+ QueryWrapper<TaBuildingImg> queryListWrapper = new QueryWrapper<>();
|
|
114
|
+ queryListWrapper.eq("building_id", taBuilding.getBuildingId());
|
|
115
|
+ queryListWrapper.eq("img_type", CommConstant.BUILDING_IMG_LIST);
|
|
116
|
+ queryListWrapper.orderByAsc("create_date");
|
|
117
|
+
|
|
118
|
+ List<TaBuildingImg> buildingListImg = taBuildingImgMapper.selectList(queryListWrapper);
|
|
119
|
+ taBuilding.setBuildingListImg(buildingListImg);
|
111
|
120
|
}
|
112
|
121
|
}
|
113
|
122
|
|
|
@@ -620,6 +629,19 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
|
620
|
629
|
if (CollectionUtils.isNotEmpty(buildingList)) {
|
621
|
630
|
for (TaBuilding build:buildingList) {
|
622
|
631
|
getBuildingAttaches(build);
|
|
632
|
+
|
|
633
|
+ // 兼容 3.0/3.5 版本(3.0/3.5 封面取的全是 buildingListImg 的第一张),因为在3.5.1新增了封面图
|
|
634
|
+
|
|
635
|
+ // 获取封面图
|
|
636
|
+ List<TaBuildingImg> buildingListImg = build.getBuildingListImg();
|
|
637
|
+ if (CollectionUtils.isNotEmpty(buildingList)) {
|
|
638
|
+ // 把封面图写入到 BuildingImg 的第一张
|
|
639
|
+ if (CollectionUtils.isNotEmpty(build.getBuildingImg())) {
|
|
640
|
+ build.getBuildingImg().add(0, buildingListImg.get(0));
|
|
641
|
+ }
|
|
642
|
+ }
|
|
643
|
+
|
|
644
|
+
|
623
|
645
|
}
|
624
|
646
|
}
|
625
|
647
|
|