|
@@ -1,79 +1,55 @@
|
|
package com.onemap.apply.controller.dimentity;
|
|
package com.onemap.apply.controller.dimentity;
|
|
|
|
|
|
-import com.onemap.apply.domain.dimentity.DimEntityDto;
|
|
+import com.onemap.apply.domain.dimentity.EntityRelationshipToNeo4jVo;
|
|
import com.onemap.apply.mapper.dimentity.DimEntityReponsitory;
|
|
import com.onemap.apply.mapper.dimentity.DimEntityReponsitory;
|
|
import com.onemap.apply.service.dimentity.DimEntityService;
|
|
import com.onemap.apply.service.dimentity.DimEntityService;
|
|
|
|
+import com.onemap.common.core.utils.StringUtils;
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.neo4j.core.Neo4jClient;
|
|
import org.springframework.data.neo4j.core.Neo4jClient;
|
|
-import org.springframework.data.neo4j.core.Neo4jTemplate;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import java.io.IOException;
|
|
|
|
-import java.util.Collection;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("dimentity")
|
|
@RequestMapping("dimentity")
|
|
public class DimEntityController {
|
|
public class DimEntityController {
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private DimEntityReponsitory dimEntityReponsitory;
|
|
|
|
- @Autowired
|
|
|
|
- private Neo4jClient neo4jClient;
|
|
|
|
@Resource
|
|
@Resource
|
|
private DimEntityService dimEntityService;
|
|
private DimEntityService dimEntityService;
|
|
|
|
|
|
@GetMapping("/entity/code/table/tree")
|
|
@GetMapping("/entity/code/table/tree")
|
|
- public RequestResult queryEntityCodeTableTree(String id) throws IOException {
|
|
+ public RequestResult queryEntityCodeTableTree(String id) {
|
|
return RequestResult.success(dimEntityService.queryEntityCodeTableTree(id));
|
|
return RequestResult.success(dimEntityService.queryEntityCodeTableTree(id));
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("/entity/data")
|
|
@GetMapping("/entity/data")
|
|
- public RequestResult queryEntityData(String entityid) throws IOException {
|
|
+ public RequestResult queryEntityData(String entityid) {
|
|
return RequestResult.success(dimEntityService.queryEntityData(entityid));
|
|
return RequestResult.success(dimEntityService.queryEntityData(entityid));
|
|
}
|
|
}
|
|
|
|
|
|
- @GetMapping("/test")
|
|
+ @GetMapping("/entity/relationship")
|
|
- public RequestResult test() throws IOException {
|
|
+ public RequestResult queryEntityRelationship(String entityid) {
|
|
- dimEntityService.TestToNe04j();
|
|
+ return RequestResult.success(dimEntityService.queryEntityRelationshipToNeo4j(entityid));
|
|
- return RequestResult.success("操作成功", 0);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+ @GetMapping("/entity/add/relationship")
|
|
-
|
|
+ public RequestResult addEntityRelationship(EntityRelationshipToNeo4jVo entityRelationshipToNeo4jVo) {
|
|
-
|
|
+ if (entityRelationshipToNeo4jVo == null) {
|
|
-
|
|
+ return RequestResult.error("参数缺失");
|
|
-
|
|
+ }
|
|
-
|
|
+ if (StringUtils.isEmpty(entityRelationshipToNeo4jVo.getComentityid())) {
|
|
-
|
|
+ return RequestResult.error("参数缺失");
|
|
-
|
|
+ }
|
|
-
|
|
+ if (StringUtils.isEmpty(entityRelationshipToNeo4jVo.getEntityid())) {
|
|
-
|
|
+ return RequestResult.error("参数缺失");
|
|
-
|
|
+ }
|
|
-
|
|
+ if (StringUtils.isEmpty(entityRelationshipToNeo4jVo.getComrelation())) {
|
|
-
|
|
+ return RequestResult.error("参数缺失");
|
|
-
|
|
+ }
|
|
-
|
|
+ dimEntityService.createEntityRelationshipToNeo4j(entityRelationshipToNeo4jVo);
|
|
-
|
|
+ return RequestResult.success("操作成功", 0);
|
|
-
|
|
+ }
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
}
|
|
}
|