|
@@ -21,10 +21,13 @@ import fcb.project.manager.base.enums.SysUserRoleEnums;
|
|
import fcb.project.manager.base.param.house.QueryHouseParam;
|
|
import fcb.project.manager.base.param.house.QueryHouseParam;
|
|
import fcb.project.manager.base.service.ITmEstateService;
|
|
import fcb.project.manager.base.service.ITmEstateService;
|
|
import fcb.project.manager.base.service.custom.PanoService;
|
|
import fcb.project.manager.base.service.custom.PanoService;
|
|
|
|
+import fcb.project.manager.base.utils.BeanUtils;
|
|
import fcb.project.manager.base.utils.DateUtil;
|
|
import fcb.project.manager.base.utils.DateUtil;
|
|
import fcb.project.manager.base.utils.ExcelUtil;
|
|
import fcb.project.manager.base.utils.ExcelUtil;
|
|
import fcb.project.manager.base.vo.house.HouseVO;
|
|
import fcb.project.manager.base.vo.house.HouseVO;
|
|
import fcb.project.manager.core.feignInterfaces.SceneFeign;
|
|
import fcb.project.manager.core.feignInterfaces.SceneFeign;
|
|
|
|
+import fdage.back.sdk.base.entity.Result;
|
|
|
|
+import fdage.back.sdk.base.entity.ViewResult;
|
|
import fdage.back.sdk.base.enums.ResultCodeEnum;
|
|
import fdage.back.sdk.base.enums.ResultCodeEnum;
|
|
import fdage.back.sdk.base.exception.CommonBaseException;
|
|
import fdage.back.sdk.base.exception.CommonBaseException;
|
|
import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
|
|
import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
|
|
@@ -33,7 +36,6 @@ import lombok.extern.log4j.Log4j2;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -90,29 +92,29 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
List<Map> dataList = new ArrayList<>();
|
|
List<Map> dataList = new ArrayList<>();
|
|
int num = 0;
|
|
int num = 0;
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
- List<String> cols = Arrays.asList("序号", "楼盘编码", "楼盘名称", "航拍数量", "景观图数量", "售楼处数量", "样板间数量", "讲房售楼处数量", "讲房样板间数量", "讲房点位数量",
|
|
|
|
- "创建时间", "更新时间", "状态", "审核人", "审核时间");
|
|
|
|
|
|
+ List<String> cols = Arrays.asList("楼盘编码", "楼盘名称", "航拍数量", "景观图数量", "售楼处数量", "样板间数量", "讲房售楼处数量", "讲房样板间数量",
|
|
|
|
+ "讲房点位数量", "创建人","创建时间", "更新时间", "状态", "审核人", "审核时间");
|
|
ExcelUtil excelUtil = new ExcelUtil(cols);
|
|
ExcelUtil excelUtil = new ExcelUtil(cols);
|
|
for(HouseVO house : houseList){
|
|
for(HouseVO house : houseList){
|
|
int index = 0;
|
|
int index = 0;
|
|
num += 1;
|
|
num += 1;
|
|
//楼盘数据
|
|
//楼盘数据
|
|
item = new HashMap(20);
|
|
item = new HashMap(20);
|
|
- item.put(excelUtil.getColeNames().get(index++), String.valueOf(num));
|
|
|
|
item.put(excelUtil.getColeNames().get(index++), house.getFcbEstateId());
|
|
item.put(excelUtil.getColeNames().get(index++), house.getFcbEstateId());
|
|
item.put(excelUtil.getColeNames().get(index++), house.getEstateName());
|
|
item.put(excelUtil.getColeNames().get(index++), house.getEstateName());
|
|
item.put(excelUtil.getColeNames().get(index++), house.getBuilding() != null ? house.getBuilding().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getBuilding() != null ? house.getBuilding().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getGarden() != null ? house.getGarden().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getGarden() != null ? house.getGarden().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getSales() != null ? house.getSales().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getSales() != null ? house.getSales().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getHouse() != null ? house.getHouse().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getHouse() != null ? house.getHouse().toString() : "0");
|
|
- item.put(excelUtil.getColeNames().get(index++), house.getSaleVideos().toString());
|
|
|
|
- item.put(excelUtil.getColeNames().get(index++), house.getHouseVideos().toString());
|
|
|
|
|
|
+ item.put(excelUtil.getColeNames().get(index++), house.getSaleVideos() != null ? house.getSaleVideos().toString() : "0");
|
|
|
|
+ item.put(excelUtil.getColeNames().get(index++), house.getHouseVideos() != null ? house.getHouseVideos().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getPoints() != null ? house.getPoints().toString() : "0");
|
|
item.put(excelUtil.getColeNames().get(index++), house.getPoints() != null ? house.getPoints().toString() : "0");
|
|
|
|
+ item.put(excelUtil.getColeNames().get(index++), house.getCreateByName());
|
|
item.put(excelUtil.getColeNames().get(index++), house.getCreateTime().format(df));
|
|
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++), house.getUpdateTime().format(df));
|
|
item.put(excelUtil.getColeNames().get(index++), HouseStatus.get(house.getStatus()).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.getAuditorName());
|
|
- item.put(excelUtil.getColeNames().get(index++), house.getAuditTime().format(df));
|
|
|
|
|
|
+ item.put(excelUtil.getColeNames().get(index++), house.getAuditTime() != null ? house.getAuditTime().format(df) : "");
|
|
dataList.add(item);
|
|
dataList.add(item);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -129,7 +131,9 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
}
|
|
}
|
|
|
|
|
|
excelUtil.writeExcel(dataList, excelUtil.getColeNames().size(), fcbConfig.getExcelLocalPath() + fileName, dateStr);
|
|
excelUtil.writeExcel(dataList, excelUtil.getColeNames().size(), fcbConfig.getExcelLocalPath() + fileName, dateStr);
|
|
- return fcbConfig.getOuterSceneVrHost() + "excel/" + dateStr + ".xls";
|
|
|
|
|
|
+ String url = fcbConfig.getOuterSceneVrHost() + "excel/" + dateStr + ".xls";
|
|
|
|
+ log.info("导出路径-{}", url);
|
|
|
|
+ return url;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -194,36 +198,37 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
panoSceneWithTypesMap = panoService.listPanoSceneWithTypes(houseVOS.get(i).getHouseId(), token);
|
|
panoSceneWithTypesMap = panoService.listPanoSceneWithTypes(houseVOS.get(i).getHouseId(), token);
|
|
|
|
|
|
if (MapUtils.isNotEmpty(panoSceneWithTypesMap)) {
|
|
if (MapUtils.isNotEmpty(panoSceneWithTypesMap)) {
|
|
- List<String> nums = panoSceneWithTypesMap.entrySet().stream().map(e -> e.getValue().toString()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> nums = panoSceneWithTypesMap.entrySet().stream().map(e -> e.getKey()).collect(Collectors.toList());
|
|
|
|
|
|
sceneRspBean = sceneFeign.listScenesInNums(nums, token);
|
|
sceneRspBean = sceneFeign.listScenesInNums(nums, token);
|
|
- List<SceneProEntity> scenes = (List<SceneProEntity>) sceneRspBean.getData();
|
|
|
|
|
|
+ List<Map<String, Object>> scenes = (List<Map<String, Object>>) sceneRspBean.getData();
|
|
log.info("远程调用listScenesInNums接口,入参-{}", nums);
|
|
log.info("远程调用listScenesInNums接口,入参-{}", nums);
|
|
log.info("远程调用listScenesInNums接口,返回数据-{}", new Gson().toJson(scenes));
|
|
log.info("远程调用listScenesInNums接口,返回数据-{}", new Gson().toJson(scenes));
|
|
- 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) {
|
|
|
|
|
|
+ for (Map<String, Object> scene : scenes) {
|
|
|
|
+ if (scene.get("videos") != null) {
|
|
|
|
+ String videoStr = scene.get("videos").toString();
|
|
|
|
+ log.info("videos-{}", videoStr);
|
|
|
|
+ JSONObject scenejson = new JSONObject();
|
|
|
|
+ if(videoStr != null) {
|
|
|
|
+ scenejson = JSONObject.parseObject(videoStr);
|
|
|
|
+ }
|
|
|
|
+ Object data = scenejson.get("data");
|
|
|
|
+ if (data != null && data instanceof JSONArray && ((JSONArray) data).size() != 0) {
|
|
Optional<Map.Entry<String, Object>> existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
|
|
Optional<Map.Entry<String, Object>> existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
|
|
- "sales".equals(m.getKey()) && scene.getNum().equals(m.getValue().toString())).findAny();
|
|
|
|
|
|
+ "sales".equals(m.getValue()) && scene.get("num").toString().equals(m.getKey())).findAny();
|
|
if (existData.isPresent()) {
|
|
if (existData.isPresent()) {
|
|
- salesVideos += jsonArray.size();
|
|
|
|
|
|
+ salesVideos++;
|
|
}
|
|
}
|
|
existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
|
|
existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
|
|
- "room".equals(m.getKey()) && scene.getNum().equals(m.getValue().toString())).findAny();
|
|
|
|
|
|
+ "room".equals(m.getValue()) && scene.get("num").toString().equals(m.getKey())).findAny();
|
|
if (existData.isPresent()) {
|
|
if (existData.isPresent()) {
|
|
- houseVideos += jsonArray.size();
|
|
|
|
|
|
+ houseVideos++;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ log.info("salesVideos-{}", salesVideos);
|
|
|
|
+ log.info("houseVideos-{}", houseVideos);
|
|
houseVOS.get(i).setSaleVideos(salesVideos);
|
|
houseVOS.get(i).setSaleVideos(salesVideos);
|
|
houseVOS.get(i).setHouseVideos(houseVideos);
|
|
houseVOS.get(i).setHouseVideos(houseVideos);
|
|
}
|
|
}
|
|
@@ -232,10 +237,12 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
if(allSceneNums != null){
|
|
if(allSceneNums != null){
|
|
param.put("sceneNum", allSceneNums.stream().filter(string ->!string.isEmpty()).collect(Collectors.joining(";")));
|
|
param.put("sceneNum", allSceneNums.stream().filter(string ->!string.isEmpty()).collect(Collectors.joining(";")));
|
|
sceneRspBean = sceneFeign.statisticsPoints(param, token);
|
|
sceneRspBean = sceneFeign.statisticsPoints(param, token);
|
|
-
|
|
|
|
|
|
+ log.info("远程调用statisticsPoints接口,入参-{}", param);
|
|
|
|
+ log.info("远程调用statisticsPoints接口,返回数据-{}", new Gson().toJson(sceneRspBean));
|
|
if(null == sceneRspBean || sceneRspBean.getCode() != 0){
|
|
if(null == sceneRspBean || sceneRspBean.getCode() != 0){
|
|
- log.info("调用四维看看获取所有场景点位数失败,场景码是:" + param.get("sceneNum"));
|
|
|
|
|
|
+ log.info("调用四维看看获取所有场景点位数失败,场景码是:{}" + param.get("sceneNum"));
|
|
}else {
|
|
}else {
|
|
|
|
+ log.info("points-{}", sceneRspBean.getData());
|
|
houseVOS.get(i).setPoints(sceneRspBean.getData());
|
|
houseVOS.get(i).setPoints(sceneRspBean.getData());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -329,17 +336,17 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public String delete(String estateId, ContextTokenBean contextTokenBean, String token) {
|
|
|
|
|
|
+ public ViewResult delete(String estateId, ContextTokenBean contextTokenBean, String token) {
|
|
TmEstate dbEstate = getById(estateId);
|
|
TmEstate dbEstate = getById(estateId);
|
|
if(null == dbEstate){
|
|
if(null == dbEstate){
|
|
- return "楼盘不存在或已被删除";
|
|
|
|
|
|
+ return ViewResult.error("楼盘不存在或已被删除");
|
|
}
|
|
}
|
|
|
|
|
|
LambdaQueryWrapper<TmHouse> qw = new LambdaQueryWrapper();
|
|
LambdaQueryWrapper<TmHouse> qw = new LambdaQueryWrapper();
|
|
qw.eq(TmHouse::getIsDelete, 0).eq(TmHouse::getEstateId, estateId);
|
|
qw.eq(TmHouse::getIsDelete, 0).eq(TmHouse::getEstateId, estateId);
|
|
TmHouse dbHouse = tmHouseService.getOne(qw);
|
|
TmHouse dbHouse = tmHouseService.getOne(qw);
|
|
if (dbHouse == null) {
|
|
if (dbHouse == null) {
|
|
- return "楼盘项目不存在或已被删除";
|
|
|
|
|
|
+ return ViewResult.error("楼盘项目不存在或已被删除");
|
|
}
|
|
}
|
|
|
|
|
|
deleteEstateById(estateId);
|
|
deleteEstateById(estateId);
|
|
@@ -349,15 +356,15 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
if(null != dbHouse.getStatus()){
|
|
if(null != dbHouse.getStatus()){
|
|
//除了草稿、未通过状态,其他状态都不能删除
|
|
//除了草稿、未通过状态,其他状态都不能删除
|
|
if(!HouseStatus.canDelete(dbHouse.getStatus())){
|
|
if(!HouseStatus.canDelete(dbHouse.getStatus())){
|
|
- return "存在待审核/已审核数据,无法删除";
|
|
|
|
|
|
+ return ViewResult.error("存在待审核/已审核数据,无法删除");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(!isCanDelete(dbHouse, contextTokenBean)){
|
|
if(!isCanDelete(dbHouse, contextTokenBean)){
|
|
- return "暂无删除权限";
|
|
|
|
|
|
+ return ViewResult.error("暂无删除权限");
|
|
}
|
|
}
|
|
|
|
|
|
- int delete = tmHouseService.deleteHouseById(dbHouse.getId());
|
|
|
|
|
|
+ tmHouseService.deleteHouseById(dbHouse.getId());
|
|
|
|
|
|
List<TmHouse> houseList = tmHouseService.getListByEstate(estateId);
|
|
List<TmHouse> houseList = tmHouseService.getListByEstate(estateId);
|
|
if(!org.apache.commons.collections.CollectionUtils.isEmpty(houseList)){
|
|
if(!org.apache.commons.collections.CollectionUtils.isEmpty(houseList)){
|
|
@@ -366,7 +373,7 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
List<String> sceneNumList = panoService.getKanKanSceneNums(house.getId() , token);
|
|
List<String> sceneNumList = panoService.getKanKanSceneNums(house.getId() , token);
|
|
log.info("720返回的房源的[{}]对应的四维场景码列表为:{}" , house.getId() , JSON.toJSONString(sceneNumList));
|
|
log.info("720返回的房源的[{}]对应的四维场景码列表为:{}" , house.getId() , JSON.toJSONString(sceneNumList));
|
|
if(!org.apache.commons.collections.CollectionUtils.isEmpty(sceneNumList)){
|
|
if(!org.apache.commons.collections.CollectionUtils.isEmpty(sceneNumList)){
|
|
- return "楼盘下存在未解绑的VR项目,请解绑后删除";
|
|
|
|
|
|
+ return ViewResult.error("楼盘下存在未解绑的VR项目,请解绑后删除");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -397,7 +404,7 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
|
|
//panoService.noticeVrAuditStatus(houseId , getToken() , 3);
|
|
//panoService.noticeVrAuditStatus(houseId , getToken() , 3);
|
|
|
|
|
|
panoService.noticeDeleteVr(dbHouse.getId(), token);
|
|
panoService.noticeDeleteVr(dbHouse.getId(), token);
|
|
- return "删除房源成功";
|
|
|
|
|
|
+ return ViewResult.success("删除房源成功");
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|