|
@@ -449,25 +449,25 @@ public class ImportDataController {
|
|
|
entry = getInfoJson.getJSONObject("data").getString("entry");
|
|
|
}
|
|
|
|
|
|
- path = URLDecoder.decode(path,"utf-8");
|
|
|
- path = path + File.separator + "data/" + num;
|
|
|
- System.out.println("文件路径:" + path);
|
|
|
- if(!new File(path).exists()){
|
|
|
- new File(path).mkdirs();
|
|
|
+ String basePath = URLDecoder.decode(path,"utf-8");
|
|
|
+ basePath = basePath + File.separator + "data/" + num;
|
|
|
+ System.out.println("文件路径:" + basePath);
|
|
|
+ if(!new File(basePath).exists()){
|
|
|
+ new File(basePath).mkdirs();
|
|
|
}
|
|
|
|
|
|
JSONObject entryJson = new JSONObject();
|
|
|
if(StringUtil.isEmpty(entry)){
|
|
|
FileUtils.downLoadFromUrl("https://4dkk.4dage.com/images/images" + num + "/vision.modeldata?t=" + System.currentTimeMillis(),
|
|
|
- "vision.modeldata", path);
|
|
|
+ "vision.modeldata", basePath);
|
|
|
|
|
|
- if(!new File(path + "/vision.modeldata").exists()){
|
|
|
+ if(!new File(basePath + "/vision.modeldata").exists()){
|
|
|
log.info("vision.modeldata文件不存在");
|
|
|
}else {
|
|
|
log.info("下载vision.modeldata完成,开始转换vision.txt");
|
|
|
- CreateObjUtil.convertVisionmodeldataToTxt(path + "/vision.modeldata", path + "/vision.txt");
|
|
|
+ CreateObjUtil.convertVisionmodeldataToTxt(basePath + "/vision.modeldata", basePath + "/vision.txt");
|
|
|
|
|
|
- JSONObject visionJson = JSON.parseObject(FileUtils.readFile(path + "/vision.txt"));
|
|
|
+ JSONObject visionJson = JSON.parseObject(FileUtils.readFile(basePath + "/vision.txt"));
|
|
|
JSONArray sweepArray = visionJson.getJSONArray("sweepLocations");
|
|
|
if(sweepArray != null && sweepArray.size() > 0){
|
|
|
entryJson.put("noSetting", sweepArray.getJSONObject(0));
|
|
@@ -480,12 +480,12 @@ public class ImportDataController {
|
|
|
//下载原场景的scene.json
|
|
|
if(!StringUtils.isEmpty(num)){
|
|
|
FileUtils.downLoadFromUrl(mainUrl + "scene/data/data" + num + "/scene.json?t=" + System.currentTimeMillis(),
|
|
|
- "scene.json", path);
|
|
|
+ "scene.json", basePath);
|
|
|
}
|
|
|
|
|
|
//原场景码的户型版本号
|
|
|
int floorPublishVer = 0;
|
|
|
- String sceneStr = FileUtils.readFile(path + "/scene.json");
|
|
|
+ String sceneStr = FileUtils.readFile(basePath + "/scene.json");
|
|
|
JSONObject sceneJson = null;
|
|
|
if(sceneStr != null){
|
|
|
sceneJson = JSONObject.parseObject(sceneStr);
|
|
@@ -522,10 +522,10 @@ public class ImportDataController {
|
|
|
|
|
|
Map<String, Double> map = null;
|
|
|
FileUtils.downLoadFromUrl("https://4dkk.4dage.com/data/data" + num + "/floor.json?t=" + System.currentTimeMillis(),
|
|
|
- "floor.json", path);
|
|
|
+ "floor.json", basePath);
|
|
|
|
|
|
ConvertCadKjl cad = new ConvertCadKjl();
|
|
|
- String data = FileUtils.readFile(path + File.separator + "floor.json");
|
|
|
+ String data = FileUtils.readFile(basePath + File.separator + "floor.json");
|
|
|
JSONObject inputJson = null;
|
|
|
JSONArray inputArray = null;
|
|
|
JSONObject resultJson = new JSONObject();
|
|
@@ -604,7 +604,7 @@ public class ImportDataController {
|
|
|
cad.init(inputJson);
|
|
|
}
|
|
|
resultJson.put("entry", entryJson);
|
|
|
- cad.writeBinary(resultJson.toString().getBytes(), path + File.separator + "kjl.json");
|
|
|
+ cad.writeBinary(resultJson.toString().getBytes(), basePath + File.separator + "kjl.json");
|
|
|
|
|
|
return resultJson.toString();
|
|
|
}catch (Exception e){
|
|
@@ -614,11 +614,11 @@ public class ImportDataController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 生成房型数据
|
|
|
+ * 修改房型数据
|
|
|
* @param num
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation("生成房型数据")
|
|
|
+ @ApiOperation("修改房型数据")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "num", value = "四维看看场景码", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "styleNum", value = "风格码", dataType = "String")})
|
|
@@ -1189,6 +1189,7 @@ public class ImportDataController {
|
|
|
}
|
|
|
|
|
|
String filePath = buildPath + "data/data" + styleNum + File.separator + fileName;
|
|
|
+ log.info("保存文件路径-filePath{}:" + filePath);
|
|
|
|
|
|
FileUtils.writeFile(filePath, jsonData);
|
|
|
|