From 1e82dfffc6cfb6ca0ff64877492ef46e3d77dcc3 Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Thu, 27 Apr 2023 13:48:14 +0800 Subject: [PATCH] tupu --- .../src/views/seknowgroup/SeKnowGroupList.vue | 21 +++-- .../org/jeecg/config/shiro/ShiroConfig.java | 2 + .../demo/know/mapper/SeKonwMapper.java | 2 + .../demo/know/service/ISeKonwService.java | 2 + .../know/service/impl/SeKonwServiceImpl.java | 4 + .../controller/SeKnowGroupController.java | 79 +++++++++++++++++++ .../demo/seknowgroup/entity/Exports.java | 11 +++ .../demo/seknowgroup/entity/NodeList.java | 10 +++ .../demo/seknowgroup/entity/NodeName.java | 9 +++ .../seknowgroup/mapper/SeKnowGroupMapper.java | 13 +++ .../service/ISeKnowGroupService.java | 10 +++ .../service/impl/SeKnowGroupServiceImpl.java | 24 ++++++ 12 files changed, 180 insertions(+), 7 deletions(-) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/Exports.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeList.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeName.java diff --git a/ant-design-vue-jeecg/src/views/seknowgroup/SeKnowGroupList.vue b/ant-design-vue-jeecg/src/views/seknowgroup/SeKnowGroupList.vue index 0236e1f..5423b2c 100644 --- a/ant-design-vue-jeecg/src/views/seknowgroup/SeKnowGroupList.vue +++ b/ant-design-vue-jeecg/src/views/seknowgroup/SeKnowGroupList.vue @@ -172,15 +172,22 @@ }, methods: { zsAtlsa(record) { - let routeData = this.$router.resolve({ path: '/atlas', query: { name: 1 } }); - - window.open(routeData.href, '_blank'); - // this.$router.push({ - // path: '/src/views/seknowgroup/SeKnowAtlasList', - // query: { - // "id": 1 + // getAction('/seknowgroup/seKnowGroup/zzzztp', {id: record.id}).then((res) => { + // if (res.success) { + // //重新计算分页问题 + // e.exports.nodes=[{name:"重庆高速路网车间器数据"},{name:"重庆高速路网交调站数据"}] + // e.exports.links=[{source:"重庆高速路网车间器数据",target:"重庆高速路网交调站数据",value:.75}] + // console.log("=================================================") + // console.log(e.exports.nodes) + // console.log("=================================================") + // } else { + // this.$message.warning(res.message); // } // }) + + + let routeData = this.$router.resolve({ path: '/atlas', query: { id: record.id } }); + window.open(routeData.href, '_blank'); }, initDictConfig(){ }, diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index fd011d9..1523f7a 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -76,6 +76,8 @@ public class ShiroConfig { filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除 filterChainDefinitionMap.put("/sys/checkCaptcha", "anon"); //登录验证码接口排除 filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除 + filterChainDefinitionMap.put("/seknowgroup/seKnowGroup/zzzztp", "anon"); //知识图谱接口排除 + filterChainDefinitionMap.put("/sys/facelogin", "anon"); //登录接口排除 filterChainDefinitionMap.put("/sys/faceIdentify", "anon"); //登录接口排除 filterChainDefinitionMap.put("/sys/mLogin", "anon"); //登录接口排除 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/mapper/SeKonwMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/mapper/SeKonwMapper.java index 7ff98c9..65b2145 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/mapper/SeKonwMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/mapper/SeKonwMapper.java @@ -32,4 +32,6 @@ public interface SeKonwMapper extends BaseMapper { void update1(String getrealname, String createBy); + @Select("select wight from se_konw_relationship where id =#{relationId}") + String getrelaint(String relationId); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/ISeKonwService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/ISeKonwService.java index e48b1ed..265c694 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/ISeKonwService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/ISeKonwService.java @@ -23,4 +23,6 @@ public interface ISeKonwService extends IService { void update1(String getrealname, String createBy); Boolean importExcel(List zlListByE); + + String getrelaint(String relationId); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/impl/SeKonwServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/impl/SeKonwServiceImpl.java index fa978d3..449548f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/impl/SeKonwServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/impl/SeKonwServiceImpl.java @@ -63,6 +63,10 @@ public class SeKonwServiceImpl extends ServiceImpl impleme return true; } + @Override + public String getrelaint(String relationId) { + return seKonwMapper.getrelaint(relationId); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java index 14950f3..1c0b47f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.seknowgroup.controller; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -12,6 +13,11 @@ import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.know.entity.SeKonw; +import org.jeecg.modules.demo.know.service.ISeKonwService; +import org.jeecg.modules.demo.seknowgroup.entity.Exports; +import org.jeecg.modules.demo.seknowgroup.entity.NodeList; +import org.jeecg.modules.demo.seknowgroup.entity.NodeName; import org.jeecg.modules.demo.seknowgroup.entity.SeKnowGroup; import org.jeecg.modules.demo.seknowgroup.service.ISeKnowGroupService; @@ -20,6 +26,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.konwRelationshipMain.entity.SeKonwRelationshipMain; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -50,6 +57,9 @@ public class SeKnowGroupController extends JeecgController zzzztp(@RequestParam(name="id",required=true) String id) { + //最多显示三层结构 + List nodelist = new ArrayList<>(); + //开始根据id查找中心知识点id + String pointnode = seKnowGroupService.findpointnode(id); + //开始组装知识点节点 + //获取中心知识点 + SeKonw seknow = seKonwService.getById(pointnode); + //将list的第一个位置设置成中心知识点名称 + NodeName nodes = new NodeName(); + nodes.setName(seknow.getName()); + nodelist.add(nodes); + //开是循环,根据中心知识点id,在知识点关系表中查询以中心知识点为中心查询第二层知识点 + List listid = seKnowGroupService.listid(seknow.getId()); + //开始循环 + for (int i=0;i listid2 = seKnowGroupService.listid(listid.get(i)); + for (int j =0;j nodelistdss = new ArrayList<>(); + //首先根据中心知识点查询 + List segouplisttemp = new ArrayList<>(); + segouplisttemp=seKnowGroupService.getzxzsnodelist(seknow.getId()); + for (int i=0; i< segouplisttemp.size();i++){ + NodeList ndoesl = new NodeList(); + ndoesl.setSource(seKonwService.getById(segouplisttemp.get(i).getPerKowId()).getName()); + ndoesl.setTarget(seKonwService.getById(segouplisttemp.get(i).getNextKnowId()).getName()); + ndoesl.setValue(seKonwService.getrelaint(segouplisttemp.get(i).getRelationId())); + nodelistdss.add(ndoesl); + List segouplisttemp2 = new ArrayList<>(); + segouplisttemp2=seKnowGroupService.getzxzsnodelist(segouplisttemp.get(i).getNextKnowId()); + for (int j=0;j nodes; + private List links; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeList.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeList.java new file mode 100644 index 0000000..09d644f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeList.java @@ -0,0 +1,10 @@ +package org.jeecg.modules.demo.seknowgroup.entity; + +import lombok.Data; + +@Data +public class NodeList { + private String source; + private String target; + private String value; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeName.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeName.java new file mode 100644 index 0000000..a592ac0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeName.java @@ -0,0 +1,9 @@ +package org.jeecg.modules.demo.seknowgroup.entity; + +import lombok.Data; + +@Data +public class NodeName { + private String name; + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/mapper/SeKnowGroupMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/mapper/SeKnowGroupMapper.java index 1ff119f..15bb868 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/mapper/SeKnowGroupMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/mapper/SeKnowGroupMapper.java @@ -3,8 +3,11 @@ package org.jeecg.modules.demo.seknowgroup.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.jeecg.modules.demo.seknowgroup.entity.NodeList; import org.jeecg.modules.demo.seknowgroup.entity.SeKnowGroup; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.konwRelationshipMain.entity.SeKonwRelationshipMain; /** * @Description: 知识图谱表 @@ -14,4 +17,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface SeKnowGroupMapper extends BaseMapper { + + @Select("select know_point from se_know_group where id =#{id}") + String findpointnode(String id); + + + @Select("select next_know_id from se_konw_relationship_main where per_kow_id=#{pointnode}") + List listid(String pointnode); + + @Select("select * from se_konw_relationship_main where per_kow_id =#{id}") + List getzxzsnodelist(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/ISeKnowGroupService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/ISeKnowGroupService.java index 71bcc16..24c6d5a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/ISeKnowGroupService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/ISeKnowGroupService.java @@ -1,7 +1,11 @@ package org.jeecg.modules.demo.seknowgroup.service; +import org.jeecg.modules.demo.seknowgroup.entity.NodeList; import org.jeecg.modules.demo.seknowgroup.entity.SeKnowGroup; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.konwRelationshipMain.entity.SeKonwRelationshipMain; + +import java.util.List; /** * @Description: 知识图谱表 @@ -11,4 +15,10 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ISeKnowGroupService extends IService { + String findpointnode(String id); + + List listid(String pointnode); + + + List getzxzsnodelist(String id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/impl/SeKnowGroupServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/impl/SeKnowGroupServiceImpl.java index fd6d999..6f0bc39 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/impl/SeKnowGroupServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/impl/SeKnowGroupServiceImpl.java @@ -1,12 +1,17 @@ package org.jeecg.modules.demo.seknowgroup.service.impl; +import org.jeecg.modules.demo.seknowgroup.entity.NodeList; import org.jeecg.modules.demo.seknowgroup.entity.SeKnowGroup; import org.jeecg.modules.demo.seknowgroup.mapper.SeKnowGroupMapper; import org.jeecg.modules.demo.seknowgroup.service.ISeKnowGroupService; +import org.jeecg.modules.konwRelationshipMain.entity.SeKonwRelationshipMain; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; + /** * @Description: 知识图谱表 * @Author: jeecg-boot @@ -16,4 +21,23 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class SeKnowGroupServiceImpl extends ServiceImpl implements ISeKnowGroupService { + @Autowired + SeKnowGroupMapper knowGroupMapper; + + @Override + public String findpointnode(String id) { + return knowGroupMapper.findpointnode(id); + } + + @Override + public List listid(String pointnode) { + return knowGroupMapper.listid(pointnode); + } + + @Override + public List getzxzsnodelist(String id) { + return knowGroupMapper.getzxzsnodelist(id); + } + + }