Browse Source

Merge branch 'test'

lyhzzz 2 years ago
parent
commit
5a4cb55e2d

+ 6 - 2
src/main/java/com/fdkankan/ucenter/service/impl/SceneProServiceImpl.java

@@ -244,6 +244,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         log.info("lockOrUnLockBySpace---cameraId:{},payStatus:{},totalSpace:{},useSpace{}",
                 cameraId,payStatus,totalSpace,cameraDetail.getUsedSpace());
         if(payStatus == 1){         //解封,判断用户权益,用户会员权益无限容量
+            if (totalSpace != -1 && totalSpace <= cameraDetail.getUsedSpace()) {
+                // 总容量小于已使用容量,不予解封
+                return;
+            }
             wrapper.orderByAsc(ScenePro::getCreateTime);
             plusWr.orderByAsc(ScenePlus::getCreateTime);
             wrapper.eq(ScenePro::getPayStatus,-2);
@@ -669,12 +673,12 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         if(incrementType.getCameraCapacity() != -1){
             Long usedSpace = detailEntity.getUsedSpace();
             if( scenePro != null && scenePro.getSpace() + usedSpace > incrementType.getCameraCapacity() * 1024 * 1024 * 1024L){
-                scenePro.setPayStatus(-2);
+                throw new BusinessException(CameraConstant.FAILURE_CODE_6008, CameraConstant.FAILURE_MSG_6008);
             }
             if( scenePlus != null ){
                 ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
                 if(ext.getSpace() + usedSpace > incrementType.getCameraCapacity() * 1024 * 1024 * 1024L){
-                    scenePlus.setPayStatus(-2);
+                    throw new BusinessException(CameraConstant.FAILURE_CODE_6008, CameraConstant.FAILURE_MSG_6008);
                 }
             }
         }