|
@@ -24,11 +24,12 @@ import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.common.util.*;
|
|
import com.fdkankan.common.util.*;
|
|
import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
|
|
import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
|
|
import com.fdkankan.contro.common.Result;
|
|
import com.fdkankan.contro.common.Result;
|
|
|
|
+import com.fdkankan.contro.constant.ApiConstant;
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
import com.fdkankan.contro.constant.ZipConstant;
|
|
import com.fdkankan.contro.constant.ZipConstant;
|
|
import com.fdkankan.contro.entity.*;
|
|
import com.fdkankan.contro.entity.*;
|
|
-import com.fdkankan.contro.httpclient.MyClient;
|
|
|
|
import com.fdkankan.contro.enums.CameraTypeEnum;
|
|
import com.fdkankan.contro.enums.CameraTypeEnum;
|
|
|
|
+import com.fdkankan.contro.httpclient.MyClient;
|
|
import com.fdkankan.contro.mapper.ISceneFileBuildMapper;
|
|
import com.fdkankan.contro.mapper.ISceneFileBuildMapper;
|
|
import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.util.HttpUtilExt;
|
|
import com.fdkankan.contro.util.HttpUtilExt;
|
|
@@ -90,8 +91,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
private static final String sendCallAlgorithmPath = "/mnt/sendCallAlgorithm/";
|
|
private static final String sendCallAlgorithmPath = "/mnt/sendCallAlgorithm/";
|
|
|
|
|
|
- private static final String URL_ADD_UCENTER_USER = "/service/manage/inner/addUcenterUser";
|
|
|
|
-
|
|
|
|
@Value("${main.url}")
|
|
@Value("${main.url}")
|
|
private String mainUrl;
|
|
private String mainUrl;
|
|
@Value("${fyun.type}")
|
|
@Value("${fyun.type}")
|
|
@@ -247,6 +246,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IJmgaService jmgaService;
|
|
private IJmgaService jmgaService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UploadShootingService uploadShootingService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
@@ -389,7 +390,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
|
|
|
int camType = jsonObject.getJSONObject("cam").getIntValue("type");
|
|
int camType = jsonObject.getJSONObject("cam").getIntValue("type");
|
|
- String cameraInStoreUrl = fdServiceUrl + "/service/manage/inner/cameraInStore";
|
|
|
|
|
|
+ String cameraInStoreUrl = fdServiceUrl + ApiConstant.URL_CAMERA_INSTORE;
|
|
Map<String, Object> cameraInStoreParams = new HashMap<>();
|
|
Map<String, Object> cameraInStoreParams = new HashMap<>();
|
|
cameraInStoreParams.put("cameraType", camType);
|
|
cameraInStoreParams.put("cameraType", camType);
|
|
cameraInStoreParams.put("snCode", jsonObject.getString("creator"));
|
|
cameraInStoreParams.put("snCode", jsonObject.getString("creator"));
|
|
@@ -412,7 +413,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
params.put("ryNo", customUserName);
|
|
params.put("ryNo", customUserName);
|
|
// params.put("nickName", customUserName);//去掉昵称,又燕海的接口进行判断
|
|
// params.put("nickName", customUserName);//去掉昵称,又燕海的接口进行判断
|
|
params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
- String url = fdServiceUrl.concat(URL_ADD_UCENTER_USER);
|
|
|
|
|
|
+ String url = fdServiceUrl.concat(ApiConstant.URL_ADD_UCENTER_USER);
|
|
myClient.post(url, params);
|
|
myClient.post(url, params);
|
|
JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
user = userService.getById(jyUser.getUserId());
|
|
user = userService.getById(jyUser.getUserId());
|
|
@@ -1092,6 +1093,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
scenePlus.setPayStatus(PayStatus.NOT_PAY.code());
|
|
scenePlus.setPayStatus(PayStatus.NOT_PAY.code());
|
|
scenePlus.setCreateTime(Calendar.getInstance().getTime());
|
|
scenePlus.setCreateTime(Calendar.getInstance().getTime());
|
|
scenePlus.setBuildFailReason("");
|
|
scenePlus.setBuildFailReason("");
|
|
|
|
+ //只要开始常规场景上传计算,场景就不可以预览了
|
|
|
|
+ scenePlus.setPreview(CommonStatus.NO.code());
|
|
|
|
|
|
ScenePlusExt oldSceneExt = scenePlusExtService.getScenePlusExtByPlusId(oldScene.getId());
|
|
ScenePlusExt oldSceneExt = scenePlusExtService.getScenePlusExtByPlusId(oldScene.getId());
|
|
scenePlusExt.setSpace(oldSceneExt.getSpace());
|
|
scenePlusExt.setSpace(oldSceneExt.getSpace());
|
|
@@ -2317,7 +2320,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
params.put("ryNo", customUserName);
|
|
params.put("ryNo", customUserName);
|
|
params.put("nickName", customUserName);
|
|
params.put("nickName", customUserName);
|
|
params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
- String url = fdServiceUrl.concat(URL_ADD_UCENTER_USER);
|
|
|
|
|
|
+ String url = fdServiceUrl.concat(ApiConstant.URL_ADD_UCENTER_USER);
|
|
myClient.post(url, params);
|
|
myClient.post(url, params);
|
|
JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
User user = userService.getById(jyUser.getUserId());
|
|
User user = userService.getById(jyUser.getUserId());
|
|
@@ -2366,6 +2369,15 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "filePath不能为空");
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "filePath不能为空");
|
|
}
|
|
}
|
|
SendCallAlgorithmDetail detail = param.getDetails();
|
|
SendCallAlgorithmDetail detail = param.getDetails();
|
|
|
|
+
|
|
|
|
+// //边拍边上传逻辑处理
|
|
|
|
+// String callType = param.getDetails().getCallType();
|
|
|
|
+// if(StrUtil.isNotEmpty(callType) && callType.equals("UPLOAD_WHILE_SHOOTING")){
|
|
|
|
+// String localPath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + detail.getUuid() + "/" + detail.getIndex() + "/" + detail.getFileName();
|
|
|
|
+// HttpUtilExt.downloadFileAndCheck(filePath, localPath, 600000);
|
|
|
|
+// return ResultData.ok();
|
|
|
|
+// }
|
|
|
|
+
|
|
String uploadType = detail.getUploadType();
|
|
String uploadType = detail.getUploadType();
|
|
if(StrUtil.isNotEmpty(uploadType) && "log".equals(uploadType)){
|
|
if(StrUtil.isNotEmpty(uploadType) && "log".equals(uploadType)){
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
@@ -2379,6 +2391,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "fileName不能为空");
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "fileName不能为空");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String callType = param.getDetails().getCallType();
|
|
|
|
+ if(StrUtil.isNotEmpty(callType) && callType.equals("UPLOAD_WHILE_SHOOTING")){
|
|
|
|
+ uploadShootingService.uploadFile(param);
|
|
|
|
+ return ResultData.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
boolean lock = redisLockUtil.lock("lock:single:upload:uuid:" + uuid, uuid, 1);
|
|
boolean lock = redisLockUtil.lock("lock:single:upload:uuid:" + uuid, uuid, 1);
|
|
if(!lock){//如果拿不到锁,证明
|
|
if(!lock){//如果拿不到锁,证明
|
|
Thread.sleep(2000L);
|
|
Thread.sleep(2000L);
|
|
@@ -2440,7 +2458,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
|
|
JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
|
|
int camType = fdageData.getJSONObject("cam").getIntValue("type");
|
|
int camType = fdageData.getJSONObject("cam").getIntValue("type");
|
|
- String cameraInStoreUrl = fdServiceUrl + "/service/manage/inner/cameraInStore";
|
|
|
|
|
|
+ String cameraInStoreUrl = fdServiceUrl + ApiConstant.URL_CAMERA_INSTORE;
|
|
Map<String, Object> cameraInStoreParams = new HashMap<>();
|
|
Map<String, Object> cameraInStoreParams = new HashMap<>();
|
|
cameraInStoreParams.put("cameraType", camType);
|
|
cameraInStoreParams.put("cameraType", camType);
|
|
cameraInStoreParams.put("snCode", snCode);
|
|
cameraInStoreParams.put("snCode", snCode);
|
|
@@ -2490,7 +2508,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
params.put("ryNo", customUserName);
|
|
params.put("ryNo", customUserName);
|
|
// params.put("nickName", customUserName);//去掉昵称,又燕海的接口进行判断
|
|
// params.put("nickName", customUserName);//去掉昵称,又燕海的接口进行判断
|
|
params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
- String url = fdServiceUrl.concat(URL_ADD_UCENTER_USER);
|
|
|
|
|
|
+ String url = fdServiceUrl.concat(ApiConstant.URL_ADD_UCENTER_USER);
|
|
myClient.post(url, params);
|
|
myClient.post(url, params);
|
|
JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
User user = userService.getById(jyUser.getUserId());
|
|
User user = userService.getById(jyUser.getUserId());
|
|
@@ -2508,15 +2526,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
}
|
|
}
|
|
|
|
|
|
-// String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
|
-// if(fdageData.containsKey("icon") && StringUtils.isNotEmpty(fdageData.getString("icon"))){
|
|
|
|
-// String ossPath = ConstantFilePath.OSS_PREFIX + dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
|
-// .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
|
|
|
|
-// fYunFileService.copyFileInBucket(ossPath + File.separator + fdageData.getString("icon"),imgViewPath + fdageData.getString("icon"));
|
|
|
|
-// icon = fYunFileConfig.getHost() + imgViewPath + fdageData.getString("icon");
|
|
|
|
-// log.info("上传icon成功....");
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, customUserId, "single");
|
|
buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, customUserId, "single");
|
|
|
|
|
|
scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|