bc_zhang 4 år sedan
förälder
incheckning
25ae45a26b

+ 1 - 1
src/main/java/com/zglc/kg/controller/AlgorithmController.java

@@ -66,7 +66,7 @@ public class AlgorithmController {
         return algorithmService.findByName(name);
     }
 
-    @ApiOperation("增添算法")
+    @ApiOperation("增添算法和图谱节点")
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
     })

+ 95 - 95
src/main/java/com/zglc/kg/controller/AlgorithmParamController.java

@@ -1,95 +1,95 @@
-package com.zglc.kg.controller;
-
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.AlgorithmParamEntity;
-import com.zglc.kg.entity.DeleteEntity;
-import com.zglc.kg.service.AlgorithmParamService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-@Api(tags = "算法参数管理接口")
-@RequestMapping("api/algorithmParam")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-public class AlgorithmParamController {
-
-    @Resource
-    private final AlgorithmParamService algorithmParamService;
-    @Autowired(required = false)
-    public AlgorithmParamController(AlgorithmParamService algorithmParamService){
-        this.algorithmParamService = algorithmParamService;
-    }
-
-    @ApiOperation("分页列出所有算法参数信息")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listpage")
-    public Result<PageInfo<AlgorithmParamEntity>> listpage(Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(algorithmParamService.listAll()));
-    }
-
-    @ApiOperation("列出所有算法参数")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listAll")
-    public Result<List<AlgorithmParamEntity>> listAll() {
-        return Result.success(algorithmParamService.listAll());
-    }
-
-    @ApiOperation("按参数ID查找算法参数")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("get")
-    public  Result<AlgorithmParamEntity> get(@RequestParam Integer id){return  Result.success(algorithmParamService.getAlgorithmParam(id));}
-
-    @ApiOperation("按算法ID查找算法参数")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getByAlgorithmId")
-    public  Result<List<AlgorithmParamEntity>> getByAlgorithmId(@RequestParam Integer id){
-        return  Result.success(algorithmParamService.getByAlgorithmId(id));
-    }
-
-    @ApiOperation("按算法名称查询")
-    @GetMapping("getByName")
-    public Result<List<AlgorithmParamEntity>> findByName(@RequestParam("name") String name){
-        return algorithmParamService.findByName(name);
-    }
-
-    @ApiOperation("增添算法")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("add")
-    public Result<String> add(@RequestBody AlgorithmParamEntity data){return  algorithmParamService.add(data);}
-
-    @ApiOperation("删除算法")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("delete")
-    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  algorithmParamService.delete(deleteEntity.getIds());}
-
-    @ApiOperation("修改算法")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody AlgorithmParamEntity data){return  algorithmParamService.edit(data);}
-
-}
+//package com.zglc.kg.controller;
+//
+//
+//import com.github.pagehelper.PageHelper;
+//import com.github.pagehelper.PageInfo;
+//import com.zglc.kg.base.Result;
+//import com.zglc.kg.entity.AlgorithmParamEntity;
+//import com.zglc.kg.entity.DeleteEntity;
+//import com.zglc.kg.service.AlgorithmParamService;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import io.swagger.annotations.ApiResponse;
+//import io.swagger.annotations.ApiResponses;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.*;
+//
+//import javax.annotation.Resource;
+//import java.util.List;
+//
+//@Api(tags = "算法参数管理接口")
+//@RequestMapping("api/algorithmParam")
+//@CrossOrigin(allowCredentials = "true")
+//@RestController
+//public class AlgorithmParamController {
+//
+//    @Resource
+//    private final AlgorithmParamService algorithmParamService;
+//    @Autowired(required = false)
+//    public AlgorithmParamController(AlgorithmParamService algorithmParamService){
+//        this.algorithmParamService = algorithmParamService;
+//    }
+//
+//    @ApiOperation("分页列出所有算法参数信息")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("listpage")
+//    public Result<PageInfo<AlgorithmParamEntity>> listpage(Integer page, Integer size) {
+//        PageHelper.startPage(page, size, "id desc");
+//        return Result.success(new PageInfo<>(algorithmParamService.listAll()));
+//    }
+//
+//    @ApiOperation("列出所有算法参数")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("listAll")
+//    public Result<List<AlgorithmParamEntity>> listAll() {
+//        return Result.success(algorithmParamService.listAll());
+//    }
+//
+//    @ApiOperation("按参数ID查找算法参数")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("get")
+//    public  Result<AlgorithmParamEntity> get(@RequestParam Integer id){return  Result.success(algorithmParamService.getAlgorithmParam(id));}
+//
+//    @ApiOperation("按算法ID查找算法参数")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("getByAlgorithmId")
+//    public  Result<List<AlgorithmParamEntity>> getByAlgorithmId(@RequestParam Integer id){
+//        return  Result.success(algorithmParamService.getByAlgorithmId(id));
+//    }
+//
+//    @ApiOperation("按算法名称查询")
+//    @GetMapping("getByName")
+//    public Result<List<AlgorithmParamEntity>> findByName(@RequestParam("name") String name){
+//        return algorithmParamService.findByName(name);
+//    }
+//
+//    @ApiOperation("增添算法")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("add")
+//    public Result<String> add(@RequestBody AlgorithmParamEntity data){return  algorithmParamService.add(data);}
+//
+//    @ApiOperation("删除算法")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("delete")
+//    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  algorithmParamService.delete(deleteEntity.getIds());}
+//
+//    @ApiOperation("修改算法")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("edit")
+//    public Result<String> edit( @RequestBody AlgorithmParamEntity data){return  algorithmParamService.edit(data);}
+//
+//}

