|
@@ -13,6 +13,7 @@ import com.huiju.estateagents.mapper.TaApartmentImgMapper;
|
13
|
13
|
import com.huiju.estateagents.mapper.TaBuildingImgMapper;
|
14
|
14
|
import com.huiju.estateagents.mapper.TaHousingResourcesMapper;
|
15
|
15
|
import com.huiju.estateagents.mapper.TaPreselectionRecordMapper;
|
|
16
|
+import com.huiju.estateagents.po.BuildingImgPO;
|
16
|
17
|
import com.huiju.estateagents.po.TaHousingResourcesPO;
|
17
|
18
|
import com.huiju.estateagents.service.ITaHousingResourcesService;
|
18
|
19
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -79,6 +80,9 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
79
|
80
|
@Autowired
|
80
|
81
|
TaApartmentImgMapper taApartmentImgMapper;
|
81
|
82
|
|
|
83
|
+ @Autowired
|
|
84
|
+ private TaBuildingPanoramaMapper taBuildingPanoramaMapper;
|
|
85
|
+
|
82
|
86
|
|
83
|
87
|
/**
|
84
|
88
|
* 分页获取房源列表
|
|
@@ -168,24 +172,52 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
168
|
172
|
resourcesPO.setIsPreselect(false);
|
169
|
173
|
}
|
170
|
174
|
|
171
|
|
- // 获取户型图片列表
|
172
|
|
- List<TaBuildingImg> taBuildingImgList = new ArrayList<>();
|
173
|
|
- List<TaApartmentImg> buildingImg;
|
174
|
|
- QueryWrapper<TaBuildingImg> buildingImgQueryWrapper;
|
175
|
|
- QueryWrapper<TaApartmentImg> apartmentImgQueryWrapper = new QueryWrapper<>();
|
176
|
|
- apartmentImgQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
|
177
|
|
- buildingImg = taApartmentImgMapper.selectList(apartmentImgQueryWrapper);
|
178
|
|
- for (TaApartmentImg apartmentImg : buildingImg) {
|
179
|
|
- buildingImgQueryWrapper = new QueryWrapper<>();
|
180
|
|
- buildingImgQueryWrapper.eq("img_id", apartmentImg.getImgId());
|
181
|
|
- buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
|
182
|
|
- buildingImgQueryWrapper.orderByAsc("order_no");
|
183
|
|
- taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
|
184
|
|
- }
|
185
|
|
- if (CollectionUtils.isNotEmpty(taBuildingImgList)) {
|
186
|
|
- resourcesPO.setBuildingImgList(taBuildingImgList);
|
|
175
|
+ List<BuildingImgPO> buildingImgPOList = new ArrayList<>();
|
|
176
|
+ BuildingImgPO buildingImgPO;
|
|
177
|
+ if (!StringUtils.isEmpty(resourcesPO.getApartmentId())) {
|
|
178
|
+ // 获取全景图
|
|
179
|
+ QueryWrapper<TaBuildingPanorama> buildingPanoramaQueryWrapper = new QueryWrapper<>();
|
|
180
|
+ buildingPanoramaQueryWrapper.eq("org_id", resourcesPO.getOrgId());
|
|
181
|
+ buildingPanoramaQueryWrapper.eq("building_id", resourcesPO.getBuildingId());
|
|
182
|
+ buildingPanoramaQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
|
|
183
|
+ buildingPanoramaQueryWrapper.eq("panorama_type", "apartment");
|
|
184
|
+ buildingPanoramaQueryWrapper.eq("status", "1");
|
|
185
|
+ List<TaBuildingPanorama> panoramaList = taBuildingPanoramaMapper.selectList(buildingPanoramaQueryWrapper);
|
|
186
|
+ if (CollectionUtils.isNotEmpty(panoramaList)) {
|
|
187
|
+ for (TaBuildingPanorama panorama : panoramaList) {
|
|
188
|
+ buildingImgPO = new BuildingImgPO();
|
|
189
|
+ buildingImgPO.setUrl(panorama.getCoverImg());
|
|
190
|
+ buildingImgPO.setType(1);
|
|
191
|
+ buildingImgPO.setPanoramaLink(panorama.getPanoramaLink());
|
|
192
|
+ buildingImgPOList.add(buildingImgPO);
|
|
193
|
+ }
|
|
194
|
+ }
|
|
195
|
+
|
|
196
|
+ // 获取户型图片列表
|
|
197
|
+ List<TaBuildingImg> taBuildingImgList = new ArrayList<>();
|
|
198
|
+ List<TaApartmentImg> buildingImg;
|
|
199
|
+ QueryWrapper<TaBuildingImg> buildingImgQueryWrapper;
|
|
200
|
+ QueryWrapper<TaApartmentImg> apartmentImgQueryWrapper = new QueryWrapper<>();
|
|
201
|
+ apartmentImgQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
|
|
202
|
+ buildingImg = taApartmentImgMapper.selectList(apartmentImgQueryWrapper);
|
|
203
|
+ for (TaApartmentImg apartmentImg : buildingImg) {
|
|
204
|
+ buildingImgQueryWrapper = new QueryWrapper<>();
|
|
205
|
+ buildingImgQueryWrapper.eq("img_id", apartmentImg.getImgId());
|
|
206
|
+ buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
|
|
207
|
+ buildingImgQueryWrapper.orderByAsc("order_no");
|
|
208
|
+ taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
|
|
209
|
+ }
|
|
210
|
+ if (CollectionUtils.isNotEmpty(taBuildingImgList)) {
|
|
211
|
+ for (TaBuildingImg img : taBuildingImgList) {
|
|
212
|
+ buildingImgPO = new BuildingImgPO();
|
|
213
|
+ buildingImgPO.setType(0);
|
|
214
|
+ buildingImgPO.setUrl(img.getUrl());
|
|
215
|
+ buildingImgPOList.add(buildingImgPO);
|
|
216
|
+ }
|
|
217
|
+ }
|
187
|
218
|
}
|
188
|
219
|
|
|
220
|
+ resourcesPO.setBuildingImgList(buildingImgPOList);
|
189
|
221
|
return resourcesPO;
|
190
|
222
|
}
|
191
|
223
|
|