|
@@ -12,17 +12,19 @@ import fcb.project.manager.base.enums.HouseStatus;
|
|
|
import fcb.project.manager.base.enums.SysUserRoleEnums;
|
|
|
import fcb.project.manager.base.enums.UuidPreEnum;
|
|
|
import fcb.project.manager.base.service.ITmHouseService;
|
|
|
+import fcb.project.manager.base.service.custom.PanoService;
|
|
|
import fcb.project.manager.core.feignInterfaces.UserFeign;
|
|
|
import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -40,11 +42,22 @@ public class TmHouseServiceImpl extends ServiceImpl<TmHouseDao, TmHouse> impleme
|
|
|
private UserFeign userFeign;
|
|
|
|
|
|
@Autowired
|
|
|
+ private PanoService panoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private TmAuditServiceImpl tmAuditService;
|
|
|
|
|
|
+ @Value("${inner.vr.scene.host}")
|
|
|
+ private String innerSceneVrHost;
|
|
|
+
|
|
|
+ @Value("${outer.vr.scene.host}")
|
|
|
+ private String outerSceneVrHost;
|
|
|
+
|
|
|
+
|
|
|
public IPage<TmHouse> getListByNameOrBelong(String houseTitle,
|
|
|
Integer status, Integer type,
|
|
|
String estateId, ContextTokenBean contextTokenBean,
|
|
|
+ String token,
|
|
|
Long pageNum, Long pageSize) {
|
|
|
LambdaQueryWrapper<TmHouse> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(TmHouse::getEstateId, estateId);
|
|
@@ -76,9 +89,23 @@ public class TmHouseServiceImpl extends ServiceImpl<TmHouseDao, TmHouse> impleme
|
|
|
IPage<TmHouse> page = new Page<>(pageNum, pageSize, true);
|
|
|
IPage<TmHouse> resultPage = getBaseMapper().selectPage(page, lambdaQueryWrapper);
|
|
|
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());
|
|
|
+ }
|
|
|
+ //从720获取最新的预览路径,重新封装给前端展示
|
|
|
+ TreeMap<String , Object> treeMap = panoService.getHouseVrlinks(getAllHouseIds , token);
|
|
|
for (int i = 0; i < resultPage.getRecords().size(); i++) {
|
|
|
String vrId = resultPage.getRecords().get(i).getId();
|
|
|
+ //获取当前房源的审核记录数,用于前端判决是否展示审核历史图标
|
|
|
resultPage.getRecords().get(i).setCountNum(tmAuditService.countAuditNum(vrId));
|
|
|
+ if(!CollectionUtils.isEmpty(treeMap)){
|
|
|
+ String path = (String) treeMap.get(vrId);
|
|
|
+ String outerHost = outerSceneVrHost.substring(0 , outerSceneVrHost.length() - 1);
|
|
|
+ String innerHost = innerSceneVrHost.substring(0 , innerSceneVrHost.length() - 1);
|
|
|
+ resultPage.getRecords().get(i).setInnerVrLink(innerHost + path);
|
|
|
+ resultPage.getRecords().get(i).setInnerVrLink(outerHost + path);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return resultPage;
|
|
@@ -93,7 +120,7 @@ public class TmHouseServiceImpl extends ServiceImpl<TmHouseDao, TmHouse> impleme
|
|
|
}
|
|
|
|
|
|
public IPage<TmHouse> getAuditHouseList(String houseTitle, Integer status, Integer type,
|
|
|
- String belongCompany, String estateName,
|
|
|
+ String belongCompany, String estateName, String token,
|
|
|
Long pageNum, Long pageSize) {
|
|
|
LambdaQueryWrapper<TmHouse> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(TmHouse::getIsShow, 1);
|
|
@@ -122,14 +149,28 @@ public class TmHouseServiceImpl extends ServiceImpl<TmHouseDao, TmHouse> impleme
|
|
|
}
|
|
|
IPage<TmHouse> page = new Page<>(pageNum, pageSize, true);
|
|
|
IPage<TmHouse> resultPage = getBaseMapper().selectPage(page, lambdaQueryWrapper);
|
|
|
+
|
|
|
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());
|
|
|
+ }
|
|
|
+ //从720获取最新的预览路径,重新封装给前端展示
|
|
|
+ TreeMap<String , Object> treeMap = panoService.getHouseVrlinks(getAllHouseIds , token);
|
|
|
for (int i = 0; i < resultPage.getRecords().size(); i++) {
|
|
|
String vrId = resultPage.getRecords().get(i).getId();
|
|
|
resultPage.getRecords().get(i).setCountNum(tmAuditService.countAuditNum(vrId));
|
|
|
+
|
|
|
+ if(!CollectionUtils.isEmpty(treeMap)){
|
|
|
+ String path = (String) treeMap.get(vrId);
|
|
|
+ String outerHost = outerSceneVrHost.substring(0 , outerSceneVrHost.length() - 1);
|
|
|
+ String innerHost = innerSceneVrHost.substring(0 , innerSceneVrHost.length() - 1);
|
|
|
+ resultPage.getRecords().get(i).setInnerVrLink(innerHost + path);
|
|
|
+ resultPage.getRecords().get(i).setInnerVrLink(outerHost + path);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return resultPage;
|
|
|
-// return tmHouseDao.getHousePageWithCount(page, lambdaQueryWrapper);
|
|
|
}
|
|
|
|
|
|
public int deleteHouseById(String houseId) {
|