|
@@ -295,7 +295,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
private void lockOrUnLockScenes(List<SimpleSceneVo> sceneVos, Integer payStatus,CameraType cameraType){
|
|
private void lockOrUnLockScenes(List<SimpleSceneVo> sceneVos, Integer payStatus,CameraType cameraType){
|
|
List<String> v3NumList = sceneVos.stream().filter(e ->"v3".equals(e.getVersion())).map(SimpleSceneVo::getNum).collect(Collectors.toList());
|
|
List<String> v3NumList = sceneVos.stream().filter(e ->"v3".equals(e.getVersion())).map(SimpleSceneVo::getNum).collect(Collectors.toList());
|
|
List<String> v4NumList = sceneVos.stream().filter(e ->"v4".equals(e.getVersion())).map(SimpleSceneVo::getNum).collect(Collectors.toList());
|
|
List<String> v4NumList = sceneVos.stream().filter(e ->"v4".equals(e.getVersion())).map(SimpleSceneVo::getNum).collect(Collectors.toList());
|
|
- lockOrUnLockScenes(v3NumList,v4NumList,payStatus,cameraType.getIsLaser());
|
|
|
|
|
|
+ List<String> panoNumList = sceneVos.stream().filter(e ->"v4".equals(e.getVersion()) && e.getLocation() != null && e.getLocation() == 7).map(SimpleSceneVo::getNum).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ lockOrUnLockScenes(v3NumList,v4NumList,payStatus,cameraType.getIsLaser(),panoNumList);
|
|
}
|
|
}
|
|
|
|
|
|
private Long getSceneUnLockedIds(List<SimpleSceneVo> lockedIds ,List<SimpleSceneVo> list,Long beyondSpace,String unit){
|
|
private Long getSceneUnLockedIds(List<SimpleSceneVo> lockedIds ,List<SimpleSceneVo> list,Long beyondSpace,String unit){
|
|
@@ -337,7 +339,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
// payStatus 为 -2 封存,为 1 解封
|
|
// payStatus 为 -2 封存,为 1 解封
|
|
@Override
|
|
@Override
|
|
- public void lockOrUnLockScenes( List<String> v3NumList,List<String> v4NumList,Integer payStatus,Integer isLaser) {
|
|
|
|
|
|
+ public void lockOrUnLockScenes( List<String> v3NumList,List<String> v4NumList,Integer payStatus,Integer isLaser,List<String> panoNumList) {
|
|
|
|
|
|
if(!v3NumList.isEmpty()){
|
|
if(!v3NumList.isEmpty()){
|
|
LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
|
|
@@ -355,16 +357,19 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
this.updateOssStatus(v3NumList,v4NumList,payStatus);
|
|
this.updateOssStatus(v3NumList,v4NumList,payStatus);
|
|
|
|
|
|
|
|
+ List<String> numList = new ArrayList<>();
|
|
|
|
+ numList.addAll(v3NumList);
|
|
|
|
+ numList.addAll(v4NumList);
|
|
if(isLaser == 1){
|
|
if(isLaser == 1){
|
|
//激光系统相机
|
|
//激光系统相机
|
|
//1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4重算中'
|
|
//1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4重算中'
|
|
- List<String> numList = new ArrayList<>();
|
|
|
|
- numList.addAll(v3NumList);
|
|
|
|
- numList.addAll(v4NumList);
|
|
|
|
if(!numList.isEmpty()){
|
|
if(!numList.isEmpty()){
|
|
laserService.updateStatus(numList,payStatus);
|
|
laserService.updateStatus(numList,payStatus);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(panoNumList != null && !panoNumList.isEmpty()){
|
|
|
|
+ laserService.updatePanoStatus(numList,payStatus);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -372,18 +377,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
*/
|
|
*/
|
|
private void updateOssStatus(List<String> v3NumList ,List<String> v4NumList , Integer payStatus) {
|
|
private void updateOssStatus(List<String> v3NumList ,List<String> v4NumList , Integer payStatus) {
|
|
if(!v3NumList.isEmpty()){
|
|
if(!v3NumList.isEmpty()){
|
|
- v3NumList.forEach(e ->this.updateOssStatus(String.format(OssPath.v3_statusPath,e),payStatus));
|
|
|
|
|
|
+ v3NumList.forEach(e ->this.updateOssStatus(String.format(OssPath.v3_statusPath,e),payStatus,e));
|
|
}
|
|
}
|
|
if(!v4NumList.isEmpty()){
|
|
if(!v4NumList.isEmpty()){
|
|
- v4NumList.forEach(e ->this.updateOssStatus(String.format(OssPath.v4_statusPath,e),payStatus));
|
|
|
|
|
|
+ v4NumList.forEach(e ->this.updateOssStatus(String.format(OssPath.v4_statusPath,e),payStatus,e));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 从oss中获取文件,并重写,上传替换
|
|
* 从oss中获取文件,并重写,上传替换
|
|
*/
|
|
*/
|
|
- @Override
|
|
|
|
- public void updateOssStatus(String path,Integer payStatus) {
|
|
|
|
|
|
+ public void updateOssStatus(String path,Integer payStatus,String num) {
|
|
|
|
+ String localStatusPath = String.format(OssPath.localStatusPath,num);
|
|
try {
|
|
try {
|
|
if(!fYunFileService.fileExist(path)){
|
|
if(!fYunFileService.fileExist(path)){
|
|
return;
|
|
return;
|
|
@@ -395,13 +400,15 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
jsonObject.put("payStatus",payStatus);
|
|
jsonObject.put("payStatus",payStatus);
|
|
String json = JSONUtil.toJsonStr(jsonObject);
|
|
String json = JSONUtil.toJsonStr(jsonObject);
|
|
- FileUtils.writeFile(OssPath.localStatusPath ,json);
|
|
|
|
- log.info("updateOssStatus--localPath:{},ossPath:{},payStatus:{}",OssPath.localStatusPath,path,payStatus);
|
|
|
|
- fYunFileService.uploadFile(OssPath.localStatusPath,path);
|
|
|
|
|
|
+ FileUtils.writeFile(localStatusPath ,json);
|
|
|
|
+ log.info("updateOssStatus--localPath:{},ossPath:{},payStatus:{}",localStatusPath,path,payStatus);
|
|
|
|
+ fYunFileService.uploadFile(localStatusPath,path);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ log.info("updateOssStatus--localPath:{},ossPath:{},payStatus:{}",localStatusPath,path,payStatus,e);
|
|
}finally {
|
|
}finally {
|
|
- FileUtil.del(OssPath.localStatusPath);
|
|
|
|
|
|
+ if(new File(localStatusPath).getParentFile().exists()){
|
|
|
|
+ FileUtil.del( new File(localStatusPath).getParentFile());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -859,7 +866,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
sceneCopyLogService.saveByNum(oldNum,newNum,scenePro.getUserId());
|
|
sceneCopyLogService.saveByNum(oldNum,newNum,scenePro.getUserId());
|
|
Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail.getCameraId(),cameraType);
|
|
Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail.getCameraId(),cameraType);
|
|
if(!checkSpace){
|
|
if(!checkSpace){
|
|
- this.lockOrUnLockScenes(Arrays.asList(scenePro.getNum()),new ArrayList<>(),-2,cameraType.getIsLaser());
|
|
|
|
|
|
+ this.lockOrUnLockScenes(Arrays.asList(scenePro.getNum()),new ArrayList<>(),-2,cameraType.getIsLaser(),null);
|
|
}
|
|
}
|
|
cameraDetailService.addUsedSpace(cameraDetail,scenePro.getSpace());
|
|
cameraDetailService.addUsedSpace(cameraDetail,scenePro.getSpace());
|
|
|
|
|
|
@@ -1140,6 +1147,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
sceneVo.setCreateTime(DateUserUtil.getDate(time).getTime());
|
|
sceneVo.setCreateTime(DateUserUtil.getDate(time).getTime());
|
|
sceneVo.setSpace(ext.getSpace());
|
|
sceneVo.setSpace(ext.getSpace());
|
|
sceneVo.setVersion("v4");
|
|
sceneVo.setVersion("v4");
|
|
|
|
+ sceneVo.setLocation(ext.getLocation());
|
|
|
|
+
|
|
voList.add(sceneVo);
|
|
voList.add(sceneVo);
|
|
}
|
|
}
|
|
return voList;
|
|
return voList;
|