|
@@ -17,6 +17,7 @@ import com.fdkankan.manage.httpClient.service.LaserService;
|
|
|
import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.mapper.ISceneProMapper;
|
|
|
import com.fdkankan.manage.service.*;
|
|
|
+import com.fdkankan.manage.util.Dateutils;
|
|
|
import com.fdkankan.manage.util.SceneStatusUtil;
|
|
|
import com.fdkankan.manage.vo.request.SceneParam;
|
|
|
import com.fdkankan.manage.vo.response.CameraDataVo;
|
|
@@ -359,9 +360,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
Long sceneCameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
Long space = scenePro == null ? 0 :scenePro.getSpace();
|
|
|
+ String dataSource = scenePro == null ? null :scenePro.getDataSource();
|
|
|
if(scenePlus !=null){
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
space = scenePlusExt.getSpace();
|
|
|
+ dataSource = scenePlusExt.getDataSource();
|
|
|
}
|
|
|
space = space == null ? 0 :space;
|
|
|
Long newUseSpace = space + cameraDetail.getUsedSpace();
|
|
@@ -437,7 +440,17 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(cameraDetail.getType() == 10){ //深时场景
|
|
|
laserService.move(param.getNum(),oldCamera.getSnCode(),camera.getSnCode(),cameraDetail.getUserId());
|
|
|
}
|
|
|
+ updateFdage(oldCamera.getSnCode(),param.getSnCode(),dataSource);
|
|
|
+ }
|
|
|
|
|
|
+ private void updateFdage(String oldSnCode,String newSnCode,String dataSource) {
|
|
|
+ String fdagePaht = dataSource.replace("/mnt/data","home") +"/data.fdage";
|
|
|
+ String fileContent = fYunFileServiceInterface.getFileContent(fdagePaht);
|
|
|
+ String newJson = fileContent.replaceAll(oldSnCode,newSnCode);
|
|
|
+ FileUtils.writeFile(OssPath.localFdagePath ,newJson);
|
|
|
+ log.info("updateFdage--localPath:{},ossPath:{}",OssPath.localFdagePath,fdagePaht);
|
|
|
+ fYunFileServiceInterface.copyFileInBucket(fdagePaht, Dateutils.getDate(new Date()) +fdagePaht+".back");
|
|
|
+ fYunFileServiceInterface.uploadFile(OssPath.localFdagePath,fdagePaht);
|
|
|
}
|
|
|
|
|
|
@Override
|