|
@@ -89,6 +89,10 @@ 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}")
|
|
|
private String mainUrl;
|
|
|
@Value("${fyun.type}")
|
|
@@ -244,6 +248,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
@Autowired
|
|
|
private IJmgaService jmgaService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneOrigBdService sceneOrigBdService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneFilenameService sceneFilenameService;
|
|
|
@Autowired
|
|
|
private UploadShootingService uploadShootingService;
|
|
|
|
|
@@ -988,6 +997,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}else {
|
|
|
scenePlusExt.setSceneScheme(SceneScheme.BM.code());
|
|
|
}
|
|
|
+ if(cameraType == 6){
|
|
|
+ scenePlusVO.setThreeCamType("yzl");
|
|
|
+ }
|
|
|
|
|
|
//转台相机用4k图
|
|
|
if(cameraType.longValue() == 13){
|
|
@@ -1015,6 +1027,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
scenePlusExt.setModelKind(modelKind);
|
|
|
}
|
|
|
|
|
|
+ //圆周率相机场景用3dtiles模型是
|
|
|
+ if(cameraType == 6){
|
|
|
+ scenePlusExt.setModelKind(modelKind);
|
|
|
+ }
|
|
|
|
|
|
if (pic != null && pic.length() > 5) {
|
|
|
scenePlusExt.setThumb(pic);
|
|
@@ -1673,9 +1689,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
|
|
|
String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user, String customUserId, String uploadType) throws Exception {
|
|
|
- String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
- String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
|
|
|
|
JSONObject firmwareVersion = new JSONObject();
|
|
|
if (!ObjectUtils.isEmpty(jsonObject.getString("camSoftwareVersion"))) {
|
|
@@ -1690,13 +1704,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
if (rebuild == 1) {
|
|
|
-// try {
|
|
|
-// scenePlusService.resetSpace(sceneNum);
|
|
|
-// }catch (Exception e){
|
|
|
-// log.error("重置容量失败", e);
|
|
|
-// }
|
|
|
-// //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
-// fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ scenePlusExt.setSpace(0L);
|
|
|
+ scenePlusExt.setUpdateTime(null);
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
} else {
|
|
|
//上传log-main.png
|
|
|
fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
|
|
@@ -1712,13 +1724,15 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
|
+ scenePlus.setTaskId(jsonObject.getString("taskId"));
|
|
|
+ scenePlus.setKNo(jsonObject.getString("kNo"));
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
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);
|
|
|
|
|
|
- BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType,
|
|
|
- scenePlusVO.getDataSource());
|
|
|
+ BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType, scenePlusVO.getDataSource());
|
|
|
|
|
|
if (cameraDetail.getCompanyId() != null) {
|
|
|
Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
@@ -1726,6 +1740,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
mqMessage.setFlexibility(-1);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
mqMessage.getExt().put("deleteExtras", true);
|
|
|
mqMessage.getExt().put("customUserId", customUserId);
|
|
|
mqMessage.getExt().put("gps", jsonObject.getString("gps"));
|
|
@@ -1738,11 +1753,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
OrigFileUploadBatch origFileUploadBatch = origFileUploadBatchService.getByCondition(condition);
|
|
|
origFileUploadBatch.setStatus(4);//修改为等待通知计算状态,由定时任务统一分配计算
|
|
|
origFileUploadBatch.setMqContent(JSON.toJSONString(mqMessage));
|
|
|
-// origFileUploadBatch.setNoticeTimes(origFileUploadBatch.getNoticeTimes() + 1);
|
|
|
-// mqMessage.getExt().put("batchId", origFileUploadBatch.getBatchId());
|
|
|
-// mqMessage.getExt().put("noticeTimes", origFileUploadBatch.getNoticeTimes());
|
|
|
origFileUploadBatchService.updateById(origFileUploadBatch);
|
|
|
redisUtil.del("single:upload:uuid:" + unicode);
|
|
|
+ }else{
|
|
|
+ rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
|
}
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
@@ -1763,8 +1777,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
log.info("推送事件失败,param:{}", param);
|
|
|
}
|
|
|
|
|
|
-// rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
|
-
|
|
|
return scenePlusVO;
|
|
|
}
|
|
|
|
|
@@ -2385,15 +2397,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "filePath不能为空");
|
|
|
}
|
|
|
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();
|
|
|
if(StrUtil.isNotEmpty(uploadType) && "log".equals(uploadType)){
|
|
|
return ResultData.ok();
|
|
@@ -2463,17 +2466,29 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData noticeBuild(String uuid) throws Exception {
|
|
|
+ public ResultData noticeBuild(String uuid, Long bdId, String dataSource, String uploadType) throws Exception {
|
|
|
log.info("通知计算,uuid:{} " + uuid);
|
|
|
|
|
|
String sceneNum = null;
|
|
|
+ SceneOrigBd sceneOrigBd = null;
|
|
|
try {
|
|
|
String[] uuidArr = uuid.split("_");
|
|
|
-
|
|
|
String snCode = uuidArr[0];
|
|
|
-
|
|
|
- JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
|
|
|
+ JSONObject fdageData = null;
|
|
|
+ if(StrUtil.isNotEmpty(dataSource)){
|
|
|
+ String homePath = SceneUtil.getHomePath(dataSource);
|
|
|
+ fdageData = JSONObject.parseObject(fYunFileService.getFileContent(homePath + "data.fdage"));
|
|
|
+ }else{
|
|
|
+ fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
|
|
|
+ }
|
|
|
int camType = fdageData.getJSONObject("cam").getIntValue("type");
|
|
|
+ if(Objects.nonNull(bdId)){
|
|
|
+ sceneOrigBd = sceneOrigBdService.getById(bdId);
|
|
|
+ fdageData.put("taskId", sceneOrigBd.getTaskId());
|
|
|
+ fdageData.put("kNo", sceneOrigBd.getKNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ //相机入库
|
|
|
String cameraInStoreUrl = fdServiceUrl + ApiConstant.URL_CAMERA_INSTORE;
|
|
|
Map<String, Object> cameraInStoreParams = new HashMap<>();
|
|
|
cameraInStoreParams.put("cameraType", camType);
|
|
@@ -2502,31 +2517,51 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraType = 10L;//看看
|
|
|
}
|
|
|
|
|
|
- String fileId = this.getFileId(snCode, uuid);
|
|
|
- String subFolder = snCode.concat(File.separator).concat(fileId).concat(File.separator).concat(uuid);
|
|
|
- String dataSource = ConstantFilePath.BUILD_MODEL_PATH.concat(subFolder);
|
|
|
- log.info("dataSource 为:{}", dataSource);
|
|
|
-
|
|
|
- JSONObject configJson = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/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(snCode)){
|
|
|
- throw new RuntimeException("config.json 文件有误!");
|
|
|
+ String ryId = null;
|
|
|
+ String ryNo = null;
|
|
|
+ String password = null;
|
|
|
+ String phone = null;
|
|
|
+ String idCard = null;
|
|
|
+ String jyNo = null;
|
|
|
+ String nickName = null;
|
|
|
+ if(uploadType != null && uploadType.equals("single")){
|
|
|
+ String fileId = this.getFileId(snCode, uuid);
|
|
|
+ String subFolder = snCode.concat(File.separator).concat(fileId).concat(File.separator).concat(uuid);
|
|
|
+ dataSource = ConstantFilePath.BUILD_MODEL_PATH.concat(subFolder);
|
|
|
+ log.info("dataSource 为:{}", dataSource);
|
|
|
+
|
|
|
+ JSONObject configJson = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/config.json")));
|
|
|
+ String folderName = configJson.getString("id");
|
|
|
+ ryId = configJson.getString("customUserId");
|
|
|
+ ryNo = configJson.getString("customUserName");
|
|
|
+ password = AesUtil.encryptCBC(configJson.getString("customUserPwd"), userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING);
|
|
|
+ if(StrUtil.isBlank(folderName) || StrUtil.isBlank(snCode)){
|
|
|
+ throw new RuntimeException("config.json 文件有误!");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ ryId = sceneOrigBd.getRyId();
|
|
|
+ ryNo = sceneOrigBd.getRyId();
|
|
|
+ password = sceneOrigBd.getPassword();
|
|
|
+ phone = sceneOrigBd.getRyPhone();
|
|
|
+ idCard = sceneOrigBd.getRyCid();
|
|
|
+ jyNo = sceneOrigBd.getRyNo();
|
|
|
+ nickName = sceneOrigBd.getRyName();
|
|
|
}
|
|
|
-
|
|
|
//推送开始上传状态
|
|
|
|
|
|
//调注册用户接口
|
|
|
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));
|
|
|
+ params.put("ryId", ryId);
|
|
|
+ params.put("ryNo", ryNo);
|
|
|
+ params.put("password", password);
|
|
|
+ params.put("phone", phone);
|
|
|
+ params.put("idCard", idCard);
|
|
|
+ params.put("jyNo", jyNo);
|
|
|
+ params.put("nickName", nickName);
|
|
|
String url = fdServiceUrl.concat(ApiConstant.URL_ADD_UCENTER_USER);
|
|
|
- myClient.post(url, params);
|
|
|
- JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
|
+ ResultData post1 = myClient.post(url, params);
|
|
|
+ log.info("---------registerUser result:{}-----------", post1);
|
|
|
+ JyUser jyUser = jyUserService.getByRyId(ryId);
|
|
|
User user = userService.getById(jyUser.getUserId());
|
|
|
if(Objects.isNull(jyUser)){
|
|
|
throw new RuntimeException("注册用户失败");
|
|
@@ -2542,14 +2577,27 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
|
}
|
|
|
|
|
|
- buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, customUserId, "single");
|
|
|
+ buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, ryId, uploadType);
|
|
|
|
|
|
scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
|
+
|
|
|
if(cameraType == 14){
|
|
|
fdkkLaserService.saveScene(scenePlus,fdageData,camera,user.getUserName(),rebuild == 1 ? true : false, scenePlus.getPayStatus());
|
|
|
}
|
|
|
+ if(sceneOrigBd != null){
|
|
|
+ sceneOrigBd.setStatus(CommonSuccessStatus.SUCCESS.code());
|
|
|
+ sceneOrigBd.setUpdateTime(null);
|
|
|
+ sceneOrigBdService.updateById(sceneOrigBd);
|
|
|
+ }
|
|
|
|
|
|
}catch (Exception e){
|
|
|
+ if(sceneOrigBd != null){
|
|
|
+ sceneOrigBd.setStatus(CommonSuccessStatus.FAIL.code());
|
|
|
+ sceneOrigBd.setReason(ExceptionUtil.stacktraceToString(e,5000));
|
|
|
+ sceneOrigBd.setUpdateTime(null);
|
|
|
+ sceneOrigBdService.updateById(sceneOrigBd);
|
|
|
+ }
|
|
|
+
|
|
|
log.error("通知计算报错,uuid:{}", uuid, e);
|
|
|
if(StrUtil.isNotEmpty(sceneNum)){
|
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|