bc_zhang 4 年之前
父节点
当前提交
607d735c02
共有 37 个文件被更改,包括 410 次插入373 次删除
  1. 19 0
      src/main/java/com/zglc/kg/controller/DeviceController.java
  2. 78 78
      src/main/java/com/zglc/kg/controller/ImgsController.java
  3. 20 0
      src/main/java/com/zglc/kg/dao/Device1Dao.java
  4. 13 40
      src/main/java/com/zglc/kg/entity/Aircraft1Entity.java
  5. 46 42
      src/main/java/com/zglc/kg/entity/AircraftSystemRelationEntity.java
  6. 2 2
      src/main/java/com/zglc/kg/entity/Algorithm1Entity.java
  7. 1 1
      src/main/java/com/zglc/kg/entity/DataSourceEntity.java
  8. 113 110
      src/main/java/com/zglc/kg/entity/Device1Entity.java
  9. 46 42
      src/main/java/com/zglc/kg/entity/SubsystemDeviceRelationEntity.java
  10. 46 42
      src/main/java/com/zglc/kg/entity/SystemSubsystemRelationEntity.java
  11. 2 2
      src/main/java/com/zglc/kg/service/AircraftService.java
  12. 1 1
      src/main/java/com/zglc/kg/service/AlgorithmService.java
  13. 23 10
      src/main/java/com/zglc/kg/service/DeviceService.java
  14. 0 3
      src/main/java/com/zglc/kg/service/MovieService.java
  15. 二进制
      target/classes/com/zglc/kg/controller/DeviceController.class
  16. 二进制
      target/classes/com/zglc/kg/controller/ImgsController.class
  17. 二进制
      target/classes/com/zglc/kg/controller/TestController.class
  18. 二进制
      target/classes/com/zglc/kg/dao/DeptDao.class
  19. 二进制
      target/classes/com/zglc/kg/dao/Device1Dao.class
  20. 二进制
      target/classes/com/zglc/kg/dao/RelationShipDao.class
  21. 二进制
      target/classes/com/zglc/kg/entity/Aircraft1Entity.class
  22. 二进制
      target/classes/com/zglc/kg/entity/AircraftSystemRelationEntity.class
  23. 二进制
      target/classes/com/zglc/kg/entity/Algorithm1Entity.class
  24. 二进制
      target/classes/com/zglc/kg/entity/DataSourceEntity.class
  25. 二进制
      target/classes/com/zglc/kg/entity/DeptEntity$DeptEntityBuilder.class
  26. 二进制
      target/classes/com/zglc/kg/entity/DeptEntity.class
  27. 二进制
      target/classes/com/zglc/kg/entity/Device1Entity.class
  28. 二进制
      target/classes/com/zglc/kg/entity/RelationShipEntity$RelationShipEntityBuilder.class
  29. 二进制
      target/classes/com/zglc/kg/entity/RelationShipEntity.class
  30. 二进制
      target/classes/com/zglc/kg/entity/SubsystemDeviceRelationEntity.class
  31. 二进制
      target/classes/com/zglc/kg/entity/SystemSubsystemRelationEntity.class
  32. 二进制
      target/classes/com/zglc/kg/service/AircraftService.class
  33. 二进制
      target/classes/com/zglc/kg/service/AlgorithmService.class
  34. 二进制
      target/classes/com/zglc/kg/service/DeviceService.class
  35. 二进制
      target/classes/com/zglc/kg/service/MovieService.class
  36. 二进制
      target/kg-1.0.jar
  37. 二进制
      target/kg-1.0.jar.original

+ 19 - 0
src/main/java/com/zglc/kg/controller/DeviceController.java

@@ -16,6 +16,7 @@ import com.zglc.kg.service.DeviceService;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 
 @Api(tags = "元器件管理接口")
@@ -129,4 +130,22 @@ public class DeviceController {
     public Result<List<DeviceEntity>> getByName(@RequestParam("name") String name,Integer deviceType){
         return deviceService.findByName(name,deviceType);
     }
+
+    @ApiOperation("查询机型系统图谱")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("findAllAircraftSystemRe")
+    public Result<List<AircraftSystemRelationEntity>> findAllAircraftSystemRe(){
+        return  deviceService.findAllAircraftSystemRe();
+    }
+
+    @ApiOperation("按机型查看图谱")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("findAircraftKg")
+    public Result<Map<String, Object>> findAircraftKg(String name){
+        return deviceService.findAircraftKg(name);
+    }
 }

+ 78 - 78
src/main/java/com/zglc/kg/controller/ImgsController.java

