|
|
@@ -2,10 +2,12 @@ package com.fdkankan.fusion.controller;
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
|
import com.fdkankan.fusion.common.ResultData;
|
|
|
import com.fdkankan.fusion.common.util.CameraUtil;
|
|
|
+import com.fdkankan.fusion.common.util.FileWriterUtil;
|
|
|
import com.fdkankan.fusion.down.FusionDownService;
|
|
|
import com.fdkankan.fusion.entity.*;
|
|
|
import com.fdkankan.fusion.entity.jsonEntity.Transform;
|
|
|
@@ -55,6 +57,9 @@ public class CaseFusionController extends BaseController{
|
|
|
IScenePlusExtService scenePlusExtService;
|
|
|
@Autowired
|
|
|
FusionDownService fusionDownService;
|
|
|
+ @Autowired
|
|
|
+ ICommonUploadService commonUploadService;
|
|
|
+
|
|
|
@GetMapping("/list")
|
|
|
public ResultData allList(@RequestParam(required = false) Integer fusionId){
|
|
|
return ResultData.ok(caseFusionService.getSceneListVo(fusionId));
|
|
|
@@ -80,9 +85,37 @@ public class CaseFusionController extends BaseController{
|
|
|
if( param.getFusionId() == null ){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
- if(param.getIsObj() == null || StringUtils.isBlank(param.getNum())){
|
|
|
+ if((param.getIsObj() == null || StringUtils.isBlank(param.getNum())) && param.getUploadId() == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
+ if(param.getUploadId() != null){
|
|
|
+ CommonUpload commonUpload = commonUploadService.getById(param.getUploadId());
|
|
|
+ if(commonUpload == null || StringUtils.isBlank(commonUpload.getFileUrl())){
|
|
|
+ throw new BusinessException(ResultCode.MEDIO_NOT_EXIT);
|
|
|
+ }
|
|
|
+ Model model = modelService.getByUploadId(commonUpload.getId());
|
|
|
+ if(model == null){
|
|
|
+ model = new Model();
|
|
|
+ model.setModelTitle(commonUpload.getFileName());
|
|
|
+ model.setModelSize(FileWriterUtil.setFileSize(Long.valueOf(commonUpload.getFileSize())));
|
|
|
+ model.setModelDateType(commonUpload.getFileFormat());
|
|
|
+ model.setModelType(commonUpload.getResultFileFormat());
|
|
|
+ model.setWgs84(commonUpload.getWgs84());
|
|
|
+ model.setGcj02(commonUpload.getGcj02());
|
|
|
+ model.setConvertType(1);
|
|
|
+ model.setCreateStatus(1);
|
|
|
+ model.setUploadId(commonUpload.getId());
|
|
|
+
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ jsonArray.add(commonUpload.getFileUrl());
|
|
|
+ model.setModelGlbUrl(jsonArray.toJSONString());
|
|
|
+ model.setType(3);
|
|
|
+ modelService.save(model);
|
|
|
+ }
|
|
|
+ return ResultData.ok(fusionNumService.addModel(param,model.getModelId(),model.getModelTitle()));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
ScenePlus scenePlus = scenePlusService.getByNum(param.getNum());
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
scenePlus.setScenePlusExt(scenePlusExt);
|