|
@@ -442,7 +442,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(cameraDetail.getType() == 10){ //深时场景
|
|
|
laserService.move(param.getNum(),oldCamera.getSnCode(),camera.getSnCode(),cameraDetail.getUserId());
|
|
|
}
|
|
|
- updateFdageNewDataSource(oldCamera.getSnCode(),param.getSnCode(),dataSource);
|
|
|
+ updateFdageNewDataSource(scenePro,scenePlus,oldCamera.getSnCode(),param.getSnCode(),dataSource);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -466,7 +466,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
/**
|
|
|
* 兼容,之前迁移,不使用旧snCode 替换新snCode。重写文件
|
|
|
*/
|
|
|
- public void updateFdageNewDataSource(String oldSnCode,String newSnCode,String dataSource) {
|
|
|
+ public void updateFdageNewDataSource(ScenePro scenePro,ScenePlus scenePlus,String oldSnCode,String newSnCode,String dataSource) {
|
|
|
String localPathFdage = null;
|
|
|
try {
|
|
|
newSnCode = newSnCode.toLowerCase();
|
|
@@ -491,7 +491,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
log.info("updateFdage--localPathFdage:{},newFdagePath:{}",localPathFdage,newFdagePath);
|
|
|
String newDataSource = newFdagePath.replace("home","/mnt/data");
|
|
|
- this.updateDataSource(dataSource,newDataSource);
|
|
|
+ this.updateDataSource(scenePro,scenePlus,newDataSource);
|
|
|
}catch (Exception e){
|
|
|
log.error("updateFdage-error:oldSnCode:{},newSnCode:{},dataSource:{}",oldSnCode,newSnCode,dataSource);
|
|
|
log.error("updateFdage-error:",e);
|
|
@@ -504,17 +504,22 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void updateDataSource(String dataSource, String newDataSource) {
|
|
|
- LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
|
- wrapper.eq(ScenePro::getDataSource,dataSource);
|
|
|
- wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
|
- wrapper.set(ScenePro::getDataSource,newDataSource);
|
|
|
- this.update(wrapper);
|
|
|
+ private void updateDataSource(ScenePro scenePro,ScenePlus scenePlus, String newDataSource) {
|
|
|
+ if(scenePro !=null){
|
|
|
+ LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(ScenePro::getId,scenePro.getId());
|
|
|
+ wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
|
+ wrapper.set(ScenePro::getDataSource,newDataSource);
|
|
|
+ this.update(wrapper);
|
|
|
+ }
|
|
|
+ if(scenePlus !=null){
|
|
|
+ LambdaUpdateWrapper<ScenePlusExt> wrapperPlus = new LambdaUpdateWrapper<>();
|
|
|
+ wrapperPlus.eq(ScenePlusExt::getPlusId,scenePlus.getId());
|
|
|
+ wrapperPlus.set(ScenePlusExt::getDataSource,newDataSource);
|
|
|
+ scenePlusExtService.update(wrapperPlus);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- LambdaUpdateWrapper<ScenePlusExt> wrapperPlus = new LambdaUpdateWrapper<>();
|
|
|
- wrapperPlus.eq(ScenePlusExt::getDataSource,dataSource);
|
|
|
- wrapperPlus.set(ScenePlusExt::getDataSource,newDataSource);
|
|
|
- scenePlusExtService.update(wrapperPlus);
|
|
|
}
|
|
|
|
|
|
@Override
|