|
@@ -385,9 +385,42 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//调用createScene方法生成scene数据和加入算法队列
|
|
|
String sceneNum = "";
|
|
|
|
|
|
+
|
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
|
|
|
+ int camType = jsonObject.getJSONObject("cam").getIntValue("type");
|
|
|
+ String cameraInStoreUrl = fdServiceUrl + "/service/manage/inner/cameraInStore";
|
|
|
+ Map<String, Object> cameraInStoreParams = new HashMap<>();
|
|
|
+ cameraInStoreParams.put("cameraType", camType);
|
|
|
+ cameraInStoreParams.put("snCode", jsonObject.getString("creator"));
|
|
|
+ ResultData post = myClient.post(cameraInStoreUrl, cameraInStoreParams);
|
|
|
+ log.info("---------cameraInStore result:{}-----------", post);
|
|
|
+
|
|
|
+ JSONObject configJson = JSONObject.parseObject(fYunFileService.getFileContent(ConstantFilePath.OSS_PREFIX + prefix + "config.fdage"));
|
|
|
+ String folderName = configJson.getString("id");
|
|
|
+ String customUserId = configJson.getString("customUserId");
|
|
|
+ String customUserName = configJson.getString("customUserName");
|
|
|
+ String customUserPwd = configJson.getString("customUserPwd");
|
|
|
+ if(StrUtil.isBlank(folderName) || StrUtil.isBlank(jsonObject.getString("creator"))){
|
|
|
+ throw new RuntimeException("config.json 文件有误!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //调注册用户接口
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("ryId", customUserId);
|
|
|
+ params.put("ryNo", customUserName);
|
|
|
+// params.put("nickName", customUserName);//去掉昵称,又燕海的接口进行判断
|
|
|
+ params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
|
+ String url = fdServiceUrl.concat(URL_ADD_UCENTER_USER);
|
|
|
+ myClient.post(url, params);
|
|
|
+ JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
|
+ User user = userService.getById(jyUser.getUserId());
|
|
|
+ if(Objects.isNull(jyUser)){
|
|
|
+ throw new RuntimeException("注册用户失败");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
Camera camera = cameraService.getByChildName(cameraName);
|
|
|
|
|
|
if (camera == null) {
|
|
@@ -493,6 +526,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
|
|
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
|
|
|
+ scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
+
|
|
|
//上传app状态文件
|
|
|
commonService.uploadStatusJson(sceneNum, scenePlusVO.getSceneStatus(),
|
|
|
scenePlusVO.getWebSite(),scenePlusVO.getThumb(),PayStatus.NOT_PAY.code(),
|
|
@@ -711,8 +750,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
|
new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, "/".concat(fileId).concat("/")));
|
|
|
|
|
|
- boolean callV3 = callV3(scenePro, preParams, fdageJson, "api/scene/file/uploadSuccessBuild");
|
|
|
- if(callV3) return ResultData.ok();
|
|
|
+// boolean callV3 = callV3(scenePro, preParams, fdageJson, "api/scene/file/uploadSuccessBuild");
|
|
|
+// if(callV3) return ResultData.ok();
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
|
|
@@ -1975,7 +2014,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData uploadFile(MultipartFile file, String params) throws Exception {
|
|
|
+ public ResultData uploadFile(MultipartFile file, String params, String dir) throws Exception {
|
|
|
|
|
|
log.info("upload-params: "+params);
|
|
|
if (StringUtils.isEmpty(params)){
|
|
@@ -2045,7 +2084,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
String filePath = mac.concat(File.separator).concat(fileId).concat(File.separator).concat(folderName);
|
|
|
|
|
|
String yunFilePath = LocalConstants.BASE_PATH.concat(fYunFileConfig.getBucket()).concat(File.separator).concat(ConstantFilePath.OSS_PREFIX)
|
|
|
- .concat(filePath).concat(File.separator).concat(fileName);
|
|
|
+ .concat(filePath).concat(File.separator).concat(dir).concat(fileName);
|
|
|
log.info("yunFilePath:{}", yunFilePath);
|
|
|
|
|
|
boolean needUpload = false;
|
|
@@ -2092,7 +2131,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// 5. 如果相等,更新数据记录。如果不相等,返回上传失败结果。
|
|
|
try {
|
|
|
if (needUpload){
|
|
|
- fYunFileService.uploadFile(file.getInputStream(),ConstantFilePath.OSS_PREFIX.concat(filePath).concat(File.separator).concat(fileName));
|
|
|
+ fYunFileService.uploadFile(file.getInputStream(),ConstantFilePath.OSS_PREFIX.concat(filePath).concat(File.separator).concat(dir).concat(fileName));
|
|
|
File uploadFile = new File(yunFilePath);
|
|
|
String fileMD5 = FileMd5Util.getFileMD5(uploadFile);
|
|
|
|