|
@@ -236,7 +236,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
if(incrementType.getCameraCapacity() == -1){
|
|
if(incrementType.getCameraCapacity() == -1){
|
|
totalSpace = -1L;
|
|
totalSpace = -1L;
|
|
}else {
|
|
}else {
|
|
- totalSpace = incrementType.getCameraCapacity() * 1024 * 1024L;
|
|
|
|
|
|
+ totalSpace = incrementType.getCameraCapacity() * 1024* 1024 * 1024L;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -361,7 +361,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
/**
|
|
/**
|
|
* 从oss中获取文件,并重写,上传替换
|
|
* 从oss中获取文件,并重写,上传替换
|
|
*/
|
|
*/
|
|
- private void updateOssStatus(String path,Integer payStatus) {
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void updateOssStatus(String path,Integer payStatus) {
|
|
try {
|
|
try {
|
|
if(!fYunFileService.fileExist(path)){
|
|
if(!fYunFileService.fileExist(path)){
|
|
return;
|
|
return;
|
|
@@ -657,6 +658,27 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
if(detailEntity == null){
|
|
if(detailEntity == null){
|
|
throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
}
|
|
}
|
|
|
|
+ UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
|
+ if(userIncrement == null){
|
|
|
|
+ throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
|
+ }
|
|
|
|
+ IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
|
+ if(incrementType == null){
|
|
|
|
+ throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
|
+ }
|
|
|
|
+ if(incrementType.getCameraCapacity() != -1){
|
|
|
|
+ Long usedSpace = detailEntity.getUsedSpace();
|
|
|
|
+ if( scenePro != null && scenePro.getSpace() + usedSpace > incrementType.getCameraCapacity() * 1024 * 1024 * 1024L){
|
|
|
|
+ scenePro.setPayStatus(-2);
|
|
|
|
+ }
|
|
|
|
+ if( scenePlus != null ){
|
|
|
|
+ ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
|
+ if(ext.getSpace() + usedSpace > incrementType.getCameraCapacity() * 1024 * 1024 * 1024L){
|
|
|
|
+ scenePlus.setPayStatus(-2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
String newNum = scene3dNumService.generateSceneNum(detailEntity.getType());
|
|
String newNum = scene3dNumService.generateSceneNum(detailEntity.getType());
|
|
String title = scenePro == null ? scenePlus.getTitle() : scenePro.getSceneName();
|
|
String title = scenePro == null ? scenePlus.getTitle() : scenePro.getSceneName();
|
|
String newTitle = title.concat("(copy)");
|
|
String newTitle = title.concat("(copy)");
|
|
@@ -785,6 +807,12 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
FileUtils.copyDirectiory(ConstantFilePath.SCENE_PATH +"video/video" + oldNum,ConstantFilePath.SCENE_PATH +"video/video" + newNum);
|
|
FileUtils.copyDirectiory(ConstantFilePath.SCENE_PATH +"video/video" + oldNum,ConstantFilePath.SCENE_PATH +"video/video" + newNum);
|
|
oldScene.setStatus(-2);
|
|
oldScene.setStatus(-2);
|
|
this.updateById(oldScene);
|
|
this.updateById(oldScene);
|
|
|
|
+
|
|
|
|
+ cameraDetail.setUsedSpace(cameraDetail.getUsedSpace() + oldScene.getSpace());
|
|
|
|
+ cameraDetailService.updateById(cameraDetail);
|
|
|
|
+ if(oldScene.getPayStatus() == -2){
|
|
|
|
+ this.updateOssStatus(String.format(OssPath.v3_statusPath,oldScene.getNum()),-2);
|
|
|
|
+ }
|
|
log.info("复制场景结束-{}", new Date());
|
|
log.info("复制场景结束-{}", new Date());
|
|
if(oldScene.getSceneSource() == 4){ //深时复制
|
|
if(oldScene.getSceneSource() == 4){ //深时复制
|
|
String laserPath = laserService.copyDataSource(preDataSource,oldScene.getDataSource());
|
|
String laserPath = laserService.copyDataSource(preDataSource,oldScene.getDataSource());
|