|
@@ -9,10 +9,9 @@ import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.common.util.ComputerUtil;
|
|
|
import com.fdkankan.common.util.CreateObjUtil;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
-import com.fdkankan.scene.service.ISceneFileBuildService;
|
|
|
-import com.fdkankan.scene.service.ISceneProService;
|
|
|
-import com.fdkankan.scene.service.ISceneService;
|
|
|
+import com.fdkankan.scene.service.*;
|
|
|
import com.fdkankan.scene.service.impl.SceneFileBuildServiceImpl;
|
|
|
+import com.fdkankan.scene.vo.RebuildVedioSceneParamVO;
|
|
|
import com.fdkankan.scene.vo.SceneParamVO;
|
|
|
import com.fdkankan.scene.vo.SceneVO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -45,6 +44,10 @@ public class SceneController {
|
|
|
ISceneService sceneService;
|
|
|
@Autowired
|
|
|
ISceneFileBuildService sceneFileBuildService;
|
|
|
+ @Autowired
|
|
|
+ IVideoSceneProgressService videoSceneProgressService;
|
|
|
+ @Autowired
|
|
|
+ IPicSceneProgressService picSceneProgressService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -111,605 +114,92 @@ public class SceneController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-// /**
|
|
|
-// * 场景模型重新计算
|
|
|
-// */
|
|
|
-// @ApiOperation("场景视频重新计算")
|
|
|
-// @PostMapping(value = "/rebuildVideoScene")
|
|
|
-// public ResultData rebuildVideoScene(@RequestBody RequestRebuildVedioScene requestRebuildVedioScene) throws Exception {
|
|
|
-//
|
|
|
-// if(StringUtils.isEmpty(requestRebuildVedioScene.getSceneNum()) || StringUtils.isEmpty(requestRebuildVedioScene.getPanoId())){
|
|
|
-// throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-//
|
|
|
-// String num = requestRebuildVedioScene.getSceneNum();
|
|
|
-//
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
|
|
|
-// SceneEntity scene = null;
|
|
|
-// String path = "";
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// scene = sceneService.findBySceneNum(requestRebuildVedioScene.getSceneNum());
|
|
|
-// if(scene == null){
|
|
|
-// throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
-// }else {
|
|
|
-// path = ConstantFilePath.BUILD_MODEL_PATH + scene.getDataSource().split("/")[scene.getDataSource().split("/").length - 2];
|
|
|
-// }
|
|
|
-// }else {
|
|
|
-// path = sceneProEntity.getDataSource();
|
|
|
-// }
|
|
|
-//
|
|
|
-// //先从备份文件下拉取
|
|
|
-// CreateObjUtil.ossUtilCp("video/video" +sceneProEntity.getNum() + File.separator + "back" + File.separator,
|
|
|
-// sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback_temp");
|
|
|
-//
|
|
|
-// String backpathtemp = sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback_temp";
|
|
|
-// File fileback = new File(backpathtemp);
|
|
|
-// File[] filebackList = fileback.listFiles();
|
|
|
-//
|
|
|
-// if(filebackList.length<=0){
|
|
|
-// String backpath = sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback";
|
|
|
-// log.info("------------------" + backpath);
|
|
|
-//
|
|
|
-// File file = new File(backpath);
|
|
|
-//
|
|
|
-// //验证video 文件夹下是否有备份
|
|
|
-// CreateObjUtil.ossUtilCp("video/video" +sceneProEntity.getNum() + File.separator,
|
|
|
-// sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback");
|
|
|
-//
|
|
|
-// String name = "";
|
|
|
-// Map<String,String> map = new HashMap<String,String>();
|
|
|
-// file = new File(backpath);
|
|
|
-// File[] fileList = file.listFiles();
|
|
|
-// if(fileList.length>0){
|
|
|
-// for(File f:fileList){
|
|
|
-// name = f.getName();
|
|
|
-// log.info("file name :" + name);
|
|
|
-// map.put(sceneProEntity.getDataSource() + "_rv" + File.separator + "videoback" + File.separator + name,
|
|
|
-// "video/video" +sceneProEntity.getNum() + File.separator + "back" + File.separator + name);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //上传
|
|
|
-// log.info("上传内容 ===== + " + map);
|
|
|
-// uploadToOssUtil.uploadMulFiles(map);
|
|
|
-// FileUtils.deleteDirectory(backpathtemp);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// //更新旧记录
|
|
|
-// rebuildVideoProgressService.updateProgressRec(requestRebuildVedioScene);
|
|
|
-//
|
|
|
-// //往文件中写入值
|
|
|
-// JSONObject reObject = new JSONObject();
|
|
|
-// JSONObject Object = new JSONObject();
|
|
|
-// Object.put("name",requestRebuildVedioScene.getPanoId());
|
|
|
-// Object.put("x",requestRebuildVedioScene.getX());
|
|
|
-// Object.put("y",requestRebuildVedioScene.getY());
|
|
|
-// Object.put("width",requestRebuildVedioScene.getW());
|
|
|
-// Object.put("height",requestRebuildVedioScene.getH());
|
|
|
-// JSONArray arrayRe = new JSONArray();
|
|
|
-// arrayRe.add(Object);
|
|
|
-// reObject.put("required_videos",arrayRe);
|
|
|
-//
|
|
|
-// JSONObject hdrObject = new JSONObject();
|
|
|
-// if(StringUtils.isNotEmpty(sceneProEntity.getVideos())){
|
|
|
-// JSONObject object = JSONObject.parseObject(sceneProEntity.getVideos());
|
|
|
-// if(object.containsKey("data")){
|
|
|
-// JSONArray array = new JSONArray();
|
|
|
-// array = (JSONArray) object.get("data");
|
|
|
-// arrayRe = new JSONArray();
|
|
|
-// if(array.size()>0){
|
|
|
-// for(int i = 0; i < array.size(); i++) {
|
|
|
-// JSONObject obj = (JSONObject) array.get(i);
|
|
|
-// Object = new JSONObject();
|
|
|
-// Object.put("name",(String) obj.get("id"));
|
|
|
-// Object.put("value",(String) obj.get("value"));
|
|
|
-// Object.put("fov",(String) obj.get("blend_fov"));
|
|
|
-// arrayRe.add(Object);
|
|
|
-// }
|
|
|
-// hdrObject.put("hdr_param",arrayRe);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// hdrObject.put("hdr_param","{}");
|
|
|
-// }
|
|
|
-//
|
|
|
-// //重新计算时需要删除文件夹,否知使用缓存
|
|
|
-// log.info("开始清除result");
|
|
|
-// FileUtils.delAllFile(path + File.separator + "results");
|
|
|
-// log.info("清除result结束");
|
|
|
-//
|
|
|
-// String fileId = path.split("/")[path.split("/").length - 2];
|
|
|
-// log.info("fileId:" + fileId);
|
|
|
-//
|
|
|
-// String parametr = "";
|
|
|
-// parametr += sceneProEntity.getNum() + ":;" +
|
|
|
-// requestRebuildVedioScene.getPanoId();
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// long start = System.currentTimeMillis();
|
|
|
-//
|
|
|
-// VideoSceneProgressEntity videoSceneProgressEntity = new VideoSceneProgressEntity();
|
|
|
-// videoSceneProgressEntity.setSceneCode(sceneProEntity.getNum());
|
|
|
-// videoSceneProgressEntity.setVideoName(requestRebuildVedioScene.getPanoId());
|
|
|
-// videoSceneProgressEntity.setDataSource(sceneProEntity.getDataSource());
|
|
|
-// videoSceneProgressEntity.setRebuildResult(2);
|
|
|
-// videoSceneProgressEntity.setDataSource(sceneProEntity.getDataSource());
|
|
|
-// videoSceneProgressEntity.setRebuildQueueStartTime(new Date());
|
|
|
-// videoSceneProgressEntity.setHdrParam(hdrObject.toJSONString());
|
|
|
-// videoSceneProgressEntity.setRebuildParam(reObject.toJSONString());
|
|
|
-// rebuildVideoProgressService.save(videoSceneProgressEntity);
|
|
|
-//
|
|
|
-// producer.sendMsg2(parametr);
|
|
|
-//
|
|
|
-// return Result.success("视频场景计算中");
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 场景模型重新计算
|
|
|
-// */
|
|
|
-// @ApiOperation("场景视频重新计算")
|
|
|
-// @PostMapping(value = "/rebuildPicScene")
|
|
|
-// public ResultData rebuildPicScene(@RequestBody RequestRebuildVedioScene requestRebuildVedioScene) throws Exception {
|
|
|
-//
|
|
|
-// if(StringUtils.isEmpty(requestRebuildVedioScene.getSceneNum())){
|
|
|
-// throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-//
|
|
|
-// String num = requestRebuildVedioScene.getSceneNum();
|
|
|
-//
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
|
|
|
-// String path = "";
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
-// }
|
|
|
-//
|
|
|
-// path = sceneProEntity.getDataSource();
|
|
|
-//
|
|
|
-// PicSceneProgressEntity picSceneProgress = rebuildPicProgressService.findrebuildVideoProgressDetail(num,null);
|
|
|
-// if(!ObjectUtils.isEmpty(picSceneProgress) && (picSceneProgress.getRebuildResult() == 2 || picSceneProgress.getRebuildResult() == 3)){
|
|
|
-// return Result.failure(SceneConstant.FAILURE_CODE_5035,SceneConstant.FAILURE_MSG_5035);
|
|
|
-// }
|
|
|
-//
|
|
|
-// //更新旧记录
|
|
|
-// rebuildPicProgressService.updateProgressRec(requestRebuildVedioScene);
|
|
|
-//
|
|
|
-// //重新计算时需要删除文件夹,否知使用缓存
|
|
|
-// log.info("开始清除result");
|
|
|
-// FileUtils.delAllFile(path + File.separator + "results");
|
|
|
-// log.info("清除result结束");
|
|
|
-//
|
|
|
-// String fileId = path.split("/")[path.split("/").length - 2];
|
|
|
-// log.info("fileId:" + fileId);
|
|
|
-//
|
|
|
-// PicSceneProgressEntity picSceneProgressEntity = new PicSceneProgressEntity();
|
|
|
-// picSceneProgressEntity.setSceneCode(sceneProEntity.getNum());
|
|
|
-// picSceneProgressEntity.setVideoName(requestRebuildVedioScene.getPanoId());
|
|
|
-// picSceneProgressEntity.setDataSource(sceneProEntity.getDataSource());
|
|
|
-// picSceneProgressEntity.setRebuildResult(2);
|
|
|
-// picSceneProgressEntity.setDataSource(sceneProEntity.getDataSource());
|
|
|
-// picSceneProgressEntity.setRebuildQueueStartTime(new Date());
|
|
|
-// picSceneProgressEntity.setRebuildParam(JSONObject.toJSONString(requestRebuildVedioScene));
|
|
|
-// rebuildPicProgressService.save(picSceneProgressEntity);
|
|
|
-//
|
|
|
-// String parametr = picSceneProgressEntity.getId()+"";
|
|
|
-// producer.sendMsgPic(parametr);
|
|
|
-//
|
|
|
-// return Result.success("图片场景计算中");
|
|
|
-// }
|
|
|
-// /**
|
|
|
-// * 场景视频重新计算进度
|
|
|
-// */
|
|
|
-// @PostMapping(value = "/rebuildVideoSceneProgress")
|
|
|
-// public ResultData rebuildVideoSceneProgress(@RequestBody RequestRebuildVedioScene requestRebuildVedioScene) throws Exception {
|
|
|
-//
|
|
|
-// if(StringUtils.isEmpty(requestRebuildVedioScene.getSceneNum())){
|
|
|
-// throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-//
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(requestRebuildVedioScene.getSceneNum());
|
|
|
-// if(null == sceneProEntity){
|
|
|
-// throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// return Result.success(rebuildVideoProgressService.findVideoSceneProgress(requestRebuildVedioScene));
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 场景视频重新计算进度
|
|
|
-// */
|
|
|
-// @PostMapping(value = "/rebuildPicSceneProgress")
|
|
|
-// public ResultData rebuildPicSceneProgress(@RequestBody RequestRebuildVedioScene requestRebuildVedioScene) throws Exception {
|
|
|
-//
|
|
|
-// if(StringUtils.isEmpty(requestRebuildVedioScene.getSceneNum())){
|
|
|
-// throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-//
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(requestRebuildVedioScene.getSceneNum());
|
|
|
-// if(null == sceneProEntity){
|
|
|
-// throw new BaseRuntimeException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
-// }
|
|
|
-//
|
|
|
-// ResponseVideoSceneProgress picSceneProgress = rebuildPicProgressService.findPicSceneProgress(requestRebuildVedioScene);
|
|
|
-// return Result.success(picSceneProgress.getRebuildResult());
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 查看场景对应的数据,给刘强用的
|
|
|
-// */
|
|
|
-// @ApiIgnore
|
|
|
-// @ApiOperation("查看场景对应的数据")
|
|
|
-// @PostMapping(value = "/querySceneDataSource")
|
|
|
-// @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")
|
|
|
-// public void querySceneDataSource(HttpServletRequest request,HttpServletResponse response){
|
|
|
-//
|
|
|
-// log.info("querySceneDataSource:查询模型数据");
|
|
|
-// try
|
|
|
-// {
|
|
|
-// response.setContentType("text/html;charset=UTF-8");
|
|
|
-// String num = request.getParameter("num");
|
|
|
-// if(num==null&&num.trim().equals(""))
|
|
|
-// {
|
|
|
-// response.getWriter().print("请输入场景号");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// SceneEntity scene = sceneService.findBySceneNum(num);
|
|
|
-// String data = null;
|
|
|
-// if(scene == null) {
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// response.getWriter().print("找不到这个场景");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// data = sceneProEntity.getDataSource();
|
|
|
-// }else {
|
|
|
-// data = scene.getDataSource();
|
|
|
-// }
|
|
|
-// if(data != null && !"".equals(data) && data.startsWith("http")){
|
|
|
-// data = ConstantFilePath.BUILD_MODEL_PATH + data.split("/")[data.split("/").length - 2];
|
|
|
-// }
|
|
|
-// response.getWriter().print(data);
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// catch(Exception e){
|
|
|
-// e.printStackTrace();
|
|
|
-// StringWriter trace=new StringWriter();
|
|
|
-// e.printStackTrace(new PrintWriter(trace));
|
|
|
-// log.error(trace.toString());
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 查看场景对应的场景码,给刘强用的
|
|
|
-// */
|
|
|
-// @ApiIgnore
|
|
|
-// @ApiOperation("查看场景对应的场景码")
|
|
|
-// @PostMapping(value = "/querySceneNum")
|
|
|
-// @ApiImplicitParam(name = "path", value = "场景路径", dataType = "String")
|
|
|
-// public void querySceneNum(HttpServletRequest request,HttpServletResponse response){
|
|
|
-//
|
|
|
-// log.info("querySceneDataSource:查询模型数据");
|
|
|
-// try
|
|
|
-// {
|
|
|
-// response.setContentType("text/html;charset=UTF-8");
|
|
|
-// String path = request.getParameter("path");
|
|
|
-// if(path==null&&path.trim().equals(""))
|
|
|
-// {
|
|
|
-// response.getWriter().print("请输入场景号");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// path = path.split("/")[path.split("/").length - 1];
|
|
|
-// SceneEntity scene = sceneService.getSceneStatusByUnicode(path, "A");
|
|
|
-// String sceneNum = null;
|
|
|
-// if(scene == null)
|
|
|
-// {
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.getSceneStatusByUnicode(path, "A");
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// response.getWriter().print("找不到这个场景");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// sceneNum = sceneProEntity.getNum();
|
|
|
-// }else {
|
|
|
-// sceneNum = scene.getNum();
|
|
|
-// }
|
|
|
-// response.getWriter().print(sceneNum);
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// catch(Exception e){
|
|
|
-// e.printStackTrace();
|
|
|
-// StringWriter trace=new StringWriter();
|
|
|
-// e.printStackTrace(new PrintWriter(trace));
|
|
|
-// log.error(trace.toString());
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 查看场景对应的数据,给刘强用的
|
|
|
-// */
|
|
|
-// @ApiIgnore
|
|
|
-// @ApiOperation("查看场景对应的数据")
|
|
|
-// @PostMapping(value = "/downloadCapture")
|
|
|
-// @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")
|
|
|
-// public void downloadCapture(HttpServletRequest request,HttpServletResponse response){
|
|
|
-//
|
|
|
-// log.info("querySceneDataSource:查询模型数据");
|
|
|
-// try
|
|
|
-// {
|
|
|
-// response.setContentType("text/html;charset=UTF-8");
|
|
|
-// String num = request.getParameter("num");
|
|
|
-// if(num==null&&num.trim().equals(""))
|
|
|
-// {
|
|
|
-// response.getWriter().print("请输入场景号");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// String data = null;
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(num);
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// response.getWriter().print("找不到这个场景");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// data = sceneProEntity.getDataSource();
|
|
|
-// CreateObjUtil.ossUtilCp(data.replace(ConstantFilePath.BUILD_MODEL_PATH, ConstantFilePath.OSS_PREFIX) + File.separator,
|
|
|
-// data + "/capture");
|
|
|
-// response.getWriter().print(data);
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// catch(Exception e){
|
|
|
-// e.printStackTrace();
|
|
|
-// StringWriter trace=new StringWriter();
|
|
|
-// e.printStackTrace(new PrintWriter(trace));
|
|
|
-// log.error(trace.toString());
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 上传results数据
|
|
|
-// * @param request
|
|
|
-// */
|
|
|
-// @ApiIgnore
|
|
|
-// @ApiOperation("上传results数据")
|
|
|
-// @PostMapping(value = "/uploadResultsData")
|
|
|
-// @ApiImplicitParams({
|
|
|
-// @ApiImplicitParam(name = "path", value = "场景路径", dataType = "String"),
|
|
|
-// @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")})
|
|
|
-// public ResultData uploadResultsData(HttpServletRequest request) throws Exception{
|
|
|
-// String path = request.getParameter("path");
|
|
|
-// String projectNum = request.getParameter("num");
|
|
|
-// String type = request.getParameter("type");
|
|
|
-// String oldNum = request.getParameter("oldNum");
|
|
|
-//
|
|
|
-// if("change".equals(type)){
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(projectNum);
|
|
|
-// if(sceneProEntity != null){
|
|
|
-// sceneProService.updateStatus(projectNum, 0);
|
|
|
-// return Result.success("一键换装场景存在,不重复生成");
|
|
|
-// }
|
|
|
-//
|
|
|
-// //根据旧的场景生成新的vr场景
|
|
|
-// sceneProEntity = sceneProService.findBySceneNum(oldNum);
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// return Result.failure("场景不存在");
|
|
|
-// }
|
|
|
-//
|
|
|
-// SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
|
|
|
-//
|
|
|
-// sceneProEntity.setId(null);
|
|
|
-// sceneProEntity.setSceneType(99);
|
|
|
-// sceneProEntity.setWebSite(sceneProEntity.getWebSite().replace(oldNum, projectNum));
|
|
|
-// sceneProEntity.setNum(projectNum);
|
|
|
-// sceneProEntity.setStatus(0);
|
|
|
-// sceneProEntity.setSceneScheme(11);
|
|
|
-// sceneProEntity.setSceneSource(11);
|
|
|
-// sceneProEntity.setSpace(new BigInteger("0"));
|
|
|
-// sceneProEntity.setCreateTime(new Date());
|
|
|
-// sceneProService.save(sceneProEntity);
|
|
|
-//
|
|
|
-// sceneProEditEntity.setId(null);
|
|
|
-// sceneProEditEntity.setProId(sceneProEntity.getId());
|
|
|
-// sceneProEditService.save(sceneProEditEntity);
|
|
|
-//
|
|
|
-// JSONObject scenejson = JSONObject.parseObject(JSONObject.toJSONString(sceneProEntity));
|
|
|
-// FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json", scenejson.toString());
|
|
|
-//
|
|
|
-// uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + oldNum + File.separator + "floorplan.png",
|
|
|
-// "images/images" + projectNum + File.separator + "floorplan.png");
|
|
|
-// path = sceneProEntity.getDataSource();
|
|
|
-// }
|
|
|
-//
|
|
|
-// Map<String, String> map = new HashMap<>();
|
|
|
-//
|
|
|
-// if(StringUtils.isEmpty(path) || StringUtils.isEmpty(projectNum)){
|
|
|
-// return Result.failure("参数为空");
|
|
|
-// }
|
|
|
-//
|
|
|
-// boolean vision2 = false;
|
|
|
-// //读取upload文件,检验需要上传的文件是否存在
|
|
|
-// String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
|
|
|
-// JSONObject uploadJson = null;
|
|
|
-// JSONArray array = null;
|
|
|
-// if(uploadData!=null) {
|
|
|
-// uploadJson = JSONObject.parseObject(uploadData);
|
|
|
-// array = uploadJson.getJSONArray("upload");
|
|
|
-// }
|
|
|
-// if(array == null){
|
|
|
-// throw new Exception("upload.json数据出错");
|
|
|
-// }
|
|
|
-// JSONObject fileJson = null;
|
|
|
-// String fileName = "";
|
|
|
-// String meshfix = ""; //双模型时候会有改文件路径
|
|
|
-// for(int i = 0, len = array.size(); i < len; i++){
|
|
|
-// fileJson = array.getJSONObject(i);
|
|
|
-// fileName = fileJson.getString("file");
|
|
|
-// //文件不存在抛出异常
|
|
|
-// if(!new File(path + File.separator + "results" +File.separator + fileName).exists()){
|
|
|
-// throw new Exception(path + File.separator + "results" +File.separator + fileName+"文件不存在");
|
|
|
-// }
|
|
|
-//
|
|
|
-// //判断是否有vision2.txt
|
|
|
-// if("vision2.txt".equals(fileName)){
|
|
|
-// vision2 = true;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //tex文件夹
|
|
|
-// if(fileJson.getIntValue("clazz") == 2 && !fileJson.containsKey("pack-file")){
|
|
|
-// if(fileName.contains("meshfix.txt")){
|
|
|
-// meshfix = fileName;
|
|
|
-// }else {
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+
|
|
|
-// projectNum+"/"+ ConstantFileName.modelUUID+"_50k_texture_jpg_high1/"+fileName.replace("tex/", ""));
|
|
|
-// }
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //high文件夹
|
|
|
-// if(fileJson.getIntValue("clazz") == 3){
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+
|
|
|
-// projectNum+"/pan/high/"+ fileName.replace("high/", ""));
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// //low文件夹
|
|
|
-// if(fileJson.getIntValue("clazz") == 4){
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+
|
|
|
-// projectNum+"/pan/low/"+ fileName.replace("low/", ""));
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //tiles文件夹
|
|
|
-// if(fileJson.getIntValue("clazz") == 5 ){
|
|
|
-// map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
|
|
|
-// projectNum+ File.separator + fileName);
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //updown文件复制一份到ecs中并去掉换行符
|
|
|
-// if(fileJson.getIntValue("clazz") == 10){
|
|
|
-// String updown = FileUtils.readFile(path + File.separator + "results" +File.separator+ fileName);
|
|
|
-// JSONObject updownJson = JSONObject.parseObject(updown);
|
|
|
-// FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + projectNum +
|
|
|
-// File.separator + fileName.replace("updown", "mapping"), updownJson.toString());
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //video视频文件或封面图
|
|
|
-// if(fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("clazz") == 12){
|
|
|
-// map.put(path + File.separator + "results" + File.separator+ fileName,"video/video"+
|
|
|
-// projectNum+ File.separator + fileName.replace("videos/", ""));
|
|
|
-// }
|
|
|
-//
|
|
|
-// //2048的模型和贴图
|
|
|
-// if(fileJson.getIntValue("clazz") == 16){
|
|
|
-// map.put(path + File.separator + "results" + File.separator+ fileName,"data/data"+
|
|
|
-// projectNum+ File.separator + fileName);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// CreateObjUtil.convertTxtToDam( path + File.separator + "results" + File.separator+"tex"+File.separator+"modeldata.txt", path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k.dam");
|
|
|
-// CreateObjUtil.convertDamToLzma(path + File.separator + "results");
|
|
|
-// CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"tex"+File.separator+"modeldata.txt", path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k.dam");
|
|
|
-// //有meshfix,表示双模型
|
|
|
-// if(!"".equals(meshfix)){
|
|
|
-// CreateObjUtil.convertTxtToDam( path + File.separator + "results" + File.separator+meshfix, path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k2.dam");
|
|
|
-// CreateObjUtil.convertDamToLzma2(path + File.separator + "results");
|
|
|
-// CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+meshfix, path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k2.dam");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k2.dam.lzma", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k2.dam.lzma");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k2.dam", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k2.dam");
|
|
|
-// }
|
|
|
-// CreateObjUtil.convertTxtToVisionmodeldata(path + File.separator + "results" +File.separator+"vision.txt",path + File.separator + "results" +File.separator+"vision.modeldata");
|
|
|
-// //8目相机有两个vision.txt因此第二个叫vision2.txt
|
|
|
-// if(vision2){
|
|
|
-// CreateObjUtil.convertTxtToVisionmodeldata(path + File.separator + "results" +File.separator+"vision2.txt",path + File.separator + "results" +File.separator+"vision2.modeldata");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+"vision2.modeldata", "images/images"+projectNum+"/"+"vision2.modeldata");
|
|
|
-// }
|
|
|
-// log.info("数据转换完成:"+projectNum);
|
|
|
-//
|
|
|
-// File file = new File(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma");
|
|
|
-// while(!file.exists())
|
|
|
-// {
|
|
|
-// Thread.sleep(60000);
|
|
|
-// }
|
|
|
-//
|
|
|
-// map.put(path + File.separator + "results" +File.separator+"vision.modeldata", "images/images"+projectNum+"/"+"vision.modeldata");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k.dam.lzma");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k.dam");
|
|
|
-//
|
|
|
-// file = new File(ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum);
|
|
|
-// if(!file.exists())
|
|
|
-// {
|
|
|
-// file.mkdir();
|
|
|
-// }
|
|
|
-// FileUtils.copyFile(path + File.separator + "results" +File.separator+"floor.json", ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum+File.separator+"floor.json", true);
|
|
|
-// log.info("floor.json路径:"+ path + File.separator + "results" +File.separator+"floor.json");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+"floor.json","data/data"+projectNum+"/floor.json");
|
|
|
-// log.info("准备上传文件到oss:"+projectNum);
|
|
|
-// uploadToOssUtil.uploadMulFiles(map);
|
|
|
-//
|
|
|
-// return Result.success("上传完成");
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 一键换装完成修改场景状态
|
|
|
-// * @param request
|
|
|
-// */
|
|
|
-// @ApiIgnore
|
|
|
-// @ApiOperation("一键换装完成修改场景状态")
|
|
|
-// @PostMapping(value = "/updateStatusByScene")
|
|
|
-// @ApiImplicitParams({
|
|
|
-// @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")})
|
|
|
-// public ResultData updateStatusByScene(HttpServletRequest request) throws Exception{
|
|
|
-// String sceneNum = request.getParameter("num");
|
|
|
-// String status = request.getParameter("status");
|
|
|
-//
|
|
|
-// if(StringUtil.isEmpty(sceneNum)){
|
|
|
-// throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-//
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
|
|
|
-// if(sceneProEntity != null){
|
|
|
-// sceneProEntity.setStatus(Integer.parseInt(status));
|
|
|
-// sceneProService.update(sceneProEntity);
|
|
|
-//
|
|
|
-// SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
|
|
|
-// sceneProEditEntity.setImagesVersion(sceneProEditEntity.getImagesVersion() + 1);
|
|
|
-// sceneProEditEntity.setVersion(sceneProEditEntity.getVersion() + 1);
|
|
|
-// sceneProEditEntity.setFloorEditVer(sceneProEditEntity.getFloorEditVer() + 1);
|
|
|
-// sceneProEditEntity.setFloorPublishVer(sceneProEditEntity.getFloorPublishVer() + 1);
|
|
|
-// sceneProEditEntity.setVideosUser(null);
|
|
|
-// sceneProEditService.update(sceneProEditEntity);
|
|
|
-// }
|
|
|
-// return Result.success();
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 获取一键换装场景状态
|
|
|
-// * @param request
|
|
|
-// */
|
|
|
-// @ApiOperation("获取一键换装场景状态")
|
|
|
-// @PostMapping(value = "/getStatusByScene")
|
|
|
-// @ApiImplicitParams({
|
|
|
-// @ApiImplicitParam(name = "num", value = "场景码", dataType = "String")})
|
|
|
-// public ResultData getStatusByScene(HttpServletRequest request) throws Exception{
|
|
|
-// String sceneNum = request.getParameter("num");
|
|
|
-//
|
|
|
-// if(StringUtil.isEmpty(sceneNum)){
|
|
|
-// throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-//
|
|
|
-// SceneProEntity sceneProEntity = sceneProService.findBySceneNum(sceneNum);
|
|
|
-// if(sceneProEntity != null){
|
|
|
-// return Result.success(sceneProEntity.getStatus() == -2? 1 : sceneProEntity.getStatus());
|
|
|
-// }
|
|
|
-// return Result.success();
|
|
|
-// }
|
|
|
-//
|
|
|
+ /**
|
|
|
+ * 场景模型重新计算
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/rebuildVideoScene")
|
|
|
+ public ResultData rebuildVideoScene(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
|
|
|
+ return sceneFileBuildService.rebuildVideoScene(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 场景模型重新计算
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/rebuildPicScene")
|
|
|
+ public ResultData rebuildPicScene(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
|
|
|
+ return sceneFileBuildService.rebuildPicScene(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 场景视频重新计算进度
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/rebuildVideoSceneProgress")
|
|
|
+ public ResultData rebuildVideoSceneProgress(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
|
|
|
+ return videoSceneProgressService.rebuildVideoSceneProgress(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 场景视频重新计算进度
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/rebuildPicSceneProgress")
|
|
|
+ public ResultData rebuildPicSceneProgress(@RequestBody RebuildVedioSceneParamVO param) throws Exception {
|
|
|
+ return picSceneProgressService.rebuildPicSceneProgress(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查看场景对应的数据,给刘强用的
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/querySceneDataSource")
|
|
|
+ public ResultData querySceneDataSource(@RequestBody SceneParamVO param){
|
|
|
+ return sceneService.querySceneDataSource(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查看场景对应的场景码,给刘强用的
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/querySceneNum")
|
|
|
+ public ResultData querySceneNum(@RequestBody SceneParamVO param){
|
|
|
+ return sceneService.querySceneNum(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查看场景对应的数据,给刘强用的
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/downloadCapture")
|
|
|
+ public ResultData downloadCapture(@RequestBody SceneParamVO param) throws Exception {
|
|
|
+ return sceneProService.downloadCapture(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传results数据
|
|
|
+ * @param param
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/uploadResultsData")
|
|
|
+ public ResultData uploadResultsData(@RequestBody SceneParamVO param) throws Exception{
|
|
|
+ return sceneProService.uploadResultsData(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 一键换装完成修改场景状态
|
|
|
+ * @param param
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/updateStatusByScene")
|
|
|
+ public ResultData updateStatusByScene(@RequestBody SceneParamVO param) throws Exception{
|
|
|
+ return sceneProService.updateStatusByScene(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取一键换装场景状态
|
|
|
+ * @param request
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/getStatusByScene")
|
|
|
+ public ResultData getStatusByScene(SceneParamVO param) throws Exception{
|
|
|
+ return sceneProService.getStatusByScene(param);
|
|
|
+ }
|
|
|
+
|
|
|
// /**
|
|
|
// * 获取场景详情
|
|
|
// */
|