|
@@ -7,18 +7,22 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.config.FileRouteConfig;
|
|
|
import com.fdkankan.common.constant.*;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.common.rocketmq.producer.MqSendMessage;
|
|
|
+import com.fdkankan.common.user.SSOUser;
|
|
|
import com.fdkankan.common.util.*;
|
|
|
-import com.fdkankan.platform.api.feign.client.PlatformClient;
|
|
|
-import com.fdkankan.platform.api.feign.vo.Camera;
|
|
|
+import com.fdkankan.mq.message.BuildSceneMqMessage;
|
|
|
+import com.fdkankan.platform.api.feign.PlatformClient;
|
|
|
+import com.fdkankan.platform.api.vo.Camera;
|
|
|
+import com.fdkankan.platform.api.vo.CameraDetail;
|
|
|
+import com.fdkankan.platform.api.vo.Company;
|
|
|
import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.mapper.ISceneFileBuildMapper;
|
|
|
import com.fdkankan.scene.service.*;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.scene.vo.ResponseSceneFile;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
@@ -556,7 +560,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- StringBuilder filePathBuffer = new StringBuilder(routeConfig.getHardDisk()).append(mac).append(File.separator).append(fileId).append(File.separator).append(folderName).append(File.separator).append("capture").append(File.separator);
|
|
|
+ StringBuilder filePathBuffer = new StringBuilder(routeConfig.getHardDisk())
|
|
|
+ .append(mac).append(File.separator)
|
|
|
+ .append(fileId).append(File.separator)
|
|
|
+ .append(folderName).append(File.separator)
|
|
|
+ .append("capture").append(File.separator);
|
|
|
StringBuilder prefixBuffer = new StringBuilder(mac).append(File.separator).append(fileId).append(File.separator).append(folderName).append(File.separator);
|
|
|
|
|
|
File filePath = new File(filePathBuffer.toString());
|
|
@@ -607,18 +615,27 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
//判断 是否为激光相机
|
|
|
- // TODO: 2021/12/31 调用跨服务接口 获取CameraEntity CameraDetailEntity
|
|
|
- Camera camera = platformClient.findByChildName(mac);
|
|
|
- CameraDetailEntity cameraDetailEntity = goodsService.findCameraDetailByCameraId(camera.getId());
|
|
|
+ ResultData<Camera> cameraResult = platformClient.getCameraByChildName(mac);
|
|
|
+ if(!cameraResult.getSuccess()){
|
|
|
+ log.error("获取不到Camera数据, childName: {}" , mac);
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ Camera camera = cameraResult.getData();
|
|
|
+ ResultData<CameraDetail> cameraDetailResult = platformClient.getCameraDetailByCameraId(camera.getId());
|
|
|
+ if(!cameraDetailResult.getSuccess()){
|
|
|
+ log.error("获取不到CameraDetail数据, CameraId: {}" , camera.getId());
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ CameraDetail cameraDetail = cameraDetailResult.getData();
|
|
|
|
|
|
String hardDisk = routeConfig.getHardDisk();
|
|
|
- if(cameraDetailEntity!=null){
|
|
|
- if(cameraDetailEntity.getType() == 10){
|
|
|
+ if(cameraDetail!=null){
|
|
|
+ if(cameraDetail.getCameraType() == 10){
|
|
|
hardDisk = routeConfig.getHardDiskLaser();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- log.info("相机 mnt 路径 : " + hardDisk + ", 相机类型 : " + cameraDetailEntity.getType());
|
|
|
+ log.info("相机 mnt 路径 : " + hardDisk + ", 相机类型 : " + cameraDetail.getCameraType());
|
|
|
|
|
|
StringBuilder filePathBuffer = new StringBuilder(hardDisk).append(mac).append(File.separator).append(fileId).append(File.separator).append(folderName).append(File.separator).append("capture").append(File.separator);
|
|
|
StringBuilder prefixBuffer = new StringBuilder(mac).append(File.separator).append(fileId).append(File.separator).append(folderName).append(File.separator);
|
|
@@ -666,17 +683,17 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3001);
|
|
|
}
|
|
|
|
|
|
- // TODO: 2021/12/31 feign
|
|
|
- CameraEntity cameraEntity = goodsService.findByChildName(userName);
|
|
|
+ ResultData<Camera> cameraResult = platformClient.getCameraByChildName(userName);
|
|
|
+ Camera camera = cameraResult.getData();
|
|
|
|
|
|
- if(cameraEntity == null){
|
|
|
- // TODO: 2021/12/31 feign
|
|
|
- cameraEntity = goodsService.findBySnCode(userName);
|
|
|
+ if(camera == null){
|
|
|
+ cameraResult = platformClient.getCameraBySnCode(userName);
|
|
|
+ camera = cameraResult.getData();
|
|
|
}
|
|
|
- if (cameraEntity == null){
|
|
|
+ if (camera == null){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
- if(!password.equals(cameraEntity.getChildPassword())){
|
|
|
+ if(!password.equals(camera.getChildPassword())){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3014);
|
|
|
}
|
|
|
|
|
@@ -712,24 +729,28 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
log.info("查询相机:" + cameraName);
|
|
|
- // TODO: 2021/12/31 feign
|
|
|
- cameraEntity = goodsService.findByChildName(cameraName);
|
|
|
+ cameraResult = platformClient.getCameraByChildName(cameraName);
|
|
|
+ camera = cameraResult.getData();
|
|
|
|
|
|
- if(cameraEntity == null){
|
|
|
+ if(camera == null){
|
|
|
log.error("该相机不存在:" + cameraName);
|
|
|
//偶现data.fdage给的相机码多了或少了4DKKPRO_
|
|
|
if(cameraName.contains("4DKKPRO_")){
|
|
|
- cameraEntity = goodsService.findByChildName(cameraName.replace("4DKKPRO_", ""));
|
|
|
+ cameraResult = platformClient.getCameraByChildName(cameraName.replace("4DKKPRO_", ""));
|
|
|
+ camera = cameraResult.getData();
|
|
|
}else {
|
|
|
- cameraEntity = goodsService.findByChildName("4DKKPRO_" + cameraName);
|
|
|
+ cameraResult = platformClient.getCameraByChildName("4DKKPRO_" + cameraName);
|
|
|
+ camera = cameraResult.getData();
|
|
|
}
|
|
|
- if(cameraEntity == null){
|
|
|
+ if(camera == null){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- CameraDetailEntity detailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
|
|
|
- if(detailEntity == null){
|
|
|
+ ResultData<CameraDetail> detailResult = platformClient.getCameraDetailByCameraId(camera.getId());
|
|
|
+ CameraDetail cameraDetail = detailResult.getData();
|
|
|
+
|
|
|
+ if(cameraDetail == null){
|
|
|
log.error("该相机详情不存在:" + cameraName);
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
@@ -765,24 +786,23 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraType = 6L;
|
|
|
}
|
|
|
|
|
|
- SceneProEntity scene = this.createScenePro(sceneNum, cameraEntity.getId(), cameraEntity.getChildName(), jsonObject.getString("creator"),
|
|
|
+ SceneProPO scene = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
- cameraType, "", prefix, zipName, icon, "0", detailEntity.getUserId(), userName,
|
|
|
+ cameraType, "", prefix, zipName, 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"), sceneProService, sceneProEditService, rebuild,
|
|
|
- producer, 4, firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,
|
|
|
- sceneCooperationService, sceneResourceCooperationService, sceneResourceCameraService, detailEntity.getCooperationUser(), rubberSheetingUtil);
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ 4, firmwareVersion.toString(), sceneUrl, buildType, type, ecsType, cameraDetail.getCooperationUser());
|
|
|
|
|
|
if(scene == null){
|
|
|
log.info("双目相机入库失败");
|
|
|
- return Result.failure("双目相机异常");
|
|
|
+ return ResultData.error(ErrorCode.FAILURE_CODE_5056);
|
|
|
}
|
|
|
JSONObject statusJson = new JSONObject();
|
|
|
//临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", scene.getStatus() == -2? 1 : scene.getStatus());
|
|
|
+ statusJson.put("status", scene.getSceneStatus() == -2? 1 : scene.getSceneStatus());
|
|
|
statusJson.put("webSite", scene.getWebSite());
|
|
|
- statusJson.put("sceneNum", scene.getNum());
|
|
|
+ statusJson.put("sceneNum", scene.getSceneCode());
|
|
|
statusJson.put("thumb", scene.getThumb());
|
|
|
statusJson.put("payStatus", scene.getPayStatus());
|
|
|
FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+sceneNum+File.separator+"status.json", statusJson.toString());
|
|
@@ -792,7 +812,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//删除oss的houst_floor.json
|
|
|
uploadToOssUtil.delete("data/data"+sceneNum+File.separator+"houst_floor.json");
|
|
|
|
|
|
- producer.sendMsg(scene.getMqMsg());
|
|
|
+ mqSendMessage.sendMessage(scene.getMqMsg());
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("sceneNum", sceneNum);
|
|
@@ -848,28 +868,30 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
log.info("查询相机:" + snCode);
|
|
|
- // TODO: 2021/12/31 调用feign
|
|
|
- CameraEntity cameraEntity = goodsService.findByChildName(snCode);
|
|
|
+ ResultData<Camera> cameraResult = platformClient.getCameraByChildName(snCode);
|
|
|
+ Camera camera = cameraResult.getData();
|
|
|
|
|
|
- if(cameraEntity == null){
|
|
|
+ if(camera == null){
|
|
|
log.error("该相机不存在:" + snCode);
|
|
|
- cameraEntity = goodsService.findBySnCode(snCode);
|
|
|
- if(cameraEntity == null){
|
|
|
+ cameraResult = platformClient.getCameraBySnCode(snCode);
|
|
|
+ camera = cameraResult.getData();
|
|
|
+ if(camera == null){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // TODO: 2021/12/31 调用feign
|
|
|
- CameraDetailEntity detailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
|
|
|
- if(detailEntity == null){
|
|
|
+ ResultData<CameraDetail> cameraDetailResult = platformClient.getCameraDetailByCameraId(camera.getId());
|
|
|
+ CameraDetail cameraDetail = cameraDetailResult.getData();
|
|
|
+ if(cameraDetail == null){
|
|
|
log.error("该相机详情不存在:" + snCode);
|
|
|
- throw new BaseRuntimeException(CameraConstant.FAILURE_CODE_6003, CameraConstant.FAILURE_MSG_6003);
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
|
|
|
String userName = null;
|
|
|
- if(detailEntity.getUserId() != null){
|
|
|
- Result result = userService.findById(detailEntity.getUserId());
|
|
|
- SSOUser user = mapper.convertValue(result.getData(), SSOUser.class);
|
|
|
+ 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();
|
|
|
}
|
|
@@ -906,7 +928,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraType = 14L;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
if(rebuild == 1){
|
|
|
sceneProService.rebuildReduceSpaceBySceneNum(sceneNum);
|
|
@@ -916,14 +937,13 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main-en.png", "images/images" + sceneNum + "/logo-main-en.png");
|
|
|
}
|
|
|
SceneProPO scene = null;
|
|
|
- scene = this.createScenePro(sceneNum, cameraEntity.getId(), cameraEntity.getChildName(), jsonObject.getString("creator"),
|
|
|
+ scene = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
- cameraType, String.valueOf(fileId), prefix, "", icon, "0", detailEntity.getUserId(), userName,
|
|
|
+ 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"), sceneProService, sceneProEditService, rebuild,
|
|
|
- producer, jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,
|
|
|
- sceneCooperationService, sceneResourceCooperationService, sceneResourceCameraService, detailEntity.getCooperationUser(), rubberSheetingUtil);
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,cameraDetail.getCooperationUser());
|
|
|
|
|
|
if(scene != null){
|
|
|
JSONObject statusJson = new JSONObject();
|
|
@@ -939,9 +959,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
"data/data"+sceneNum+File.separator+"status.json");
|
|
|
}
|
|
|
|
|
|
- if(detailEntity.getCompanyId() != null){
|
|
|
- CompanyEntity companyEntity = companyService.findById(detailEntity.getCompanyId());
|
|
|
- if(companyEntity != null){
|
|
|
+ if(cameraDetail.getCompanyId() != null){
|
|
|
+
|
|
|
+ ResultData<Company> companyResult = platformClient.getCompanyById(cameraDetail.getCompanyId());
|
|
|
+ Company company = companyResult.getData();
|
|
|
+ if(company != null){
|
|
|
|
|
|
Map<String, Object> jsonMap = new HashMap<>();
|
|
|
|
|
@@ -949,17 +971,17 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
SceneProEdit sceneProEdit = sceneProEditService.findByProId(scene.getId());
|
|
|
SceneProEditExt sceneProEditExt = sceneProEditExtService.getByProEditId(sceneProEdit.getId());
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(companyEntity.getTopLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getTopLogo())){
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getTopLogo(),
|
|
|
+ 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(companyEntity.getFloorLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getFloorLogo())){
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getFloorLogo(),
|
|
|
+ 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");
|
|
@@ -969,9 +991,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonMap.put("floorLogo", "user");
|
|
|
}
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(companyEntity.getQrLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getQrLogo())){
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getQrLogo(),
|
|
|
+ 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");
|
|
@@ -984,9 +1006,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
}
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(companyEntity.getMarkerLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getMarkerLogo())){
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getMarkerLogo(),
|
|
|
+ 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");
|
|
@@ -999,10 +1021,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
sceneProEditService.updateById(sceneProEdit);
|
|
|
|
|
|
sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
- sceneProEditExt.setShowLogoBottom(companyEntity.getShowLogo());
|
|
|
+ sceneProEditExt.setShowLogoBottom(company.getShowLogo());
|
|
|
sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
|
|
|
- jsonMap.put("showLogoBottom", companyEntity.getShowLogo());
|
|
|
+ jsonMap.put("showLogoBottom", company.getShowLogo());
|
|
|
FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/scene.json", jsonMap);
|
|
|
}
|
|
|
|
|
@@ -1013,9 +1035,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
//激光转台 八目相机占用 10 和 11
|
|
|
if(jsonObject.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
- producer.sendMsgLaser(scene.getMqMsg());
|
|
|
+ mqSendMessage.sendMessageLaser("TOPIC_LASER_A", scene.getMqMsg());
|
|
|
}else if(scene != null){
|
|
|
- producer.sendMsg(scene.getMqMsg());
|
|
|
+ mqSendMessage.sendMessage(scene.getMqMsg());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1033,7 +1055,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//生成标定数据
|
|
|
ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
//开始标定计算
|
|
|
- producer.sendMsg(calPath);
|
|
|
+ mqSendMessage.sendMessage(calPath);
|
|
|
|
|
|
}else if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("2")){
|
|
|
String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
@@ -1048,7 +1070,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//生成标定数据
|
|
|
ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
//开始标定计算
|
|
|
- producer.sendMsg(calPath);
|
|
|
+ mqSendMessage.sendMessage(calPath);
|
|
|
|
|
|
}else {
|
|
|
|
|
@@ -1076,31 +1098,35 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
log.info("查询相机:" + cameraName);
|
|
|
- Camera camera = platformClient.findByChildName(cameraName);
|
|
|
+ ResultData<Camera> cameraResult = platformClient.getCameraByChildName(cameraName);
|
|
|
+ Camera camera = cameraResult.getData();
|
|
|
|
|
|
if(camera == null){
|
|
|
log.error("该相机不存在:" + cameraName);
|
|
|
//偶现data.fdage给的相机码多了或少了4DKKPRO_
|
|
|
if(cameraName.contains("4DKKPRO_")){
|
|
|
- camera = platformClient.findByChildName(cameraName.replace("4DKKPRO_", ""));
|
|
|
+ cameraResult = platformClient.getCameraByChildName(cameraName.replace("4DKKPRO_", ""));
|
|
|
+ camera = cameraResult.getData();
|
|
|
}else {
|
|
|
- camera = platformClient.findByChildName("4DKKPRO_" + cameraName);
|
|
|
+ cameraResult = platformClient.getCameraByChildName("4DKKPRO_" + cameraName);
|
|
|
+ camera = cameraResult.getData();
|
|
|
}
|
|
|
if(camera == null){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- CameraDetailEntity detailEntity = goodsService.findCameraDetailByCameraId(cameraEntity.getId());
|
|
|
- if(detailEntity == null){
|
|
|
+ ResultData<CameraDetail> cameraDetailResult = platformClient.getCameraDetailByCameraId(camera.getId());
|
|
|
+ CameraDetail cameraDetail = cameraDetailResult.getData();
|
|
|
+ if(cameraDetail == null){
|
|
|
log.error("该相机详情不存在:" + cameraName);
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
|
|
|
String userName = null;
|
|
|
- if(detailEntity.getUserId() != null){
|
|
|
- ResultData result = userService.findById(detailEntity.getUserId());
|
|
|
- SSOUser user = mapper.convertValue(result.getData(), SSOUser.class);
|
|
|
+ if(cameraDetail.getUserId() != null){
|
|
|
+ ResultData<SSOUser> ssoResult = platformClient.getSSOUserByUserId(cameraDetail.getUserId());
|
|
|
+ SSOUser user = ssoResult.getData();
|
|
|
if(user != null){
|
|
|
userName = user.getUserName();
|
|
|
}
|
|
@@ -1146,29 +1172,29 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
SceneProPO sceneProPO = null;
|
|
|
if(fromOss){
|
|
|
- sceneProPO = this.createScenePro(sceneNum, cameraEntity.getId(), cameraEntity.getChildName(), jsonObject.getString("creator"),
|
|
|
+ sceneProPO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
- cameraType, String.valueOf(fileId), prefix, "", icon, "0", detailEntity.getUserId(), userName,
|
|
|
+ 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,detailEntity.getCooperationUser());
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,cameraDetail.getCooperationUser());
|
|
|
}else {
|
|
|
- sceneProPO = this.createScenePro(sceneNum, cameraEntity.getId(), cameraEntity.getChildName(), jsonObject.getString("creator"),
|
|
|
+ sceneProPO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
- detailEntity.getGoodsId(), String.valueOf(fileId), "", "", icon, "0", detailEntity.getUserId(), userName,
|
|
|
+ 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, detailEntity.getCooperationUser());
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType, cameraDetail.getCooperationUser());
|
|
|
}
|
|
|
|
|
|
if(sceneProPO != null){
|
|
|
JSONObject statusJson = new JSONObject();
|
|
|
//临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", sceneProPO.getStatus() == -2? 1 : scene.getStatus());
|
|
|
+ statusJson.put("status", sceneProPO.getSceneStatus() == -2? 1 : sceneProPO.getSceneStatus());
|
|
|
statusJson.put("webSite", sceneProPO.getWebSite());
|
|
|
- statusJson.put("sceneNum", sceneProPO.getNum());
|
|
|
+ statusJson.put("sceneNum", sceneProPO.getSceneCode());
|
|
|
statusJson.put("thumb", sceneProPO.getThumb());
|
|
|
statusJson.put("payStatus", sceneProPO.getPayStatus());
|
|
|
statusJson.put("recStatus", sceneProPO.getRecStatus());
|
|
@@ -1180,9 +1206,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
uploadToOssUtil.delete("data/data"+sceneNum+File.separator+"houst_floor.json");
|
|
|
|
|
|
- if(detailEntity.getCompanyId() != null){
|
|
|
- CompanyEntity companyEntity = companyService.findById(detailEntity.getCompanyId());
|
|
|
- if(companyEntity != null){
|
|
|
+ if(cameraDetail.getCompanyId() != null){
|
|
|
+ ResultData<Company> companyResult = platformClient.getCompanyById(cameraDetail.getCompanyId());
|
|
|
+ Company company = companyResult.getData();
|
|
|
+ if(company != null){
|
|
|
|
|
|
Map<String, Object> jsonMap = new HashMap<>();
|
|
|
|
|
@@ -1190,31 +1217,31 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
SceneProEdit sceneProEdit = sceneProEditService.findByProId(sceneProPO.getId());
|
|
|
SceneProEditExt sceneProEditExt = sceneProEditExtService.getByProEditId(sceneProEdit.getId());
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(companyEntity.getTopLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getTopLogo())){
|
|
|
//复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getTopLogo()).exists()){
|
|
|
+ if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo()).exists()){
|
|
|
log.info("下载topLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + companyEntity.getTopLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- companyEntity.getTopLogo().substring(companyEntity.getTopLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + companyEntity.getTopLogo().substring(0, companyEntity.getTopLogo().lastIndexOf("/")));
|
|
|
+ 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("/")));
|
|
|
}
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getTopLogo(),
|
|
|
+ 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(companyEntity.getFloorLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getFloorLogo())){
|
|
|
//复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getFloorLogo()).exists()){
|
|
|
+ if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo()).exists()){
|
|
|
log.info("下载floorLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + companyEntity.getFloorLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- companyEntity.getFloorLogo().substring(companyEntity.getFloorLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + companyEntity.getFloorLogo().substring(0, companyEntity.getFloorLogo().lastIndexOf("/")));
|
|
|
+ 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 + companyEntity.getFloorLogo(),
|
|
|
+ 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");
|
|
@@ -1224,16 +1251,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonMap.put("floorLogo", "user");
|
|
|
}
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(companyEntity.getQrLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getQrLogo())){
|
|
|
//复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getQrLogo()).exists()){
|
|
|
+ if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getQrLogo()).exists()){
|
|
|
log.info("下载qrLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + companyEntity.getQrLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- companyEntity.getQrLogo().substring(companyEntity.getQrLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + companyEntity.getQrLogo().substring(0, companyEntity.getQrLogo().lastIndexOf("/")));
|
|
|
+ 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("/")));
|
|
|
}
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getQrLogo(),
|
|
|
+ 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");
|
|
@@ -1246,16 +1273,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
}
|
|
|
|
|
|
- if(StrUtil.isNotEmpty(companyEntity.getMarkerLogo())){
|
|
|
+ if(StrUtil.isNotEmpty(company.getMarkerLogo())){
|
|
|
//复制阿里云主服务器的图片到横琴云副服务器中
|
|
|
- if(!new File(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getMarkerLogo()).exists()){
|
|
|
+ if(!new File(ConstantFilePath.BASE_PATH + File.separator + company.getMarkerLogo()).exists()){
|
|
|
log.info("下载floorLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + companyEntity.getMarkerLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- companyEntity.getMarkerLogo().substring(companyEntity.getMarkerLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + companyEntity.getMarkerLogo().substring(0, companyEntity.getMarkerLogo().lastIndexOf("/")));
|
|
|
+ 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("/")));
|
|
|
}
|
|
|
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + companyEntity.getMarkerLogo(),
|
|
|
+ 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");
|
|
@@ -1268,22 +1295,22 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
sceneProEditService.updateById(sceneProEdit);
|
|
|
|
|
|
sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
- sceneProEditExt.setShowLogoBottom(companyEntity.getShowLogo());
|
|
|
+ sceneProEditExt.setShowLogoBottom(company.getShowLogo());
|
|
|
sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
|
|
|
- jsonMap.put("showLogoBottom", companyEntity.getShowLogo());
|
|
|
+ jsonMap.put("showLogoBottom", company.getShowLogo());
|
|
|
FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/scene.json", jsonMap);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 正顺相机不予计算
|
|
|
- Long companyId = detailEntity.getCompanyId();
|
|
|
+ Long companyId = cameraDetail.getCompanyId();
|
|
|
if(Objects.nonNull(unCalculatedCompanyIds) && Arrays.asList(unCalculatedCompanyIds).contains(companyId)){
|
|
|
return;
|
|
|
}
|
|
|
if(sceneProPO != null){
|
|
|
- producer.sendMsg(sceneProPO.getMqMsg());
|
|
|
+ mqSendMessage.sendMessage(sceneProPO.getMqMsg());
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1322,7 +1349,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
|
|
|
fileId + File.separator + unicode);
|
|
|
path = ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode;
|
|
|
- log.info("激光相机 dataSource :" + scene.getDataSource());
|
|
|
+ log.info("激光相机 dataSource :" + sceneProExt.getDataSource());
|
|
|
|
|
|
}else if(cameraType.longValue() >= 3){
|
|
|
sceneProExt.setDataSource(ConstantFilePath.BUILD_MODEL_PATH +
|
|
@@ -1368,12 +1395,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
scenePro.setThumb(ConstantUrl.DEFAULT_SCENE_PIC);
|
|
|
}
|
|
|
scenePro.setThumb(scenePro.getThumb().concat("?t=")+System.currentTimeMillis());
|
|
|
- String parametr = ComputerUtil.getMQMsg(projectNum, cameraName, unicode, cameraType, fileId, prefix, imgsName, isModel,
|
|
|
+// String parametr = ComputerUtil.getMQMsg(projectNum, cameraName, unicode, cameraType, fileId, prefix, imgsName, isModel,
|
|
|
+// userName, algorithm, resolution, buildType, path);
|
|
|
+ BuildSceneMqMessage buildSceneMqMessage = ComputerUtil.getBuildSceneMqMessage(projectNum, cameraName, unicode, cameraType, fileId, prefix, imgsName, isModel,
|
|
|
userName, algorithm, resolution, buildType, path);
|
|
|
+
|
|
|
+
|
|
|
if(!ObjectUtils.isEmpty(userName)){
|
|
|
scenePro.setUserId(userId);
|
|
|
}
|
|
|
- sceneProPO.setMqMsg(parametr);
|
|
|
+ sceneProPO.setMqMsg(buildSceneMqMessage);
|
|
|
|
|
|
if(sceneShootCount == null)
|
|
|
{
|
|
@@ -1528,7 +1559,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
sceneProEditExt.setCreateTime(oldSceneProEdit.getCreateTime());
|
|
|
sceneProEditExt.setImagesVersion(oldSceneProEditeExt.getImagesVersion() + 1);
|
|
|
sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
- sceneProEditExtService.updateById(sceneProEdit);
|
|
|
+ sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
|
|
|
}
|
|
|
|