+ 0 - 90
src/main/java/com/zglc/kg/controller/TestController.java

@@ -1,90 +0,0 @@
-package com.zglc.kg.controller;
-
-
-import com.zglc.kg.dao.DeptDao;
-import com.zglc.kg.dao.RelationShipDao;
-import com.zglc.kg.entity.DeptEntity;
-import com.zglc.kg.entity.RelationShipEntity;
-import com.zglc.kg.service.UserService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-
-@RestController
-public class TestController {
-
-
-    @Resource
-    private DeptDao deptDao;
-    @Resource
-    private RelationShipDao relationShipDao;
-
-    /**
-     * CEO
-     *    -设计部
-     *        - 设计1组
-     *        - 设计2组
-     *    -技术部
-     *        - 前端技术部
-     *        - 后端技术部
-     *        - 测试技术部
-     */
-    @GetMapping("create")
-    public void create(){
-        DeptEntity CEO = DeptEntity.builder().deptName("CEO").build();
-        DeptEntity dept1 = DeptEntity.builder().deptName("设计部").build();
-        DeptEntity dept11 = DeptEntity.builder().deptName("设计1组").build();
-        DeptEntity dept12 = DeptEntity.builder().deptName("设计2组").build();
-
-        DeptEntity dept2 = DeptEntity.builder().deptName("技术部").build();
-        DeptEntity dept21 = DeptEntity.builder().deptName("前端技术部").build();
-        DeptEntity dept22 = DeptEntity.builder().deptName("后端技术部").build();
-        DeptEntity dept23 = DeptEntity.builder().deptName("测试技术部").build();
-        List<DeptEntity> depts = new ArrayList<>(Arrays.asList(CEO,dept1,dept11,dept12,dept2,dept21,dept22,dept23));
-        deptDao.saveAll(depts);
-
-        RelationShipEntity relationShip1 = RelationShipEntity.builder().parent(CEO).child(dept1).build();
-        RelationShipEntity relationShip2 = RelationShipEntity.builder().parent(CEO).child(dept2).build();
-        RelationShipEntity relationShip3 = RelationShipEntity.builder().parent(dept1).child(dept11).build();
-        RelationShipEntity relationShip4 = RelationShipEntity.builder().parent(dept1).child(dept12).build();
-        RelationShipEntity relationShip5 = RelationShipEntity.builder().parent(dept2).child(dept21).build();
-        RelationShipEntity relationShip6 = RelationShipEntity.builder().parent(dept2).child(dept22).build();
-        RelationShipEntity relationShip7 = RelationShipEntity.builder().parent(dept2).child(dept23).build();
-        List<RelationShipEntity> relationShips = new ArrayList<>(Arrays.asList(relationShip1,relationShip2,relationShip3,relationShip4,relationShip5
-                ,relationShip6,relationShip7));
-        relationShipDao.saveAll(relationShips);
-    }
-
-    @GetMapping("getRelationShip")
-    public RelationShipEntity get(Long id){
-        Optional<RelationShipEntity> byId = relationShipDao.findById(id);
-        return byId.orElse(null);
-    }
-
-    @GetMapping("getDept")
-    public DeptEntity getDept(Long id){
-        Optional<DeptEntity> byId = deptDao.findById(id);
-        return byId.orElse(null);
-    }
-
-    @GetMapping("deleteRelationShip")
-    public void deleteRelationShip(Long id){
-        relationShipDao.deleteById(id);
-    }
-
-    @GetMapping("deleteDept")
-    public void deleteDept(Long id){
-        deptDao.deleteById(id);
-    }
-
-    @GetMapping("deleteAll")
-    public void deleteAll(){
-        deptDao.deleteAll();
-        relationShipDao.deleteAll();
-    }
-}

