|
@@ -5,6 +5,9 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.aliyun.oss.OSS;
|
|
|
+import com.aliyun.oss.OSSClientBuilder;
|
|
|
+import com.amazonaws.services.s3.AmazonS3;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -18,6 +21,8 @@ import com.fdkankan.manage.httpClient.client.FdKKClient;
|
|
|
import com.fdkankan.manage.httpClient.service.LaserService;
|
|
|
import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.mapper.ISceneProMapper;
|
|
|
+import com.fdkankan.manage.mq.common.MqQueueUtil;
|
|
|
+import com.fdkankan.manage.mq.param.ScenePayStatusVo;
|
|
|
import com.fdkankan.manage.service.*;
|
|
|
import com.fdkankan.manage.util.Dateutils;
|
|
|
import com.fdkankan.manage.util.SceneStatusUtil;
|
|
@@ -25,6 +30,7 @@ import com.fdkankan.manage.vo.request.SceneParam;
|
|
|
import com.fdkankan.manage.vo.response.CameraDataVo;
|
|
|
import com.fdkankan.manage.vo.response.GroupByCount;
|
|
|
import com.fdkankan.manage.vo.response.SceneVo;
|
|
|
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -88,6 +94,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
ISceneResourceCameraService sceneResourceCameraService;
|
|
|
@Autowired
|
|
|
ISceneDelLogService sceneDelLogService;
|
|
|
+ @Autowired
|
|
|
+ RabbitMqProducer rabbitMqProducer;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -140,155 +148,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
*/
|
|
|
@Override
|
|
|
public void lockOrUnLockBySpace(CameraDetail cameraDetail, Long cameraId, Integer payStatus) {
|
|
|
- if(cameraDetail == null){
|
|
|
- cameraDetail = cameraDetailService.getByCameraId(cameraId);
|
|
|
- }
|
|
|
- LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
|
|
|
- LambdaQueryWrapper<ScenePlus> plusWr = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(ScenePro::getStatus,-2);
|
|
|
- plusWr.eq(ScenePlus::getSceneStatus,-2);
|
|
|
- Long totalSpace = cameraDetail.getTotalSpace();
|
|
|
- UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
- if(userIncrement!=null){
|
|
|
- IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
- if(incrementType!=null){
|
|
|
- if(incrementType.getCameraCapacity() == -1){
|
|
|
- totalSpace = -1L;
|
|
|
- }else {
|
|
|
- totalSpace = incrementType.getCameraCapacity() * 1024* 1024 * 1024L;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- log.info("lockOrUnLockBySpace---cameraId:{},payStatus:{},totalSpace:{},useSpace{}",
|
|
|
- cameraId,payStatus,totalSpace,cameraDetail.getUsedSpace());
|
|
|
- if(payStatus == 1){ //解封,判断用户权益,用户会员权益无限容量
|
|
|
- wrapper.orderByAsc(ScenePro::getCreateTime);
|
|
|
- plusWr.orderByAsc(ScenePlus::getCreateTime);
|
|
|
- wrapper.eq(ScenePro::getPayStatus,-2);
|
|
|
- plusWr.eq(ScenePlus::getPayStatus,-2);
|
|
|
- }else {
|
|
|
- if (totalSpace == -1 || totalSpace >= cameraDetail.getUsedSpace()) {
|
|
|
- // 总容量大于已使用容量,不予封存
|
|
|
- return;
|
|
|
- }
|
|
|
- wrapper.orderByDesc(ScenePro::getCreateTime);
|
|
|
- plusWr.orderByDesc(ScenePlus::getCreateTime);
|
|
|
- wrapper.eq(ScenePro::getPayStatus,1);
|
|
|
- plusWr.eq(ScenePlus::getPayStatus,1);
|
|
|
- }
|
|
|
|
|
|
- wrapper.eq(ScenePro::getCameraId,cameraId)
|
|
|
- .eq(ScenePro::getIsUpgrade,0);
|
|
|
-
|
|
|
- plusWr.eq(ScenePlus::getCameraId,cameraId);
|
|
|
-
|
|
|
- List<ScenePro> list = this.list(wrapper);
|
|
|
- List<ScenePlus> plusList = scenePlusService.list(plusWr);
|
|
|
-
|
|
|
- List<Long> lockedIds = new ArrayList<>();
|
|
|
-
|
|
|
- if(totalSpace == -1){
|
|
|
- List<Long> collect = list.stream().map(ScenePro::getId).collect(Collectors.toList());
|
|
|
- List<Long> collect2 = plusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
|
- lockedIds.addAll(collect);
|
|
|
- lockedIds.addAll(collect2);
|
|
|
- lockOrUnLockScenes(lockedIds,payStatus); // 无限容量 全部解封
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Long beyondSpace = 0L;
|
|
|
- Long accumulateSpace = 0L;
|
|
|
- if(payStatus == 1){
|
|
|
- beyondSpace = totalSpace - cameraDetail.getUsedSpace();
|
|
|
- getScenePlusLockedIds(lockedIds, plusList, beyondSpace, accumulateSpace);
|
|
|
- getSceneLockedIds(lockedIds,list,beyondSpace,accumulateSpace);
|
|
|
- }else {
|
|
|
- beyondSpace = cameraDetail.getUsedSpace() - totalSpace;
|
|
|
- getSceneLockedIds(lockedIds, list, beyondSpace, accumulateSpace);
|
|
|
- getScenePlusLockedIds(lockedIds,plusList,beyondSpace,accumulateSpace);
|
|
|
- }
|
|
|
-
|
|
|
- lockOrUnLockScenes(lockedIds,payStatus);
|
|
|
+ ScenePayStatusVo scenePayStatusVo = new ScenePayStatusVo(cameraDetail.getCameraId());
|
|
|
+ rabbitMqProducer.sendByWorkQueue(MqQueueUtil.ucenterScenePayStatusQueue, JSONObject.toJSONString(scenePayStatusVo));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void lockOrUnLockBySpace(ScenePro scenePro, ScenePlus scenePlus,Integer payStatus) {
|
|
|
- List<Long> lockedIds = new ArrayList<>();
|
|
|
- if(scenePro!= null){
|
|
|
- lockedIds.add(scenePro.getId());
|
|
|
- }
|
|
|
- if(scenePlus!= null){
|
|
|
- lockedIds.add(scenePlus.getId());
|
|
|
- }
|
|
|
- lockOrUnLockScenes(lockedIds,payStatus); // 无限容量 全部解封
|
|
|
- }
|
|
|
-
|
|
|
- private void getSceneLockedIds(List<Long> lockedIds , List<ScenePro> list, Long beyondSpace, Long accumulateSpace){
|
|
|
- if (list != null && list.size() > 0){
|
|
|
- for (ScenePro scenePro : list){
|
|
|
- accumulateSpace += scenePro.getSpace()== null ? 0 : scenePro.getSpace();
|
|
|
- if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
|
- break;
|
|
|
- }
|
|
|
- lockedIds.add(scenePro.getId());
|
|
|
- }
|
|
|
- }
|
|
|
+ Long sceneId = scenePro == null ? scenePlus.getId() : scenePro.getId();
|
|
|
+ ScenePayStatusVo scenePayStatusVo = new ScenePayStatusVo(sceneId,payStatus);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(MqQueueUtil.ucenterScenePayStatusQueue, JSONObject.toJSONString(scenePayStatusVo));
|
|
|
}
|
|
|
- private void getScenePlusLockedIds(List<Long> lockedIds , List<ScenePlus> list, Long beyondSpace, Long accumulateSpace){
|
|
|
- if (list != null && list.size() > 0){
|
|
|
- List<Long> plusIds = list.parallelStream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
|
- HashMap<Long, ScenePlusExt> byPlusIds = scenePlusExtService.getByPlusIds(plusIds);
|
|
|
- for (ScenePlus scenePlus : list){
|
|
|
- ScenePlusExt scenePlusExt = byPlusIds.get(scenePlus.getId());
|
|
|
- accumulateSpace += scenePlusExt.getSpace() == null ? 0 : scenePlusExt.getSpace();
|
|
|
- if (accumulateSpace.compareTo(beyondSpace) > 0){
|
|
|
- break;
|
|
|
- }
|
|
|
- lockedIds.add(scenePlus.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // payStatus 为 -2 封存,为 1 解封
|
|
|
- private void lockOrUnLockScenes(List<Long> lockedIds,Integer payStatus) {
|
|
|
- if (lockedIds == null || lockedIds.size() == 0){
|
|
|
- return;
|
|
|
- }
|
|
|
- LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.set(ScenePro::getPayStatus,payStatus)
|
|
|
- .eq(ScenePro::getIsUpgrade,0)
|
|
|
- .in(ScenePro::getId,lockedIds);
|
|
|
- this.update(updateWrapper);
|
|
|
-
|
|
|
- LambdaUpdateWrapper<ScenePlus> updatePlusWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updatePlusWrapper.set(ScenePlus::getPayStatus,payStatus)
|
|
|
- .in(ScenePlus::getId,lockedIds);
|
|
|
- scenePlusService.update(updatePlusWrapper);
|
|
|
-
|
|
|
- this.updateOssStatus(lockedIds,payStatus);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改oss status.json中 payStatus
|
|
|
- */
|
|
|
- private void updateOssStatus(List<Long> lockedIds, Integer payStatus) {
|
|
|
- LambdaQueryWrapper<ScenePro> proWr = new LambdaQueryWrapper<>();
|
|
|
- proWr.eq(ScenePro::getIsUpgrade,0);
|
|
|
- proWr.in(ScenePro::getId,lockedIds);
|
|
|
- List<ScenePro> proList = this.list(proWr);
|
|
|
-
|
|
|
- LambdaQueryWrapper<ScenePlus> pluWr = new LambdaQueryWrapper<>();
|
|
|
- pluWr.in(ScenePlus::getId,lockedIds);
|
|
|
- List<ScenePlus> plusList = scenePlusService.list(pluWr);
|
|
|
- for (ScenePro scenePro : proList) {
|
|
|
- this.updateOssStatus(String.format(OssPath.v3_statusPath,scenePro.getNum()),payStatus,"payStatus");
|
|
|
- }
|
|
|
- for (ScenePlus scenePlus : plusList) {
|
|
|
- this.updateOssStatus(String.format(OssPath.v4_statusPath,scenePlus.getNum()),payStatus,"payStatus");
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 从oss中获取文件,并重写,上传替换
|
|
@@ -299,7 +170,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(!fYunFileServiceInterface.fileExist(path)){
|
|
|
return;
|
|
|
}
|
|
|
- String data = fYunFileServiceInterface.getFileContent("4dkankan",path);
|
|
|
+ String data = fYunFileServiceInterface.getFileContent(path);
|
|
|
if(StringUtils.isBlank(data)){
|
|
|
return;
|
|
|
}
|
|
@@ -374,7 +245,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
|
|
|
Long sceneCameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
- Long space = scenePro == null ? 0 :scenePro.getSpace();
|
|
|
+ Long space = null;
|
|
|
+ space = scenePro == null ? 0 :scenePro.getSpace();
|
|
|
String dataSource = scenePro == null ? null :scenePro.getDataSource();
|
|
|
if(scenePlus !=null){
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
@@ -382,22 +254,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
dataSource = scenePlusExt.getDataSource();
|
|
|
}
|
|
|
space = space == null ? 0 :space;
|
|
|
- Long newUseSpace = space + cameraDetail.getUsedSpace();
|
|
|
-
|
|
|
- Long totalSpace = cameraDetail.getTotalSpace();
|
|
|
- UserIncrement userIncrement = userIncrementService.getByCameraId(camera.getId());
|
|
|
- if(userIncrement!=null){
|
|
|
- IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
- if(incrementType!=null){
|
|
|
- if(incrementType.getCameraCapacity() == -1){
|
|
|
- totalSpace = -1L;
|
|
|
- }else {
|
|
|
- totalSpace = incrementType.getCameraCapacity() * 1024 *1024 * 1024L;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail, space);
|
|
|
//深时场景无限容量
|
|
|
- if(cameraDetail.getType() != 11 && cameraDetail.getType() != 10 && totalSpace !=-1 && newUseSpace > totalSpace){
|
|
|
+ if(cameraDetail.getType() != 11 && cameraDetail.getType() != 10 && !checkSpace){
|
|
|
throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
|
}
|
|
|
|
|
@@ -427,14 +287,16 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
if(cameraDetail.getType() == 10 || cameraDetail.getType() == 11) { //深时场景
|
|
|
//迁移深时 dataSource
|
|
|
- File file = new File(dataSource + "_laserData/laserData");
|
|
|
+ File file = new File(dataSource + "_laserData");
|
|
|
if (!file.exists()) {
|
|
|
throw new BusinessException(ResultCode.MOVE_ERROR);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Long oldUseSpace = oldCameraDetail.getUsedSpace() - space < 0 ? 0 : oldCameraDetail.getUsedSpace() - space;
|
|
|
- oldCameraDetail.setUsedSpace(oldUseSpace);
|
|
|
+ if("GB".equals(oldCameraDetail.getUnit())){
|
|
|
+ oldUseSpace = 1L;
|
|
|
+ }
|
|
|
Long subSpace = oldCameraDetail.getTotalSpace() - oldUseSpace;
|
|
|
|
|
|
if(oldCameraDetail.getType() != 11 && oldCameraDetail.getType() != 10 && subSpace >0){ //有剩余容量解封容量内场景
|
|
@@ -446,9 +308,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(cameraDetail.getType() != 11 && cameraDetail.getType() != 10 && payStatus!=1){ //有剩余容量解封容量内场景
|
|
|
this.lockOrUnLockBySpace(scenePro,scenePlus,1);
|
|
|
}
|
|
|
- cameraDetailService.updateById(oldCameraDetail);
|
|
|
- cameraDetail.setUsedSpace(newUseSpace);
|
|
|
- cameraDetailService.updateById(cameraDetail);
|
|
|
+
|
|
|
|
|
|
if(scenePro!=null){
|
|
|
LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
@@ -478,10 +338,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
if(cameraDetail.getType() == 10 || cameraDetail.getType() == 11){ //深时场景
|
|
|
//迁移深时 dataSource
|
|
|
- FileUtil.move(new File(dataSource +"_laserData/laserData"),new File(newDataSource+"_laserData/laserData"),true);
|
|
|
+ FileUtil.move(new File(dataSource +"_laserData"),new File(newDataSource+"_laserData"),true);
|
|
|
laserService.move(param.getNum(),oldCamera.getSnCode(),camera.getSnCode(),cameraDetail.getUserId(),newDataSource);
|
|
|
}
|
|
|
-
|
|
|
+ cameraDetailService.initSpace(oldCameraDetail);
|
|
|
+ cameraDetailService.initSpace(cameraDetail);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -599,15 +460,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(sceneStatus != -2){
|
|
|
throw new BusinessException(ResultCode.SCENE_IS_BUILDING);
|
|
|
}
|
|
|
- Long totalSpace = detailEntity.getTotalSpace();
|
|
|
- UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
- if(userIncrement != null && userIncrement.getIsExpired() ==0){
|
|
|
- IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
- totalSpace = incrementType.getCameraCapacity() * 1024 * 1024 * 1024L;
|
|
|
- }
|
|
|
- if(detailEntity.getType() == 10 || detailEntity.getType() == 11){
|
|
|
- totalSpace = -1L;
|
|
|
- }
|
|
|
|
|
|
Long needSpace = 0L;
|
|
|
if(scenePro != null){
|
|
@@ -619,8 +471,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
needSpace = scenePlusExt.getSpace();
|
|
|
}
|
|
|
}
|
|
|
+ Boolean checkSpace = cameraDetailService.checkSpace(detailEntity, needSpace);
|
|
|
|
|
|
- if( totalSpace > 0 && detailEntity.getUsedSpace() + needSpace > totalSpace){
|
|
|
+ if(!checkSpace){
|
|
|
throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
|
}
|
|
|
|
|
@@ -634,12 +487,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
public void deleteByNum(String num) {
|
|
|
Integer sceneSource = null;
|
|
|
Long cameraId = null;
|
|
|
- Long space = null;
|
|
|
ScenePro scenePro = this.getByNum(num);
|
|
|
if(scenePro!=null){
|
|
|
cameraId = scenePro.getCameraId();
|
|
|
sceneSource = scenePro.getSceneSource();
|
|
|
- space = scenePro.getSpace();
|
|
|
this.removeById(scenePro.getId());
|
|
|
}
|
|
|
Scene scene = sceneService.getByNum(num);
|
|
@@ -652,7 +503,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
sceneSource = scenePlus.getSceneSource();
|
|
|
ScenePlusExt plusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
if(plusExt != null){
|
|
|
- space = plusExt.getSpace();
|
|
|
scenePlusExtService.delByPlus(scenePlus.getId());
|
|
|
}
|
|
|
scenePlusService.removeById(scenePlus.getId());
|
|
@@ -661,7 +511,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
laserService.delete(num);
|
|
|
}
|
|
|
if(cameraId != null){
|
|
|
- cameraDetailService.addUsedSpace(cameraId,space);
|
|
|
+ cameraDetailService.initSpace(cameraId);
|
|
|
}
|
|
|
sceneDelLogService.saveLog(num, StpUtil.getLoginId());
|
|
|
}
|
|
@@ -774,4 +624,63 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void rebuildScene(String num) {
|
|
|
+ String dataSource = null;
|
|
|
+ ScenePro scenePro = this.getByNum(num);
|
|
|
+ if(scenePro!=null && scenePro.getSceneSource() != 4){
|
|
|
+ throw new BusinessException(ResultCode.V3_SCENE_REBUILD);
|
|
|
+ }
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
|
+ if(scenePlus == null && scenePro == null){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
|
|
|
+ }
|
|
|
+ if(scenePro != null){
|
|
|
+ dataSource = scenePro.getDataSource();
|
|
|
+ }
|
|
|
+ if(scenePlus != null){
|
|
|
+ ScenePlusExt scenePlusExt= scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+ if(scenePlusExt!= null){
|
|
|
+ dataSource = scenePlusExt.getDataSource();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(dataSource)){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
|
|
|
+ }
|
|
|
+ Long countByNewNum = sceneCopyLogService.getCountByNewNum(num);
|
|
|
+ if(countByNewNum >0){
|
|
|
+ throw new BusinessException(ResultCode.COPY_NUM_NOTREBUILD);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!fYunFileServiceInterface.fileExist(dataSource.replace("/mnt/data","home")+"/data.fdage")){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
|
|
|
+ }
|
|
|
+ HashMap<String,Object> paramMap = new HashMap<>();
|
|
|
+ paramMap.put("num",num);
|
|
|
+ try {
|
|
|
+ JSONObject jsonObject = fdKKClient.rebuildScene(paramMap);
|
|
|
+ Integer code = jsonObject.getInteger("code");
|
|
|
+ if(code != 0){
|
|
|
+ log.error("场景重算失败:{},{}",num,jsonObject);
|
|
|
+ throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long getSpaceSumByCameraId(Long cameraId) {
|
|
|
+ return this.getBaseMapper().getSpaceSumByCameraId(cameraId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long getCountByCameraId(Long cameraId) {
|
|
|
+ LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(ScenePro::getIsUpgrade,0);
|
|
|
+ wrapper.eq(ScenePro::getCameraId,cameraId);
|
|
|
+ return this.count(wrapper);
|
|
|
+ }
|
|
|
}
|