|
@@ -282,13 +282,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
Long accumulateSpace = 0L;
|
|
Long accumulateSpace = 0L;
|
|
if(payStatus == 1){
|
|
if(payStatus == 1){
|
|
beyondSpace = totalSpace - cameraDetail.getTotalSpace();
|
|
beyondSpace = totalSpace - cameraDetail.getTotalSpace();
|
|
- Long doSpace = getScenePlusLockedIds(lockedIds, plusList, beyondSpace, accumulateSpace);
|
|
|
|
- beyondSpace -= doSpace;
|
|
|
|
|
|
+ getScenePlusLockedIds(lockedIds, plusList, beyondSpace, accumulateSpace);
|
|
getSceneLockedIds(lockedIds,list,beyondSpace,accumulateSpace);
|
|
getSceneLockedIds(lockedIds,list,beyondSpace,accumulateSpace);
|
|
}else {
|
|
}else {
|
|
- beyondSpace = Math.abs(cameraDetail.getUsedSpace() - totalSpace);
|
|
|
|
- Long doSpace = getSceneLockedIds(lockedIds, list, beyondSpace, accumulateSpace);
|
|
|
|
- beyondSpace -= doSpace;
|
|
|
|
|
|
+ beyondSpace = cameraDetail.getUsedSpace() - totalSpace;
|
|
|
|
+ getSceneLockedIds(lockedIds, list, beyondSpace, accumulateSpace);
|
|
getScenePlusLockedIds(lockedIds,plusList,beyondSpace,accumulateSpace);
|
|
getScenePlusLockedIds(lockedIds,plusList,beyondSpace,accumulateSpace);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -297,19 +295,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- private Long getSceneLockedIds(List<Long> lockedIds ,List<ScenePro> list,Long beyondSpace,Long accumulateSpace){
|
|
|
|
|
|
+ private void 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 (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
- return accumulateSpace - scenePro.getSpace();
|
|
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
lockedIds.add(scenePro.getId());
|
|
lockedIds.add(scenePro.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return accumulateSpace;
|
|
|
|
}
|
|
}
|
|
- private Long getScenePlusLockedIds(List<Long> lockedIds , List<ScenePlus> list, Long beyondSpace, Long accumulateSpace){
|
|
|
|
|
|
+ private void 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);
|
|
@@ -317,12 +314,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
ScenePlusExt scenePlusExt = byPlusIds.get(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = byPlusIds.get(scenePlus.getId());
|
|
accumulateSpace += scenePlusExt.getSpace();
|
|
accumulateSpace += scenePlusExt.getSpace();
|
|
if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
- return accumulateSpace - scenePlusExt.getSpace();
|
|
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
lockedIds.add(scenePlus.getId());
|
|
lockedIds.add(scenePlus.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return accumulateSpace;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|