|
@@ -64,7 +64,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
IIncrementTypeService incrementTypeService;
|
|
IIncrementTypeService incrementTypeService;
|
|
@Autowired
|
|
@Autowired
|
|
ISceneProEditService sceneProEditService;
|
|
ISceneProEditService sceneProEditService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
FYunFileServiceInterface fYunFileServiceInterface;
|
|
FYunFileServiceInterface fYunFileServiceInterface;
|
|
@Autowired
|
|
@Autowired
|
|
IScenePlusService scenePlusService;
|
|
IScenePlusService scenePlusService;
|
|
@@ -76,8 +76,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
IScenePlusExtService scenePlusExtService;
|
|
IScenePlusExtService scenePlusExtService;
|
|
@Autowired
|
|
@Autowired
|
|
LaserService laserService;
|
|
LaserService laserService;
|
|
- @Resource
|
|
|
|
|
|
+ @Autowired
|
|
FdKKClient fdKKClient;
|
|
FdKKClient fdKKClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ IFolderSceneService folderSceneService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -93,9 +95,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList) {
|
|
|
|
|
|
+ public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList,Integer isObj) {
|
|
HashMap<Long,Long> map = new HashMap<>();
|
|
HashMap<Long,Long> map = new HashMap<>();
|
|
- List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList);
|
|
|
|
|
|
+ List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList,isObj);
|
|
result.forEach(entity ->map.put(entity.getId(),entity.getCount()));
|
|
result.forEach(entity ->map.put(entity.getId(),entity.getCount()));
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
@@ -329,7 +331,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5037, SceneConstant.FAILURE_MSG_5037);
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5037, SceneConstant.FAILURE_MSG_5037);
|
|
}
|
|
}
|
|
|
|
|
|
- Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
|
|
|
+ Long sceneCameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
Long space = scenePro == null ? 0 :scenePro.getSpace();
|
|
Long space = scenePro == null ? 0 :scenePro.getSpace();
|
|
if(scenePlus !=null){
|
|
if(scenePlus !=null){
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
@@ -339,7 +341,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
Long newUseSpace = space + cameraDetail.getUsedSpace();
|
|
Long newUseSpace = space + cameraDetail.getUsedSpace();
|
|
|
|
|
|
Long totalSpace = cameraDetail.getTotalSpace();
|
|
Long totalSpace = cameraDetail.getTotalSpace();
|
|
- UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
|
|
|
+ UserIncrement userIncrement = userIncrementService.getByCameraId(camera.getId());
|
|
if(userIncrement!=null){
|
|
if(userIncrement!=null){
|
|
IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
if(incrementType!=null){
|
|
if(incrementType!=null){
|
|
@@ -355,7 +357,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
}
|
|
}
|
|
|
|
|
|
- Camera oldCamera = cameraService.getById(cameraId);
|
|
|
|
|
|
+ Camera oldCamera = cameraService.getById(sceneCameraId);
|
|
if(oldCamera == null){
|
|
if(oldCamera == null){
|
|
throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
}
|
|
}
|
|
@@ -363,6 +365,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
if(oldCameraDetail == null){
|
|
if(oldCameraDetail == null){
|
|
throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
}
|
|
}
|
|
|
|
+ if(oldCameraDetail.getCameraId().equals(cameraDetail.getCameraId())){
|
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_NOT_MOVE);
|
|
|
|
+ }
|
|
if(!oldCameraDetail.getType().equals(cameraDetail.getType())){
|
|
if(!oldCameraDetail.getType().equals(cameraDetail.getType())){
|
|
throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
|
|
throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
|
|
}
|
|
}
|
|
@@ -378,12 +383,16 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
cameraDetail.setUsedSpace(newUseSpace);
|
|
cameraDetail.setUsedSpace(newUseSpace);
|
|
cameraDetailService.updateById(cameraDetail);
|
|
cameraDetailService.updateById(cameraDetail);
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if(scenePro!=null){
|
|
if(scenePro!=null){
|
|
LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
wrapper.eq(ScenePro::getId,scenePro.getId());
|
|
wrapper.eq(ScenePro::getId,scenePro.getId());
|
|
wrapper.set(ScenePro::getCameraId,camera.getId());
|
|
wrapper.set(ScenePro::getCameraId,camera.getId());
|
|
wrapper.set(ScenePro::getUserId,cameraDetail.getUserId());
|
|
wrapper.set(ScenePro::getUserId,cameraDetail.getUserId());
|
|
this.update(wrapper);
|
|
this.update(wrapper);
|
|
|
|
+ //场景迁移到另外的相机清除本身在的文件夹
|
|
|
|
+ folderSceneService.delBySceneId(scenePro.getId());
|
|
}
|
|
}
|
|
if(scenePlus!=null){
|
|
if(scenePlus!=null){
|
|
LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
|
|
@@ -391,6 +400,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
wrapper.set(ScenePlus::getCameraId,camera.getId());
|
|
wrapper.set(ScenePlus::getCameraId,camera.getId());
|
|
wrapper.set(ScenePlus::getUserId,cameraDetail.getUserId());
|
|
wrapper.set(ScenePlus::getUserId,cameraDetail.getUserId());
|
|
scenePlusService.update(wrapper);
|
|
scenePlusService.update(wrapper);
|
|
|
|
+ folderSceneService.delBySceneId(scenePlus.getId());
|
|
}
|
|
}
|
|
if(cameraDetail.getType() == 10){ //深时场景
|
|
if(cameraDetail.getType() == 10){ //深时场景
|
|
laserService.move(param.getNum(),oldCamera.getSnCode(),camera.getSnCode());
|
|
laserService.move(param.getNum(),oldCamera.getSnCode(),camera.getSnCode());
|
|
@@ -437,8 +447,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
if(scenePlus!=null){
|
|
if(scenePlus!=null){
|
|
scenePlusService.removeById(scenePlus.getId());
|
|
scenePlusService.removeById(scenePlus.getId());
|
|
|
|
+ scenePlusExtService.delByPlus(scenePlus.getId());
|
|
|
|
+ }
|
|
|
|
+ if(num.contains("SS")){
|
|
|
|
+ laserService.delete(num);
|
|
}
|
|
}
|
|
- laserService.delete(num);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -472,11 +485,15 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.in(ScenePro::getSceneSource,asList);
|
|
wrapper.in(ScenePro::getSceneSource,asList);
|
|
wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
- wrapper.lt(ScenePro::getCreateTime,startTime);
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(startTime)){
|
|
|
|
+ wrapper.lt(ScenePro::getCreateTime,startTime);
|
|
|
|
+ }
|
|
wrapper.eq(ScenePro::getIsObj,1);
|
|
wrapper.eq(ScenePro::getIsObj,1);
|
|
LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
|
|
wrapper2.in(ScenePlus::getSceneSource,asList);
|
|
wrapper2.in(ScenePlus::getSceneSource,asList);
|
|
- wrapper2.lt(ScenePlus::getCreateTime,startTime);
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(startTime)){
|
|
|
|
+ wrapper2.lt(ScenePlus::getCreateTime,startTime);
|
|
|
|
+ }
|
|
List<ScenePlus> list = scenePlusService.list(wrapper2);
|
|
List<ScenePlus> list = scenePlusService.list(wrapper2);
|
|
List<Long> plusIds = list.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
List<Long> plusIds = list.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
long count = 0L;
|
|
long count = 0L;
|
|
@@ -489,4 +506,46 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
}
|
|
}
|
|
return this.count(wrapper) + count;
|
|
return this.count(wrapper) + count;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HashMap<String, String> getSnCodeByNumList(Set<String> numList) {
|
|
|
|
+ HashMap<String, Long> sceneMap = new HashMap<>();
|
|
|
|
+ HashMap<Long, String> cameraMap = new HashMap<>();
|
|
|
|
+ HashMap<String, String> snCodeMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
|
|
+ wrapper.in(ScenePro::getNum,numList);
|
|
|
|
+ List<ScenePro> list = this.list(wrapper);
|
|
|
|
+ if(list.size() >0){
|
|
|
|
+ list.forEach(entity -> sceneMap.put(entity.getNum(),entity.getCameraId()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper2.in(ScenePlus::getNum,numList);
|
|
|
|
+ List<ScenePlus> list2 = scenePlusService.list(wrapper2);
|
|
|
|
+ if(list2.size() >0){
|
|
|
|
+ list2.forEach(entity -> sceneMap.put(entity.getNum(),entity.getCameraId()));
|
|
|
|
+ }
|
|
|
|
+ if(sceneMap.size() <=0){
|
|
|
|
+ return snCodeMap;
|
|
|
|
+ }
|
|
|
|
+ Set<Long> cameraIds = list.stream().map(ScenePro::getCameraId).collect(Collectors.toSet());
|
|
|
|
+ Set<Long> cameraIds2 = list2.stream().map(ScenePlus::getCameraId).collect(Collectors.toSet());
|
|
|
|
+
|
|
|
|
+ cameraIds.addAll(cameraIds2);
|
|
|
|
+
|
|
|
|
+ if(cameraIds.size() >0){
|
|
|
|
+ List<Camera> cameraList = cameraService.listByIds(cameraIds);
|
|
|
|
+ cameraList.forEach(entity -> cameraMap.put(entity.getId(),entity.getSnCode()));
|
|
|
|
+ for (String num : numList) {
|
|
|
|
+ Long cameraId = sceneMap.get(num);
|
|
|
|
+ if(cameraId != null){
|
|
|
|
+ snCodeMap.put(num,cameraMap.get(cameraId));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return snCodeMap;
|
|
|
|
+ }
|
|
}
|
|
}
|