|
@@ -249,7 +249,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
wrapper.eq(ScenePro::getPayStatus,-2);
|
|
wrapper.eq(ScenePro::getPayStatus,-2);
|
|
plusWr.eq(ScenePlus::getPayStatus,-2);
|
|
plusWr.eq(ScenePlus::getPayStatus,-2);
|
|
}else {
|
|
}else {
|
|
- if (totalSpace >= cameraDetail.getUsedSpace()) {
|
|
|
|
|
|
+ if (totalSpace == -1 || totalSpace >= cameraDetail.getUsedSpace()) {
|
|
// 总容量大于已使用容量,不予封存
|
|
// 总容量大于已使用容量,不予封存
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -268,16 +268,20 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
List<ScenePlus> plusList = scenePlusService.list(plusWr);
|
|
List<ScenePlus> plusList = scenePlusService.list(plusWr);
|
|
|
|
|
|
Long beyondSpace = Math.abs(cameraDetail.getUsedSpace() - totalSpace);
|
|
Long beyondSpace = Math.abs(cameraDetail.getUsedSpace() - totalSpace);
|
|
|
|
+ if(totalSpace == -1){
|
|
|
|
+ beyondSpace = Long.MAX_VALUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
Long accumulateSpace = 0L;
|
|
Long accumulateSpace = 0L;
|
|
List<Long> lockedIds = new ArrayList<>();
|
|
List<Long> lockedIds = new ArrayList<>();
|
|
if(payStatus == 1){
|
|
if(payStatus == 1){
|
|
- Long doSpace = getScenePlusLockedIds(lockedIds, plusList, totalSpace, beyondSpace, accumulateSpace);
|
|
|
|
|
|
+ Long doSpace = getScenePlusLockedIds(lockedIds, plusList, beyondSpace, accumulateSpace);
|
|
beyondSpace -= doSpace;
|
|
beyondSpace -= doSpace;
|
|
- getSceneLockedIds(lockedIds,list,totalSpace,beyondSpace,accumulateSpace);
|
|
|
|
|
|
+ getSceneLockedIds(lockedIds,list,beyondSpace,accumulateSpace);
|
|
}else {
|
|
}else {
|
|
- Long doSpace = getSceneLockedIds(lockedIds, list, totalSpace, beyondSpace, accumulateSpace);
|
|
|
|
|
|
+ Long doSpace = getSceneLockedIds(lockedIds, list, beyondSpace, accumulateSpace);
|
|
beyondSpace -= doSpace;
|
|
beyondSpace -= doSpace;
|
|
- getScenePlusLockedIds(lockedIds,plusList,totalSpace,beyondSpace,accumulateSpace);
|
|
|
|
|
|
+ getScenePlusLockedIds(lockedIds,plusList,beyondSpace,accumulateSpace);
|
|
}
|
|
}
|
|
|
|
|
|
lockOrUnLockScenes(lockedIds,payStatus);
|
|
lockOrUnLockScenes(lockedIds,payStatus);
|
|
@@ -285,11 +289,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- private Long getSceneLockedIds(List<Long> lockedIds ,List<ScenePro> list,Long count,Long beyondSpace,Long accumulateSpace){
|
|
|
|
|
|
+ private Long getSceneLockedIds(List<Long> lockedIds ,List<ScenePro> list,Long beyondSpace,Long accumulateSpace){
|
|
if (list != null && list.size() > 0){
|
|
if (list != null && list.size() > 0){
|
|
for (ScenePro scenePro : list){
|
|
for (ScenePro scenePro : list){
|
|
accumulateSpace += scenePro.getSpace();
|
|
accumulateSpace += scenePro.getSpace();
|
|
- if (count ==-1 && accumulateSpace.compareTo(beyondSpace) > 0){
|
|
|
|
|
|
+ if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
return accumulateSpace - scenePro.getSpace();
|
|
return accumulateSpace - scenePro.getSpace();
|
|
}
|
|
}
|
|
lockedIds.add(scenePro.getId());
|
|
lockedIds.add(scenePro.getId());
|
|
@@ -297,14 +301,14 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
}
|
|
}
|
|
return accumulateSpace;
|
|
return accumulateSpace;
|
|
}
|
|
}
|
|
- private Long getScenePlusLockedIds(List<Long> lockedIds , List<ScenePlus> list, Long count, Long beyondSpace, Long accumulateSpace){
|
|
|
|
|
|
+ private Long getScenePlusLockedIds(List<Long> lockedIds , List<ScenePlus> list, Long beyondSpace, Long accumulateSpace){
|
|
if (list != null && list.size() > 0){
|
|
if (list != null && list.size() > 0){
|
|
List<Long> plusIds = list.parallelStream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
List<Long> plusIds = list.parallelStream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
HashMap<Long, ScenePlusExt> byPlusIds = scenePlusExtService.getByPlusIds(plusIds);
|
|
HashMap<Long, ScenePlusExt> byPlusIds = scenePlusExtService.getByPlusIds(plusIds);
|
|
for (ScenePlus scenePlus : list){
|
|
for (ScenePlus scenePlus : list){
|
|
ScenePlusExt scenePlusExt = byPlusIds.get(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = byPlusIds.get(scenePlus.getId());
|
|
accumulateSpace += scenePlusExt.getSpace();
|
|
accumulateSpace += scenePlusExt.getSpace();
|
|
- if (count ==-1 && accumulateSpace.compareTo(beyondSpace) > 0){
|
|
|
|
|
|
+ if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
return accumulateSpace - scenePlusExt.getSpace();
|
|
return accumulateSpace - scenePlusExt.getSpace();
|
|
}
|
|
}
|
|
lockedIds.add(scenePlus.getId());
|
|
lockedIds.add(scenePlus.getId());
|