+ 15 - 0
src/main/java/com/zglc/kg/dao/Algorithm1Dao.java

@@ -0,0 +1,15 @@
+package com.zglc.kg.dao;
+
+import com.zglc.kg.entity.Algorithm1Entity;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface Algorithm1Dao extends Neo4jRepository<Algorithm1Entity,Long> {
+
+    Algorithm1Entity getAlgorithm1EntitiesByMysqlId(Integer id);
+
+
+
+}
+

+ 3 - 0
src/main/java/com/zglc/kg/dao/AlgorithmDao.java

@@ -15,4 +15,7 @@ public interface AlgorithmDao extends Mapper<AlgorithmEntity> {
     Integer getCount();
 
     List<AlgorithmEntity> findByName(@Param("name") String name);
+
+    AlgorithmEntity getLastInsert();
+
 }

+ 0 - 15
src/main/java/com/zglc/kg/dao/DeptDao.java

@@ -1,15 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.DeptEntity;
-import org.springframework.data.neo4j.repository.Neo4jRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface DeptDao extends Neo4jRepository<DeptEntity, Long> {
-
-}
-
-
-
-
-

+ 0 - 11
src/main/java/com/zglc/kg/dao/RelationShipDao.java

@@ -1,11 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.RelationShipEntity;
-import org.springframework.data.neo4j.repository.Neo4jRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface RelationShipDao extends Neo4jRepository<RelationShipEntity, Long> {
-
-}
-

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

