|
@@ -278,18 +278,23 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
List<Long> lockedIds = new ArrayList<>();
|
|
|
Long beyondSpace = 0L;
|
|
|
Long accumulateSpace = 0L;
|
|
|
+ Long cameraDetailSpace = 0L;
|
|
|
if(payStatus == 1){ //解封
|
|
|
beyondSpace = totalSpace - usedSpace;
|
|
|
- getSceneLockedIds(lockedIds,sceneVos,beyondSpace,accumulateSpace);
|
|
|
+ Long space = getSceneLockedIds(lockedIds, sceneVos, beyondSpace, accumulateSpace);
|
|
|
+ cameraDetailSpace = usedSpace + space;
|
|
|
}else {
|
|
|
beyondSpace = usedSpace - totalSpace;
|
|
|
Collections.reverse(sceneVos);
|
|
|
- getSceneLockedIds(lockedIds,sceneVos, beyondSpace, accumulateSpace);
|
|
|
+ Long space = getSceneLockedIds(lockedIds,sceneVos, beyondSpace, accumulateSpace);
|
|
|
+ cameraDetailSpace = usedSpace -space;
|
|
|
}
|
|
|
+ cameraDetailService.updateSpaceByCameraId(cameraId,cameraDetailSpace);
|
|
|
lockOrUnLockScenes(lockedIds,payStatus);
|
|
|
}
|
|
|
|
|
|
- private void getSceneLockedIds(List<Long> lockedIds ,List<SimpleSceneVo> list,Long beyondSpace,Long accumulateSpace){
|
|
|
+ private Long getSceneLockedIds(List<Long> lockedIds ,List<SimpleSceneVo> list,Long beyondSpace,Long accumulateSpace){
|
|
|
+ Long space = 0L;
|
|
|
if (list != null && list.size() > 0){
|
|
|
for (SimpleSceneVo scenePro : list){
|
|
|
if(scenePro.getSpace() > beyondSpace){
|
|
@@ -299,9 +304,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if (accumulateSpace > beyondSpace){
|
|
|
break;
|
|
|
}
|
|
|
+ space += scenePro.getSpace();
|
|
|
lockedIds.add(scenePro.getId());
|
|
|
}
|
|
|
}
|
|
|
+ return space;
|
|
|
}
|
|
|
|
|
|
|