|
@@ -841,281 +841,210 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
public void turntableBuildScene(String filePath, String fileId, boolean fromOss, String prefix) throws Exception{
|
|
|
- //获取解压后的资源的data.fdage中的数据
|
|
|
String data = FileUtils.readFile(filePath + "data.fdage");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
|
|
|
//调用createScene方法生成scene数据和加入算法队列
|
|
|
- if(jsonObject != null){
|
|
|
- //有calibration值为标定,1: camera_calibration 2: color_anlysis,0正常计算
|
|
|
- if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("1")){
|
|
|
- String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
|
- String calPath = ConstantFilePath.BUILD_MODEL_PATH + mac + "/camera_calibration";
|
|
|
- //生成标定数据
|
|
|
- ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
- //开始标定计算
|
|
|
- mqSendMessage.sendMessage(calPath);
|
|
|
+ if(jsonObject == null) {
|
|
|
+ log.info("data.fdage文件不存在");
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
+ }
|
|
|
|
|
|
- }else if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("2")){
|
|
|
- String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
|
- String calPath = ConstantFilePath.BUILD_MODEL_PATH + mac + "/color_anlysis";
|
|
|
- //生成标定数据
|
|
|
- ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
- //开始标定计算
|
|
|
- Map<String,String> map = ComputerUtil.computerCalibration(calPath);
|
|
|
- }else if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("3")){
|
|
|
- String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
|
- String calPath = ConstantFilePath.BUILD_MODEL_PATH + mac + "/shading";
|
|
|
- //生成标定数据
|
|
|
- ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
- //开始标定计算
|
|
|
- mqSendMessage.sendMessage(calPath);
|
|
|
+ String sceneNum = "";
|
|
|
|
|
|
- }else {
|
|
|
+ String snCode = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
+ String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime"); //从data.fage 取出
|
|
|
+// sceneProService.updateRecStatus(unicode);
|
|
|
+ //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
+ SceneProPO sceneProPO = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
+ int rebuild = 1;
|
|
|
+ if(sceneProPO != null){
|
|
|
+ sceneNum = sceneProPO.getSceneCode();
|
|
|
+ if(sceneProPO.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
+ log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum();
|
|
|
+ rebuild = 0;
|
|
|
+ }
|
|
|
|
|
|
- String sceneNum = "";
|
|
|
+ if(sceneNum == null){
|
|
|
+ log.error("大场景序号为空:" + sceneNum);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
|
|
|
- String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
- String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
- //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
- SceneProPO proEntity = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
- int rebuild = 1;
|
|
|
- if(proEntity != null){
|
|
|
- sceneNum = proEntity.getSceneCode();
|
|
|
- if(proEntity.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
- log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
- return;
|
|
|
- }
|
|
|
- }else {
|
|
|
- sceneNum = scene3dNumService.generateSceneNum();
|
|
|
- rebuild = 0;
|
|
|
- }
|
|
|
+ log.info("查询相机:" + snCode);
|
|
|
+ ResultData<Camera> cameraResult = platformClient.getCameraByChildName(snCode);
|
|
|
+ Camera camera = cameraResult.getData();
|
|
|
|
|
|
- if(sceneNum == null){
|
|
|
- log.error("大场景序号为空:" + sceneNum);
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
- }
|
|
|
+ if(camera == null){
|
|
|
+ log.error("该相机不存在:" + snCode);
|
|
|
+ cameraResult = platformClient.getCameraBySnCode(snCode);
|
|
|
+ camera = cameraResult.getData();
|
|
|
+ if(camera == null){
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- log.info("查询相机:" + cameraName);
|
|
|
- ResultData<Camera> cameraResult = platformClient.getCameraByChildName(cameraName);
|
|
|
- Camera camera = cameraResult.getData();
|
|
|
+ ResultData<CameraDetail> cameraDetailResult = platformClient.getCameraDetailByCameraId(camera.getId());
|
|
|
+ CameraDetail cameraDetail = cameraDetailResult.getData();
|
|
|
+ if(cameraDetail == null){
|
|
|
+ log.error("该相机详情不存在:" + snCode);
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
+ }
|
|
|
|
|
|
- if(camera == null){
|
|
|
- log.error("该相机不存在:" + cameraName);
|
|
|
- //偶现data.fdage给的相机码多了或少了4DKKPRO_
|
|
|
- if(cameraName.contains("4DKKPRO_")){
|
|
|
- cameraResult = platformClient.getCameraByChildName(cameraName.replace("4DKKPRO_", ""));
|
|
|
- camera = cameraResult.getData();
|
|
|
- }else {
|
|
|
- cameraResult = platformClient.getCameraByChildName("4DKKPRO_" + cameraName);
|
|
|
- camera = cameraResult.getData();
|
|
|
- }
|
|
|
- if(camera == null){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
- }
|
|
|
- }
|
|
|
+ String userName = null;
|
|
|
+ if(cameraDetail.getUserId() != null){
|
|
|
+ ResultData<SSOUser> ssoResult = platformClient.getSSOUserByUserId(cameraDetail.getUserId());
|
|
|
+ SSOUser user = ssoResult.getData();
|
|
|
+// SSOUser user = mapper.convertValue(result.getData(), SSOUser.class);
|
|
|
+ if(user != null){
|
|
|
+ userName = user.getUserName();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- ResultData<CameraDetail> cameraDetailResult = platformClient.getCameraDetailByCameraId(camera.getId());
|
|
|
- CameraDetail cameraDetail = cameraDetailResult.getData();
|
|
|
- if(cameraDetail == null){
|
|
|
- log.error("该相机详情不存在:" + cameraName);
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
- }
|
|
|
+ String icon = null;
|
|
|
+ if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
|
|
|
+ CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
|
|
|
+ icon = prefixAli + "images/images" + sceneNum + "/" + jsonObject.getString("icon");
|
|
|
+ if("s3".equals(type)){
|
|
|
+ CreateObjUtil.ossFileCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath + jsonObject.getString("icon"));
|
|
|
+ icon = ConstantUrl.PREFIX_AWS + "images/images" + sceneNum + "/" + jsonObject.getString("icon");
|
|
|
+ }
|
|
|
+ uploadToOssUtil.upload(filePath + jsonObject.getString("icon"), "images/images" + sceneNum + "/" + jsonObject.getString("icon"));
|
|
|
+ }
|
|
|
|
|
|
- String userName = null;
|
|
|
- if(cameraDetail.getUserId() != null){
|
|
|
- ResultData<SSOUser> ssoResult = platformClient.getSSOUserByUserId(cameraDetail.getUserId());
|
|
|
- SSOUser user = ssoResult.getData();
|
|
|
- if(user != null){
|
|
|
- userName = user.getUserName();
|
|
|
- }
|
|
|
- }
|
|
|
- String icon = null;
|
|
|
- if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
|
|
|
- CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
|
|
|
- icon = prefixAli + "images/images" + sceneNum + "/" + jsonObject.getString("icon");
|
|
|
- if("s3".equals(type)){
|
|
|
- CreateObjUtil.ossFileCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath + jsonObject.getString("icon"));
|
|
|
- icon = ConstantUrl.PREFIX_AWS + "images/images" + sceneNum + "/" + jsonObject.getString("icon");
|
|
|
- }
|
|
|
- uploadToOssUtil.upload(filePath + jsonObject.getString("icon"), "images/images" + sceneNum + "/" + jsonObject.getString("icon"));
|
|
|
- }
|
|
|
+ JSONObject firmwareVersion = new JSONObject();
|
|
|
+ if(jsonObject.containsKey("camSoftwareVersion") && StrUtil.isNotEmpty(jsonObject.getString("camSoftwareVersion"))){
|
|
|
+ firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
|
|
|
+ }
|
|
|
|
|
|
- JSONObject firmwareVersion = new JSONObject();
|
|
|
- if(jsonObject.containsKey("camSoftwareVersion") && StrUtil.isNotEmpty(jsonObject.getString("camSoftwareVersion"))){
|
|
|
- firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
|
|
|
- }
|
|
|
+ if(jsonObject.containsKey("version") && StrUtil.isNotEmpty(jsonObject.getString("version"))){
|
|
|
+ firmwareVersion.put("version", jsonObject.getString("version"));
|
|
|
+ }
|
|
|
|
|
|
- if(jsonObject.containsKey("version") && StrUtil.isNotEmpty(jsonObject.getString("version"))){
|
|
|
- firmwareVersion.put("version", jsonObject.getString("version"));
|
|
|
- }
|
|
|
+ String sceneUrl = mainUrl + sceneProNewUrl;
|
|
|
+ String buildType = "V3";
|
|
|
+ //13表示转台
|
|
|
+ Long cameraType = 13L;
|
|
|
|
|
|
- String sceneUrl = mainUrl + sceneProUrl;
|
|
|
- String buildType = "V2";
|
|
|
- Long cameraType = 10L;
|
|
|
- //根据videoVersion判断是V2还是V3版本的算法和页面
|
|
|
- if(jsonObject.containsKey("videoVersion") && StrUtil.isNotEmpty(jsonObject.getString("videoVersion"))){
|
|
|
- if(jsonObject.getIntValue("videoVersion") >= 4){
|
|
|
- buildType = "V3";
|
|
|
- cameraType = 11L;
|
|
|
- sceneUrl = mainUrl + sceneProNewUrl;
|
|
|
- }
|
|
|
- }
|
|
|
- //重算的场景,先移除该场景对应的容量
|
|
|
- if(rebuild == 1){
|
|
|
- sceneProService.rebuildReduceSpaceBySceneNum(sceneNum);
|
|
|
- }else {
|
|
|
- //上传log-main.png
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main.png", "images/images" + sceneNum + "/logo-main.png");
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main-en.png", "images/images" + sceneNum + "/logo-main-en.png");
|
|
|
- }
|
|
|
- SceneProPO sceneProPO = null;
|
|
|
- if(fromOss){
|
|
|
- sceneProPO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
- jsonObject.getString("pwd"), unicode,
|
|
|
- cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
- jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
- jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
- jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
- jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,cameraDetail.getCooperationUser());
|
|
|
- }else {
|
|
|
- sceneProPO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
- jsonObject.getString("pwd"), unicode,
|
|
|
- cameraDetail.getGoodsId(), String.valueOf(fileId), "", "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
- jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
- jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
- jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
- jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType, cameraDetail.getCooperationUser());
|
|
|
- }
|
|
|
+ //激光转台 八目相机占用 10 和 11
|
|
|
+ if(jsonObject.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
+ //激光转台
|
|
|
+ cameraType = 14L;
|
|
|
+ }
|
|
|
|
|
|
- if(sceneProPO != null){
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
- //临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", sceneProPO.getSceneStatus() == -2 ? 1 : sceneProPO.getSceneStatus());
|
|
|
- statusJson.put("webSite", sceneProPO.getWebSite());
|
|
|
- statusJson.put("sceneNum", sceneProPO.getSceneCode());
|
|
|
- statusJson.put("thumb", sceneProPO.getThumb());
|
|
|
- statusJson.put("payStatus", sceneProPO.getPayStatus());
|
|
|
- statusJson.put("recStatus", sceneProPO.getRecStatus());
|
|
|
- FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+sceneNum+File.separator+"status.json", statusJson.toString());
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH+"data/data"+sceneNum+File.separator+"status.json",
|
|
|
- "data/data"+sceneNum+File.separator+"status.json");
|
|
|
- }
|
|
|
+ //重算的场景,先移除该场景对应的容量
|
|
|
+ if(rebuild == 1){
|
|
|
+ sceneProService.rebuildReduceSpaceBySceneNum(sceneNum);
|
|
|
+ }else {
|
|
|
+ //上传log-main.png
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main.png", "images/images" + sceneNum + "/logo-main.png");
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main-en.png", "images/images" + sceneNum + "/logo-main-en.png");
|
|
|
+ }
|
|
|
+ SceneProPO scene = null;
|
|
|
+ scene = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
+ jsonObject.getString("pwd"), unicode,
|
|
|
+ cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
+ jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,cameraDetail.getCooperationUser());
|
|
|
|
|
|
- //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
- uploadToOssUtil.delete("data/data"+sceneNum+File.separator+"houst_floor.json");
|
|
|
+ if(scene != null){
|
|
|
+ JSONObject statusJson = new JSONObject();
|
|
|
+ //临时将-2改成1,app还没完全更新
|
|
|
+ statusJson.put("status", scene.getSceneStatus() == -2? 1 : scene.getSceneStatus());
|
|
|
+ statusJson.put("webSite", scene.getWebSite());
|
|
|
+ statusJson.put("sceneNum", scene.getSceneCode());
|
|
|
+ statusJson.put("thumb", scene.getThumb());
|
|
|
+ statusJson.put("payStatus", scene.getPayStatus());
|
|
|
+ statusJson.put("recStatus", scene.getRecStatus());
|
|
|
+ FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+sceneNum+File.separator+"status.json", statusJson.toString());
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH+"data/data"+sceneNum+File.separator+"status.json",
|
|
|
+ "data/data"+sceneNum+File.separator+"status.json");
|
|
|
+ }
|
|
|
|
|
|
- if(cameraDetail.getCompanyId() != null){
|
|
|
- ResultData<Company> companyResult = platformClient.getCompanyById(cameraDetail.getCompanyId());
|
|
|
- Company company = companyResult.getData();
|
|
|
- if(company != null){
|
|
|
+ if(cameraDetail.getCompanyId() != null){
|
|
|
|
|
|
- Map<String, Object> jsonMap = new HashMap<>();
|
|
|
+ ResultData<Company> companyResult = platformClient.getCompanyById(cameraDetail.getCompanyId());
|
|
|
+ Company company = companyResult.getData();
|
|
|
+ if(company != null){
|
|
|
|
|
|
- log.info("复制企业logo");
|
|
|
- SceneProEdit sceneProEdit = sceneProEditService.findByProId(sceneProPO.getId());
|
|
|
- SceneProEditExt sceneProEditExt = sceneProEditExtService.getByProEditId(sceneProEdit.getId());
|
|
|
+ Map<String, Object> jsonMap = new HashMap<>();
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(company.getTopLogo())){
|
|
|
- //复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo()).exists()){
|
|
|
- log.info("下载topLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + company.getTopLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- company.getTopLogo().substring(company.getTopLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + company.getTopLogo().substring(0, company.getTopLogo().lastIndexOf("/")));
|
|
|
- }
|
|
|
+ log.info("复制企业logo");
|
|
|
+ SceneProEdit sceneProEdit = sceneProEditService.findByProId(scene.getId());
|
|
|
+ SceneProEditExt sceneProEditExt = sceneProEditExtService.getByProEditId(sceneProEdit.getId());
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),
|
|
|
- ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/logo-main.png", true);
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/logo-main.png",
|
|
|
- "images/images" + sceneNum + "/logo-main.png");
|
|
|
- }
|
|
|
+ if(StrUtil.isNotEmpty(company.getTopLogo())){
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(company.getFloorLogo())){
|
|
|
- //复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo()).exists()){
|
|
|
- log.info("下载floorLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + company.getFloorLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- company.getFloorLogo().substring(company.getFloorLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + company.getFloorLogo().substring(0, company.getFloorLogo().lastIndexOf("/")));
|
|
|
- }
|
|
|
+ FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),
|
|
|
+ ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/logo-main.png", true);
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/logo-main.png",
|
|
|
+ "images/images" + sceneNum + "/logo-main.png");
|
|
|
+ }
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo(),
|
|
|
- ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/floorLogoImg.png", true);
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/floorLogoImg.png",
|
|
|
- "images/images" + sceneNum + "/floorLogoImg.png");
|
|
|
+ if(StrUtil.isNotEmpty(company.getFloorLogo())){
|
|
|
|
|
|
- sceneProEdit.setFloorLogo("user");
|
|
|
- jsonMap.put("floorLogoSize", sceneProEdit.getFloorLogoSize());
|
|
|
- jsonMap.put("floorLogo", "user");
|
|
|
- }
|
|
|
+ FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo(),
|
|
|
+ ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/floorLogoImg.png", true);
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/floorLogoImg.png",
|
|
|
+ "images/images" + sceneNum + "/floorLogoImg.png");
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(company.getQrLogo())){
|
|
|
- //复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getQrLogo()).exists()){
|
|
|
- log.info("下载qrLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + company.getQrLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- company.getQrLogo().substring(company.getQrLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + company.getQrLogo().substring(0, company.getQrLogo().lastIndexOf("/")));
|
|
|
- }
|
|
|
+ sceneProEdit.setFloorLogo("user");
|
|
|
+ jsonMap.put("floorLogoSize", sceneProEdit.getFloorLogoSize());
|
|
|
+ jsonMap.put("floorLogo", "user");
|
|
|
+ }
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getQrLogo(),
|
|
|
- ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png", true);
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png",
|
|
|
- "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
- sceneProEdit.setShareLogo("images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
+ if(StrUtil.isNotEmpty(company.getQrLogo())){
|
|
|
|
|
|
- //生成新的分享的二维码
|
|
|
- MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+".png",
|
|
|
- ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
- MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+"_en.png",
|
|
|
- ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
- }
|
|
|
+ FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getQrLogo(),
|
|
|
+ ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png", true);
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png",
|
|
|
+ "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
+ sceneProEdit.setShareLogo("images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(company.getMarkerLogo())){
|
|
|
- //复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getMarkerLogo()).exists()){
|
|
|
- log.info("下载floorLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + company.getMarkerLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- company.getMarkerLogo().substring(company.getMarkerLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + company.getMarkerLogo().substring(0, company.getMarkerLogo().lastIndexOf("/")));
|
|
|
- }
|
|
|
+ //生成新的分享的二维码
|
|
|
+ MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+".png",
|
|
|
+ ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
+ MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+"_en.png",
|
|
|
+ ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
+ }
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getMarkerLogo(),
|
|
|
- ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/marker.png", true);
|
|
|
- uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/marker.png",
|
|
|
- "images/images" + sceneNum + "/marker.png");
|
|
|
+ if(StrUtil.isNotEmpty(company.getMarkerLogo())){
|
|
|
|
|
|
- sceneProEdit.setMarkerLogo("user");
|
|
|
- jsonMap.put("markerLogo", "user");
|
|
|
- }
|
|
|
+ FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getMarkerLogo(),
|
|
|
+ ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/marker.png", true);
|
|
|
+ uploadToOssUtil.upload(ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/marker.png",
|
|
|
+ "images/images" + sceneNum + "/marker.png");
|
|
|
|
|
|
- sceneProEdit.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
- sceneProEditService.updateById(sceneProEdit);
|
|
|
+ sceneProEdit.setMarkerLogo("user");
|
|
|
+ jsonMap.put("markerLogo", "user");
|
|
|
+ }
|
|
|
|
|
|
- sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
- sceneProEditExt.setShowLogoBottom(company.getShowLogo());
|
|
|
- sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
+ sceneProEdit.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
+ sceneProEditService.updateById(sceneProEdit);
|
|
|
|
|
|
- jsonMap.put("showLogoBottom", company.getShowLogo());
|
|
|
- FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/scene.json", jsonMap);
|
|
|
- }
|
|
|
+ sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
+ sceneProEditExt.setShowLogoBottom(company.getShowLogo());
|
|
|
+ sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
|
|
|
- }
|
|
|
+ jsonMap.put("showLogoBottom", company.getShowLogo());
|
|
|
+ FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/scene.json", jsonMap);
|
|
|
+ }
|
|
|
|
|
|
- // 正顺相机不予计算
|
|
|
- Long companyId = cameraDetail.getCompanyId();
|
|
|
- if(Objects.nonNull(unCalculatedCompanyIds) && Arrays.asList(unCalculatedCompanyIds).contains(companyId)){
|
|
|
- return;
|
|
|
- }
|
|
|
- if(sceneProPO != null){
|
|
|
- mqSendMessage.sendMessage(sceneProPO.getMqMsg());
|
|
|
- }
|
|
|
+ //删除oss的houst_floor.json
|
|
|
+ uploadToOssUtil.delete("data/data"+sceneNum+File.separator+"houst_floor.json");
|
|
|
|
|
|
- }
|
|
|
- }else {
|
|
|
- log.info("data.fdage文件不存在");
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
+ }
|
|
|
+
|
|
|
+ //激光转台 八目相机占用 10 和 11
|
|
|
+ if(jsonObject.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
+ mqSendMessage.sendMessageLaser("TOPIC_LASER_A", scene.getMqMsg());
|
|
|
+ }else if(scene != null){
|
|
|
+ mqSendMessage.sendMessage(scene.getMqMsg());
|
|
|
}
|
|
|
}
|
|
|
|