@@ -0,0 +1,280 @@
+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.util.Date;
+
+@Getter
+@Setter
+@NodeEntity(label = "algorithm")
+public class Algorithm1Entity {
+
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Property(name = "algorithm_type")
+    private String algorithmType;
+
+    @Property(name = "algorithm_title")
+    private String algorithmTitle;
+
+    @Property(name = "algorithm_method_name")
+    private String algorithmMethodName;
+
+    @Property(name = "algorithm_format")
+    private String algorithmFormat;
+
+    @Property(name = "algorithm_des")
+    private String algorithmDes;
+
+    @Property(name = "create_time")
+    private Date createTime;
+
+    @Property(name = "create_user")
+    private String createUser;
+
+    @Property(name = "is_enable")
+    private Integer isEnable;
+
+    @Property(name = "parent_id")
+    private Integer parentId;
+
+    @Property(name = "is_fusion_method")
+    private String isFusionMethod;
+
+    @Property(name = "assess_method")
+    private String assessMethod;
+
+    @Property(name = "assess_model")
+    private String assessModel;
+
+    @Property(name = "environment_load")
+    private String environmentLoad;
+
+    @Property(name = "show_type")
+    private String showType;
+
+    @Property(name = "r_type")
+    private String rType;
+
+    @Property(name = "m_type")
+    private String mType;
+
+    @Property(name = "data_file_path")
+    private String dataFilePath;
+
+    @Property(name = "is_zh")
+    private Integer isZh;
+
+    @Property(name = "apply_type")
+    private String applyType;
+
+    @Property(name = "is_open")
+    private String isOpen;
+
+    @Property(name = "is_algorithm_model")
+    private String isAlgorithmModel;
+
+    @Property(name = "mysql_id")
+    private Integer mysqlId;
+
+//    public Algorithm1Entity() {
+//    }
+//
+//    public Algorithm1Entity(Long id,String algorithmType, String algorithmTitle, String algorithmMethodName,String algorithmFormat,String algorithmDes,
+//                            Date createTime,String createUser,Integer isEnable,Integer parentId,String isFusionMethod,String assessMethod,
+//                            String assessModel,String environmentLoad,String showType,String rType,String mType,String dataFilePath,
+//                            Integer isZh,String applyType,String isOpen,String isAlgorithmModel,Integer mysqlId) {
+//        this.id = id;
+//        this.algorithmType = algorithmType;
+//        this.algorithmTitle = algorithmTitle;
+//        this.algorithmMethodName = algorithmMethodName;
+//        this.algorithmFormat = algorithmFormat;
+//        this.algorithmDes = algorithmDes;
+//        this.createTime = createTime;
+//        this.createUser = createUser;
+//        this.isEnable = isEnable;
+//        this.parentId = parentId;
+//        this.isFusionMethod = isFusionMethod;
+//        this.assessMethod = assessMethod;
+//        this.assessModel = assessModel;
+//        this.environmentLoad = environmentLoad;
+//        this.showType = showType;
+//        this.rType = rType;
+//        this.mType = mType;
+//        this.dataFilePath = dataFilePath;
+//        this.isZh = isZh;
+//        this.applyType = applyType;
+//        this.isOpen = isOpen;
+//        this.isAlgorithmModel = isAlgorithmModel;
+//        this.mysqlId = mysqlId;
+//    }
+//
+//    public Long getId() {
+//        return id;
+//    }
+//    public void setId(Long id) {
+//        this.id = id;
+//    }
+//
+//    public String getAlgorithmType() {
+//        return algorithmType;
+//    }
+//    public void setAlgorithmType(String algorithmType) {
+//        this.algorithmType = algorithmType;
+//    }
+//
+//    public String getAlgorithmTitle() {
+//        return algorithmTitle;
+//    }
+//    public void setAlgorithmTitle(String algorithmTitle) {
+//        this.algorithmTitle = algorithmTitle;
+//    }
+//
+//    public String getAlgorithmMethodName() {
+//        return algorithmMethodName;
+//    }
+//    public void setAlgorithmMethodName(String algorithmMethodName) {
+//        this.algorithmMethodName = algorithmMethodName;
+//    }
+//
+//    public String getAlgorithmFormat() {
+//        return algorithmFormat;
+//    }
+//    public void setAlgorithmFormat(String algorithmFormat) {
+//        this.algorithmFormat = algorithmFormat;
+//    }
+//
+//    public void setAlgorithmDes(String algorithmDes) {
+//        this.algorithmDes = algorithmDes;
+//    }
+//    public String getAlgorithmDes() {
+//        return algorithmDes;
+//    }
+//
+//    public void setCreateTime(Date createTime) {
+//        this.createTime = createTime;
+//    }
+//    public Date getCreateTime() {
+//        return createTime;
+//    }
+//
+//    public void setCreateUser(String createUser) {
+//        this.createUser = createUser;
+//    }
+//    public String getCreateUser() {
+//        return createUser;
+//    }
+//
+//    public void setIsEnable(Integer isEnable) {
+//        this.isEnable = isEnable;
+//    }
+//    public Integer getIsEnable() {
+//        return isEnable;
+//    }
+//
+//    public void setParentId(Integer parentId) {
+//        this.parentId = parentId;
+//    }
+//    public Integer getParentId() {
+//        return parentId;
+//    }
+//
+//    public void setIsFusionMethod(String isFusionMethod) {
+//        this.isFusionMethod = isFusionMethod;
+//    }
+//    public String getIsFusionMethod() {
+//        return isFusionMethod;
+//    }
+//
+//    public void setAssessMethod(String assessMethod) {
+//        this.assessMethod = assessMethod;
+//    }
+//    public String getAssessMethod() {
+//        return assessMethod;
+//    }
+//
+//    public void setAssessModel(String assessModel) {
+//        this.assessModel = assessModel;
+//    }
+//    public String getAssessModel() {
+//        return assessModel;
+//    }
+//
+//    public void setEnvironmentLoad(String environmentLoad) {
+//        this.environmentLoad = environmentLoad;
+//    }
+//    public String getEnvironmentLoad() {
+//        return environmentLoad;
+//    }
+//
+//    public void setShowType(String showType) {
+//        this.showType = showType;
+//    }    public String getShowType() {
+//        return showType;
+//    }
+//
+//    public void setrType(String rType) {
+//        this.rType = rType;
+//    }
+//    public String getrType() {
+//        return rType;
+//    }
+//
+//    public void setmType(String mType) {
+//        this.mType = mType;
+//    }
+//    public String getmType() {
+//        return mType;
+//    }
+//
+//    public void setDataFilePath(String dataFilePath) {
+//        this.dataFilePath = dataFilePath;
+//    }
+//    public String getDataFilePath() {
+//        return dataFilePath;
+//    }
+//
+//    public void setIsZh(Integer isZh) {
+//        this.isZh = isZh;
+//    }
+//    public Integer getIsZh() {
+//        return isZh;
+//    }
+//
+//    public void setApplyType(String applyType) {
+//        this.applyType = applyType;
+//    }
+//    public String getApplyType() {
+//        return applyType;
+//    }
+//
+//    public void setIsOpen(String isOpen) {
+//        this.isOpen = isOpen;
+//    }
+//    public String getIsOpen() {
+//        return isOpen;
+//    }
+//
+//    public void setIsAlgorithmModel(String isAlgorithmModel) {
+//        this.isAlgorithmModel = isAlgorithmModel;
+//    }
+//    public String getIsAlgorithmModel() {
+//        return isAlgorithmModel;
+//    }
+//
+//    public Integer getMysqlId() {
+//        return mysqlId;
+//    }
+//    public void setMysqlId(Integer mysqlId) {
+//        this.mysqlId = mysqlId;
+//    }
+
+}