@@ -1,78 +1,78 @@
-package com.zglc.kg.controller;
-
-import javax.annotation.Resource;
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.zglc.kg.entity.DeleteEntity;
-import org.springframework.web.bind.annotation.*;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.ImgsEntity;
-import com.zglc.kg.service.ImgsService;
-
-
-
-/**
- * 图片资料
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-17 02:23:39
- * @description Refactoring 1st
- *
- */
- 
-@Api(tags = "图片资料接口")
-@RequestMapping("api/imgs")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-public class ImgsController {
-
-	@Resource
-    private final ImgsService imgsService;
-
-	public ImgsController(ImgsService imgsService){this.imgsService = imgsService;}
-	
-	@ApiOperation("分页列出所有图片")
-	@ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listpage")
-    public Result<PageInfo<ImgsEntity>> listpage(Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(imgsService.getAllImgs()));
-    }
-	
-    @ApiOperation("按ID查找图片")
-	@ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("get")
-    public  Result<ImgsEntity> get(@RequestParam Integer id){return  Result.success(imgsService.getImgs(id));}
-
-    @ApiOperation("增添图片")
-	@ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("add")
-    public Result<String> add( @RequestBody ImgsEntity data){return  imgsService.add(data);}
-
-    @ApiOperation("删除图片")
-	@ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("delete")
-    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  imgsService.delete(deleteEntity.getIds());}
-
-    @ApiOperation("修改图片")
-	@ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody ImgsEntity data){return  imgsService.edit(data);}
-
-}
+//package com.zglc.kg.controller;
+//
+//import javax.annotation.Resource;
+//
+//import com.github.pagehelper.PageHelper;
+//import com.github.pagehelper.PageInfo;
+//import com.zglc.kg.entity.DeleteEntity;
+//import org.springframework.web.bind.annotation.*;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import io.swagger.annotations.ApiResponse;
+//import io.swagger.annotations.ApiResponses;
+//import com.zglc.kg.base.Result;
+//import com.zglc.kg.entity.ImgsEntity;
+//import com.zglc.kg.service.ImgsService;
+//
+//
+//
+///**
+// * 图片资料
+// *
+// * @author wcf
+// * @email mnhwa@163.com
+// * @date 2020-02-17 02:23:39
+// * @description Refactoring 1st
+// *
+// */
+//
+//@Api(tags = "图片资料接口")
+//@RequestMapping("api/imgs")
+//@CrossOrigin(allowCredentials = "true")
+//@RestController
+//public class ImgsController {
+//
+//	@Resource
+//    private final ImgsService imgsService;
+//
+//	public ImgsController(ImgsService imgsService){this.imgsService = imgsService;}
+//
+//	@ApiOperation("分页列出所有图片")
+//	@ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("listpage")
+//    public Result<PageInfo<ImgsEntity>> listpage(Integer page, Integer size) {
+//        PageHelper.startPage(page, size, "id desc");
+//        return Result.success(new PageInfo<>(imgsService.getAllImgs()));
+//    }
+//
+//    @ApiOperation("按ID查找图片")
+//	@ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("get")
+//    public  Result<ImgsEntity> get(@RequestParam Integer id){return  Result.success(imgsService.getImgs(id));}
+//
+//    @ApiOperation("增添图片")
+//	@ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("add")
+//    public Result<String> add( @RequestBody ImgsEntity data){return  imgsService.add(data);}
+//
+//    @ApiOperation("删除图片")
+//	@ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("delete")
+//    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  imgsService.delete(deleteEntity.getIds());}
+//
+//    @ApiOperation("修改图片")
+//	@ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("edit")
+//    public Result<String> edit( @RequestBody ImgsEntity data){return  imgsService.edit(data);}
+//
+//}

+ 20 - 0
src/main/java/com/zglc/kg/dao/Device1Dao.java

@@ -1,6 +1,9 @@
 package com.zglc.kg.dao;
 
 import com.zglc.kg.entity.Device1Entity;
+import com.zglc.kg.entity.AircraftSystemRelationEntity;
+import com.zglc.kg.entity.SystemSubsystemRelationEntity;
+import com.zglc.kg.entity.SubsystemDeviceRelationEntity;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.data.neo4j.annotation.Query;
 import org.springframework.data.neo4j.repository.Neo4jRepository;
