|
@@ -22,6 +22,7 @@ import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.service.*;
|
|
|
import com.fdkankan.scene.util.FyunUtil;
|
|
|
import com.fdkankan.scene.vo.SceneEditControlsVO;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -33,6 +34,7 @@ import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class ReverseSceneServiceImpl implements IReverseSceneService {
|
|
|
|
|
@@ -63,35 +65,42 @@ public class ReverseSceneServiceImpl implements IReverseSceneService {
|
|
|
String bucket = jsonObject.getString("bucket");
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ try {
|
|
|
+ String dataSource = scenePlusExt.getDataSource();
|
|
|
|
|
|
- String dataSource = scenePlusExt.getDataSource();
|
|
|
+ //解压
|
|
|
+ String destPath = dataSource + "/" + FileUtil.getName(zipPath);
|
|
|
+ fyunUtil.yunDownloadSs(fyunType, bucket, zipPath, destPath);
|
|
|
+ ZipUtil.unzip(destPath, dataSource, CharsetUtil.CHARSET_GBK);
|
|
|
|
|
|
- //解压
|
|
|
- String destPath = dataSource + "/" + FileUtil.getName(zipPath);
|
|
|
- fyunUtil.yunDownloadSs(fyunType, bucket, zipPath, destPath);
|
|
|
- ZipUtil.unzip(destPath, dataSource, CharsetUtil.CHARSET_GBK);
|
|
|
+ //生成vision.txt
|
|
|
+ int shootCount = this.genVisionTxt(num, dataSource);
|
|
|
|
|
|
- //生成vision.txt
|
|
|
- int shootCount = this.genVisionTxt(num, dataSource);
|
|
|
+ //计算模型
|
|
|
+ this.genModel(num, dataSource);
|
|
|
|
|
|
- //计算模型
|
|
|
- this.genModel(num, dataSource);
|
|
|
+ //计算全景图
|
|
|
+ this.genPano(num, dataSource);
|
|
|
+
|
|
|
+ scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
|
+ scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
|
+ scenePlus.setUpdateTime(new Date());
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
- //计算全景图
|
|
|
- this.genPano(num, dataSource);
|
|
|
+ scenePlusExt.setAlgorithmTime(new Date());
|
|
|
+ scenePlusExt.setWebSite(sceneProNewUrl + num);
|
|
|
+ scenePlusExt.setShootCount(shootCount);
|
|
|
+ scenePlusExt.setUpdateTime(new Date());
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
|
|
|
- scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
|
- scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
|
- scenePlus.setUpdateTime(new Date());
|
|
|
- scenePlusService.updateById(scenePlus);
|
|
|
+ this.genSceneJson(num);
|
|
|
|
|
|
- scenePlusExt.setAlgorithmTime(new Date());
|
|
|
- scenePlusExt.setWebSite(sceneProNewUrl + num);
|
|
|
- scenePlusExt.setShootCount(shootCount);
|
|
|
- scenePlusExt.setUpdateTime(new Date());
|
|
|
- scenePlusExtService.updateById(scenePlusExt);
|
|
|
+ }catch (Exception e){
|
|
|
+ scenePlus.setSceneStatus(CommonSuccessStatus.FAIL.code());
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
- this.genSceneJson(num);
|
|
|
+ log.error("上传安正数据包报错, num:{}", num, e);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|