+ 62 - 4
src/main/java/com/zglc/kg/entity/AlgorithmEntity.java

@@ -1,6 +1,8 @@
 package com.zglc.kg.entity;
+import io.swagger.models.auth.In;
 import lombok.Data;
 import javax.persistence.*;
+import java.util.Date;
 
 
 @Data
@@ -14,10 +16,66 @@ public class AlgorithmEntity {
     @Column(name = "id")
     private Integer id;
 
-    @Column(name = "algorithm_name")
-    private String algorithm_name;
+    @Column(name = "algorithm_type")
+    private String algorithm_type;
 
-    @Column(name = "remarks")
-    private String remarks;
+    @Column(name = "algorithm_title")
+    private String algorithm_title;
 
+    @Column(name = "algorithm_method_name")
+    private String algorithm_method_name;
+
+    @Column(name = "algorithm_format")
+    private String algorithm_format;
+
+    @Column(name = "algorithm_des")
+    private String algorithm_des;
+
+    @Column(name = "create_time")
+    private Date create_time;
+
+    @Column(name = "create_user")
+    private String create_user;
+
+    @Column(name = "is_enable")
+    private Integer is_enable;
+
+    @Column(name = "parent_id")
+    private Integer parent_id;
+
+    @Column(name = "is_fusion_method")
+    private String is_fusion_method;
+
+    @Column(name = "assess_method")
+    private String assess_method;
+
+    @Column(name = "assess_model")
+    private String assess_model;
+
+    @Column(name = "environment_load")
+    private String environment_load;
+
+    @Column(name = "show_type")
+    private String show_type;
+
+    @Column(name = "r_type")
+    private String r_type;
+
+    @Column(name = "m_type")
+    private String m_type;
+
+    @Column(name = "data_file_path")
+    private String data_file_path;
+
+    @Column(name = "is_zh")
+    private Integer is_zh;
+
+    @Column(name = "apply_type")
+    private String apply_type;
+
+    @Column(name = "is_open")
+    private String is_open;
+
+    @Column(name = "is_algorithm_model")
+    private String is_algorithm_model;
 }

+ 0 - 28
src/main/java/com/zglc/kg/entity/DeptEntity.java

@@ -1,28 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Builder;
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import org.neo4j.ogm.annotation.GeneratedValue;
-import org.neo4j.ogm.annotation.Id;
-import org.neo4j.ogm.annotation.NodeEntity;
-import org.neo4j.ogm.annotation.Property;
-
-import javax.persistence.Column;
-import javax.persistence.GenerationType;
-
-@NodeEntity(label = "dept")
-@Data
-@Builder
-public class DeptEntity {
-
-    @Id
-    @GeneratedValue
-    private Long id;
-
-    @Property(name = "deptName")
-    private String deptName;
-
-}
-