@@ -17,5 +20,22 @@ public interface Device1Dao extends Neo4jRepository<Device1Entity,Long> {
     @Query("MATCH (n:device)-[r]-() WHERE n.mysql_id={id} DELETE n,r")
     void deleteNR(@Param("id") Integer id);
 
+    @Query("match p= (na:aircraft)-[re:RelationAS]->(nb:device) return p")
+    List<AircraftSystemRelationEntity> findAllAircraftSystemRe();
+
+    @Query("match p= (na:device)-[re:RelationSysSub]->(nb:device) return p")
+    List<SystemSubsystemRelationEntity> findAllSystemSubsystemRe();
+
+    @Query("match p= (na:device)-[re:RelationSubD]->(nb:device) return p")
+    List<SubsystemDeviceRelationEntity> findAllSubsystemDeviceRe();
+
+    @Query("match p= (na:aircraft)-[re:RelationAS]->(nb:device) WHERE na.name={name} return p")
+    List<AircraftSystemRelationEntity> findAircraftSystemReByAircraft(@Param("name") String name);
+
+    @Query("match p= (na:device)-[re:RelationSysSub]->(nb:device) WHERE na.aircraft_type={name} return p")
+    List<SystemSubsystemRelationEntity> findSystemSubsystemReByAircraft(@Param("name") String name);
+
+    @Query("match p= (na:device)-[re:RelationSubD]->(nb:device) WHERE na.aircraft_type={name} return p")
+    List<SubsystemDeviceRelationEntity> findSubsystemDeviceReByAircraft(@Param("name") String name);
 }
 

+ 13 - 40
src/main/java/com/zglc/kg/entity/Aircraft1Entity.java

@@ -1,11 +1,15 @@
 package com.zglc.kg.entity;
 
 import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
 import org.neo4j.ogm.annotation.NodeEntity;
 import org.neo4j.ogm.annotation.Property;
 
 import javax.persistence.*;
 
