|
@@ -18,6 +18,7 @@ import com.fdkankan.scene.entity.ScenePro;
|
|
|
import com.fdkankan.scene.factory.FloorLogoHandlerFactory;
|
|
|
import com.fdkankan.scene.factory.FloorPlanHandlerFactory;
|
|
|
import com.fdkankan.scene.factory.MusicHandlerFactory;
|
|
|
+import com.fdkankan.scene.factory.ScreenshotHandlerFactory;
|
|
|
import com.fdkankan.scene.mapper.ISceneEditInfoMapper;
|
|
|
import com.fdkankan.scene.service.ISceneEditControlsService;
|
|
|
import com.fdkankan.scene.service.ISceneEditInfoService;
|
|
@@ -26,6 +27,7 @@ import com.fdkankan.scene.vo.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.IOException;
|
|
@@ -122,6 +124,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
SceneEditControlsVO sceneEditControlsVO = BeanUtil.copyProperties(sceneEditControls, SceneEditControlsVO.class);
|
|
|
sceneJson.setControls(sceneEditControlsVO);
|
|
|
sceneJson.setNum(sceneNum);
|
|
|
+ if(StrUtil.isNotEmpty(sceneEditInfo.getFloorPlanPath())){
|
|
|
+ sceneJson.setFloorPlanPaths(sceneEditInfo.getFloorPlanPath().split(","));
|
|
|
+ sceneJson.setFloorPlanStatus(CommonStatus.YES.code());
|
|
|
+ }
|
|
|
|
|
|
//上传sceneJson文件
|
|
|
String sceneJsonPath = String.format(ConstantFilePath.SCENE_VIEW_DATA_DATA_SCENEJSON, sceneNum);
|
|
@@ -175,6 +181,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
SceneInfoVO sceneInfoVO = BeanUtil.copyProperties(sceneEditInfo, SceneInfoVO.class);
|
|
|
sceneInfoVO.setControls(BeanUtil.copyProperties(sceneEditControls, SceneEditControlsVO.class));
|
|
|
sceneInfoVO.setNum(num);
|
|
|
+ //生成sceneJson
|
|
|
+ if(StrUtil.isNotEmpty(sceneEditInfo.getFloorPlanPath())){
|
|
|
+ sceneInfoVO.setFloorPlanPaths(sceneEditInfo.getFloorPlanPath().split(","));
|
|
|
+ sceneInfoVO.setFloorPlanStatus(CommonStatus.YES.code());
|
|
|
+ }
|
|
|
|
|
|
return sceneInfoVO;
|
|
|
}
|
|
@@ -208,18 +219,24 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+// @Transactional
|
|
|
public ResultData saveUpload(SaveUploadParamVO param) throws Exception {
|
|
|
FileBizType fileBizType = FileBizType.get(param.getBizType());
|
|
|
+ String num = param.getNum();
|
|
|
+ String fileInfo = param.getFileInfo();
|
|
|
if(Objects.isNull(fileBizType)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7003);
|
|
|
}
|
|
|
switch (fileBizType){
|
|
|
case MUSIC:
|
|
|
- return new MusicHandlerFactory().getHandler().save(param.getNum(), param.getFileInfo());
|
|
|
+ return new MusicHandlerFactory().getHandler().save(num, fileInfo);
|
|
|
case FLOOR_LOGO:
|
|
|
- return new FloorLogoHandlerFactory().getHandler().save(param.getNum(), param.getFileInfo());
|
|
|
+ return new FloorLogoHandlerFactory().getHandler().save(num, fileInfo);
|
|
|
case FLOOR_PLAN:
|
|
|
- return new FloorPlanHandlerFactory().getHandler().save(param.getNum(), param.getFileInfo());
|
|
|
+ return new FloorPlanHandlerFactory().getHandler().save(num, fileInfo);
|
|
|
+ case SCREENSHOT:
|
|
|
+ return new ScreenshotHandlerFactory().getHandler().save(num, fileInfo);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|