|
@@ -3,6 +3,7 @@ package com.fdkankan.platform.user.service.impl;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.platform.common.DownloadStatusEnum;
|
|
|
import com.fdkankan.platform.goods.service.ICameraService;
|
|
|
import com.fdkankan.platform.user.request.RequestUser;
|
|
@@ -10,12 +11,13 @@ import com.fdkankan.platform.user.service.IUserSceneService;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.scene.api.feign.SceneUserSceneClient;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Service
|
|
|
public class UserSceneServiceImpl implements IUserSceneService {
|
|
|
|
|
@@ -28,13 +30,11 @@ public class UserSceneServiceImpl implements IUserSceneService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> checkDownload(RequestUser param) {
|
|
|
+ public ResultData checkDownload(RequestUser param) {
|
|
|
if(StringUtils.isEmpty(param.getSceneNum())){
|
|
|
throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
- //todo
|
|
|
- return result;
|
|
|
+ return sceneUserSceneClient.checkDownLoad(param.getSceneNum());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -42,17 +42,7 @@ public class UserSceneServiceImpl implements IUserSceneService {
|
|
|
if(StringUtils.isEmpty(param.getSceneNum())){
|
|
|
throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
-
|
|
|
-// ScenePro sceneProEntity = sceneService.findProBySceneNum(param.getSceneNum());
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
-// }
|
|
|
-//
|
|
|
-// SceneProEditEntity sceneProEditEntity = sceneProEditService.findByProId(sceneProEntity.getId());
|
|
|
-// if(sceneProEditEntity == null){
|
|
|
-// throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
-// }
|
|
|
- //todo findProBySceneNum findByProId
|
|
|
+ sceneUserSceneClient.checkDownLoad(param.getSceneNum());
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
result.put("downloadStatus", 1);
|
|
@@ -73,7 +63,6 @@ public class UserSceneServiceImpl implements IUserSceneService {
|
|
|
// 获取下载进度
|
|
|
String processStr = redisUtil.get(String.format(RedisKey.PREFIX_DOWNLOAD_PROGRESS, sceneNum));
|
|
|
if (StringUtils.isEmpty(processStr)) {
|
|
|
- Map<String, Object> result = new HashMap<>(1);
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", 1000);
|
|
|
object.put("url", "");
|
|
@@ -94,27 +83,5 @@ public class UserSceneServiceImpl implements IUserSceneService {
|
|
|
return process;
|
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
-// public ResultData findSceneNumber(long userId, String snCode) {
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// Camera camera = null;
|
|
|
-// if (!ObjectUtils.isEmpty(snCode)) {
|
|
|
-// camera = cameraService.getBySnCode(snCode);
|
|
|
-// if(ObjectUtils.isEmpty(camera)){
|
|
|
-// map.put("sceneNum", 0);
|
|
|
-// map.put("cooperatimeNum", 0);
|
|
|
-// return ResultData.ok(map);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// //双目场景数量
|
|
|
-// ResultData<SceneCnt> resultData = sceneUserSceneClient.getSceneCnt(userId, Objects.isNull(camera) ? null : camera.getId());
|
|
|
-// SceneCnt sceneCnt = resultData.getData();
|
|
|
-// map.put("sceneNum", sceneCnt.getSceneCnt() + sceneCnt.getSceneProCnt());
|
|
|
-// map.put("cooperatimeNum", sceneCnt.getCooperSceneCnt());
|
|
|
-//
|
|
|
-// return ResultData.ok(map);
|
|
|
-// }
|
|
|
-
|
|
|
|
|
|
}
|