Ver código fonte

同步代码

dsx 2 anos atrás
pai
commit
f4d9d5b413

+ 0 - 6
src/main/java/com/fdkankan/contro/mq/service/impl/BuildV3SceneServiceImpl.java

@@ -595,12 +595,6 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
        return sceneProService.getByNum(num);
     }
 
-    private int getPayStatus(Long cameraId, Long space) throws Exception{
-        //更新相机使用用量
-        CameraDetail cameraDetail = cameraDetailService.updateCameraDetailByCameraIdAndSpace(cameraId, space);
-        return PayStatus.PAY.code();
-    }
-
     public void uploadHouseTypeJson(String num, String floorPlanCardFilePath) {
         if (!new File(floorPlanCardFilePath).exists()) {
             log.error("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);

+ 5 - 29
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -70,8 +70,6 @@ public class CommonServiceImpl implements ICommonService {
     @Autowired
     private ICameraService cameraService;
     @Autowired
-    private FYunFileServiceInterface fYunFileService;
-    @Autowired
     private FYunFileConfig fYunFileConfig;
 
     @Override
@@ -263,30 +261,8 @@ public class CommonServiceImpl implements ICommonService {
 
     @Override
     public int getPayStatus(Long cameraId, Long space){
-        //查询权益统计容量的方式
-        String unit = SpaceType.GB.code();
-        CameraDetail cameraDetail = cameraDetailService.getByCameraId(cameraId);
-        if(StrUtil.isNotEmpty(cameraDetail.getUnit())){
-            unit = cameraDetail.getUnit();
-        }
-        Long limit = this.getSpaceLimit(cameraDetail);
-
-        if(SpaceType.SP.code().equals(unit)){//如果按空间方式统计,则space置为1
-            space = 1L;
-        }
-
         //更新相机使用用量
         cameraDetailService.updateCameraDetailByCameraIdAndSpace(cameraId, space);
-
-        if(limit == -1){
-            return PayStatus.PAY.code();
-        }
-
-        Long usedSpace = cameraService.getUsedSpace(cameraId, unit);
-        if(usedSpace + space > limit){
-            return PayStatus.NO_CAPACITY.code();
-        }
-
         return PayStatus.PAY.code();
     }
 
@@ -327,11 +303,11 @@ public class CommonServiceImpl implements ICommonService {
 
     @Override
     public Long getSpace(String num){
-        Long space = fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.DATA_VIEW_PATH, num));
-        space += fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.IMG_VIEW_PATH, num));
-        space += fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.VIDEOS_VIEW_PATH, num));
-        space += fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.VOICE_VIEW_PATH, num));
-        space += fYunFileService.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.scene_result_data_path, num).concat("caches"));
+        Long space = fYunFileServiceInterface.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.DATA_VIEW_PATH, num));
+        space += fYunFileServiceInterface.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.IMG_VIEW_PATH, num));
+        space += fYunFileServiceInterface.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.VIDEOS_VIEW_PATH, num));
+        space += fYunFileServiceInterface.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.VOICE_VIEW_PATH, num));
+        space += fYunFileServiceInterface.getSpace(fYunFileConfig.getBucket(), String.format(UploadFilePath.scene_result_data_path, num).concat("caches"));
         return  space;
     }
 }