master
wangjiadong 2 years ago
parent 4a38e0c6b4
commit 1e82dfffc6
  1. 21
      ant-design-vue-jeecg/src/views/seknowgroup/SeKnowGroupList.vue
  2. 2
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/mapper/SeKonwMapper.java
  4. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/ISeKonwService.java
  5. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/know/service/impl/SeKonwServiceImpl.java
  6. 79
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/controller/SeKnowGroupController.java
  7. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/Exports.java
  8. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeList.java
  9. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/entity/NodeName.java
  10. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/mapper/SeKnowGroupMapper.java
  11. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/ISeKnowGroupService.java
  12. 24
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/seknowgroup/service/impl/SeKnowGroupServiceImpl.java

@ -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(){
},

@ -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"); //登录接口排除

@ -32,4 +32,6 @@ public interface SeKonwMapper extends BaseMapper<SeKonw> {
void update1(String getrealname, String createBy);
@Select("select wight from se_konw_relationship where id =#{relationId}")
String getrelaint(String relationId);
}

@ -23,4 +23,6 @@ public interface ISeKonwService extends IService<SeKonw> {
void update1(String getrealname, String createBy);
Boolean importExcel(List<SeKonw> zlListByE);
String getrelaint(String relationId);
}

@ -63,6 +63,10 @@ public class SeKonwServiceImpl extends ServiceImpl<SeKonwMapper, SeKonw> impleme
return true;
}
@Override
public String getrelaint(String relationId) {
return seKonwMapper.getrelaint(relationId);
}
}

@ -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<SeKnowGroup, ISeKnowG
@Autowired
private ISeKnowGroupService seKnowGroupService;
@Autowired
private ISeKonwService seKonwService;
/**
* 分页列表查询
*
@ -168,4 +178,73 @@ public class SeKnowGroupController extends JeecgController<SeKnowGroup, ISeKnowG
return super.importExcel(request, response, SeKnowGroup.class);
}
/**
* 开始组装知识图谱
*/
@RequestMapping(value = "/zzzztp")
public Result<?> zzzztp(@RequestParam(name="id",required=true) String id) {
//最多显示三层结构
List<NodeName> 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<String> listid = seKnowGroupService.listid(seknow.getId());
//开始循环
for (int i=0;i<listid.size();i++){
NodeName nodes1 = new NodeName();
//根据id获取知识点名字,并且进行赋值
nodes1.setName(seKonwService.getById(listid.get(i)).getName());
nodelist.add(nodes1);
//开始第二层循环
List<String> listid2 = seKnowGroupService.listid(listid.get(i));
for (int j =0;j<listid2.size();j++ ){
NodeName nodes2 = new NodeName();
nodes2.setName(seKonwService.getById(listid.get(j)).getName());
nodelist.add(nodes2);
}
}
//现在开始组装知识图谱经管系节点
List<NodeList> nodelistdss = new ArrayList<>();
//首先根据中心知识点查询
List<SeKonwRelationshipMain> 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<SeKonwRelationshipMain> segouplisttemp2 = new ArrayList<>();
segouplisttemp2=seKnowGroupService.getzxzsnodelist(segouplisttemp.get(i).getNextKnowId());
for (int j=0;j<segouplisttemp2.size();j++){
NodeList ndoesl2 = new NodeList();
ndoesl2.setSource(seKonwService.getById(segouplisttemp.get(i).getPerKowId()).getName());
ndoesl2.setTarget(seKonwService.getById(segouplisttemp.get(i).getNextKnowId()).getName());
ndoesl2.setValue(seKonwService.getrelaint(segouplisttemp.get(i).getRelationId()));
nodelistdss.add(ndoesl2);
}
}
Exports exep = new Exports();
exep.setNodes(nodelist.stream().distinct().collect(Collectors.toList()));
exep.setLinks(nodelistdss);
System.out.println(exep);
return Result.OK(exep);
}
}

@ -0,0 +1,11 @@
package org.jeecg.modules.demo.seknowgroup.entity;
import lombok.Data;
import java.util.List;
@Data
public class Exports {
private List<NodeName> nodes;
private List<NodeList> links;
}

@ -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;
}

@ -0,0 +1,9 @@
package org.jeecg.modules.demo.seknowgroup.entity;
import lombok.Data;
@Data
public class NodeName {
private String name;
}

@ -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<SeKnowGroup> {
@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<String> listid(String pointnode);
@Select("select * from se_konw_relationship_main where per_kow_id =#{id}")
List<SeKonwRelationshipMain> getzxzsnodelist(String id);
}

@ -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<SeKnowGroup> {
String findpointnode(String id);
List<String> listid(String pointnode);
List<SeKonwRelationshipMain> getzxzsnodelist(String id);
}

@ -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<SeKnowGroupMapper, SeKnowGroup> implements ISeKnowGroupService {
@Autowired
SeKnowGroupMapper knowGroupMapper;
@Override
public String findpointnode(String id) {
return knowGroupMapper.findpointnode(id);
}
@Override
public List<String> listid(String pointnode) {
return knowGroupMapper.listid(pointnode);
}
@Override
public List<SeKonwRelationshipMain> getzxzsnodelist(String id) {
return knowGroupMapper.getzxzsnodelist(id);
}
}

Loading…
Cancel
Save