+@Getter
+@Setter
 @NodeEntity(label = "aircraft")
 public class Aircraft1Entity {
 
@@ -13,8 +17,8 @@ public class Aircraft1Entity {
     @GeneratedValue
     private Long id;
 
-    @Property(name = "aircraft_type")
-    private String aircraftType;
+    @Property(name = "name")
+    private String name;
 
     @Property(name = "aircraft_describe")
     private String aircraftDescribe;
@@ -25,44 +29,13 @@ public class Aircraft1Entity {
     public Aircraft1Entity() {
     }
 
-    public Aircraft1Entity(Long id, String aircraftType, String aircraftDescribe,Integer mysqlId) {
-        this.id = id;
-        this.aircraftType = aircraftType;
-        this.aircraftDescribe = aircraftDescribe;
-        this.mysqlId = mysqlId;
+//    public Aircraft1Entity(Long id, String name, String aircraftDescribe,Integer mysqlId) {
+//        this.id = id;
+//        this.name = name;
+//        this.aircraftDescribe = aircraftDescribe;
+//        this.mysqlId = mysqlId;
+//
+//    }
 
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getAircraftType() {
-        return aircraftType;
-    }
-
-    public void setAircraftType(String aircraftType) {
-        this.aircraftType = aircraftType;
-    }
-
-    public String getAircraftDescribe() {
-        return aircraftDescribe;
-    }
-
-    public void setAircraftDescribe(String aircraftDescribe) {
-        this.aircraftDescribe = aircraftDescribe;
-    }
-
-    public Integer getMysqlId() {
-        return mysqlId;
-    }
-
-    public void setMysqlId(Integer mysqlId) {
-        this.mysqlId = mysqlId;
-    }
 
 }

+ 46 - 42
src/main/java/com/zglc/kg/entity/AircraftSystemRelationEntity.java

@@ -1,5 +1,7 @@
 package com.zglc.kg.entity;
 
+import lombok.Getter;
+import lombok.Setter;
 import org.neo4j.ogm.annotation.EndNode;
 import org.neo4j.ogm.annotation.Property;
 import org.neo4j.ogm.annotation.RelationshipEntity;
@@ -8,6 +10,8 @@ import org.neo4j.ogm.annotation.StartNode;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
+@Getter
+@Setter
 @RelationshipEntity(type = "RelationAS")
 public class AircraftSystemRelationEntity {
     @Id
@@ -18,48 +22,48 @@ public class AircraftSystemRelationEntity {
     @EndNode
     private Device1Entity endNode;
     @Property
-    private String relationAS;
+    private String relation;
 
-    public AircraftSystemRelationEntity() {
-    }
-
-    public AircraftSystemRelationEntity(Long id, Aircraft1Entity startNode, Device1Entity endNode, String relationAS) {
-        this.id = id;
-        this.startNode = startNode;
-        this.endNode = endNode;
-        this.relationAS = relationAS;
-    }
-
-    public String getRelationAS() {
-        return relationAS;
-    }
-
-    public void setRelationAS(String relationAS) {
-        this.relationAS = relationAS;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Aircraft1Entity getStartNode() {
-        return startNode;
-    }
-
-    public void setStartNode(Aircraft1Entity startNode) {
-        this.startNode = startNode;
-    }
-
-    public Device1Entity getEndNode() {
-        return endNode;
-    }
-
-    public void setEndNode(Device1Entity endNode) {
-        this.endNode = endNode;
-    }
+//    public AircraftSystemRelationEntity() {
+//    }
+//
+//    public AircraftSystemRelationEntity(Long id, Aircraft1Entity startNode, Device1Entity endNode, String relationAS) {
+//        this.id = id;
+//        this.startNode = startNode;
+//        this.endNode = endNode;
+//        this.relationAS = relationAS;
+//    }
+//
+//    public String getRelationAS() {
+//        return relationAS;
+//    }
+//
+//    public void setRelationAS(String relationAS) {
+//        this.relationAS = relationAS;
+//    }
+//
+//    public Long getId() {
+//        return id;
+//    }
+//
+//    public void setId(Long id) {
+//        this.id = id;
+//    }
+//
+//    public Aircraft1Entity getStartNode() {
+//        return startNode;
+//    }
+//
+//    public void setStartNode(Aircraft1Entity startNode) {
+//        this.startNode = startNode;
+//    }
+//
+//    public Device1Entity getEndNode() {
+//        return endNode;
+//    }
+//
+//    public void setEndNode(Device1Entity endNode) {
+//        this.endNode = endNode;
+//    }
 
 }

+ 2 - 2
src/main/java/com/zglc/kg/entity/Algorithm1Entity.java

@@ -22,8 +22,8 @@ public class Algorithm1Entity {
     @Property(name = "algorithm_type")
     private String algorithmType;
 
-    @Property(name = "algorithm_title")
-    private String algorithmTitle;
+    @Property(name = "name")
+    private String name;
 
     @Property(name = "algorithm_method_name")
     private String algorithmMethodName;

+ 1 - 1
src/main/java/com/zglc/kg/entity/DataSourceEntity.java

@@ -23,7 +23,7 @@ public class DataSourceEntity {
     private Integer port_number;
 
     @Column(name = "source_status")
-    private String source_status;
+    private Integer source_status;
 
     @Column(name = "remarks")
     private String remarks;

+ 113 - 110
src/main/java/com/zglc/kg/entity/Device1Entity.java

@@ -1,13 +1,16 @@
 package com.zglc.kg.entity;
 
 import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
 import org.neo4j.ogm.annotation.NodeEntity;
 import org.neo4j.ogm.annotation.Property;
 
 import javax.persistence.*;
 import java.io.Serializable;
 
-
+@Getter
+@Setter
 @NodeEntity(label = "device")
 public class Device1Entity {
 
@@ -15,8 +18,8 @@ public class Device1Entity {
     @GeneratedValue
     private Long id;
 
-    @Property(name = "device_name")
-    private String device_name;
+    @Property(name = "name")
+    private String name;
 
     @Property(name = "device_type")
     private Integer device_type;
@@ -45,111 +48,111 @@ public class Device1Entity {
     @Property(name = "mysql_id")
     private Integer mysqlId;
 
-    public Device1Entity() {
-    }
-
-    public Device1Entity(Long id, String device_name, Integer device_type,String device_describe, Integer aircraft_id,
-                         String aircraft_type,Integer syst_id,String syst_name,Integer subsys_id,String subsys_name,
-                         Integer mysqlId) {
-        this.id = id;
-        this.device_name = device_name;
-        this.device_type = device_type;
-        this.device_describe = device_describe;
-        this.aircraft_id = aircraft_id;
-        this.aircraft_type = aircraft_type;
-        this.syst_id = syst_id;
-        this.syst_name = syst_name;
-        this.subsys_id = subsys_id;
-        this.subsys_name = subsys_name;
-        this.mysqlId = mysqlId;
-
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getDevice_name() {
-        return device_name;
-    }
-
-    public void setDevice_name(String device_name) {
-        this.device_name = device_name;
-    }
-
-    public Integer getDevice_type() {
-        return device_type;
-    }
-
-    public void setDevice_type(Integer device_type) {
-        this.device_type = device_type;
-    }
-
-    public String getDevice_describe() {
-        return device_describe;
-    }
-
-    public void setDevice_describe(String device_describe) {
-        this.device_describe = device_describe;
-    }
-
-    public Integer getAircraft_id() {
-        return aircraft_id;
-    }
-
-    public void setAircraft_id(Integer aircraft_id) {
-        this.aircraft_id = aircraft_id;
-    }
-
-    public String getAircraft_type() {
-        return aircraft_type;
-    }
-
-    public void setAircraft_type(String aircraft_type) {
-        this.aircraft_type = aircraft_type;
-    }
-
-    public Integer getSyst_id() {
-        return syst_id;
-    }
-
-    public void setSyst_id(Integer syst_id) {
-        this.syst_id = syst_id;
-    }
-
-    public String getSyst_name() {
-        return syst_name;
-    }
-
-    public void setSyst_name(String syst_name) {
-        this.syst_name = syst_name;
-    }
-
-    public Integer getSubsys_id() {
-        return subsys_id;
-    }
-
-    public void setSubsys_id(Integer subsys_id) {
-        this.subsys_id = subsys_id;
-    }
-
-    public String getSubsys_name() {
-        return subsys_name;
-    }
-
-    public void setSubsys_name(String subsys_name) {
-        this.subsys_name = subsys_name;
-    }
-
-    public Integer getMysqlId() {
-        return mysqlId;
-    }
-
-    public void setMysqlId(Integer mysqlId) {
-        this.mysqlId = mysqlId;
-    }
+//    public Device1Entity() {
+//    }
+//
+//    public Device1Entity(Long id, String device_name, Integer device_type,String device_describe, Integer aircraft_id,
+//                         String aircraft_type,Integer syst_id,String syst_name,Integer subsys_id,String subsys_name,
+//                         Integer mysqlId) {
+//        this.id = id;
+//        this.device_name = device_name;
+//        this.device_type = device_type;
+//        this.device_describe = device_describe;
+//        this.aircraft_id = aircraft_id;
+//        this.aircraft_type = aircraft_type;
+//        this.syst_id = syst_id;
+//        this.syst_name = syst_name;
+//        this.subsys_id = subsys_id;
+//        this.subsys_name = subsys_name;
+//        this.mysqlId = mysqlId;
+//
+//    }
+
+//    public Long getId() {
+//        return id;
+//    }
+//
+//    public void setId(Long id) {
+//        this.id = id;
+//    }
+//
+//    public String getDevice_name() {
+//        return device_name;
+//    }
+//
+//    public void setDevice_name(String device_name) {
+//        this.device_name = device_name;
+//    }
+//
+//    public Integer getDevice_type() {
+//        return device_type;
+//    }
+//
+//    public void setDevice_type(Integer device_type) {
+//        this.device_type = device_type;
+//    }
+//
+//    public String getDevice_describe() {
+//        return device_describe;
+//    }
+//
+//    public void setDevice_describe(String device_describe) {
+//        this.device_describe = device_describe;
+//    }
+//
+//    public Integer getAircraft_id() {
+//        return aircraft_id;
+//    }
+//
+//    public void setAircraft_id(Integer aircraft_id) {
+//        this.aircraft_id = aircraft_id;
+//    }
+//
+//    public String getAircraft_type() {
+//        return aircraft_type;
+//    }
+//
+//    public void setAircraft_type(String aircraft_type) {
+//        this.aircraft_type = aircraft_type;
+//    }
+//
+//    public Integer getSyst_id() {
+//        return syst_id;
+//    }
+//
+//    public void setSyst_id(Integer syst_id) {
+//        this.syst_id = syst_id;
+//    }
+//
+//    public String getSyst_name() {
+//        return syst_name;
+//    }
+//
+//    public void setSyst_name(String syst_name) {
+//        this.syst_name = syst_name;
+//    }
+//
+//    public Integer getSubsys_id() {
+//        return subsys_id;
+//    }
+//
+//    public void setSubsys_id(Integer subsys_id) {
+//        this.subsys_id = subsys_id;
+//    }
+//
+//    public String getSubsys_name() {
+//        return subsys_name;
+//    }
+//
+//    public void setSubsys_name(String subsys_name) {
+//        this.subsys_name = subsys_name;
+//    }
+//
+//    public Integer getMysqlId() {
+//        return mysqlId;
+//    }
+//
+//    public void setMysqlId(Integer mysqlId) {
+//        this.mysqlId = mysqlId;
+//    }
 }

+ 46 - 42
src/main/java/com/zglc/kg/entity/SubsystemDeviceRelationEntity.java

@@ -1,5 +1,7 @@
 package com.zglc.kg.entity;
 
+import lombok.Getter;
+import lombok.Setter;
 import org.neo4j.ogm.annotation.EndNode;
 import org.neo4j.ogm.annotation.Property;
 import org.neo4j.ogm.annotation.RelationshipEntity;
@@ -8,6 +10,8 @@ import org.neo4j.ogm.annotation.StartNode;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
+@Getter
+@Setter
 @RelationshipEntity(type = "RelationSubD")
 public class SubsystemDeviceRelationEntity {
     @Id
@@ -18,48 +22,48 @@ public class SubsystemDeviceRelationEntity {
     @EndNode
     private Device1Entity endNode;
     @Property
-    private String RelationSubD;
+    private String relation;
 
-    public SubsystemDeviceRelationEntity() {
-    }
-
-    public SubsystemDeviceRelationEntity(Long id, Device1Entity startNode, Device1Entity endNode, String RelationSubD) {
-        this.id = id;
-        this.startNode = startNode;
-        this.endNode = endNode;
-        this.RelationSubD = RelationSubD;
-    }
-
-    public String getRelationSubD() {
-        return RelationSubD;
-    }
-
-    public void setRelationSubD(String RelationSubD) {
-        this.RelationSubD = RelationSubD;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Device1Entity getStartNode() {
-        return startNode;
-    }
-
-    public void setStartNode(Device1Entity startNode) {
-        this.startNode = startNode;
-    }
-
-    public Device1Entity getEndNode() {
-        return endNode;
-    }
-
-    public void setEndNode(Device1Entity endNode) {
-        this.endNode = endNode;
-    }
+//    public SubsystemDeviceRelationEntity() {
+//    }
+//
+//    public SubsystemDeviceRelationEntity(Long id, Device1Entity startNode, Device1Entity endNode, String RelationSubD) {
+//        this.id = id;
+//        this.startNode = startNode;
+//        this.endNode = endNode;
+//        this.RelationSubD = RelationSubD;
+//    }
+//
+//    public String getRelationSubD() {
+//        return RelationSubD;
+//    }
+//
+//    public void setRelationSubD(String RelationSubD) {
+//        this.RelationSubD = RelationSubD;
+//    }
+//
+//    public Long getId() {
+//        return id;
+//    }
+//
+//    public void setId(Long id) {
+//        this.id = id;
+//    }
+//
+//    public Device1Entity getStartNode() {
+//        return startNode;
+//    }
+//
+//    public void setStartNode(Device1Entity startNode) {
+//        this.startNode = startNode;
+//    }
+//
+//    public Device1Entity getEndNode() {
+//        return endNode;
+//    }
+//
+//    public void setEndNode(Device1Entity endNode) {
+//        this.endNode = endNode;
+//    }
 
 }

+ 46 - 42
src/main/java/com/zglc/kg/entity/SystemSubsystemRelationEntity.java

@@ -1,5 +1,7 @@
 package com.zglc.kg.entity;
 
+import lombok.Getter;
+import lombok.Setter;
 import org.neo4j.ogm.annotation.EndNode;
 import org.neo4j.ogm.annotation.Property;
 import org.neo4j.ogm.annotation.RelationshipEntity;
@@ -8,6 +10,8 @@ import org.neo4j.ogm.annotation.StartNode;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
+@Getter
+@Setter
 @RelationshipEntity(type = "RelationSysSub")
 public class SystemSubsystemRelationEntity {
     @Id
@@ -18,48 +22,48 @@ public class SystemSubsystemRelationEntity {
     @EndNode
     private Device1Entity endNode;
     @Property
-    private String RelationSysSub;
+    private String relation;
 
-    public SystemSubsystemRelationEntity() {
-    }
-
-    public SystemSubsystemRelationEntity(Long id, Device1Entity startNode, Device1Entity endNode, String RelationSysSub) {
-        this.id = id;
-        this.startNode = startNode;
-        this.endNode = endNode;
-        this.RelationSysSub = RelationSysSub;
-    }
-
-    public String getRelationSysSub() {
-        return RelationSysSub;
-    }
-
-    public void setRelationSysSub(String RelationSysSub) {
-        this.RelationSysSub = RelationSysSub;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Device1Entity getStartNode() {
-        return startNode;
-    }
-
-    public void setStartNode(Device1Entity startNode) {
-        this.startNode = startNode;
-    }
-
-    public Device1Entity getEndNode() {
-        return endNode;
-    }
-
-    public void setEndNode(Device1Entity endNode) {
-        this.endNode = endNode;
-    }
+//    public SystemSubsystemRelationEntity() {
+//    }
+//
+//    public SystemSubsystemRelationEntity(Long id, Device1Entity startNode, Device1Entity endNode, String RelationSysSub) {
+//        this.id = id;
+//        this.startNode = startNode;
+//        this.endNode = endNode;
+//        this.RelationSysSub = RelationSysSub;
+//    }
+//
+//    public String getRelationSysSub() {
+//        return RelationSysSub;
+//    }
+//
+//    public void setRelationSysSub(String RelationSysSub) {
+//        this.RelationSysSub = RelationSysSub;
+//    }
+//
+//    public Long getId() {
+//        return id;
+//    }
+//
+//    public void setId(Long id) {
+//        this.id = id;
+//    }
+//
+//    public Device1Entity getStartNode() {
+//        return startNode;
+//    }
+//
+//    public void setStartNode(Device1Entity startNode) {
+//        this.startNode = startNode;
+//    }
+//
+//    public Device1Entity getEndNode() {
+//        return endNode;
+//    }
+//
+//    public void setEndNode(Device1Entity endNode) {
+//        this.endNode = endNode;
+//    }
 
 }

+ 2 - 2
src/main/java/com/zglc/kg/service/AircraftService.java

@@ -64,7 +64,7 @@ public class AircraftService {
             //加入机型节点
             Aircraft1Entity aircraft1 = new Aircraft1Entity();
 //            aircraft1.setId(data.getId().longValue());
-            aircraft1.setAircraftType(data.getAircraft_type());
+            aircraft1.setName(data.getAircraft_type());
             aircraft1.setAircraftDescribe(data.getAircraft_describe());
             aircraft1.setMysqlId(aircraft2.getId());
             aircraft1Dao.save(aircraft1);
@@ -108,7 +108,7 @@ public class AircraftService {
         if (tmpData != null) {
             int index = aircraftDao.updateByPrimaryKeySelective(data);
             Aircraft1Entity aircraft1 = aircraft1Dao.getAircraft1EntitiesByMysqlId(data.getId());
-            aircraft1.setAircraftType(data.getAircraft_type());
+            aircraft1.setName(data.getAircraft_type());
             aircraft1.setAircraftDescribe(data.getAircraft_describe());
             aircraft1.setMysqlId(data.getId());
             aircraft1Dao.save(aircraft1);

+ 1 - 1
src/main/java/com/zglc/kg/service/AlgorithmService.java

@@ -38,7 +38,7 @@ public class AlgorithmService {
         //加入机型节点
         Algorithm1Entity algorithm1 = new Algorithm1Entity();
         algorithm1.setAlgorithmType(data.getAlgorithm_type());
-        algorithm1.setAlgorithmTitle(data.getAlgorithm_title());
+        algorithm1.setName(data.getAlgorithm_title());
         algorithm1.setAlgorithmMethodName(data.getAlgorithm_method_name());
         algorithm1.setAlgorithmFormat(data.getAlgorithm_format());
         algorithm1.setAlgorithmDes(data.getAlgorithm_des());

+ 23 - 10
src/main/java/com/zglc/kg/service/DeviceService.java

@@ -6,8 +6,10 @@ import com.zglc.kg.base.Result;
 import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class DeviceService {
@@ -43,7 +45,7 @@ public class DeviceService {
                 DeviceEntity device = deviceDao.getLastInsert();
                 Device1Entity device1 = new Device1Entity();
 //                device1.setId(device.getId().longValue());
-                device1.setDevice_name(device.getDevice_name());
+                device1.setName(device.getDevice_name());
                 device1.setDevice_type(device.getDevice_type());
                 device1.setDevice_describe(device.getDevice_describe());
                 device1.setAircraft_id(device.getAircraft_id());
@@ -54,7 +56,7 @@ public class DeviceService {
                 device1.setSubsys_name(device.getSubsys_name());
                 device1.setMysqlId(device.getId());
                 aircraftSystemRelation.setEndNode(device1);
-                aircraftSystemRelation.setRelationAS("包含");
+                aircraftSystemRelation.setRelation("包含");
                 aircraftSystemRelationDao.save(aircraftSystemRelation);
                 break;
             }
@@ -64,7 +66,7 @@ public class DeviceService {
                 systemSubsystemRelation.setStartNode(device1);
                 DeviceEntity device = deviceDao.getLastInsert();
                 Device1Entity device2 = new Device1Entity();
-                device2.setDevice_name(device.getDevice_name());
+                device2.setName(device.getDevice_name());
                 device2.setDevice_type(device.getDevice_type());
                 device2.setDevice_describe(device.getDevice_describe());
                 device2.setAircraft_id(device.getAircraft_id());
@@ -75,7 +77,7 @@ public class DeviceService {
                 device2.setSubsys_name(device.getSubsys_name());
                 device2.setMysqlId(device.getId());
                 systemSubsystemRelation.setEndNode(device2);
-                systemSubsystemRelation.setRelationSysSub("包含");
+                systemSubsystemRelation.setRelation("包含");
                 systemSubsystemRelationDao.save(systemSubsystemRelation);
                 break;
             }
@@ -85,7 +87,7 @@ public class DeviceService {
                 subsystemDeviceRelation.setStartNode(device1);
                 DeviceEntity device = deviceDao.getLastInsert();
                 Device1Entity device2 = new Device1Entity();
-                device2.setDevice_name(device.getDevice_name());
+                device2.setName(device.getDevice_name());
                 device2.setDevice_type(device.getDevice_type());
                 device2.setDevice_describe(device.getDevice_describe());
                 device2.setAircraft_id(device.getAircraft_id());
@@ -96,7 +98,7 @@ public class DeviceService {
                 device2.setSubsys_name(device.getSubsys_name());
                 device2.setMysqlId(device.getId());
                 subsystemDeviceRelation.setEndNode(device2);
-                subsystemDeviceRelation.setRelationSubD("包含");
+                subsystemDeviceRelation.setRelation("包含");
                 subsystemDeviceRelationDao.save(subsystemDeviceRelation);
                 break;
             }
@@ -147,7 +149,7 @@ public class DeviceService {
         if (tmpData != null) {
             int index = deviceDao.updateByPrimaryKeySelective(data);
             Device1Entity device1 = device1Dao.getDevice1EntitiesByMysqlId(data.getId());
-            device1.setDevice_name(data.getDevice_name());
+            device1.setName(data.getDevice_name());
             device1.setDevice_type(data.getDevice_type());
             device1.setDevice_describe(data.getDevice_describe());
             device1.setAircraft_id(data.getAircraft_id());
@@ -171,6 +173,11 @@ public class DeviceService {
         return Result.result(flag, msg, msg);
     }
 
+    public Result<List<AircraftSystemRelationEntity>> findAllAircraftSystemRe(){
+        List<AircraftSystemRelationEntity> list = device1Dao.findAllAircraftSystemRe();
+        return Result.success(list);
+    }
+
     public List<DeviceEntity> listAll(int deviceType) {
         Example example = new Example(DeviceEntity.class);
         example.createCriteria().andEqualTo("device_type", deviceType);
@@ -208,9 +215,6 @@ public class DeviceService {
         return deviceDao.selectByPrimaryKey(id);
     }
 
-//    public Integer getCount() {
-//        return deviceDao.getCount();
-//    }
 
     public Result<List<DeviceEntity>> findByName(String name,Integer deviceType){
         if (name == null || "".equals(name)){
@@ -223,4 +227,13 @@ public class DeviceService {
         List<DeviceEntity> list = deviceDao.findByName1("%" + name + "%",deviceType);
         return Result.success(list);
     }
+
+    public Result<Map<String, Object>> findAircraftKg(String name){
+        Map<String, Object> map = new HashMap<>();
+//        if (type == null || "".equals(type) || "all".equals(type)){
+        map.put("AircraftSystemRe", device1Dao.findAircraftSystemReByAircraft(name));
+        map.put("SystemSubsystemRe", device1Dao.findSystemSubsystemReByAircraft(name));
+        map.put("SubsystemDeviceRe", device1Dao.findSubsystemDeviceReByAircraft(name));
+        return Result.success(map);
+    }
 }

+ 0 - 3
src/main/java/com/zglc/kg/service/MovieService.java

@@ -1,7 +1,6 @@
 package com.zglc.kg.service;
 
 import com.zglc.kg.base.Result;
-import com.zglc.kg.dao.DeptDao;
 import com.zglc.kg.dao.MovieDao;
 import com.zglc.kg.dao.PersonDao;
 import com.zglc.kg.dao.BaseRelationDao;
@@ -25,8 +24,6 @@ public class MovieService {
     @Resource
     private PersonDao personDao;
 
-    @Resource
-    private DeptDao deptDao;
     @Resource
     private BaseRelationDao baseRelationDao;
 

二进制
target/classes/com/zglc/kg/controller/DeviceController.class


二进制
target/classes/com/zglc/kg/controller/ImgsController.class


二进制
target/classes/com/zglc/kg/controller/TestController.class


二进制
target/classes/com/zglc/kg/dao/DeptDao.class


二进制
target/classes/com/zglc/kg/dao/Device1Dao.class


二进制
target/classes/com/zglc/kg/dao/RelationShipDao.class


二进制
target/classes/com/zglc/kg/entity/Aircraft1Entity.class


二进制
target/classes/com/zglc/kg/entity/AircraftSystemRelationEntity.class


二进制
target/classes/com/zglc/kg/entity/Algorithm1Entity.class


二进制
target/classes/com/zglc/kg/entity/DataSourceEntity.class


二进制
target/classes/com/zglc/kg/entity/DeptEntity$DeptEntityBuilder.class


二进制
target/classes/com/zglc/kg/entity/DeptEntity.class


二进制
target/classes/com/zglc/kg/entity/Device1Entity.class


二进制
target/classes/com/zglc/kg/entity/RelationShipEntity$RelationShipEntityBuilder.class


二进制
target/classes/com/zglc/kg/entity/RelationShipEntity.class


二进制
target/classes/com/zglc/kg/entity/SubsystemDeviceRelationEntity.class


二进制
target/classes/com/zglc/kg/entity/SystemSubsystemRelationEntity.class


二进制
target/classes/com/zglc/kg/service/AircraftService.class


二进制
target/classes/com/zglc/kg/service/AlgorithmService.class


二进制
target/classes/com/zglc/kg/service/DeviceService.class


二进制
target/classes/com/zglc/kg/service/MovieService.class


二进制
target/kg-1.0.jar


二进制
target/kg-1.0.jar.original