bc_zhang 3 жил өмнө
parent
commit
39c5cf614b

+ 12 - 2
src/main/java/com/zglc/kg/controller/AlgorithmCallController.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.zglc.kg.base.Result;
 import com.zglc.kg.entity.AlgorithmCallEntity;
+import com.zglc.kg.entity.CommonRelationEntity;
 import com.zglc.kg.entity.DeleteEntity;
 import com.zglc.kg.service.AlgorithmCallService;
 import io.swagger.annotations.Api;
@@ -102,13 +103,22 @@ public class AlgorithmCallController {
     @PostMapping("edit")
     public Result<String> edit( @RequestBody AlgorithmCallEntity data){return  algorithmCallService.edit(data);}
 
+//    @ApiOperation("按实验id查看图谱")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("findExperimentKg")
+//    public Result<Map<String, Object>> findExperimentKg(Integer experimentId){
+//        return algorithmCallService.findExperimentKg(experimentId);
+//    }
+
     @ApiOperation("按实验id查看图谱")
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
     })
     @GetMapping("findExperimentKg")
-    public Result<Map<String, Object>> findExperimentKg(Integer experimentId){
-        return algorithmCallService.findExperimentKg(experimentId);
+    public Result<List<CommonRelationEntity>> findExperimentKg(Integer experimentId){
+        return algorithmCallService.findExperimentKg1(experimentId);
     }
 
 }

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

@@ -141,21 +141,21 @@ public class DeviceController {
         return  deviceService.findAllAircraftSystemRe();
     }
 
-    @ApiOperation("按机型查看图谱")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("findAircraftKg")
-    public Result<Map<String, Object>> findAircraftKg(String name){
-        return deviceService.findAircraftKg(name);
-    }
+//    @ApiOperation("按机型查看图谱")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("findAircraftKg")
+//    public Result<Map<String, Object>> findAircraftKg(String name){
+//        return deviceService.findAircraftKg(name);
+//    }
 
-    @ApiOperation("按机型查看图谱1")
+    @ApiOperation("按机型查看图谱")
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
     })
     @GetMapping("findAircraftKg1")
-    public Result<List<CommonRelationEntity>> findAircraftKg1(String name){
+    public Result<List<CommonRelationEntity>> findAircraftKg(String name){
         return deviceService.findAircraftKg1(name);
     }
 }

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

