|
@@ -127,48 +127,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);
|
|
|
- }
|
|
|
- ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
|
- 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);
|
|
|
- }
|
|
|
- Long countByNewNum = sceneCopyLogService.getCountByNewNum(num);
|
|
|
- if(countByNewNum >0){
|
|
|
- throw new BusinessException(ResultCode.COPY_NUM_NOTREBUILD);
|
|
|
- }
|
|
|
-
|
|
|
- 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 {
|
|
|
- JSONObject jsonObject = fdKKClient.rebuildScene(paramMap);
|
|
|
- Integer code = jsonObject.getInteger("code");
|
|
|
- if(code != 0){
|
|
|
- log.error("场景重算失败:{},{}",num,jsonObject);
|
|
|
- throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
|
|
|
- }
|
|
|
-
|
|
|
+ sceneProService.rebuildScene(num);
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
}
|