|
@@ -28,8 +28,10 @@ import fdage.back.sdk.base.enums.ResultCodeEnum;
|
|
|
import fdage.back.sdk.base.exception.CommonBaseException;
|
|
|
import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -73,10 +75,9 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
|
public IPage<HouseVO> listProject(QueryHouseParam queryHouseParam, ContextTokenBean contextUserInfo, String token) {
|
|
|
produceQuery(queryHouseParam, contextUserInfo);
|
|
|
|
|
|
-// IPage<TmHouse> page = new Page<>(queryHouseParam.getPageNum(), queryHouseParam.getPageSize(), true);
|
|
|
Page page = new Page().setCurrent(queryHouseParam.getPageNum()).setSize(queryHouseParam.getPageSize());
|
|
|
IPage<HouseVO> vos = getBaseMapper().listProject(page, queryHouseParam);
|
|
|
-
|
|
|
+
|
|
|
produceRes(vos, token);
|
|
|
return vos;
|
|
|
}
|
|
@@ -110,7 +111,7 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
|
item.put(excelUtil.getColeNames().get(index++), house.getPoints().toString());
|
|
|
item.put(excelUtil.getColeNames().get(index++), house.getCreateTime().format(df));
|
|
|
item.put(excelUtil.getColeNames().get(index++), house.getUpdateTime().format(df));
|
|
|
- item.put(excelUtil.getColeNames().get(index++), HouseStatus.get(house.getAuditStatus()).getDesc());
|
|
|
+ item.put(excelUtil.getColeNames().get(index++), HouseStatus.get(house.getStatus()).getDesc());
|
|
|
item.put(excelUtil.getColeNames().get(index++), house.getAuditorName());
|
|
|
item.put(excelUtil.getColeNames().get(index++), house.getAuditTime().format(df));
|
|
|
dataList.add(item);
|
|
@@ -151,14 +152,14 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
|
if(null != resultPage && resultPage.getTotal() > 0){
|
|
|
List<String> getAllHouseIds = new ArrayList<>();
|
|
|
for (int i = 0; i < resultPage.getRecords().size(); i++) {
|
|
|
- getAllHouseIds.add(resultPage.getRecords().get(i).getId());
|
|
|
+ getAllHouseIds.add(resultPage.getRecords().get(i).getHouseId());
|
|
|
}
|
|
|
//从720获取最新的预览路径,重新封装给前端展示
|
|
|
TreeMap<String , Object> treeMap = panoService.getHouseVrlinks(getAllHouseIds , token);
|
|
|
|
|
|
//从720获取统计数据
|
|
|
Map<String, Object> statistics;
|
|
|
- List<Map<String, Object>> panoSceneWithTypes;
|
|
|
+ Map<String, Object> panoSceneWithTypesMap;
|
|
|
|
|
|
//当前房源所有场景码集合
|
|
|
List<String> allSceneNums;
|
|
@@ -169,7 +170,7 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
|
SceneRspBean sceneRspBean;
|
|
|
|
|
|
for (int i = 0; i < resultPage.getRecords().size(); i++) {
|
|
|
- String vrId = resultPage.getRecords().get(i).getId();
|
|
|
+ String vrId = resultPage.getRecords().get(i).getHouseId();
|
|
|
//获取当前房源的审核记录数,用于前端判决是否展示审核历史图标
|
|
|
resultPage.getRecords().get(i).setCountNum(tmAuditService.countAuditNum(vrId));
|
|
|
if(!CollectionUtils.isEmpty(treeMap)){
|
|
@@ -192,38 +193,40 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
|
|
|
|
int salesVideos = 0;
|
|
|
int houseVideos = 0;
|
|
|
- panoSceneWithTypes = panoService.listPanoSceneWithTypes(resultPage.getRecords().get(i).getId(), token);
|
|
|
-
|
|
|
-// List<String> nums = panoSceneWithTypes.stream().map(e -> e.get("sceneNum").toString()).collect(Collectors.toList());
|
|
|
-//
|
|
|
-// sceneRspBean = sceneFeign.listScenesInNums(nums, token);
|
|
|
-// List<SceneProEntity> scenes = (List<SceneProEntity>) sceneRspBean.getData();
|
|
|
-// for (SceneProEntity scene : scenes) {
|
|
|
-// String videoStr = scene.getVideos();
|
|
|
-// JSONObject scenejson = new JSONObject();
|
|
|
-// if(videoStr != null) {
|
|
|
-// scenejson = JSONObject.parseObject(videoStr);
|
|
|
-// }
|
|
|
-// Object data = scenejson.get("data");
|
|
|
-// if (data != null && data instanceof JSONArray) {
|
|
|
-// JSONArray jsonArray = (JSONArray) data;
|
|
|
-// if (jsonArray.size() != 0) {
|
|
|
-// Optional<Map<String, Object>> existData = panoSceneWithTypes.stream().filter(m ->
|
|
|
-// "sales".equals(m.get("type")) && scene.getNum().equals(m.get("sceneNum"))).findAny();
|
|
|
-// if (existData.isPresent()) {
|
|
|
-// salesVideos += jsonArray.size();
|
|
|
-// }
|
|
|
-// existData = panoSceneWithTypes.stream().filter(m ->
|
|
|
-// "room".equals(m.get("type")) && scene.getNum().equals(m.get("sceneNum"))).findAny();
|
|
|
-// if (existData.isPresent()) {
|
|
|
-// houseVideos += jsonArray.size();
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// resultPage.getRecords().get(i).setSaleVideos(salesVideos);
|
|
|
-// resultPage.getRecords().get(i).setHouseVideos(houseVideos);
|
|
|
+ panoSceneWithTypesMap = panoService.listPanoSceneWithTypes(resultPage.getRecords().get(i).getHouseId(), token);
|
|
|
+
|
|
|
+ if (MapUtils.isNotEmpty(panoSceneWithTypesMap)) {
|
|
|
+ List<String> nums = panoSceneWithTypesMap.entrySet().stream().map(e -> e.getValue().toString()).collect(Collectors.toList());
|
|
|
+
|
|
|
+ sceneRspBean = sceneFeign.listScenesInNums(nums, token);
|
|
|
+ List<SceneProEntity> scenes = (List<SceneProEntity>) sceneRspBean.getData();
|
|
|
+ for (SceneProEntity scene : scenes) {
|
|
|
+ String videoStr = scene.getVideos();
|
|
|
+ JSONObject scenejson = new JSONObject();
|
|
|
+ if(videoStr != null) {
|
|
|
+ scenejson = JSONObject.parseObject(videoStr);
|
|
|
+ }
|
|
|
+ Object data = scenejson.get("data");
|
|
|
+ if (data != null && data instanceof JSONArray) {
|
|
|
+ JSONArray jsonArray = (JSONArray) data;
|
|
|
+ if (jsonArray.size() != 0) {
|
|
|
+ Optional<Map.Entry<String, Object>> existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
|
|
|
+ "sales".equals(m.getKey()) && scene.getNum().equals(m.getValue().toString())).findAny();
|
|
|
+ if (existData.isPresent()) {
|
|
|
+ salesVideos += jsonArray.size();
|
|
|
+ }
|
|
|
+ existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
|
|
|
+ "room".equals(m.getKey()) && scene.getNum().equals(m.getValue().toString())).findAny();
|
|
|
+ if (existData.isPresent()) {
|
|
|
+ houseVideos += jsonArray.size();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultPage.getRecords().get(i).setSaleVideos(salesVideos);
|
|
|
+ resultPage.getRecords().get(i).setHouseVideos(houseVideos);
|
|
|
+ }
|
|
|
|
|
|
allSceneNums = panoService.getAllSceneNums(vrId, token);
|
|
|
if(allSceneNums != null){
|