@@ -28,8 +28,8 @@ public class AlgorithmCall1Entity {
     @Property(name = "calling_time")
     private Date calling_time;
 
-    @Property(name = "name")
-    private String name;
+    @Property(name = "predict_results")
+    private String predict_results;
 
     @Property(name = "diagnosis_results")
     private String diagnosis_results;

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

@@ -25,8 +25,8 @@ public class Experiment1Entity {
     @Property(name = "device_name")
     private String device_name;
 
-    @Property(name = "name")
-    private String name;
+    @Property(name = "experiment_name")
+    private String experiment_name;
 
     @Property(name = "start_time")
     private Date start_time;

+ 31 - 3
src/main/java/com/zglc/kg/service/AlgorithmCallService.java

@@ -58,7 +58,7 @@ public class AlgorithmCallService {
         algorithmCall1.setExperiment_id(algorithmCall.getExperiment_id());
         algorithmCall1.setAlgorithm_id(algorithmCall.getAlgorithm_id());
         algorithmCall1.setCalling_time(algorithmCall.getCalling_time());
-        algorithmCall1.setName(algorithmCall.getPredict_results());
+        algorithmCall1.setPredict_results(algorithmCall.getPredict_results());
         algorithmCall1.setDiagnosis_results(algorithmCall.getDiagnosis_results());
         algorithmCall1.setRemarks(algorithmCall.getRemarks());
         algorithmCall1.setMysqlId(algorithmCall.getId());
@@ -106,7 +106,7 @@ public class AlgorithmCallService {
             algorithmCall1.setExperiment_id(data.getExperiment_id());
             algorithmCall1.setAlgorithm_id(data.getAlgorithm_id());
             algorithmCall1.setCalling_time(data.getCalling_time());
-            algorithmCall1.setName(data.getPredict_results());
+            algorithmCall1.setPredict_results(data.getPredict_results());
             algorithmCall1.setDiagnosis_results(data.getDiagnosis_results());
             algorithmCall1.setRemarks(data.getRemarks());
             algorithmCall1.setMysqlId(data.getId());
@@ -153,9 +153,37 @@ public class AlgorithmCallService {
 
     public Result<Map<String, Object>> findExperimentKg(Integer name){
         Map<String, Object> map = new HashMap<>();
-//        if (type == null || "".equals(type) || "all".equals(type)){
         map.put("ExperimentAlgorithmRe", algorithmCall1Dao.findExperimentAlgorithmReById(name));
         map.put("AlgorithmResultsRe", algorithmCall1Dao.findAlgorithmResultsReById(name));
         return Result.success(map);
     }
+
+    public Result<List<CommonRelationEntity>> findExperimentKg1(Integer name){
+        List<CommonRelationEntity> lst = new ArrayList<>();
+        List<ExperimentAlgorithmRelationEntity> lst1 = algorithmCall1Dao.findExperimentAlgorithmReById(name);
+        for (ExperimentAlgorithmRelationEntity Relation1:lst1)
+        {
+            CommonRelationEntity CRelation = new CommonRelationEntity();
+            CRelation.setId(Relation1.getId());
+            CRelation.setRelation(Relation1.getRelation());
+            CRelation.setStartNode(Relation1.getStartNode().getExperiment_name());
+            CRelation.setStartNodeId(Relation1.getStartNode().getId());
+            CRelation.setEndNode(Relation1.getEndNode().getName());
+            CRelation.setEndNodeId(Relation1.getEndNode().getId());
+            lst.add(CRelation);
+        }
+        List<AlgorithmResultsRelationEntity> lst2 = algorithmCall1Dao.findAlgorithmResultsReById(name);
+        for (AlgorithmResultsRelationEntity Relation2:lst2)
+        {
+            CommonRelationEntity CRelation = new CommonRelationEntity();
+            CRelation.setId(Relation2.getId());
+            CRelation.setRelation(Relation2.getRelation());
+            CRelation.setStartNode(Relation2.getStartNode().getName());
+            CRelation.setStartNodeId(Relation2.getStartNode().getId());
+            CRelation.setEndNode(Relation2.getEndNode().getPredict_results());
+            CRelation.setEndNodeId(Relation2.getEndNode().getId());
+            lst.add(CRelation);
+        }
+        return Result.success(lst);
+    }
 }

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

@@ -41,7 +41,7 @@ public class ExperimentService {
         Experiment1Entity experiment1 = new Experiment1Entity();
         experiment1.setDevice_id(data.getDevice_id());
         experiment1.setDevice_name(data.getDevice_name());
-        experiment1.setName(data.getExperiment_name());
+        experiment1.setExperiment_name(data.getExperiment_name());
         experiment1.setStart_time(data.getStart_time());
         experiment1.setEnd_time(data.getEnd_time());
         experiment1.setData_type(data.getData_type());
@@ -114,7 +114,7 @@ public class ExperimentService {
         Experiment1Entity experiment1 = experiment1Dao.getExperiment1EntitiesByMysqlId(data.getId());
         experiment1.setDevice_id(data.getDevice_id());
         experiment1.setDevice_name(data.getDevice_name());
-        experiment1.setName(data.getExperiment_name());
+        experiment1.setExperiment_name(data.getExperiment_name());
         experiment1.setStart_time(data.getStart_time());
         experiment1.setEnd_time(data.getEnd_time());
         experiment1.setData_type(data.getData_type());

BIN
target/classes/com/zglc/kg/controller/AlgorithmCallController.class


BIN
target/classes/com/zglc/kg/controller/DeviceController.class


BIN
target/classes/com/zglc/kg/entity/AlgorithmCall1Entity.class


BIN
target/classes/com/zglc/kg/entity/Experiment1Entity.class


BIN
target/classes/com/zglc/kg/service/AlgorithmCallService.class


BIN
target/classes/com/zglc/kg/service/ExperimentService.class