|
@@ -3,18 +3,15 @@ package com.gis.service.impl;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.gis.common.constant.ConfigConstant;
|
|
import com.gis.common.constant.ConfigConstant;
|
|
|
|
+import com.gis.common.constant.ErrorEnum;
|
|
import com.gis.common.util.*;
|
|
import com.gis.common.util.*;
|
|
import com.gis.domain.dto.*;
|
|
import com.gis.domain.dto.*;
|
|
-import com.gis.domain.entity.CatalogEntity;
|
|
|
|
import com.gis.domain.entity.SceneEntity;
|
|
import com.gis.domain.entity.SceneEntity;
|
|
-import com.gis.domain.tree.CatalogTree;
|
|
|
|
import com.gis.domain.vo.ProSceneVo;
|
|
import com.gis.domain.vo.ProSceneVo;
|
|
import com.gis.mapper.IBaseMapper;
|
|
import com.gis.mapper.IBaseMapper;
|
|
import com.gis.mapper.SceneMapper;
|
|
import com.gis.mapper.SceneMapper;
|
|
-//import com.gis.service.CatalogService;
|
|
|
|
import com.gis.service.SceneService;
|
|
import com.gis.service.SceneService;
|
|
import com.gis.service.WorkService;
|
|
import com.gis.service.WorkService;
|
|
-import com.gis.tree.CatalogTreeUtil;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.http.HttpResponse;
|
|
import org.apache.http.HttpResponse;
|
|
@@ -33,7 +30,6 @@ import java.util.*;
|
|
*/
|
|
*/
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
-//@Transactional
|
|
|
|
public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implements SceneService {
|
|
public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implements SceneService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -42,8 +38,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
@Autowired
|
|
@Autowired
|
|
WorkService workService;
|
|
WorkService workService;
|
|
|
|
|
|
-// @Autowired
|
|
|
|
-// CatalogService catalogService;
|
|
|
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ConfigConstant configConstant;
|
|
ConfigConstant configConstant;
|
|
@@ -65,7 +60,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
public Result select4dkk(PageDto param, String workId) {
|
|
public Result select4dkk(PageDto param, String workId) {
|
|
startPage(param);
|
|
startPage(param);
|
|
|
|
|
|
-// String url = "https://test.4dkankan.com/api/user/scene/list";
|
|
|
|
|
|
+ // String url = "https://test.4dkankan.com/api/user/scene/list";
|
|
String url = configConstant.domain4dKK + "/api/user/scene/list";
|
|
String url = configConstant.domain4dKK + "/api/user/scene/list";
|
|
JSONObject reqParam = new JSONObject();
|
|
JSONObject reqParam = new JSONObject();
|
|
reqParam.put("pageNum", param.getPageNum().toString());
|
|
reqParam.put("pageNum", param.getPageNum().toString());
|
|
@@ -95,13 +90,14 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
if (code == 3004) {
|
|
if (code == 3004) {
|
|
String msg = reJson.getString("msg");
|
|
String msg = reJson.getString("msg");
|
|
log.info("获取四维看看列表失败,{}", msg);
|
|
log.info("获取四维看看列表失败,{}", msg);
|
|
- return Result.failure(5001, msg);
|
|
|
|
|
|
+// return Result.failure(5001, msg);
|
|
|
|
+ return Result.failure(ErrorEnum.FAILURE_API_3201.code(), msg);
|
|
}
|
|
}
|
|
|
|
|
|
if (code != 0) {
|
|
if (code != 0) {
|
|
String msg = reJson.getString("msg");
|
|
String msg = reJson.getString("msg");
|
|
log.info("获取四维看看列表失败,{}", msg);
|
|
log.info("获取四维看看列表失败,{}", msg);
|
|
- return Result.failure(msg);
|
|
|
|
|
|
+ return Result.failure(ErrorEnum.FAILURE_API_3201.code(),msg);
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject dataJson = reJson.getJSONObject("data");
|
|
JSONObject dataJson = reJson.getJSONObject("data");
|
|
@@ -142,72 +138,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- /***
|
|
|
|
- * 根据父节点查询子节点
|
|
|
|
- */
|
|
|
|
-// private List<CatalogTree> getTreeByParentId(CatalogEntity catalogEntity){
|
|
|
|
-// Long parentId = catalogEntity.getParentId();
|
|
|
|
-//
|
|
|
|
-// List<CatalogTree> resultTree = new ArrayList<>();
|
|
|
|
-// // 根据父节点查询子节点
|
|
|
|
-// if (parentId != null) {
|
|
|
|
-// // 查找子节点
|
|
|
|
-// List<CatalogEntity> parents = catalogService.findByParentId(parentId);
|
|
|
|
-// // 查找父节点
|
|
|
|
-// CatalogEntity parentCatalog = catalogService.findById(parentId);
|
|
|
|
-//
|
|
|
|
-// parents.add(parentCatalog);
|
|
|
|
-// CatalogTreeUtil tree = new CatalogTreeUtil(parents);
|
|
|
|
-// resultTree = tree.buildTree();
|
|
|
|
-// } else {
|
|
|
|
-// // 只有父节点
|
|
|
|
-// CatalogTree catalogTree = new CatalogTree();
|
|
|
|
-// catalogTree.setId(catalogEntity.getId());
|
|
|
|
-// catalogTree.setName(catalogEntity.getName());
|
|
|
|
-// resultTree.add(catalogTree);
|
|
|
|
-// }
|
|
|
|
-// return resultTree;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 创建分组
|
|
|
|
- *
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
-// private CatalogEntity createCatalog(CatalogSceneDto params) {
|
|
|
|
-// Long parentId = params.getParentId();
|
|
|
|
-// String parentName = params.getParentName();
|
|
|
|
-// Long workId = params.getWorkId();
|
|
|
|
-//
|
|
|
|
-// CatalogEntity entity = new CatalogEntity();
|
|
|
|
-// entity.setName(params.getCatalogName());
|
|
|
|
-// entity.setWorkId(workId);
|
|
|
|
-// // 当父id不为空时
|
|
|
|
-// if (parentId != null) {
|
|
|
|
-// entity.setParentId(parentId);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// // 创建父目录
|
|
|
|
-// if (parentId == null && parentName != null) {
|
|
|
|
-// CatalogEntity parentEntity = new CatalogEntity();
|
|
|
|
-// parentEntity.setWorkId(workId);
|
|
|
|
-// parentEntity.setName(parentName);
|
|
|
|
-// catalogService.save(parentEntity);
|
|
|
|
-// entity.setParentId(parentEntity.getId());
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// // 创建目录
|
|
|
|
-// catalogService.save(entity);
|
|
|
|
-// return entity;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public List<String> strFindByWorkId(String workId, String type) {
|
|
public List<String> strFindByWorkId(String workId, String type) {
|
|
return entityMapper.strFindByWorkId(workId, type);
|
|
return entityMapper.strFindByWorkId(workId, type);
|
|
@@ -244,16 +174,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public Result checkToken() {
|
|
|
|
- String userNameForToken = getUserNameForToken();
|
|
|
|
- if (StringUtils.isNotBlank(userNameForToken)) {
|
|
|
|
- log.warn("token: " + userNameForToken);
|
|
|
|
- } else {
|
|
|
|
- log.warn("token 为空");
|
|
|
|
- }
|
|
|
|
- return Result.success();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result upload(MultipartFile file) {
|
|
public Result upload(MultipartFile file) {
|