|
@@ -1,6 +1,7 @@
|
|
|
package com.gis.web.controller;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.dto.*;
|
|
|
import com.gis.domain.entity.SceneEntity;
|
|
@@ -43,7 +44,6 @@ public class SceneController extends BaseController {
|
|
|
private SceneMapper sceneMapper;
|
|
|
|
|
|
|
|
|
-
|
|
|
@WebControllerLog(description = "场景管理-场景列表")
|
|
|
@ApiOperation(value = "场景列表", position = 1)
|
|
|
@PostMapping("list")
|
|
@@ -53,12 +53,11 @@ public class SceneController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 创建场景
|
|
|
+ *
|
|
|
* @param file
|
|
|
* @param houseId
|
|
|
* @param type
|
|
|
- * @return
|
|
|
- *
|
|
|
- * 恒大id 唯一入口
|
|
|
+ * @return 恒大id 唯一入口
|
|
|
*/
|
|
|
@WebControllerLog(description = "场景管理-创建场景")
|
|
|
@ApiImplicitParams({
|
|
@@ -68,7 +67,7 @@ public class SceneController extends BaseController {
|
|
|
})
|
|
|
@ApiOperation(value = "上传-全景图(创建场景)", position = 2)
|
|
|
@PostMapping("uploadPano/{houseId}/{type}/{hengdaId}")
|
|
|
- public Result uploadPano(MultipartFile file, @PathVariable String houseId, @PathVariable String type, @PathVariable String hengdaId){
|
|
|
+ public Result uploadPano(MultipartFile file, @PathVariable String houseId, @PathVariable String type, @PathVariable String hengdaId) {
|
|
|
|
|
|
if (file == null) {
|
|
|
log.error("文件不能为空");
|
|
@@ -80,25 +79,43 @@ public class SceneController extends BaseController {
|
|
|
|
|
|
@WebControllerLog(description = "场景管理-场景排序")
|
|
|
@ApiOperation(value = "场景排序")
|
|
|
- @PostMapping(value = "setSort" )
|
|
|
- public Result setSort(@RequestBody Map<String, String> param){
|
|
|
+ @PostMapping(value = "setSort")
|
|
|
+ public Result setSort(@RequestBody Map<String, String> param) {
|
|
|
return sceneService.setSort(param);
|
|
|
}
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "上传-图标", position = 2)
|
|
|
- @PostMapping(value = "upload" )
|
|
|
- public Result upload(@RequestParam("file")MultipartFile file){
|
|
|
+ @PostMapping(value = "upload")
|
|
|
+ public Result upload(@RequestParam("file") MultipartFile file) {
|
|
|
return sceneService.upload(file);
|
|
|
}
|
|
|
|
|
|
@WebControllerLog(description = "场景管理-编辑场景")
|
|
|
- @ApiOperation(value = "修改VR项目", position = 3)
|
|
|
+ @ApiOperation(value = "VR项目修改", position = 3)
|
|
|
@PostMapping("house/edit")
|
|
|
public Result editHouse(@Valid @RequestBody EditHouseDto param) {
|
|
|
return sceneService.editHouse(param);
|
|
|
}
|
|
|
|
|
|
+ @WebControllerLog(description = "场景管理-VR项目审核通过/下线")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "houseId", value = "房源id", dataType = "String", required = true),
|
|
|
+ @ApiImplicitParam(name = "status", value = "状态, 审核通过/上线:4, 下线:3", dataType = "String"),
|
|
|
+ })
|
|
|
+ @ApiOperation(value = "VR项目审核通过/下线/上线", position = 3)
|
|
|
+ @GetMapping("house/audit/{houseId}/{status}")
|
|
|
+ public Result houseAudit(@PathVariable String houseId, @PathVariable String status) {
|
|
|
+ return sceneService.houseAudit(houseId, status);
|
|
|
+ }
|
|
|
+
|
|
|
+ @WebControllerLog(description = "场景管理-VR项目删除")
|
|
|
+ @ApiOperation(value = "VR项目删除", position = 3)
|
|
|
+ @GetMapping("house/remove/{houseId}")
|
|
|
+ public Result houseRemove(@PathVariable String houseId) {
|
|
|
+ return sceneService.houseRemove(houseId);
|
|
|
+ }
|
|
|
+
|
|
|
@WebControllerLog(description = "场景管理-编辑场景")
|
|
|
@ApiOperation(value = "编辑someData,(重命名)", position = 3)
|
|
|
@PostMapping("editSomeData")
|
|
@@ -106,13 +123,13 @@ public class SceneController extends BaseController {
|
|
|
return sceneService.editSomeData(param);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "首页设置" , position = 3)
|
|
|
+ @ApiOperation(value = "首页设置", position = 3)
|
|
|
@PostMapping("setIndex/{id}")
|
|
|
public Result setIndex(@PathVariable String id) {
|
|
|
return sceneService.setIndex(id);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "首页获取" , position = 3)
|
|
|
+ @ApiOperation(value = "首页获取", position = 3)
|
|
|
@GetMapping("getIndex/{houseId}")
|
|
|
public Result getIndex(@PathVariable String houseId) {
|
|
|
return sceneService.getIndex(houseId);
|
|
@@ -121,29 +138,40 @@ public class SceneController extends BaseController {
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "houseId", value = "房源id", dataType = "String", required = true),
|
|
|
- @ApiImplicitParam(name = "type", value = "场景类型, 楼盘:building, 园林:garden, 户型:house", dataType = "String",required = true),
|
|
|
+ @ApiImplicitParam(name = "type", value = "场景类型, 楼盘:building, 园林:garden, 户型:house", dataType = "String", required = true),
|
|
|
@ApiImplicitParam(name = "status", value = "状态 3:成功", dataType = "String", required = true)
|
|
|
})
|
|
|
- @ApiOperation(value = "获取场景码列表" , position = 3)
|
|
|
+ @ApiOperation(value = "获取场景码列表", position = 3)
|
|
|
@GetMapping("getVrSceneCode/{houseId}/{status}/{type}")
|
|
|
public Result getVrSceneCode(@PathVariable String houseId, @PathVariable String status, @PathVariable String type) {
|
|
|
return sceneService.getVrSceneCode(houseId, status, type);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- @ApiOperation(value = "房源详情" , position = 3)
|
|
|
+ @ApiOperation(value = "房源详情", position = 3)
|
|
|
@GetMapping("house/detail/{houseId}")
|
|
|
public Result houseDetail(@PathVariable String houseId) {
|
|
|
return houseFeign.findByHouseId(houseId);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "VR模型查找" , position = 3)
|
|
|
+
|
|
|
+ @ApiOperation(value = "VR模型查找", position = 3)
|
|
|
@PostMapping("findVrModel")
|
|
|
public Result findVrModel(@Valid @RequestBody SceneRroPageDto param) {
|
|
|
return sceneService.findVrModel(param);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "VR模模型-根据场景码查询")
|
|
|
+ @GetMapping(value = "fdkk/findBySceneCode")
|
|
|
+ public Result vrFindBySceneCode(String sceneCode) {
|
|
|
+ SceneEntity entity = sceneService.findBySceneCode(sceneCode);
|
|
|
+ boolean flag = true;
|
|
|
+ if (entity == null) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ return Result.success(flag);
|
|
|
+ }
|
|
|
+
|
|
|
@WebControllerLog(description = "场景管理-保存VR模型")
|
|
|
@ApiOperation("VR模型保存")
|
|
|
@PostMapping("saveVrModel")
|
|
@@ -192,59 +220,133 @@ public class SceneController extends BaseController {
|
|
|
return Result.success(entity);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@WebControllerLog(description = "场景管理-删除场景")
|
|
|
@ApiOperation("删除")
|
|
|
- @GetMapping("removes/{ids}")
|
|
|
- public Result removes(@PathVariable String ids) {
|
|
|
- String[] split = ids.split(",");
|
|
|
- SceneEntity entity = null;
|
|
|
+ @GetMapping("removes/{id}")
|
|
|
+ public Result remove(@PathVariable String id) {
|
|
|
+
|
|
|
+ SceneEntity entity = sceneService.findById(id);
|
|
|
+ if (entity.getStatus() == 1) {
|
|
|
+ return Result.failure(7004, "执行中的任务不能删除");
|
|
|
+
|
|
|
+ }
|
|
|
+ entity.setIsDelete(1);
|
|
|
+ // 设置场景为0
|
|
|
+ entity.setIsIndex(0);
|
|
|
+ entity.setUpdateTime(new Date());
|
|
|
+ String houseId = entity.getHouseId();
|
|
|
+ sceneService.update(entity);
|
|
|
+
|
|
|
boolean flag = false;
|
|
|
- for (String id: split) {
|
|
|
- entity = sceneService.findById(id);
|
|
|
- if (entity.getStatus() == 1) {
|
|
|
- return Result.failure(7004, "执行中的任务不能删除");
|
|
|
-// flag = true;
|
|
|
-// break;
|
|
|
- }
|
|
|
- entity.setIsDelete(1);
|
|
|
- // 设置场景为0
|
|
|
- entity.setIsIndex(0);
|
|
|
- entity.setUpdateTime(new Date());
|
|
|
- String houseId = entity.getHouseId();
|
|
|
- sceneService.update(entity);
|
|
|
-
|
|
|
- // 更新首页
|
|
|
- List<SceneEntity> entityList = sceneMapper.findByHouseId(houseId);
|
|
|
- if (entityList.size() > 0) {
|
|
|
- SceneEntity sceneEntity = entityList.get(0);
|
|
|
- if (sceneEntity != null) {
|
|
|
- sceneEntity.setIsIndex(1);
|
|
|
- sceneService.update(sceneEntity);
|
|
|
- // 更新首页场景到VR项目
|
|
|
- HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
|
|
|
- indexDto.setId(sceneEntity.getHouseId());
|
|
|
- indexDto.setSceneNum(entity.getSceneCode());
|
|
|
- indexDto.setUpdateTime(LocalDateTime.now());
|
|
|
- indexDto.setFcbHouseId(sceneEntity.getHengdaId());
|
|
|
- Result result = houseFeign.updateHouseSceneIndex(indexDto);
|
|
|
- if (result.getCode() == 0) {
|
|
|
- log.info("更新了初始场景到VR项目完成");
|
|
|
- } else {
|
|
|
- log.error("更新了初始场景到VR项目异常");
|
|
|
- return Result.failure(result.getMsg());
|
|
|
- }
|
|
|
- log.info("result: "+ result);
|
|
|
- log.info("更新了初始场景到VR项目");
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ // 更新首页
|
|
|
+ List<SceneEntity> buildingList = sceneMapper.findByHouseIdAndType(houseId, "building");
|
|
|
+ List<SceneEntity> gardenList = sceneMapper.findByHouseIdAndType(houseId, "garden");
|
|
|
+ List<SceneEntity> houseList = sceneMapper.findByHouseIdAndType(houseId, "house");
|
|
|
+
|
|
|
+ // 顺序不能变
|
|
|
+ SceneEntity IndexEntity = null;
|
|
|
+ if (buildingList.size() > 0) {
|
|
|
+ IndexEntity = setInitIndex(buildingList);
|
|
|
+ flag = true;
|
|
|
+ } else if (gardenList.size() > 0) {
|
|
|
+ IndexEntity = setInitIndex(gardenList);
|
|
|
+ flag = true;
|
|
|
+ } else if (houseList.size() > 0) {
|
|
|
+ flag = true;
|
|
|
+ IndexEntity = setInitIndex(houseList);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ // todo 测试一下是否要更新初始场景到伟玉那边
|
|
|
+ // 更新首页场景到VR项目
|
|
|
+ if (flag) {
|
|
|
+ HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
|
|
|
+ indexDto.setId(IndexEntity.getHouseId());
|
|
|
+ indexDto.setSceneNum(IndexEntity.getSceneCode());
|
|
|
+ indexDto.setUpdateTime(LocalDateTime.now());
|
|
|
+ indexDto.setFcbHouseId(IndexEntity.getHengdaId());
|
|
|
+ Result result = houseFeign.updateHouseSceneIndex(indexDto);
|
|
|
+
|
|
|
+
|
|
|
+ if (result.getCode() == 0) {
|
|
|
+ log.info("更新了初始场景到VR项目完成");
|
|
|
+ } else {
|
|
|
+ log.error("更新了初始场景到VR项目异常");
|
|
|
+ return Result.failure(result.getMsg());
|
|
|
+ }
|
|
|
+ log.info("result: " + result);
|
|
|
+ log.info("更新了初始场景到VR项目");
|
|
|
+ }
|
|
|
+
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
+// @WebControllerLog(description = "场景管理-删除场景")
|
|
|
+// @ApiOperation("删除")
|
|
|
+// @GetMapping("removes/{ids}")
|
|
|
+// public Result removes(@PathVariable String ids) {
|
|
|
+// String[] split = ids.split(",");
|
|
|
+// SceneEntity entity = null;
|
|
|
+//
|
|
|
+// for (String id: split) {
|
|
|
+// entity = sceneService.findById(id);
|
|
|
+// if (entity.getStatus() == 1) {
|
|
|
+// return Result.failure(7004, "执行中的任务不能删除");
|
|
|
+//
|
|
|
+// }
|
|
|
+// entity.setIsDelete(1);
|
|
|
+// // 设置场景为0
|
|
|
+// entity.setIsIndex(0);
|
|
|
+// entity.setUpdateTime(new Date());
|
|
|
+// String houseId = entity.getHouseId();
|
|
|
+// sceneService.update(entity);
|
|
|
+//
|
|
|
+// // 更新首页
|
|
|
+// List<SceneEntity> entityList = sceneMapper.findByHouseId(houseId);
|
|
|
+// if (entityList.size() > 0) {
|
|
|
+// SceneEntity sceneEntity = entityList.get(0);
|
|
|
+// if (sceneEntity != null) {
|
|
|
+// sceneEntity.setIsIndex(1);
|
|
|
+// sceneService.update(sceneEntity);
|
|
|
+// // 更新首页场景到VR项目
|
|
|
+// HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
|
|
|
+// indexDto.setId(sceneEntity.getHouseId());
|
|
|
+// indexDto.setSceneNum(entity.getSceneCode());
|
|
|
+// indexDto.setUpdateTime(LocalDateTime.now());
|
|
|
+// indexDto.setFcbHouseId(sceneEntity.getHengdaId());
|
|
|
+// Result result = houseFeign.updateHouseSceneIndex(indexDto);
|
|
|
+// if (result.getCode() == 0) {
|
|
|
+// log.info("更新了初始场景到VR项目完成");
|
|
|
+// } else {
|
|
|
+// log.error("更新了初始场景到VR项目异常");
|
|
|
+// return Result.failure(result.getMsg());
|
|
|
+// }
|
|
|
+// log.info("result: "+ result);
|
|
|
+// log.info("更新了初始场景到VR项目");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// return Result.success();
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ private SceneEntity setInitIndex(List<SceneEntity> entityList) {
|
|
|
+
|
|
|
+ SceneEntity sceneEntity = entityList.get(0);
|
|
|
+ if (sceneEntity != null) {
|
|
|
+ sceneEntity.setIsIndex(1);
|
|
|
+ sceneService.update(sceneEntity);
|
|
|
+ }
|
|
|
+ return sceneEntity;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 这个接口,好像是没用的
|
|
|
+ *
|
|
|
* @param houseId
|
|
|
* @return
|
|
|
*/
|