|
@@ -4,11 +4,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
|
+import com.fdkankan.openApi.config.OpenApiConfig;
|
|
import com.fdkankan.openApi.constant.JmgaConstant;
|
|
import com.fdkankan.openApi.constant.JmgaConstant;
|
|
import com.fdkankan.openApi.dto.www.DownSceneDto;
|
|
import com.fdkankan.openApi.dto.www.DownSceneDto;
|
|
|
|
+import com.fdkankan.openApi.entity.www.ScenePlus;
|
|
import com.fdkankan.openApi.httpclient.client.FdKKClient;
|
|
import com.fdkankan.openApi.httpclient.client.FdKKClient;
|
|
import com.fdkankan.openApi.httpclient.client.JmgaClient;
|
|
import com.fdkankan.openApi.httpclient.client.JmgaClient;
|
|
import com.fdkankan.openApi.service.www.IDownSceneService;
|
|
import com.fdkankan.openApi.service.www.IDownSceneService;
|
|
|
|
+import com.fdkankan.openApi.service.www.IScenePlusService;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -21,6 +24,10 @@ public class DownSceneServiceImpl implements IDownSceneService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
JmgaClient jmgaClient;
|
|
JmgaClient jmgaClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ IScenePlusService scenePlusService;
|
|
|
|
+ @Autowired
|
|
|
|
+ OpenApiConfig openApiConfig;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -28,6 +35,13 @@ public class DownSceneServiceImpl implements IDownSceneService {
|
|
if(StringUtils.isBlank(num)){
|
|
if(StringUtils.isBlank(num)){
|
|
throw new BusinessException(ErrorCode.PARAM_ERROR);
|
|
throw new BusinessException(ErrorCode.PARAM_ERROR);
|
|
}
|
|
}
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
|
|
+ if(scenePlus == null){
|
|
|
|
+ scenePlus = scenePlusService.getByTaskId(num);
|
|
|
|
+ }
|
|
|
|
+ if(scenePlus == null){
|
|
|
|
+ throw new BusinessException(ErrorCode.NOT_RECORD);
|
|
|
|
+ }
|
|
ResultData checkResult = jmgaClient.get(JmgaConstant.API_GET_CHECK_DOWNLOAD + "?num=" + num +"&isObj="+type);
|
|
ResultData checkResult = jmgaClient.get(JmgaConstant.API_GET_CHECK_DOWNLOAD + "?num=" + num +"&isObj="+type);
|
|
if(checkResult.getCode() != 0 || checkResult.getData() == null){
|
|
if(checkResult.getCode() != 0 || checkResult.getData() == null){
|
|
throw new BusinessException(checkResult.getCode(),checkResult.getMessage());
|
|
throw new BusinessException(checkResult.getCode(),checkResult.getMessage());
|
|
@@ -36,7 +50,7 @@ public class DownSceneServiceImpl implements IDownSceneService {
|
|
Integer checkStatus = checkObject.getInteger("downloadStatus");
|
|
Integer checkStatus = checkObject.getInteger("downloadStatus");
|
|
String checkUrl = checkObject.getString("downloadUrl");
|
|
String checkUrl = checkObject.getString("downloadUrl");
|
|
if(StringUtils.isNotBlank(checkUrl)){
|
|
if(StringUtils.isNotBlank(checkUrl)){
|
|
- return new DownSceneDto(checkUrl);
|
|
|
|
|
|
+ return new DownSceneDto(checkUrl,openApiConfig.getServerUrl());
|
|
}
|
|
}
|
|
if(checkStatus !=1){
|
|
if(checkStatus !=1){
|
|
ResultData downResult = jmgaClient.get(JmgaConstant.API_GET_DOWN_SCENE + "?num=" + num +"&isObj="+type);
|
|
ResultData downResult = jmgaClient.get(JmgaConstant.API_GET_DOWN_SCENE + "?num=" + num +"&isObj="+type);
|
|
@@ -55,9 +69,9 @@ public class DownSceneServiceImpl implements IDownSceneService {
|
|
Integer percent = processObj.getInteger("percent");
|
|
Integer percent = processObj.getInteger("percent");
|
|
Integer processStatus = processObj.getInteger("status");
|
|
Integer processStatus = processObj.getInteger("status");
|
|
if(processStatus == 1003){
|
|
if(processStatus == 1003){
|
|
- return new DownSceneDto(processUrl,percent,-1);
|
|
|
|
|
|
+ return new DownSceneDto(processUrl,percent,-1,openApiConfig.getServerUrl());
|
|
}
|
|
}
|
|
|
|
|
|
- return new DownSceneDto(processUrl,percent);
|
|
|
|
|
|
+ return new DownSceneDto(processUrl,percent,openApiConfig.getServerUrl());
|
|
}
|
|
}
|
|
}
|
|
}
|