|
@@ -2,16 +2,14 @@ package com.fdkankan.ucenter.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
-import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.SceneConstant;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.ucenter.common.DownloadStatusEnum;
|
|
|
-import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
|
import com.fdkankan.ucenter.common.RedisKeyUtil;
|
|
|
-import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
|
+import com.fdkankan.ucenter.common.constants.ResultCodeMsg;
|
|
|
import com.fdkankan.ucenter.constant.CameraConstant;
|
|
|
import com.fdkankan.ucenter.constant.LoginConstant;
|
|
|
import com.fdkankan.ucenter.entity.*;
|
|
@@ -23,7 +21,6 @@ import com.fdkankan.ucenter.vo.response.DownVo;
|
|
|
import com.fdkankan.ucenter.vo.response.DownloadProcessVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.ibatis.annotations.Case;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -271,7 +268,7 @@ public class DownService implements IDownService {
|
|
|
DownVo downVo = new DownVo();
|
|
|
SSDownSceneVo vo = laserService.downOfflineSceneStatus(sceneNum);
|
|
|
if(vo == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
downVo.setDownloadStatus(0);
|
|
|
if(vo.getStatus() == 1){
|
|
@@ -295,7 +292,7 @@ public class DownService implements IDownService {
|
|
|
//status :0:正在生成 1,初次生成 2,已经生成直接下载 3,重新生成
|
|
|
SSDownSceneVo vo = laserService.downOfflineScene(sceneNum);
|
|
|
if(vo == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
|
|
|
wrapper.eq(User::getId,user.getId());
|
|
@@ -319,7 +316,7 @@ public class DownService implements IDownService {
|
|
|
DownloadProcessVo downVo = new DownloadProcessVo();
|
|
|
SSDownSceneVo vo = laserService.downOfflineSceneStatus(sceneNum);
|
|
|
if(vo == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
downVo.setStatus(1003);
|
|
|
|
|
@@ -362,7 +359,7 @@ public class DownService implements IDownService {
|
|
|
DownVo downVo = new DownVo();
|
|
|
SSDownSceneVo vo = laserService.downE57Status(num);
|
|
|
if(vo == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
downVo.setDownloadStatus(0);
|
|
|
if(vo.getStatus() == 1){
|
|
@@ -376,7 +373,7 @@ public class DownService implements IDownService {
|
|
|
downVo.setDownloadStatus(1);
|
|
|
}
|
|
|
if(vo.getStatus() == -1){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400016,ResultCode.FAILURE_MSG_400016);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400016, ResultCodeMsg.FAILURE_MSG_400016);
|
|
|
}
|
|
|
return downVo;
|
|
|
}
|
|
@@ -388,39 +385,39 @@ public class DownService implements IDownService {
|
|
|
}
|
|
|
ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
|
if(scenePlus == null ){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400002,ResultCode.FAILURE_MSG_400002);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400002, ResultCodeMsg.FAILURE_MSG_400002);
|
|
|
}
|
|
|
if(scenePlus.getSceneSource() != 4 && scenePlus.getSceneSource() != 5){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400011,ResultCode.FAILURE_MSG_400011);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400011, ResultCodeMsg.FAILURE_MSG_400011);
|
|
|
}
|
|
|
if(scenePlus.getUserId()!= null && !scenePlus.getUserId().equals(user.getId())){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400012,ResultCode.FAILURE_MSG_400012);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400012, ResultCodeMsg.FAILURE_MSG_400012);
|
|
|
}
|
|
|
if(scenePlus.getCameraId() == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400010,ResultCode.FAILURE_MSG_400010);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400010, ResultCodeMsg.FAILURE_MSG_400010);
|
|
|
}
|
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
|
if(cameraDetail == null){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_CODE_6029,CameraConstant.FAILURE_MSG_6029);
|
|
|
}
|
|
|
if(!cameraDetail.getUserId().equals(user.getId())){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400012,ResultCode.FAILURE_MSG_400012);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400012, ResultCodeMsg.FAILURE_MSG_400012);
|
|
|
}
|
|
|
SceneColdStorage sceneColdStorage = sceneColdStorageService.getByNum(num);
|
|
|
if(sceneColdStorage != null && sceneColdStorage.getState() == 1){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400013,ResultCode.FAILURE_MSG_400013);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400013, ResultCodeMsg.FAILURE_MSG_400013);
|
|
|
}
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
String dataSource = scenePlusExt.getDataSource();
|
|
|
if(!fYunFileServiceInterface.fileExist(dataSource.replace("/mnt/data","home")+"/data.fdage")){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400014,ResultCode.FAILURE_MSG_400014);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400014, ResultCodeMsg.FAILURE_MSG_400014);
|
|
|
}
|
|
|
SceneStatusInfoDTO dto = laserService.laserSceneInfo(num);
|
|
|
if(dto == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
if(dto.getStatus()!=2 ){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400015,ResultCode.FAILURE_MSG_400015);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400015, ResultCodeMsg.FAILURE_MSG_400015);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -433,7 +430,7 @@ public class DownService implements IDownService {
|
|
|
//status :0:正在生成 1,初次生成 2,已经生成直接下载 3,重新生成
|
|
|
SSDownSceneVo vo = laserService.downE57(num);
|
|
|
if(vo == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
downVo.setDownloadStatus(1);
|
|
|
return downVo;
|
|
@@ -448,10 +445,10 @@ public class DownService implements IDownService {
|
|
|
DownloadProcessVo downVo = new DownloadProcessVo();
|
|
|
SSDownSceneVo vo = laserService.downE57Status(num);
|
|
|
if(vo == null){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400003,ResultCode.FAILURE_MSG_400003);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400003, ResultCodeMsg.FAILURE_MSG_400003);
|
|
|
}
|
|
|
if(vo.getStatus() ==-1){
|
|
|
- throw new BusinessException(ResultCode.FAILURE_CODE_400016,ResultCode.FAILURE_MSG_400016);
|
|
|
+ throw new BusinessException(ResultCodeMsg.FAILURE_CODE_400016, ResultCodeMsg.FAILURE_MSG_400016);
|
|
|
}
|
|
|
downVo.setStatus(1003);
|
|
|
if(vo.getStatus() == 0 || vo.getStatus() == 2 || vo.getStatus() == 3){ //下载中
|