|
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.gis.common.constant.CmdConstant;
|
|
|
import com.gis.common.constant.ConfigConstant;
|
|
|
import com.gis.common.constant.RabbitConfig;
|
|
|
+import com.gis.common.exception.BaseRuntimeException;
|
|
|
import com.gis.common.task.AsyncTask;
|
|
|
import com.gis.common.util.*;
|
|
|
import com.gis.domain.dto.*;
|
|
@@ -105,7 +106,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
return Result.failure("houseId不能为空");
|
|
|
}
|
|
|
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
+ Result resStatus = canEdit(houseId);
|
|
|
if (resStatus != null) {
|
|
|
return resStatus;
|
|
|
}
|
|
@@ -160,11 +161,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
entity.setPath(panoPath);
|
|
|
entity.setOssPath(configConstant.ossDomain + configConstant.projectName + "/" + houseId + "/" + sceneCode);
|
|
|
|
|
|
- // 缩略图,使用切图那个thumb.jpg
|
|
|
// 压缩图片并上传oss
|
|
|
// 全景图缩略图统一命名规则: http:// oss/cms_pano_fcb/image/thumb_sceneCode.jpg
|
|
|
-// String iconPath = fileUtils.compressImgAndUploadOss2(
|
|
|
-// panoPath, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain, 600, 300, "image/thumb_"+sceneCode+".jpg");
|
|
|
|
|
|
String iconPath = convertAndUploadOss(
|
|
|
panoPath, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain, 600, 300, "image/thumb_"+sceneCode+".jpg");
|
|
@@ -214,7 +212,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
log.info("saveCompressImgPath: " + saveCompressImgPath);
|
|
|
String ossUrl = null;
|
|
|
try {
|
|
|
-// Img.from(new File(inputFilePath)).scale(width, height).write(new File(saveCompressImgPath));
|
|
|
// 使用convert压缩图片
|
|
|
String cmd = CmdConstant.CONVERT;
|
|
|
String size = width + "x" + height;
|
|
@@ -239,63 +236,79 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
log.error("图片格式有误,不支持此图片");
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
return ossUrl;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 查询VR项目状态
|
|
|
+ * 查询VR项目是否可编辑
|
|
|
+ * true: 可编辑
|
|
|
+ * false: 不可编辑
|
|
|
* @param houseId
|
|
|
* @return
|
|
|
*/
|
|
|
- private Result getHouseStatus(String houseId){
|
|
|
+ private Result canEdit(String houseId){
|
|
|
Result result = null;
|
|
|
try {
|
|
|
result = houseFeign.findByHouseId(houseId);
|
|
|
+ log.info("房车宝返回数据:{}", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ log.error("调用房车宝接口失败");
|
|
|
+ throw new BaseRuntimeException("调用房车宝接口失败");
|
|
|
}
|
|
|
- String status = null;
|
|
|
if (result.getCode() == 0) {
|
|
|
- Object data = result.getData();
|
|
|
- JSONObject jsonObject = JSON.parseObject(data.toString());
|
|
|
- status = jsonObject.getString("status");
|
|
|
- log.info("house status: " + status);
|
|
|
- log.warn("可以正常编辑");
|
|
|
- if (status.equals("1")) {
|
|
|
- log.warn("审核中不能编辑");
|
|
|
- return Result.failure(7005, "审核中不能编辑");
|
|
|
- }
|
|
|
- if (status.equals("2")) {
|
|
|
- log.warn("已审核中不能编辑");
|
|
|
- return Result.failure(7006, "已审核中不能编辑");
|
|
|
+ boolean data = (boolean) result.getData();
|
|
|
+ if (data) {
|
|
|
+ log.info("vr项目可编辑");
|
|
|
+ return Result.success();
|
|
|
+ } else {
|
|
|
+ log.info("vr项目不可编辑");
|
|
|
+ return Result.failure(7005, "VR项目不可编辑");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (result.getCode() == -1){
|
|
|
+ } else {
|
|
|
log.error("VR项目接口查询失败:" + result.getMsg() );
|
|
|
return Result.failure(7007, "VR项目接口查询失败");
|
|
|
}
|
|
|
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
+// private Result getHouseStatus(String houseId){
|
|
|
+// Result result = null;
|
|
|
+// try {
|
|
|
+// result = houseFeign.findByHouseId(houseId);
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// String status = null;
|
|
|
+// if (result.getCode() == 0) {
|
|
|
+// Object data = result.getData();
|
|
|
+// JSONObject jsonObject = JSON.parseObject(data.toString());
|
|
|
+// status = jsonObject.getString("status");
|
|
|
+// log.info("house status: " + status);
|
|
|
+// log.warn("可以正常编辑");
|
|
|
+// if (status.equals("1")) {
|
|
|
+// log.warn("审核中不能编辑");
|
|
|
+// return Result.failure(7005, "审核中不能编辑");
|
|
|
+// }
|
|
|
+// if (status.equals("2")) {
|
|
|
+// log.warn("已审核中不能编辑");
|
|
|
+// return Result.failure(7006, "已审核中不能编辑");
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (result.getCode() == -1){
|
|
|
+// log.error("VR项目接口查询失败:" + result.getMsg() );
|
|
|
+// return Result.failure(7007, "VR项目接口查询失败");
|
|
|
+// }
|
|
|
+//
|
|
|
+// return null;
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
- @Test
|
|
|
- public void test2(){
|
|
|
- String type = "aa.jpg";
|
|
|
- System.out.println(StringUtils.substringBeforeLast(type, "."));
|
|
|
- System.out.println(type.equalsIgnoreCase("jpeg"));
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public Result search(ScenePageDto param) {
|
|
@@ -353,12 +366,14 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
String byType = sceneEntity.getByType();
|
|
|
String sceneCode = sceneEntity.getSceneCode();
|
|
|
String houseId = sceneEntity.getHouseId();
|
|
|
+ String id = sceneEntity.getId();
|
|
|
if (byType.equals("garden")) {
|
|
|
sceneEntity.setType("garden");
|
|
|
}
|
|
|
|
|
|
// 2020.04.02检查初始场景是否使用
|
|
|
- List<SceneInitEntity> initEntities = sceneInitService.findByHouseIdAndSceneCode(houseId, sceneCode);
|
|
|
+// List<SceneInitEntity> initEntities = sceneInitService.findByHouseIdAndSceneCode(houseId, sceneCode);
|
|
|
+ List<SceneInitEntity> initEntities = sceneInitService.findByHouseIdAndSceneId(houseId, id);
|
|
|
if (initEntities.size() > 0) {
|
|
|
sceneEntity.setIsUseIndex(1);
|
|
|
}
|
|
@@ -385,15 +400,13 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
// 检查VR项目状态
|
|
|
String houseId = param.getHouseId();
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
+ Result resStatus = canEdit(houseId);
|
|
|
if (resStatus != null) {
|
|
|
return resStatus;
|
|
|
}
|
|
|
|
|
|
SceneEntity entity = null;
|
|
|
|
|
|
-// List<SceneEntity> index = entityMapper.getIndex(param.getHouseId());
|
|
|
-
|
|
|
if ( id == null) {
|
|
|
entity = entityMapper.findByVrModelIdAndHouseId(param.getVrModelId(), param.getHouseId());
|
|
|
if (entity != null){
|
|
@@ -409,24 +422,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
- // 2021-03-30 更新pro, 不更新场景码到恒大后台
|
|
|
-// if (index.size() == 0) {
|
|
|
-// entity.setIsIndex(1);
|
|
|
-
|
|
|
-// HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
|
|
|
-// indexDto.setId(entity.getHouseId());
|
|
|
-// indexDto.setSceneNum(entity.getSceneCode());
|
|
|
-// indexDto.setUpdateTime(LocalDateTime.now());
|
|
|
-// indexDto.setFcbHouseId(entity.getHengdaId());
|
|
|
-// Result result = houseFeign.updateHouseSceneIndex(indexDto);
|
|
|
-
|
|
|
-// if (result.getCode() == 0) {
|
|
|
-// log.info("更新了初始场景到VR项目完成");
|
|
|
-// } else {
|
|
|
-// log.error("更新了初始场景到VR项目异常");
|
|
|
-// return Result.failure(result.getMsg());
|
|
|
-// }
|
|
|
-// }
|
|
|
+
|
|
|
entity.setId(RandomUtils.getUuid());
|
|
|
entity.setType("house");
|
|
|
entity.setStatus(3);
|
|
@@ -452,6 +448,22 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public SceneEntity findByHouseIdAndSceneCode(String houseId, String sceneCode) {
|
|
|
+ return entityMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result editAgent(String id, String agentId) {
|
|
|
+ SceneEntity entity = this.findById(id);
|
|
|
+ if (entity == null) {
|
|
|
+ return Result.failure("场景不存在:" + id);
|
|
|
+ }
|
|
|
+ entity.setAgentId(agentId);
|
|
|
+ entity.setUpdateTime(new Date());
|
|
|
+ this.update(entity);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -495,112 +507,9 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
return flag;
|
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
-// * 编辑场景
|
|
|
-// * house字段更新伟玉房源接口
|
|
|
-// * 其他字段更新720场景数据,websit要更新到伟玉那边去
|
|
|
-// */
|
|
|
-// @Override
|
|
|
-// public Result editHouse(EditHouseDto param) {
|
|
|
-//
|
|
|
-// // 检查VR项目状态
|
|
|
-// String houseId = param.getHouseId();
|
|
|
-// Result resStatus = getHouseStatus(houseId);
|
|
|
-// if (resStatus != null) {
|
|
|
-// return resStatus;
|
|
|
-// }
|
|
|
-//
|
|
|
-// // TODO: 2021/1/8 0008 更新伟玉房源表单接口
|
|
|
-// HouseDto houseDto = new HouseDto();
|
|
|
-// houseDto.setId(houseId);
|
|
|
-// houseDto.setCoverImagUrl(param.getHouseIcon());
|
|
|
-// houseDto.setHouseTitle(param.getHouseTitle());
|
|
|
-// houseDto.setShareDesc(param.getHouseDescription());
|
|
|
-// houseDto.setUpdateTime(LocalDateTime.now());
|
|
|
-// // 2021-03-30 新增
|
|
|
-// houseDto.setFcbHouseId(param.getFcbHouseId());
|
|
|
-// // 设置为显示
|
|
|
-// houseDto.setIsShow("1");
|
|
|
-//
|
|
|
-// log.info("update houseDto: " + houseDto.toString());
|
|
|
-//
|
|
|
-// try {
|
|
|
-// Result result = houseFeign.updateHouse(houseDto);
|
|
|
-// if (result.getCode() == 0) {
|
|
|
-// log.info("更新房源信息完成");
|
|
|
-// } else {
|
|
|
-// log.error("更新房源信息异常");
|
|
|
-// return Result.failure(result.getMsg());
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-//
|
|
|
-// return Result.success();
|
|
|
-// }
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Result setIndex(String id) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- SceneEntity entity = findById(id);
|
|
|
- if (entity == null) {
|
|
|
- log.error("场景不存在,id: {}", id);
|
|
|
- return Result.failure("场景不存在");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // 检查VR项目状态
|
|
|
- String houseId = entity.getHouseId();
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
- if (resStatus != null) {
|
|
|
- return resStatus;
|
|
|
- }
|
|
|
- log.info("检查状态完成,可以编辑");
|
|
|
-
|
|
|
-
|
|
|
- // 设置初始场景
|
|
|
- // step:1先全部设置为0
|
|
|
- entityMapper.setIndexByHouseId(0, entity.getHouseId());
|
|
|
- // step:1先全部设置为1
|
|
|
- entityMapper.setIndexById(id, 1);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // TODO: 2021/1/9 0008 更新伟玉房源表单接口
|
|
|
-// HouseSceneIndexDto houseSceneIndexDto = new HouseSceneIndexDto();
|
|
|
-// houseSceneIndexDto.setId(houseId);
|
|
|
-//
|
|
|
-// // 初始场景
|
|
|
-// houseSceneIndexDto.setSceneNum(entity.getSceneCode());
|
|
|
-// houseSceneIndexDto.setUpdateTime(LocalDateTime.now());
|
|
|
-// houseSceneIndexDto.setFcbHouseId(entity.getHouseId());
|
|
|
-// Result result = houseFeign.updateHouseSceneIndex(houseSceneIndexDto);
|
|
|
-// if (result.getCode() == 0) {
|
|
|
-// log.info("更新房源updateHouse完成");
|
|
|
-// } else {
|
|
|
-// log.error("更新房源updateHouse异常");
|
|
|
-// return Result.failure(result.getMsg());
|
|
|
-// }
|
|
|
-
|
|
|
- return Result.success();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Result getIndex(String houseId) {
|
|
|
- List<SceneEntity> index = entityMapper.getIndex(houseId);
|
|
|
- if (index.size() == 0) {
|
|
|
- log.info("首页场景码不存在");
|
|
|
- return Result.success();
|
|
|
- }
|
|
|
- SceneEntity entity = index.get(0);
|
|
|
- log.info("首页场景码: " + entity.getSceneCode());
|
|
|
- return Result.success(entity);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
public Result findByHouseId(String houseId) {
|
|
|
return Result.success(entityMapper.findByHouseId(houseId));
|
|
|
}
|
|
@@ -614,7 +523,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
if (n == 1) {
|
|
|
SceneEntity entity = this.findById(id);
|
|
|
String houseId = entity.getHouseId();
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
+ Result resStatus = canEdit(houseId);
|
|
|
if (resStatus != null) {
|
|
|
return resStatus;
|
|
|
}
|
|
@@ -641,8 +550,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
@Override
|
|
|
public Result houseRemove(String houseId) {
|
|
|
+
|
|
|
entityMapper.houseRemove(houseId);
|
|
|
sceneInitMapper.removeByHouseId(houseId);
|
|
|
+ log.info("管理后台-vr项目删除成功, id: {}", houseId);
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
@@ -745,57 +656,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 没有的接口,需要删除
|
|
|
- * @param param
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Result findVrModel2(SceneRroPageDto param) {
|
|
|
- // TODO: 2021/1/8 0008 查找4dkk场景数据,当前区域公司下的模型
|
|
|
- @NotBlank(message = "token不能为空") String token = param.getToken();
|
|
|
- // 只获取计算成功的, 0:计算成功
|
|
|
-// param.setStatus("0");
|
|
|
- Result result = sceneProFeign.findByList(param, token);
|
|
|
- log.info("result: " + result.toString());
|
|
|
-
|
|
|
- // 过滤已添加的数据
|
|
|
- if (result.getCode() == 0) {
|
|
|
-
|
|
|
- Object data = result.getData();
|
|
|
- PageInfo page = JSON.parseObject(data.toString(), PageInfo.class);
|
|
|
-
|
|
|
- List<Object> list = page.getList();
|
|
|
- log.info("list size: " + list.size());
|
|
|
-
|
|
|
- List<Object> newList = new ArrayList<>();
|
|
|
-
|
|
|
- for (Object o : list) {
|
|
|
- JSONObject scenePro = JSON.parseObject(o.toString());
|
|
|
- String sceneProId = scenePro.getString("id");
|
|
|
- List<SceneEntity> vrModelId = entityMapper.findByVrModelId2(sceneProId);
|
|
|
-// SceneEntity vrModelId = entityMapper.findByVrModelIdAndHouseId(sceneProId, param.getHouseId());
|
|
|
- String use = "0";
|
|
|
- if (vrModelId.size() > 0) {
|
|
|
- use = "1";
|
|
|
- }
|
|
|
-
|
|
|
- scenePro.put("isUse", use);
|
|
|
- newList.add(scenePro);
|
|
|
- }
|
|
|
-
|
|
|
- page.setList(newList);
|
|
|
- log.info("newList size: " + newList.size());
|
|
|
-
|
|
|
- return Result.success(page);
|
|
|
- } else {
|
|
|
- log.error("异常了");
|
|
|
- return Result.failure(result.getMsg());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -806,7 +666,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
// 检查VR项目状态
|
|
|
String houseId = param.getHouseId();
|
|
|
String roomId = param.getRoomId();
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
+ Result resStatus = canEdit(houseId);
|
|
|
if (resStatus != null) {
|
|
|
return resStatus;
|
|
|
}
|
|
@@ -842,7 +702,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
this.save(entity);
|
|
|
|
|
|
// 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
|
|
|
- checkSceneInit(houseId, sceneCode);
|
|
|
+// checkSceneInit(houseId, sceneCode);
|
|
|
+ checkSceneInit(houseId, id);
|
|
|
|
|
|
log.info("保存VR模型完成");
|
|
|
} else {
|
|
@@ -859,17 +720,30 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
|
|
|
// 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
|
|
|
- private void checkSceneInit(String houseId, String sceneCode){
|
|
|
+ private void checkSceneInit(String houseId, String id){
|
|
|
List<SceneInitEntity> list = sceneInitService.findByHouseId(houseId);
|
|
|
if (list.size() == 0){
|
|
|
SceneInitEntity entity = new SceneInitEntity();
|
|
|
entity.setId(RandomUtils.getUuid("init"));
|
|
|
entity.setHouseId(houseId);
|
|
|
- entity.setSceneCode(sceneCode);
|
|
|
+// entity.setSceneCode(sceneCode);
|
|
|
+ entity.setSceneId(id);
|
|
|
sceneInitService.save(entity);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
|
|
|
+// private void checkSceneInit(String houseId, String sceneCode){
|
|
|
+// List<SceneInitEntity> list = sceneInitService.findByHouseId(houseId);
|
|
|
+// if (list.size() == 0){
|
|
|
+// SceneInitEntity entity = new SceneInitEntity();
|
|
|
+// entity.setId(RandomUtils.getUuid("init"));
|
|
|
+// entity.setHouseId(houseId);
|
|
|
+// entity.setSceneCode(sceneCode);
|
|
|
+// sceneInitService.save(entity);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -885,64 +759,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
return Result.success(fileUtils.renameUploadOss(file, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain));
|
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
-// public Result editXml(XmlDataDto param) {
|
|
|
-// long start = System.currentTimeMillis();
|
|
|
-// String id = param.getId();
|
|
|
-//// SceneEntity entity = findById(id);
|
|
|
-// SceneEntity entity = entityMapper.findByIdForUpdate(id);
|
|
|
-// if (entity == null) {
|
|
|
-// log.error("对象不存在,id : " + id);
|
|
|
-// return Result.failure("场景码不存在");
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// // 检查VR项目状态
|
|
|
-// String houseId = entity.getHouseId();
|
|
|
-// Result resStatus = getHouseStatus(houseId);
|
|
|
-// if (resStatus != null) {
|
|
|
-// return resStatus;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// // 注意网络下载会有缓存,必须加时间戳
|
|
|
-// // http://ossxiaoan.4dage.com/cms_pano_fcb/p19/fcb_px2rJW96F/vtour/tour.xml
|
|
|
-// String tourOssUrl = entity.getOssPath() + "/vtour/tour.xml?m=" + System.currentTimeMillis();
|
|
|
-// log.info("网络下载文件地址: {}", tourOssUrl);
|
|
|
-// String fileName = "tour2.xml";
|
|
|
-// String filePath = entity.getPath();
|
|
|
-// String localBasePath = StringUtils.substringBeforeLast(filePath, "/");
|
|
|
-// FileUtils.downLoadFromUrl(tourOssUrl, fileName, localBasePath);
|
|
|
-// log.info("网络下载成功: {}", localBasePath+ "/tour2.xml");
|
|
|
-//
|
|
|
-// // 编辑xml, 修改初始角度
|
|
|
-// String inPath = localBasePath + "/tour2.xml";
|
|
|
-// String outPath = localBasePath + "/tour.xml";
|
|
|
-// String hlookat = param.getHlookat();
|
|
|
-// String vlookat = param.getVlookat();
|
|
|
-// streamEditFile(inPath, outPath, hlookat, vlookat);
|
|
|
-// log.info("编辑xml, 修改初始角度完毕");
|
|
|
-//
|
|
|
-// String tourOssSavePath = configConstant.ossBasePath + entity.getHouseId() + "/" + entity.getSceneCode() + "/vtour/tour.xml";
|
|
|
-// log.info("osspath: " + tourOssSavePath);
|
|
|
-// aliyunOssUtil.upload(outPath, tourOssSavePath);
|
|
|
-//// asyncTask.uploadOss(outPath, tourOssSavePath);
|
|
|
-// long end = System.currentTimeMillis();
|
|
|
-// log.info("tour.xml 上传oss完成, 共耗时: " + (end-start)/1000 + " s");
|
|
|
-//
|
|
|
-// // 保存初始视觉
|
|
|
-// JSONObject jsonObject = new JSONObject();
|
|
|
-// jsonObject.put("hlookat", hlookat);
|
|
|
-// jsonObject.put("vlookat", vlookat);
|
|
|
-// entity.setInitVisual(jsonObject.toJSONString());
|
|
|
-//
|
|
|
-// this.update(entity);
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// return Result.success(entity.getOssPath());
|
|
|
-// }
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public Result editXml(XmlDataDto param) {
|
|
@@ -958,7 +774,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
// 检查VR项目状态
|
|
|
String houseId = entity.getHouseId();
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
+ Result resStatus = canEdit(houseId);
|
|
|
if (resStatus != null) {
|
|
|
return resStatus;
|
|
|
}
|
|
@@ -1000,73 +816,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
return Result.success(entity.getOssPath());
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void tes1(){
|
|
|
- String inPath = "C:\\Users\\Administrator\\Desktop\\33\\tour2.xml";
|
|
|
- String outPath = "C:\\Users\\Administrator\\Desktop\\33\\tour.xml";
|
|
|
- streamEditFile(inPath, outPath, "0.1", "0.2");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static void streamEditFile(String inPath, String outPath, String hlookat, String vlookat) {
|
|
|
- // 4*4矩阵
|
|
|
-
|
|
|
- BufferedReader reader = null;
|
|
|
- try {
|
|
|
- InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(inPath), "UTF-8");
|
|
|
- reader = new BufferedReader(inputStreamReader);
|
|
|
-
|
|
|
-
|
|
|
- // 输出缓冲流
|
|
|
-
|
|
|
- String tempString = null;
|
|
|
- StringBuffer buffer = new StringBuffer();
|
|
|
-
|
|
|
- // 转数组
|
|
|
- while ((tempString = reader.readLine()) != null) {
|
|
|
-
|
|
|
- if (tempString.contains("<view hlookat=")) {
|
|
|
- tempString = tempString.replace("\t", "");
|
|
|
-
|
|
|
- String start = StringUtils.substring(tempString, 0, 5);
|
|
|
- String end = StringUtils.substringAfter(tempString, "fovtype");
|
|
|
-
|
|
|
- StringBuffer aa = new StringBuffer();
|
|
|
- aa.append(start);
|
|
|
- aa.append(" hlookat=").append("\"").append(hlookat).append("\"");
|
|
|
- aa.append(" vlookat=").append("\"").append(vlookat).append("\"");
|
|
|
- aa.append(" fovtype");
|
|
|
- aa.append(end);
|
|
|
- // 写文件
|
|
|
- tempString = aa.toString();
|
|
|
- log.info("temp: " + tempString);
|
|
|
- }
|
|
|
- // 换行写入
|
|
|
- buffer.append(tempString).append("\r\n");
|
|
|
- }
|
|
|
- reader.close();
|
|
|
- FileUtil.writeUtf8String(buffer.toString(), outPath);
|
|
|
- } catch (IOException ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- } finally {
|
|
|
- if (reader != null) {
|
|
|
- try {
|
|
|
- reader.close();
|
|
|
- } catch (IOException ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- @Test
|
|
|
- public void test(){
|
|
|
- String a= "/home/data/cms_pano_fcb_data/p19/fcb_px2rJW96F/fcb_px2rJW96F.jpg";
|
|
|
- String s = StringUtils.substringBeforeLast(a, "/");
|
|
|
- System.out.println(s);
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public SceneEntity findBySceneCode(String sceneCode) {
|
|
@@ -1090,7 +840,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
|
|
|
// 检查VR项目状态
|
|
|
String houseId = entity.getHouseId();
|
|
|
- Result resStatus = getHouseStatus(houseId);
|
|
|
+ Result resStatus = canEdit(houseId);
|
|
|
if (resStatus != null) {
|
|
|
return resStatus;
|
|
|
}
|
|
@@ -1106,26 +856,4 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @Test
|
|
|
- public void tess(){
|
|
|
- String a = "/home/data/cms_pano_fcb_data/fcb_pano1348947775971389440/pano.jpg";
|
|
|
- String s = StringUtils.substringBeforeLast(a, "/");
|
|
|
- System.out.println(s);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Test
|
|
|
- public void pngToJpg(){
|
|
|
-// String png = "C:\\Users\\Administrator\\Desktop\\33\\2_1.png";
|
|
|
-// String jpg = "C:\\Users\\Administrator\\Desktop\\33\\png\\1.jpn";
|
|
|
-// ImgUtil.convert();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|