|
@@ -3300,82 +3300,82 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
//调用objToTxt算法
|
|
|
CreateObjUtil.objToTxt(imagesBuffer.toString(), "");
|
|
|
|
|
|
- String uploadJsonPath = imagesBuffer.toString() + File.separator + "results" +File.separator+"upload.json";
|
|
|
- boolean exist = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
|
|
|
- if(!exist){
|
|
|
- log.error("upload.json数据出错");
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5012);
|
|
|
- }
|
|
|
- String uploadData = FileUtils.readFile(uploadJsonPath);
|
|
|
- JSONObject uploadJson = null;
|
|
|
- JSONArray array = null;
|
|
|
- if(uploadData!=null) {
|
|
|
- uploadJson = JSONObject.parseObject(uploadData);
|
|
|
- array = uploadJson.getJSONArray("upload");
|
|
|
- }
|
|
|
- if(array == null){
|
|
|
- log.error("upload.json数据出错");
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5012);
|
|
|
- }
|
|
|
-
|
|
|
- Map<String,String> map = new HashMap<String,String>();
|
|
|
- JSONObject fileJson = null;
|
|
|
- String fileName = "";
|
|
|
- for(int i = 0, len = array.size(); i < len; i++) {
|
|
|
- fileJson = array.getJSONObject(i);
|
|
|
- fileName = fileJson.getString("file");
|
|
|
- //文件不存在抛出异常
|
|
|
- if (!new File(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName).exists()) {
|
|
|
- throw new Exception(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName + "文件不存在");
|
|
|
- }
|
|
|
-
|
|
|
- //tex文件夹
|
|
|
- if (fileJson.getIntValue("clazz") == 15) {
|
|
|
- map.put(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName, "images/images" +
|
|
|
- param.getNum() + "/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- CreateObjUtil.convertTxtToDam(imagesBuffer.toString() + File.separator + "results" +File.separator+"modeldata.txt", imagesBuffer.toString() + File.separator + "results" +File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
- CreateObjUtil.convertDamToLzma(imagesBuffer.toString() + File.separator + "results" +File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
- CreateObjUtil.convertTxtToDam(imagesBuffer.toString() + File.separator + "results" +File.separator+"modeldata.txt", imagesBuffer.toString() + File.separator + "results" + File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
- map.put(imagesBuffer.toString() + File.separator + "results" +File.separator+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam.lzma", "images/images"+param.getNum()+"/"+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam.lzma");
|
|
|
- map.put(imagesBuffer.toString() + File.separator + "results" +File.separator+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam", "images/images"+param.getNum()+"/"+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
-
|
|
|
- FileUtils.deleteFile(imagesBuffer.toString() + "/vision.modeldata");
|
|
|
- CreateObjUtil.convertTxtToVisionmodeldata(imagesBuffer.toString() + "/vision.txt", imagesBuffer.toString() + "/vision.modeldata");
|
|
|
- map.put(imagesBuffer.toString() + "/vision.modeldata", "images/images"+param.getNum()+"/vision.modeldata");
|
|
|
-
|
|
|
- fYunFileService.uploadMulFiles(map);
|
|
|
-
|
|
|
- ScenePro proEntity = this.findBySceneNum(param.getNum());
|
|
|
- if(proEntity == null){
|
|
|
- proEntity = new ScenePro();
|
|
|
- proEntity.setSceneName("四维看看");
|
|
|
- proEntity.setSceneDec("<p>四维看看 让空间讲故事</p>");
|
|
|
- proEntity.setSceneScheme(2);
|
|
|
- proEntity.setNum(param.getNum());
|
|
|
- proEntity.setUserId(param.getUserId());
|
|
|
- proEntity.setWebSite(mainUrl + "/" + sceneProNewUrl + param.getNum());
|
|
|
- proEntity.setStatus(1);
|
|
|
- proEntity.setPayStatus(1);
|
|
|
- proEntity.setBuildType("V3");
|
|
|
-
|
|
|
- if(param.getSceneSource()!=null){
|
|
|
- proEntity.setSceneSource(Integer.parseInt(param.getSceneSource()));
|
|
|
- }
|
|
|
-
|
|
|
- this.save(proEntity);
|
|
|
-
|
|
|
- SceneProEdit proEditEntity = new SceneProEdit();
|
|
|
- proEditEntity.setProId(proEntity.getId());
|
|
|
- sceneProEditService.save(proEditEntity);
|
|
|
-
|
|
|
- JSONObject scenejson = JSONObject.parseObject(JSONObject.toJSONString(proEntity));
|
|
|
- scenejson.put("visions", 1);
|
|
|
- FileUtils.writeFile(dataBuffer.toString() + File.separator+"scene.json", scenejson.toString());
|
|
|
- }
|
|
|
+// String uploadJsonPath = imagesBuffer.toString() + File.separator + "results" +File.separator+"upload.json";
|
|
|
+// boolean exist = ComputerUtil.checkComputeCompleted(uploadJsonPath, maxCheckTimes, waitTime);
|
|
|
+// if(!exist){
|
|
|
+// log.error("upload.json数据出错");
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5012);
|
|
|
+// }
|
|
|
+// String uploadData = FileUtils.readFile(uploadJsonPath);
|
|
|
+// JSONObject uploadJson = null;
|
|
|
+// JSONArray array = null;
|
|
|
+// if(uploadData!=null) {
|
|
|
+// uploadJson = JSONObject.parseObject(uploadData);
|
|
|
+// array = uploadJson.getJSONArray("upload");
|
|
|
+// }
|
|
|
+// if(array == null){
|
|
|
+// log.error("upload.json数据出错");
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5012);
|
|
|
+// }
|
|
|
+//
|
|
|
+// Map<String,String> map = new HashMap<String,String>();
|
|
|
+// JSONObject fileJson = null;
|
|
|
+// String fileName = "";
|
|
|
+// for(int i = 0, len = array.size(); i < len; i++) {
|
|
|
+// fileJson = array.getJSONObject(i);
|
|
|
+// fileName = fileJson.getString("file");
|
|
|
+// //文件不存在抛出异常
|
|
|
+// if (!new File(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName).exists()) {
|
|
|
+// throw new Exception(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName + "文件不存在");
|
|
|
+// }
|
|
|
+//
|
|
|
+// //tex文件夹
|
|
|
+// if (fileJson.getIntValue("clazz") == 15) {
|
|
|
+// map.put(imagesBuffer.toString() + File.separator + "results" + File.separator + fileName, "images/images" +
|
|
|
+// param.getNum() + "/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// CreateObjUtil.convertTxtToDam(imagesBuffer.toString() + File.separator + "results" +File.separator+"modeldata.txt", imagesBuffer.toString() + File.separator + "results" +File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
+// CreateObjUtil.convertDamToLzma(imagesBuffer.toString() + File.separator + "results" +File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
+// CreateObjUtil.convertTxtToDam(imagesBuffer.toString() + File.separator + "results" +File.separator+"modeldata.txt", imagesBuffer.toString() + File.separator + "results" + File.separator+ "dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
+// map.put(imagesBuffer.toString() + File.separator + "results" +File.separator+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam.lzma", "images/images"+param.getNum()+"/"+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam.lzma");
|
|
|
+// map.put(imagesBuffer.toString() + File.separator + "results" +File.separator+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam", "images/images"+param.getNum()+"/"+"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
+//
|
|
|
+// FileUtils.deleteFile(imagesBuffer.toString() + "/vision.modeldata");
|
|
|
+// CreateObjUtil.convertTxtToVisionmodeldata(imagesBuffer.toString() + "/vision.txt", imagesBuffer.toString() + "/vision.modeldata");
|
|
|
+// map.put(imagesBuffer.toString() + "/vision.modeldata", "images/images"+param.getNum()+"/vision.modeldata");
|
|
|
+//
|
|
|
+// fYunFileService.uploadMulFiles(map);
|
|
|
+//
|
|
|
+// ScenePro proEntity = this.findBySceneNum(param.getNum());
|
|
|
+// if(proEntity == null){
|
|
|
+// proEntity = new ScenePro();
|
|
|
+// proEntity.setSceneName("四维看看");
|
|
|
+// proEntity.setSceneDec("<p>四维看看 让空间讲故事</p>");
|
|
|
+// proEntity.setSceneScheme(2);
|
|
|
+// proEntity.setNum(param.getNum());
|
|
|
+// proEntity.setUserId(param.getUserId());
|
|
|
+// proEntity.setWebSite(mainUrl + "/" + sceneProNewUrl + param.getNum());
|
|
|
+// proEntity.setStatus(1);
|
|
|
+// proEntity.setPayStatus(1);
|
|
|
+// proEntity.setBuildType("V3");
|
|
|
+//
|
|
|
+// if(param.getSceneSource()!=null){
|
|
|
+// proEntity.setSceneSource(Integer.parseInt(param.getSceneSource()));
|
|
|
+// }
|
|
|
+//
|
|
|
+// this.save(proEntity);
|
|
|
+//
|
|
|
+// SceneProEdit proEditEntity = new SceneProEdit();
|
|
|
+// proEditEntity.setProId(proEntity.getId());
|
|
|
+// sceneProEditService.save(proEditEntity);
|
|
|
+//
|
|
|
+// JSONObject scenejson = JSONObject.parseObject(JSONObject.toJSONString(proEntity));
|
|
|
+// scenejson.put("visions", 1);
|
|
|
+// FileUtils.writeFile(dataBuffer.toString() + File.separator+"scene.json", scenejson.toString());
|
|
|
+// }
|
|
|
|
|
|
return Result.success(mainUrl + "/" + sceneProNewUrl + param.getNum());
|
|
|
|