|
@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
+import org.checkerframework.checker.units.qual.C;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -43,16 +44,12 @@ public class SceneController extends BaseController {
|
|
|
@Autowired
|
|
|
private SceneMapper sceneMapper;
|
|
|
|
|
|
- /**
|
|
|
- * 改VR项目有计算中的模型,允许轮询,否则停止轮询
|
|
|
- * 30s 轮询一次
|
|
|
- */
|
|
|
-// @WebControllerLog(description = "场景管理-场景列表")
|
|
|
-// @ApiOperation(value = "场景列表", position = 1)
|
|
|
-// @PostMapping("list")
|
|
|
-// public Result list(@RequestBody ScenePageDto param) {
|
|
|
-// return sceneService.search(param);
|
|
|
-// }
|
|
|
+
|
|
|
+ @ApiOperation(value = "保存关联场景热点", position = 1, notes = "sceneCodes:场景关联的场景码")
|
|
|
+ @PostMapping("save/useHots")
|
|
|
+ public Result saveUseHots(@Valid @RequestBody UseHotsDto param) {
|
|
|
+ return sceneService.saveUseHots(param);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 改VR项目有计算中的模型,允许轮询,否则停止轮询
|
|
@@ -112,7 +109,7 @@ public class SceneController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@WebControllerLog(description = "场景管理-编辑场景")
|
|
|
- @ApiOperation(value = "VR项目修改", position = 3)
|
|
|
+ @ApiOperation(value = "VR项目修改", position = 3, notes = "修改VR项目的基础信息")
|
|
|
@PostMapping("house/edit")
|
|
|
public Result editHouse(@Valid @RequestBody EditHouseDto param) {
|
|
|
return sceneService.editHouse(param);
|
|
@@ -137,7 +134,7 @@ public class SceneController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@WebControllerLog(description = "场景管理-VR项目删除")
|
|
|
- @ApiOperation(value = "VR项目删除", position = 3)
|
|
|
+ @ApiOperation(value = "VR项目删除", position = 3, notes = "删除VR项目时,把相应场景设置为删除状态")
|
|
|
@GetMapping("house/remove/{houseId}")
|
|
|
public Result houseRemove(@PathVariable String houseId) {
|
|
|
log.info("VR项目删除: " + houseId);
|
|
@@ -177,7 +174,7 @@ public class SceneController extends BaseController {
|
|
|
@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, notes = "把VR项目相应的计算成功的场景码返回给恒大管理后台")
|
|
|
@GetMapping("getVrSceneCode/{houseId}/{status}/{type}")
|
|
|
public Result getVrSceneCode(@PathVariable String houseId, @PathVariable String status, @PathVariable String type) {
|
|
|
log.info("获取场景码列表");
|
|
@@ -189,13 +186,19 @@ public class SceneController extends BaseController {
|
|
|
@GetMapping("house/detail/{houseId}")
|
|
|
public Result houseDetail(@PathVariable String houseId) {
|
|
|
log.info("房源详情");
|
|
|
- return houseFeign.findByHouseId(houseId);
|
|
|
+ Result result = houseFeign.findByHouseId(houseId);
|
|
|
+ int code = result.getCode();
|
|
|
+ if (code == -1) {
|
|
|
+ log.info("房源不存在: " + houseId);
|
|
|
+ return Result.failure(7007, "房源不存在");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提供恒大管理后台使用
|
|
|
*/
|
|
|
- @ApiOperation(value = "房源首页批量获取", position = 3)
|
|
|
+ @ApiOperation(value = "房源首页批量获取", position = 3, notes = "获取所有VR项目的首页场景链接")
|
|
|
@PostMapping("house/findAllHouseId")
|
|
|
public Result findAllHouseId(@RequestBody HouseIndexPageDto param) {
|
|
|
log.info("房源首页批量获取");
|
|
@@ -208,7 +211,7 @@ public class SceneController extends BaseController {
|
|
|
* @param param
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation(value = "VR模型查找", position = 3)
|
|
|
+ @ApiOperation(value = "VR模型查找", position = 3, notes = "获取四维看看计算成功的场景信息")
|
|
|
@PostMapping("findVrModel")
|
|
|
public Result findVrModel(@Valid @RequestBody SceneRroPageDto param) {
|
|
|
log.info("VR模型查找");
|
|
@@ -220,13 +223,15 @@ public class SceneController extends BaseController {
|
|
|
* @param sceneCode
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation(value = "VR模模型-根据场景码查询")
|
|
|
+ @ApiOperation(value = "VR模模型-根据场景码查询", notes = "提供给四维看看,判断是否在720yun中使用此场景,true:有,四维看看不能删除此场景; false:可以删除")
|
|
|
@GetMapping(value = "fdkk/findBySceneCode")
|
|
|
public Result vrFindBySceneCode(String sceneCode) {
|
|
|
log.info("VR模模型-根据场景码查询: " + sceneCode);
|
|
|
- SceneEntity entity = sceneService.findBySceneCode(sceneCode);
|
|
|
+ // 此方法建议把返回值改回list值会更安全
|
|
|
+ List<SceneEntity> list = sceneService.listFindBySceneCode(sceneCode);
|
|
|
+ log.info("使用中的VR模型数量:" + list.size());
|
|
|
boolean flag = true;
|
|
|
- if (entity == null) {
|
|
|
+ if (list.isEmpty()) {
|
|
|
flag = false;
|
|
|
}
|
|
|
log.info("查询结果: " + flag);
|
|
@@ -249,7 +254,7 @@ public class SceneController extends BaseController {
|
|
|
})
|
|
|
public Result saveIndex(@RequestParam String sceneId, @RequestParam String icon) {
|
|
|
log.info("保存初始画面");
|
|
|
-// SceneEntity entity = sceneService.findb(sceneId);
|
|
|
+ // forUpdate:数据一致新问题
|
|
|
SceneEntity entity = sceneMapper.findByIdForUpdate(sceneId);
|
|
|
if (entity == null) {
|
|
|
log.error("对象不存在: {}", sceneId);
|
|
@@ -265,7 +270,7 @@ public class SceneController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation("编辑xml")
|
|
|
+ @ApiOperation(value = "编辑xml", notes = "设置初始角度")
|
|
|
@PostMapping("editXml")
|
|
|
public Result editXml(@Valid @RequestBody XmlDataDto param) {
|
|
|
|
|
@@ -286,7 +291,7 @@ public class SceneController extends BaseController {
|
|
|
|
|
|
|
|
|
@WebControllerLog(description = "场景管理-场景删除")
|
|
|
- @ApiOperation("场景删除")
|
|
|
+ @ApiOperation(value = "场景删除", notes = "判断VR项目关联场景、关联热点等判断")
|
|
|
@GetMapping("removes/{id}")
|
|
|
public Result remove(@PathVariable String id) {
|
|
|
log.info("场景删除");
|
|
@@ -295,11 +300,21 @@ public class SceneController extends BaseController {
|
|
|
return Result.failure(7004, "执行中的任务不能删除");
|
|
|
|
|
|
}
|
|
|
+ String sceneCode = entity.getSceneCode();
|
|
|
+ String houseId = entity.getHouseId();
|
|
|
+
|
|
|
+ // 查询热点关联场景
|
|
|
+ List<SceneEntity> list = sceneService.searchUseHots(houseId, sceneCode);
|
|
|
+ log.info("关联热点场景数量: " +list.size());
|
|
|
+ if (list.size() > 0) {
|
|
|
+ return Result.failure(7008, "有关联热点场景使用此场景,不能删除");
|
|
|
+ }
|
|
|
+
|
|
|
entity.setIsDelete(1);
|
|
|
// 设置场景为0
|
|
|
entity.setIsIndex(0);
|
|
|
entity.setUpdateTime(new Date());
|
|
|
- String houseId = entity.getHouseId();
|
|
|
+
|
|
|
sceneService.update(entity);
|
|
|
|
|
|
boolean flag = false;
|