|
@@ -2,13 +2,16 @@ package com.fdkankan.manage.controller;
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
+import com.fdkankan.manage.entity.ScenePlusExt;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
import com.fdkankan.manage.common.ResultData;
|
|
|
import com.fdkankan.manage.entity.ScenePlus;
|
|
|
import com.fdkankan.manage.entity.ScenePro;
|
|
|
import com.fdkankan.manage.httpClient.client.FdKKClient;
|
|
|
import com.fdkankan.manage.service.IDownService;
|
|
|
+import com.fdkankan.manage.service.IScenePlusExtService;
|
|
|
import com.fdkankan.manage.service.IScenePlusService;
|
|
|
import com.fdkankan.manage.service.ISceneProService;
|
|
|
import com.fdkankan.manage.vo.request.SceneParam;
|
|
@@ -34,9 +37,13 @@ public class SceneController {
|
|
|
@Autowired
|
|
|
IScenePlusService scenePlusService;
|
|
|
@Autowired
|
|
|
+ IScenePlusExtService scenePlusExtService;
|
|
|
+ @Autowired
|
|
|
IDownService downService;
|
|
|
@Autowired
|
|
|
FdKKClient fdKKClient;
|
|
|
+ @Autowired
|
|
|
+ FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
public ResultData list(@RequestBody SceneParam param){
|
|
@@ -119,6 +126,7 @@ public class SceneController {
|
|
|
*/
|
|
|
@GetMapping("/rebuildScene")
|
|
|
public ResultData rebuild(@RequestParam(required = false) String num){
|
|
|
+ String dataSource = null;
|
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
if(scenePro!=null && scenePro.getSceneSource() != 4){
|
|
|
throw new BusinessException(ResultCode.V3_SCENE_REBUILD);
|
|
@@ -127,6 +135,21 @@ public class SceneController {
|
|
|
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);
|
|
|
+ }
|
|
|
+ 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 {
|