|
@@ -25,6 +25,7 @@ import com.fdkankan.common.util.*;
|
|
|
import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
|
|
|
import com.fdkankan.contro.common.Result;
|
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
|
+import com.fdkankan.contro.constant.ZipConstant;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
import com.fdkankan.contro.httpclient.MyClient;
|
|
|
import com.fdkankan.contro.enums.CameraTypeEnum;
|
|
@@ -89,8 +90,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
private static final String sendCallAlgorithmPath = "/mnt/sendCallAlgorithm/";
|
|
|
|
|
|
- private static final String zipPassword = "a3ad34136de359536af553f9e7f3cefd";
|
|
|
-
|
|
|
private static final String URL_ADD_UCENTER_USER = "/service/manage/inner/addUcenterUser";
|
|
|
|
|
|
@Value("${main.url}")
|
|
@@ -381,7 +380,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return list.get(0);
|
|
|
}
|
|
|
|
|
|
- public ScenePlusVO buildScene(String fileId, String prefix,JSONObject jsonObject,String buildType,long cameraType) throws Exception{
|
|
|
+ public ScenePlusVO buildScene(String fileId, String prefix,JSONObject jsonObject,String buildType,long cameraType, User user) throws Exception{
|
|
|
//调用createScene方法生成scene数据和加入算法队列
|
|
|
String sceneNum = "";
|
|
|
|
|
@@ -397,27 +396,29 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ResultData post = myClient.post(cameraInStoreUrl, cameraInStoreParams);
|
|
|
log.info("---------cameraInStore result:{}-----------", post);
|
|
|
|
|
|
- JSONObject configJson = JSONObject.parseObject(fYunFileService.getFileContent(ConstantFilePath.OSS_PREFIX + prefix + "config.json"));
|
|
|
- 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 文件有误!");
|
|
|
- }
|
|
|
+ if(Objects.isNull(user)){
|
|
|
+ JSONObject configJson = JSONObject.parseObject(fYunFileService.getFileContent(ConstantFilePath.OSS_PREFIX + prefix + "config.json"));
|
|
|
+ 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);
|
|
|
+ //调注册用户接口
|
|
|
+ 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("注册用户失败");
|
|
|
+ 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 = userService.getById(jyUser.getUserId());
|
|
|
+ if(Objects.isNull(jyUser)){
|
|
|
+ throw new RuntimeException("注册用户失败");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -688,7 +689,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData uploadSuccessBuild(String params) throws Exception {
|
|
|
+ public ResultData uploadSuccessBuild(String params, User user) throws Exception {
|
|
|
log.info("uploadSuccessBuild-params: " + params);
|
|
|
String preParams = params;
|
|
|
if (StringUtils.isEmpty(params)) {
|
|
@@ -758,7 +759,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
|
|
|
- buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
|
|
|
+ buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType, user);
|
|
|
}else{
|
|
|
buildV3Scene(scenePro,fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
|
|
|
}
|
|
@@ -840,7 +841,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData turntableUploadSuccess(String params) throws Exception {
|
|
|
+ public ResultData turntableUploadSuccess(String params, User user) throws Exception {
|
|
|
log.info("turntableUploadSuccess-params: " + params);
|
|
|
String preParams = params;
|
|
|
if (StringUtils.isEmpty(params)) {
|
|
@@ -915,7 +916,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ScenePlusVO scenePlusVO = null;
|
|
|
|
|
|
if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
|
|
|
- scenePlusVO = buildScene(fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
|
|
|
+ scenePlusVO = buildScene(fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType, user);
|
|
|
} else {
|
|
|
scenePlusVO = buildV3Scene(scenePro,fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
|
|
|
}
|
|
@@ -2244,7 +2245,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
log.info("开始异步解压文件");
|
|
|
ZipFile zipFile = new ZipFile(new File(localFilePath));
|
|
|
if (zipFile.isEncrypted()) {
|
|
|
- zipFile.setPassword(zipPassword);
|
|
|
+ zipFile.setPassword(ZipConstant.zipPassword);
|
|
|
zipFile.extractAll(parentPath);
|
|
|
} else {
|
|
|
ZipUtil.unzip(localFilePath, parentPath);
|
|
@@ -2342,6 +2343,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// System.out.println(s);
|
|
|
// System.out.println(UUID.fastUUID());
|
|
|
|
|
|
+ String test = "bpvt00017#1396877795149217792#";
|
|
|
+ String[] split = test.split("#");
|
|
|
+ System.out.println(split);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2549,7 +2553,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
- public String getFileId(String snCode, String uuid) throws Exception {
|
|
|
+ @Override
|
|
|
+ public String getFileId(String snCode, String uuid){
|
|
|
|
|
|
// 检测是否有生成
|
|
|
String fileId = null;
|