|
@@ -31,6 +31,7 @@ import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
|
+import com.fdkankan.model.utils.SceneUtil;
|
|
import com.fdkankan.push.config.PushMessageConfig;
|
|
import com.fdkankan.push.config.PushMessageConfig;
|
|
import com.fdkankan.push.utils.PushMsgUtil;
|
|
import com.fdkankan.push.utils.PushMsgUtil;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
@@ -87,6 +88,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
@Value("#{'${build.scene.post.not-delete-nas-nums:}'.split(',')}")
|
|
@Value("#{'${build.scene.post.not-delete-nas-nums:}'.split(',')}")
|
|
private List<String> notDeleteNasNumList;
|
|
private List<String> notDeleteNasNumList;
|
|
|
|
|
|
|
|
+ @Value("4dkk.laserService.bucket")
|
|
|
|
+ private String laserBucket;
|
|
|
|
+
|
|
|
|
+ @Value("${4dkk.laserService.dir}")
|
|
|
|
+ private String laserDir;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer mqProducer;
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
|
@@ -321,14 +328,19 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
if (cameraType == 14) {
|
|
if (cameraType == 14) {
|
|
//计算成功 激光转台相机 同步 请求
|
|
//计算成功 激光转台相机 同步 请求
|
|
- fdkkLaserService.syncBuildResult(scenePlus.getNum(), path, scenePlus.getCreateTime(), Calendar.getInstance().getTime());
|
|
|
|
|
|
+ fdkkLaserService.syncBuildResult(scenePlus.getNum(), path, scenePlus.getCreateTime(), Calendar.getInstance().getTime(), scenePlusExt.getShootCount());
|
|
sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap,0)
|
|
sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap,0)
|
|
.eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
|
|
.eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
|
|
sceneEditControls.setShowMap(0);
|
|
sceneEditControls.setShowMap(0);
|
|
|
|
+ scenePlusExt.setSpace(scenePlusExt.getSpace() + fYunFileService.getSpace(laserBucket, String.format(laserDir, sceneCode)));
|
|
} else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
|
|
} else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
|
|
fdkkLaserService.cloudPointBuild(sceneCode,path);
|
|
fdkkLaserService.cloudPointBuild(sceneCode,path);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //统计原始资源大小
|
|
|
|
+ scenePlusExt.setOrigSpace(FileUtil.size(new File(path.concat(File.separator).concat("capture"))));
|
|
|
|
+
|
|
|
|
+
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
|
|
Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
|
|
@@ -360,6 +372,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
this.uploadStatusJson(scenePlus, scenePlusExt);
|
|
this.uploadStatusJson(scenePlus, scenePlusExt);
|
|
|
|
|
|
scenePlusService.updateById(scenePlus);
|
|
scenePlusService.updateById(scenePlus);
|
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
|
|
|
//国际环境需要发邮件通知
|
|
//国际环境需要发邮件通知
|
|
if("eur".equals(env)){
|
|
if("eur".equals(env)){
|
|
@@ -873,14 +886,51 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
scenePlusExt.setSceneKind(sceneKind);
|
|
scenePlusExt.setSceneKind(sceneKind);
|
|
// scenePlusExt.setModelKind(modelKind);
|
|
// scenePlusExt.setModelKind(modelKind);
|
|
|
|
|
|
- String dataFdage = FileUtil.readUtf8String(scenePlusExt.getDataSource().concat("/capture/").concat("data.fdage"));
|
|
|
|
- JSONObject jsonObject = JSON.parseObject(dataFdage);
|
|
|
|
- int points = jsonObject.getJSONArray("points").size();
|
|
|
|
- scenePlusExt.setShootCount(points);
|
|
|
|
|
|
+ //统计点位数量
|
|
|
|
+ scenePlusExt.setShootCount(this.getShootCount(scenePlusExt));
|
|
|
|
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private Integer getShootCount(ScenePlusExt scenePlusExt){
|
|
|
|
+ String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
|
|
|
|
+ if(scenePlusExt.getLocation() == 5 || scenePlusExt.getLocation() == 6){
|
|
|
|
+ String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
|
|
|
|
+ JSONObject slamDataObj = JSON.parseObject(slamDataStr);
|
|
|
|
+ JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
|
|
|
|
+ if(CollUtil.isEmpty(viewsInfo)){
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ return viewsInfo.stream().mapToInt(info -> {
|
|
|
|
+ return ((JSONArray) info).size();
|
|
|
|
+ }).sum();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
|
|
|
|
+ return dataFdageObj.getJSONArray("points").size();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private int getPayStatus(Long cameraId, Long space){
|
|
|
|
+ //更新相机使用用量
|
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.updateCameraDetailByCameraIdAndSpace(cameraId, space);
|
|
|
|
+ Long totalSpace = cameraDetail.getTotalSpace();
|
|
|
|
+
|
|
|
|
+ UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
|
+ if(!ObjectUtils.isEmpty(userIncrement) && userIncrement.getIsExpired().equals(ExpiredStatus.NOT_EXPIRED.code())){
|
|
|
|
+ IncrementType type = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
|
+ if(type != null){
|
|
|
|
+ Integer cameraCapacity = type.getCameraCapacity();
|
|
|
|
+ if(cameraCapacity == -1){ //无限容量权益
|
|
|
|
+ return PayStatus.PAY.code();
|
|
|
|
+ }else {
|
|
|
|
+ totalSpace = cameraCapacity *1024 * 1024 * 1024L; //权益设置容量
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return totalSpace.compareTo(cameraDetail.getUsedSpace()) == -1 ? PayStatus.NO_CAPACITY.code() : PayStatus.PAY.code();
|
|
|
|
+ }
|
|
|
|
+
|
|
private Object[] updateEditInfo(ScenePlus scenePlus){
|
|
private Object[] updateEditInfo(ScenePlus scenePlus){
|
|
SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
|
|
SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
|
|
SceneEditControls sceneEditControls = null;
|
|
SceneEditControls sceneEditControls = null;
|