+ 0 - 23
src/main/java/com/zglc/kg/entity/RelationShipEntity.java

@@ -1,23 +0,0 @@
-package com.zglc.kg.entity;
-
-
-
-import lombok.Builder;
-import lombok.Data;
-import org.neo4j.ogm.annotation.*;
-
-@RelationshipEntity(type = "relationShip")
-@Data
-@Builder
-public class RelationShipEntity {
-
-    @Id
-    @GeneratedValue
-    private Long id;
-
-    @StartNode
-    private DeptEntity parent;
-
-    @EndNode
-    private DeptEntity child;
-}

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

@@ -1,22 +1,24 @@
 package com.zglc.kg.service;
 
 import com.zglc.kg.base.Result;
+import com.zglc.kg.dao.Algorithm1Dao;
 import com.zglc.kg.dao.AlgorithmDao;
 import com.zglc.kg.entity.AlgorithmEntity;
+import com.zglc.kg.entity.Algorithm1Entity;
+
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.Iterator;
 import java.util.List;
 
 @Service
 
 public class AlgorithmService {
-
+    @Resource
     private AlgorithmDao algorithmDao;
-
-    public AlgorithmService(AlgorithmDao algorithmDao) {
-        this.algorithmDao = algorithmDao;
-    }
+    @Resource
+    private Algorithm1Dao algorithm1Dao;
 
     public List<AlgorithmEntity> listAll() {
         return algorithmDao.listAll();
@@ -31,13 +33,39 @@ public class AlgorithmService {
         boolean flag = true;
         String msg = "";
         int index = algorithmDao.insertSelective(data);
+        //获取最新机型id
+        AlgorithmEntity Algorithm2 = algorithmDao.getLastInsert();
+        //加入机型节点
+        Algorithm1Entity algorithm1 = new Algorithm1Entity();
+        algorithm1.setAlgorithmType(data.getAlgorithm_type());
+        algorithm1.setAlgorithmTitle(data.getAlgorithm_title());
+        algorithm1.setAlgorithmMethodName(data.getAlgorithm_method_name());
+        algorithm1.setAlgorithmFormat(data.getAlgorithm_format());
+        algorithm1.setAlgorithmDes(data.getAlgorithm_des());
+        algorithm1.setCreateTime(data.getCreate_time());
+        algorithm1.setCreateUser(data.getCreate_user());
+        algorithm1.setIsEnable(data.getIs_enable());
+        algorithm1.setParentId(data.getParent_id());
+        algorithm1.setIsFusionMethod(data.getIs_fusion_method());
+        algorithm1.setAssessMethod(data.getAssess_method());
+        algorithm1.setAssessModel(data.getAssess_model());
+        algorithm1.setEnvironmentLoad(data.getEnvironment_load());
+        algorithm1.setShowType(data.getShow_type());
+        algorithm1.setRType(data.getR_type());
+        algorithm1.setMType(data.getM_type());
+        algorithm1.setDataFilePath(data.getData_file_path());
+        algorithm1.setIsZh(data.getIs_zh());
+        algorithm1.setApplyType(data.getApply_type());
+        algorithm1.setIsOpen(data.getIs_open());
+        algorithm1.setIsAlgorithmModel(data.getIs_algorithm_model());
+        algorithm1.setMysqlId(Algorithm2.getId());
+        algorithm1Dao.save(algorithm1);
         if (index == 0) {
             flag = false;
             msg = "添加算法信息失败!";
         } else {
             msg = "添加算法信息成功!";
         }
-
         return Result.result(flag, msg, msg);
     }
 

+ 26 - 3
src/main/resources/mapping/AlgorithmDao.xml

@@ -6,8 +6,27 @@
 	<!-- 可根据自己的需求,是否要使用 -->
     <resultMap type="com.zglc.kg.entity.AlgorithmEntity" id="algorithmMap">
         <result property="id" column="id"/>
-        <result property="algorithm_name" column="algorithm_name"/>
-        <result property="remarks" column="remarks"/>
+        <result property="algorithm_type" column="algorithm_type"/>
+        <result property="algorithm_title" column="algorithm_title"/>
+        <result property="algorithm_method_name" column="algorithm_method_name"/>
+        <result property="algorithm_format" column="algorithm_format"/>
+        <result property="algorithm_des" column="algorithm_des"/>
+        <result property="create_time" column="create_time"/>
+        <result property="create_user" column="create_user"/>
+        <result property="is_enable" column="is_enable"/>
+        <result property="parent_id" column="parent_id"/>
+        <result property="is_fusion_method" column="is_fusion_method"/>
+        <result property="assess_method" column="assess_method"/>
+        <result property="assess_model" column="assess_model"/>
+        <result property="environment_load" column="environment_load"/>
+        <result property="show_type" column="show_type"/>
+        <result property="r_type" column="r_type"/>
+        <result property="m_type" column="m_type"/>
+        <result property="data_file_path" column="data_file_path"/>
+        <result property="is_zh" column="is_zh"/>
+        <result property="apply_type" column="apply_type"/>
+        <result property="is_open" column="is_open"/>
+        <result property="is_algorithm_model" column="is_algorithm_model"/>
     </resultMap>
 
     <select id="listAll" resultMap="algorithmMap">
@@ -18,7 +37,7 @@
 
     <select id="findByName" parameterType="String" resultMap="algorithmMap">
         select  * from t_algorithm
-        where algorithm_name like #{name}
+        where algorithm_title like #{name}
     </select>
 
     <select id="getCount" resultType="java.lang.Integer">
@@ -27,6 +46,10 @@
         where id > 1
     </select>
 
+    <select id="getLastInsert" resultMap="algorithmMap">
+        SELECT * FROM t_algorithm ORDER BY id DESC LIMIT 1
+    </select>
+
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
 <!--        <foreach collection="list" item="equ" separator=";">-->
 <!--            insert into t_equipment (equipment_type)-->

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


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


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


BIN
target/classes/com/zglc/kg/dao/Algorithm1Dao.class


BIN
target/classes/com/zglc/kg/dao/AlgorithmDao.class


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


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


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


+ 26 - 3
target/classes/mapping/AlgorithmDao.xml

@@ -6,8 +6,27 @@
 	<!-- 可根据自己的需求,是否要使用 -->
     <resultMap type="com.zglc.kg.entity.AlgorithmEntity" id="algorithmMap">
         <result property="id" column="id"/>
-        <result property="algorithm_name" column="algorithm_name"/>
-        <result property="remarks" column="remarks"/>
+        <result property="algorithm_type" column="algorithm_type"/>
+        <result property="algorithm_title" column="algorithm_title"/>
+        <result property="algorithm_method_name" column="algorithm_method_name"/>
+        <result property="algorithm_format" column="algorithm_format"/>
+        <result property="algorithm_des" column="algorithm_des"/>
+        <result property="create_time" column="create_time"/>
+        <result property="create_user" column="create_user"/>
+        <result property="is_enable" column="is_enable"/>
+        <result property="parent_id" column="parent_id"/>
+        <result property="is_fusion_method" column="is_fusion_method"/>
+        <result property="assess_method" column="assess_method"/>
+        <result property="assess_model" column="assess_model"/>
+        <result property="environment_load" column="environment_load"/>
+        <result property="show_type" column="show_type"/>
+        <result property="r_type" column="r_type"/>
+        <result property="m_type" column="m_type"/>
+        <result property="data_file_path" column="data_file_path"/>
+        <result property="is_zh" column="is_zh"/>
+        <result property="apply_type" column="apply_type"/>
+        <result property="is_open" column="is_open"/>
+        <result property="is_algorithm_model" column="is_algorithm_model"/>
     </resultMap>
 
     <select id="listAll" resultMap="algorithmMap">
@@ -18,7 +37,7 @@
 
     <select id="findByName" parameterType="String" resultMap="algorithmMap">
         select  * from t_algorithm
-        where algorithm_name like #{name}
+        where algorithm_title like #{name}
     </select>
 
     <select id="getCount" resultType="java.lang.Integer">
@@ -27,6 +46,10 @@
         where id > 1
     </select>
 
+    <select id="getLastInsert" resultMap="algorithmMap">
+        SELECT * FROM t_algorithm ORDER BY id DESC LIMIT 1
+    </select>
+
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
 <!--        <foreach collection="list" item="equ" separator=";">-->
 <!--            insert into t_equipment (equipment_type)-->