Browse Source

后台管理

small-tupu
hanyuqing 7 months ago
parent
commit
7988a7f482
  1. 17
      gyxtp/src/view/small.vue
  2. 141
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java
  3. 157
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointRelationshipController.java
  4. 1
      ruoyi-api/src/main/java/com/ruoyi/api/controller/LoginController.java
  5. 15
      ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java
  6. 42
      ruoyi-api/src/main/java/com/ruoyi/api/service/impl/PointService.java
  7. 3
      ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml
  8. 78
      ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPoint.java
  9. 139
      ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPointRelationship.java
  10. 61
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPointMapper.java
  11. 65
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZhyPointRelationshipMapper.java
  12. 61
      ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointRelationshipService.java
  13. 61
      ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointService.java
  14. 93
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointRelationshipServiceImpl.java
  15. 93
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointServiceImpl.java
  16. 66
      ruoyi-system/src/main/resources/mapper/system/SysPointMapper.xml
  17. 90
      ruoyi-system/src/main/resources/mapper/system/ZhyPointRelationshipMapper.xml
  18. 44
      ruoyi-ui/src/api/system/SysPoint.js
  19. 44
      ruoyi-ui/src/api/system/relationship1.js
  20. 272
      ruoyi-ui/src/views/system/SysPoint/index.vue

17
gyxtp/src/view/small.vue

@ -121,7 +121,7 @@ import { config } from '@/assets/defaultConfig.js'
import { demoData } from '@/assets/demo2.js'
import HeaderInfo from "@/components/UseAll/headerInfo.vue";
import leftInfo from "@/components/UseAll/leftInfo.vue";
import { getAllTitle, getDocInfo } from "@/api/api/doc";
import {getAllTitle, getDocInfo, getTitleBySamll} from "@/api/api/doc";
import {getDocInfoBylinkIds, getDomainGraphTest, getKeyWorlds, getpoinAll, getpoinByName} from "@/api/api/graph";
import { Picture } from "@element-plus/icons-vue";
import { selectAticleByRelation } from '@/api/api/article'
@ -306,7 +306,7 @@ export default {
}
],
defaultProps: {
children: 'level2',
children: 'children',
label: 'docTitle',
level: 'titleLevel',
docLevel: 'docLevel',
@ -448,6 +448,19 @@ export default {
},
mounted() {
this.getPointData()
getTitleBySamll().then((res)=>{
let data = res
data.mxMap["level"] = 1
data.mxMap["docTitle"] = data.mxMap["name"]
data.zbMap["level"] = 1
data.zbMap["docTitle"] = data.zbMap["name"]
data.zhibMap["level"] = 1
data.zhibMap["docTitle"] = data.zhibMap["name"]
this.data1 = []
this.data1.push(data.mxMap)
this.data1.push(data.zbMap)
this.data1.push(data.zhibMap)
})
},
}
</script>

141
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.system;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.api.service.impl.PointService;
import com.ruoyi.common.utils.Neo4jUtil;
import com.ruoyi.system.mapper.ZhyPointRelationshipMapper;
import com.ruoyi.system.service.IZhyPointRelationshipService;
import org.neo4j.driver.v1.StatementResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ZhyPoint;
import com.ruoyi.system.service.IZhyPointService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 知识点管理Controller
*
* @author ruoyi
* @date 2025-09-18
*/
@RestController
@RequestMapping("/system/SysPoint")
public class ZhyPointController extends BaseController
{
@Autowired
private IZhyPointService zhyPointService;
@Autowired
IZhyPointRelationshipService zhyPointRelationshipService;
@Autowired
ZhyPointRelationshipMapper zhyPointRelationshipMapper;
@Autowired
Neo4jUtil neo4jUtil;
@Autowired
PointService pointService;
/**
* 查询知识点管理列表
*/
@PreAuthorize("@ss.hasPermi('system:SysPoint:list')")
@GetMapping("/list")
public TableDataInfo list(ZhyPoint zhyPoint)
{
startPage();
List<ZhyPoint> list = zhyPointService.selectZhyPointList(zhyPoint);
return getDataTable(list);
}
/**
* 导出知识点管理列表
*/
@PreAuthorize("@ss.hasPermi('system:SysPoint:export')")
@Log(title = "知识点管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZhyPoint zhyPoint)
{
List<ZhyPoint> list = zhyPointService.selectZhyPointList(zhyPoint);
ExcelUtil<ZhyPoint> util = new ExcelUtil<ZhyPoint>(ZhyPoint.class);
util.exportExcel(response, list, "知识点管理数据");
}
/**
* 获取知识点管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:SysPoint:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(zhyPointService.selectZhyPointById(id));
}
/**
* 新增知识点管理
*/
@PreAuthorize("@ss.hasPermi('system:SysPoint:add')")
@Log(title = "知识点管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZhyPoint zhyPoint)
{
Map<String, Object> data = new HashMap<>();
data.put("type", zhyPoint.getType1());
int neo4jId = pointService.createPoint(zhyPoint.getPointName(), data);
zhyPoint.setUuid(Long.valueOf(neo4jId));
return toAjax(zhyPointService.insertZhyPoint(zhyPoint));
}
/**
* 修改知识点管理
*/
@PreAuthorize("@ss.hasPermi('system:SysPoint:edit')")
@Log(title = "知识点管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZhyPoint zhyPoint)
{
return toAjax(zhyPointService.updateZhyPoint(zhyPoint));
}
/**
* 删除知识点管理
*/
@PreAuthorize("@ss.hasPermi('system:SysPoint:remove')")
@Log(title = "知识点管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
for (int i = 0;i<ids.length;i++){
Long DBid = ids[i];
ZhyPoint zhyPoint = zhyPointService.selectZhyPointById(DBid);
if (zhyPoint.getType1().equals("author")){
zhyPointRelationshipMapper.deleteZhyPointRelationshipByAuthor(zhyPoint.getPointName());
}
if (zhyPoint.getType1().equals("keyword")){
zhyPointRelationshipMapper.deleteZhyPointRelationshipByKeyword(zhyPoint.getPointName());
}
if (zhyPoint.getType1().equals("agency")){
zhyPointRelationshipMapper.deleteZhyPointRelationshipByAgency(zhyPoint.getPointName());
}
pointService.deletePointAndRSByInternalId(zhyPoint.getUuid());
}
return toAjax(zhyPointService.deleteZhyPointByIds(ids));
}
}

157
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointRelationshipController.java

@ -0,0 +1,157 @@
package com.ruoyi.web.controller.system;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.api.mapper.ZhyPointMapper;
import com.ruoyi.api.service.impl.PointService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ZhyPointRelationship;
import com.ruoyi.system.service.IZhyPointRelationshipService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 知识点关系Controller
*
* @author ruoyi
* @date 2025-09-20
*/
@RestController
@RequestMapping("/system/relationship1")
public class ZhyPointRelationshipController extends BaseController
{
@Autowired
private IZhyPointRelationshipService zhyPointRelationshipService;
@Autowired
PointService pointService;
@Autowired
ZhyPointMapper zhyPointMapper;
/**
* 查询知识点关系列表
*/
@PreAuthorize("@ss.hasPermi('system:relationship:list')")
@GetMapping("/list")
public TableDataInfo list(ZhyPointRelationship zhyPointRelationship)
{
startPage();
List<ZhyPointRelationship> list = zhyPointRelationshipService.selectZhyPointRelationshipList(zhyPointRelationship);
return getDataTable(list);
}
/**
* 导出知识点关系列表
*/
@PreAuthorize("@ss.hasPermi('system:relationship:export')")
@Log(title = "知识点关系", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZhyPointRelationship zhyPointRelationship)
{
List<ZhyPointRelationship> list = zhyPointRelationshipService.selectZhyPointRelationshipList(zhyPointRelationship);
ExcelUtil<ZhyPointRelationship> util = new ExcelUtil<ZhyPointRelationship>(ZhyPointRelationship.class);
util.exportExcel(response, list, "知识点关系数据");
}
/**
* 获取知识点关系详细信息
*/
@PreAuthorize("@ss.hasPermi('system:relationship:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(zhyPointRelationshipService.selectZhyPointRelationshipById(id));
}
/**
* 新增知识点关系
*/
@PreAuthorize("@ss.hasPermi('system:relationship:add')")
@Log(title = "知识点关系", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZhyPointRelationship zhyPointRelationship)
{
List<Map> point = zhyPointMapper.selectPointByName(zhyPointRelationship.getStart());
int startid = Integer.valueOf(String.valueOf(point.get(0).get("uuid")));
String startType = String.valueOf(point.get(0).get("type1"));
List<Map> point2 = zhyPointMapper.selectPointByName(zhyPointRelationship.getEnd());
int endid = Integer.valueOf(String.valueOf(point2.get(0).get("uuid")));
String endType = String.valueOf(point2.get(0).get("type1"));
String RType = "";
if (startType.equals("author")){
if (endType.equals("agency")){
RType = "相关机构";
}
if (endType.equals("keyword")){
RType = "相关作者";
}
}
if (startType.equals("agency")){
if (endType.equals("author")){
RType = "相关机构";
}
if (endType.equals("keyword")){
RType = "相关";
}
}
if (startType.equals("keyword")){
if (endType.equals("author")){
RType = "相关作者";
}
if (endType.equals("agency")){
RType = "相关";
}
}
Map map = new HashMap();
map.put("relType",RType);
int uuid = pointService.createReletionship(startid,endid,RType,map);
zhyPointRelationship.setRelationshipId(Long.valueOf(uuid));
return toAjax(zhyPointRelationshipService.insertZhyPointRelationship(zhyPointRelationship));
}
/**
* 修改知识点关系
*/
@PreAuthorize("@ss.hasPermi('system:relationship:edit')")
@Log(title = "知识点关系", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZhyPointRelationship zhyPointRelationship)
{
return toAjax(zhyPointRelationshipService.updateZhyPointRelationship(zhyPointRelationship));
}
/**
* 删除知识点关系
*/
@PreAuthorize("@ss.hasPermi('system:relationship:remove')")
@Log(title = "知识点关系", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
for (int i =0;i<ids.length;i++){
ZhyPointRelationship zhyPointRelationship = zhyPointRelationshipService.selectZhyPointRelationshipById(ids[i]);
pointService.deleteRSById(zhyPointRelationship.getRelationshipId());
}
return toAjax(zhyPointRelationshipService.deleteZhyPointRelationshipByIds(ids));
}
}

1
ruoyi-api/src/main/java/com/ruoyi/api/controller/LoginController.java

@ -96,6 +96,7 @@ public class LoginController extends BaseController {
//通过token获取uuid
zhyUserEntity.setToken(a);
zhyUserEntity.setRealName(userEntity.getUserName());
return AjaxResult.success("成功登录", zhyUserEntity);
}
@PostMapping("/doRegister")

15
ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java

@ -101,12 +101,17 @@ public class TestXiaoTuPuController extends BaseController {
}
Integer uuid = Integer.valueOf(String.valueOf(list.get(0).get("uuid")));
String cypher ="MATCH (center:TestNode)\n" +
"WHERE id(center) = "+uuid+"\n" +
"MATCH path = (center)-[*1..2]-(other:TestNode)\n" +
"UNWIND relationships(path) AS r\n" +
"WITH r, startNode(r) AS n, endNode(r) AS m\n" +
String cypher = "MATCH (center:TestNode)\n" +
"WHERE id(center) = " + uuid + "\n" +
"MATCH path = (center)-[r]-(other:TestNode)\n" + // 直接匹配一条关系
"WITH r, center AS n, other AS m\n" +
"RETURN DISTINCT n, m, r";
// String cypher ="MATCH (center:TestNode)\n" +
// "WHERE id(center) = "+uuid+"\n" +
// "MATCH path = (center)-[*1..2]-(other:TestNode)\n" +
// "UNWIND relationships(path) AS r\n" +
// "WITH r, startNode(r) AS n, endNode(r) AS m\n" +
// "RETURN DISTINCT n, m, r";
HashMap<String, Object> graphNode = neo4jUtil.getGraphNodeAndShip(cypher);

42
ruoyi-api/src/main/java/com/ruoyi/api/service/impl/PointService.java

@ -5,7 +5,9 @@ import com.ruoyi.common.utils.Neo4jUtil;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import org.neo4j.driver.v1.Record;
import org.neo4j.driver.v1.StatementResult;
import org.neo4j.driver.v1.Value;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,8 +31,6 @@ public class PointService {
public void buildPoint(String url) throws IOException {
// String url="D:\\project\\gyx\\tupudata\\thesis\\thesis_results_20250914_201832.csv";
List<Map<String, String>> dataList = getCsvLine(url);
System.out.println("2222222222222222222222");
System.out.println(dataList);
Map<String,Integer> nameToId = new HashMap<>();
for (Map<String, String> record : dataList) {
List<Map<String, String>> relationshipList = new ArrayList<>();
@ -362,7 +362,7 @@ public class PointService {
return result.toArray(new String[0]);
}
private int createPoint(String name, Map<String, Object> data) {
public int createPoint(String name, Map<String, Object> data) {
// 构建属性字符串,例如:key1: 'value1', key2: 30
StringBuilder propsBuilder = new StringBuilder();
propsBuilder.append(String.format("name: '%s'", name)); // 保留 name 字段
@ -393,8 +393,42 @@ public class PointService {
StatementResult res = neo4jUtil.excuteCypherSql(cypher);
return Integer.valueOf(String.valueOf(res.next().get("nodeId")));
}
public int deletePointAndRSByInternalId(long nodeId) {
String cypher = String.format(
"MATCH (r) WHERE id(r) = %d DETACH DELETE r RETURN count(r) AS deletedCount",
nodeId
);
try {
StatementResult result = neo4jUtil.excuteCypherSql(cypher);
if (result.hasNext()) {
Record record = result.next();
Value value = record.get("deletedCount");
return value.asInt(); // ✅ 正确方式:使用 asInt()
}
return 0;
} catch (Exception e) {
System.err.println("删除节点失败,uid: " + nodeId + ", 错误: " + e.getMessage());
throw e;
}
}
public int deleteRSById(Long id){
String cypher = String.format(
"MATCH ()-[r]-() WHERE id(r)=%d DELETE r",
id
);
try {
neo4jUtil.excuteCypherSql(cypher);
return 1;
}
catch(Exception e){
System.err.println("删除关系失败,uid: " + id + ", 错误: " + e.getMessage());
private int createReletionship(int startNodeId,int endNodeId,String relationshipType,Map data){
}
return 0;
}
public int createReletionship(int startNodeId,int endNodeId,String relationshipType,Map data){
String cypher = String.format(
"MATCH (a), (b) " +
"WHERE id(a) = %d AND id(b) = %d " +

3
ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml

@ -61,4 +61,7 @@
</insert>
</mapper>

78
ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPoint.java

@ -0,0 +1,78 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 知识点管理对象 sys_point
*
* @author ruoyi
* @date 2025-09-18
*/
public class ZhyPoint extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 知识点名称 */
@Excel(name = "知识点名称")
private String pointName;
/** neo4j ID */
private Long uuid;
/** 类型 */
@Excel(name = "类型")
private String type1;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPointName(String pointName)
{
this.pointName = pointName;
}
public String getPointName()
{
return pointName;
}
public void setUuid(Long uuid)
{
this.uuid = uuid;
}
public Long getUuid()
{
return uuid;
}
public void setType1(String type1)
{
this.type1 = type1;
}
public String getType1()
{
return type1;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("pointName", getPointName())
.append("uuid", getUuid())
.append("type1", getType1())
.toString();
}
}

139
ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPointRelationship.java

@ -0,0 +1,139 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 知识点关系对象 zhy_point_relationship
*
* @author ruoyi
* @date 2025-09-20
*/
public class ZhyPointRelationship extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
private String start;
private String end;
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String author;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String keyword;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String agency;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long relationshipId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String url;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String title;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAuthor(String author)
{
this.author = author;
}
public String getAuthor()
{
return author;
}
public void setKeyword(String keyword)
{
this.keyword = keyword;
}
public String getKeyword()
{
return keyword;
}
public void setAgency(String agency)
{
this.agency = agency;
}
public String getAgency()
{
return agency;
}
public void setRelationshipId(Long relationshipId)
{
this.relationshipId = relationshipId;
}
public Long getRelationshipId()
{
return relationshipId;
}
public void setUrl(String url)
{
this.url = url;
}
public String getUrl()
{
return url;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("author", getAuthor())
.append("keyword", getKeyword())
.append("agency", getAgency())
.append("relationshipId", getRelationshipId())
.append("url", getUrl())
.append("title", getTitle())
.toString();
}
}

61
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPointMapper.java

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.ZhyPoint;
/**
* 知识点管理Mapper接口
*
* @author ruoyi
* @date 2025-09-18
*/
public interface SysPointMapper
{
/**
* 查询知识点管理
*
* @param id 知识点管理主键
* @return 知识点管理
*/
public ZhyPoint selectZhyPointById(Long id);
/**
* 查询知识点管理列表
*
* @param zhyPoint 知识点管理
* @return 知识点管理集合
*/
public List<ZhyPoint> selectZhyPointList(ZhyPoint zhyPoint);
/**
* 新增知识点管理
*
* @param zhyPoint 知识点管理
* @return 结果
*/
public int insertZhyPoint(ZhyPoint zhyPoint);
/**
* 修改知识点管理
*
* @param zhyPoint 知识点管理
* @return 结果
*/
public int updateZhyPoint(ZhyPoint zhyPoint);
/**
* 删除知识点管理
*
* @param id 知识点管理主键
* @return 结果
*/
public int deleteZhyPointById(Long id);
/**
* 批量删除知识点管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZhyPointByIds(Long[] ids);
}

65
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZhyPointRelationshipMapper.java

@ -0,0 +1,65 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.ZhyPointRelationship;
/**
* 知识点关系Mapper接口
*
* @author ruoyi
* @date 2025-09-20
*/
public interface ZhyPointRelationshipMapper
{
/**
* 查询知识点关系
*
* @param id 知识点关系主键
* @return 知识点关系
*/
public ZhyPointRelationship selectZhyPointRelationshipById(Long id);
/**
* 查询知识点关系列表
*
* @param zhyPointRelationship 知识点关系
* @return 知识点关系集合
*/
public List<ZhyPointRelationship> selectZhyPointRelationshipList(ZhyPointRelationship zhyPointRelationship);
/**
* 新增知识点关系
*
* @param zhyPointRelationship 知识点关系
* @return 结果
*/
public int insertZhyPointRelationship(ZhyPointRelationship zhyPointRelationship);
/**
* 修改知识点关系
*
* @param zhyPointRelationship 知识点关系
* @return 结果
*/
public int updateZhyPointRelationship(ZhyPointRelationship zhyPointRelationship);
/**
* 删除知识点关系
*
* @param id 知识点关系主键
* @return 结果
*/
public int deleteZhyPointRelationshipById(Long id);
public int deleteZhyPointRelationshipByAuthor(String author);
public int deleteZhyPointRelationshipByKeyword(String keyword);
public int deleteZhyPointRelationshipByAgency(String agency);
/**
* 批量删除知识点关系
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZhyPointRelationshipByIds(Long[] ids);
}

61
ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointRelationshipService.java

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.ZhyPointRelationship;
/**
* 知识点关系Service接口
*
* @author ruoyi
* @date 2025-09-20
*/
public interface IZhyPointRelationshipService
{
/**
* 查询知识点关系
*
* @param id 知识点关系主键
* @return 知识点关系
*/
public ZhyPointRelationship selectZhyPointRelationshipById(Long id);
/**
* 查询知识点关系列表
*
* @param zhyPointRelationship 知识点关系
* @return 知识点关系集合
*/
public List<ZhyPointRelationship> selectZhyPointRelationshipList(ZhyPointRelationship zhyPointRelationship);
/**
* 新增知识点关系
*
* @param zhyPointRelationship 知识点关系
* @return 结果
*/
public int insertZhyPointRelationship(ZhyPointRelationship zhyPointRelationship);
/**
* 修改知识点关系
*
* @param zhyPointRelationship 知识点关系
* @return 结果
*/
public int updateZhyPointRelationship(ZhyPointRelationship zhyPointRelationship);
/**
* 批量删除知识点关系
*
* @param ids 需要删除的知识点关系主键集合
* @return 结果
*/
public int deleteZhyPointRelationshipByIds(Long[] ids);
/**
* 删除知识点关系信息
*
* @param id 知识点关系主键
* @return 结果
*/
public int deleteZhyPointRelationshipById(Long id);
}

61
ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointService.java

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.ZhyPoint;
/**
* 知识点管理Service接口
*
* @author ruoyi
* @date 2025-09-18
*/
public interface IZhyPointService
{
/**
* 查询知识点管理
*
* @param id 知识点管理主键
* @return 知识点管理
*/
public ZhyPoint selectZhyPointById(Long id);
/**
* 查询知识点管理列表
*
* @param zhyPoint 知识点管理
* @return 知识点管理集合
*/
public List<ZhyPoint> selectZhyPointList(ZhyPoint zhyPoint);
/**
* 新增知识点管理
*
* @param zhyPoint 知识点管理
* @return 结果
*/
public int insertZhyPoint(ZhyPoint zhyPoint);
/**
* 修改知识点管理
*
* @param zhyPoint 知识点管理
* @return 结果
*/
public int updateZhyPoint(ZhyPoint zhyPoint);
/**
* 批量删除知识点管理
*
* @param ids 需要删除的知识点管理主键集合
* @return 结果
*/
public int deleteZhyPointByIds(Long[] ids);
/**
* 删除知识点管理信息
*
* @param id 知识点管理主键
* @return 结果
*/
public int deleteZhyPointById(Long id);
}

93
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointRelationshipServiceImpl.java

@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZhyPointRelationshipMapper;
import com.ruoyi.system.domain.ZhyPointRelationship;
import com.ruoyi.system.service.IZhyPointRelationshipService;
/**
* 知识点关系Service业务层处理
*
* @author ruoyi
* @date 2025-09-20
*/
@Service
public class ZhyPointRelationshipServiceImpl implements IZhyPointRelationshipService
{
@Autowired
private ZhyPointRelationshipMapper zhyPointRelationshipMapper;
/**
* 查询知识点关系
*
* @param id 知识点关系主键
* @return 知识点关系
*/
@Override
public ZhyPointRelationship selectZhyPointRelationshipById(Long id)
{
return zhyPointRelationshipMapper.selectZhyPointRelationshipById(id);
}
/**
* 查询知识点关系列表
*
* @param zhyPointRelationship 知识点关系
* @return 知识点关系
*/
@Override
public List<ZhyPointRelationship> selectZhyPointRelationshipList(ZhyPointRelationship zhyPointRelationship)
{
return zhyPointRelationshipMapper.selectZhyPointRelationshipList(zhyPointRelationship);
}
/**
* 新增知识点关系
*
* @param zhyPointRelationship 知识点关系
* @return 结果
*/
@Override
public int insertZhyPointRelationship(ZhyPointRelationship zhyPointRelationship)
{
return zhyPointRelationshipMapper.insertZhyPointRelationship(zhyPointRelationship);
}
/**
* 修改知识点关系
*
* @param zhyPointRelationship 知识点关系
* @return 结果
*/
@Override
public int updateZhyPointRelationship(ZhyPointRelationship zhyPointRelationship)
{
return zhyPointRelationshipMapper.updateZhyPointRelationship(zhyPointRelationship);
}
/**
* 批量删除知识点关系
*
* @param ids 需要删除的知识点关系主键
* @return 结果
*/
@Override
public int deleteZhyPointRelationshipByIds(Long[] ids)
{
return zhyPointRelationshipMapper.deleteZhyPointRelationshipByIds(ids);
}
/**
* 删除知识点关系信息
*
* @param id 知识点关系主键
* @return 结果
*/
@Override
public int deleteZhyPointRelationshipById(Long id)
{
return zhyPointRelationshipMapper.deleteZhyPointRelationshipById(id);
}
}

93
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointServiceImpl.java

@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysPointMapper;
import com.ruoyi.system.domain.ZhyPoint;
import com.ruoyi.system.service.IZhyPointService;
/**
* 知识点管理Service业务层处理
*
* @author ruoyi
* @date 2025-09-18
*/
@Service
public class ZhyPointServiceImpl implements IZhyPointService
{
@Autowired
private SysPointMapper zhyPointMapper;
/**
* 查询知识点管理
*
* @param id 知识点管理主键
* @return 知识点管理
*/
@Override
public ZhyPoint selectZhyPointById(Long id)
{
return zhyPointMapper.selectZhyPointById(id);
}
/**
* 查询知识点管理列表
*
* @param zhyPoint 知识点管理
* @return 知识点管理
*/
@Override
public List<ZhyPoint> selectZhyPointList(ZhyPoint zhyPoint)
{
return zhyPointMapper.selectZhyPointList(zhyPoint);
}
/**
* 新增知识点管理
*
* @param zhyPoint 知识点管理
* @return 结果
*/
@Override
public int insertZhyPoint(ZhyPoint zhyPoint)
{
return zhyPointMapper.insertZhyPoint(zhyPoint);
}
/**
* 修改知识点管理
*
* @param zhyPoint 知识点管理
* @return 结果
*/
@Override
public int updateZhyPoint(ZhyPoint zhyPoint)
{
return zhyPointMapper.updateZhyPoint(zhyPoint);
}
/**
* 批量删除知识点管理
*
* @param ids 需要删除的知识点管理主键
* @return 结果
*/
@Override
public int deleteZhyPointByIds(Long[] ids)
{
return zhyPointMapper.deleteZhyPointByIds(ids);
}
/**
* 删除知识点管理信息
*
* @param id 知识点管理主键
* @return 结果
*/
@Override
public int deleteZhyPointById(Long id)
{
return zhyPointMapper.deleteZhyPointById(id);
}
}

66
ruoyi-system/src/main/resources/mapper/system/SysPointMapper.xml

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysPointMapper">
<resultMap type="ZhyPoint" id="ZhyPointResult">
<result property="id" column="id" />
<result property="pointName" column="point_name" />
<result property="uuid" column="uuid" />
<result property="type1" column="type1" />
</resultMap>
<sql id="selectZhyPointVo">
select id, point_name, uuid, type1 from zhy_point
</sql>
<select id="selectZhyPointList" parameterType="ZhyPoint" resultMap="ZhyPointResult">
<include refid="selectZhyPointVo"/>
<where>
<if test="pointName != null and pointName != ''"> and point_name like concat('%', #{pointName}, '%')</if>
<if test="uuid != null "> and uuid = #{uuid}</if>
<if test="type1 != null and type1 != ''"> and type1 = #{type1}</if>
</where>
</select>
<select id="selectZhyPointById" parameterType="Long" resultMap="ZhyPointResult">
<include refid="selectZhyPointVo"/>
where id = #{id}
</select>
<insert id="insertZhyPoint" parameterType="ZhyPoint" useGeneratedKeys="true" keyProperty="id">
insert into zhy_point
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pointName != null">point_name,</if>
<if test="uuid != null">uuid,</if>
<if test="type1 != null">type1,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pointName != null">#{pointName},</if>
<if test="uuid != null">#{uuid},</if>
<if test="type1 != null">#{type1},</if>
</trim>
</insert>
<update id="updateZhyPoint" parameterType="ZhyPoint">
update zhy_point
<trim prefix="SET" suffixOverrides=",">
<if test="pointName != null">point_name = #{pointName},</if>
<if test="uuid != null">uuid = #{uuid},</if>
<if test="type1 != null">type1 = #{type1},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZhyPointById" parameterType="Long">
delete from zhy_point where id = #{id}
</delete>
<delete id="deleteZhyPointByIds" parameterType="String">
delete from zhy_point where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

90
ruoyi-system/src/main/resources/mapper/system/ZhyPointRelationshipMapper.xml

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.ZhyPointRelationshipMapper">
<resultMap type="ZhyPointRelationship" id="ZhyPointRelationshipResult">
<result property="id" column="id" />
<result property="author" column="author" />
<result property="keyword" column="keyword" />
<result property="agency" column="agency" />
<result property="relationshipId" column="relationship_id" />
<result property="url" column="url" />
<result property="title" column="title" />
</resultMap>
<sql id="selectZhyPointRelationshipVo">
select id, author, keyword, agency, relationship_id, url, title from zhy_point_relationship
</sql>
<select id="selectZhyPointRelationshipList" parameterType="ZhyPointRelationship" resultMap="ZhyPointRelationshipResult">
<include refid="selectZhyPointRelationshipVo"/>
<where>
<if test="author != null and author != ''"> and author = #{author}</if>
<if test="keyword != null and keyword != ''"> and keyword = #{keyword}</if>
<if test="agency != null and agency != ''"> and agency = #{agency}</if>
<if test="relationshipId != null "> and relationship_id = #{relationshipId}</if>
<if test="url != null and url != ''"> and url = #{url}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
</where>
</select>
<select id="selectZhyPointRelationshipById" parameterType="Long" resultMap="ZhyPointRelationshipResult">
<include refid="selectZhyPointRelationshipVo"/>
where id = #{id}
</select>
<insert id="insertZhyPointRelationship" parameterType="ZhyPointRelationship" useGeneratedKeys="true" keyProperty="id">
insert into zhy_point_relationship
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="author != null">author,</if>
<if test="keyword != null">keyword,</if>
<if test="agency != null">agency,</if>
<if test="relationshipId != null">relationship_id,</if>
<if test="url != null">url,</if>
<if test="title != null">title,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="author != null">#{author},</if>
<if test="keyword != null">#{keyword},</if>
<if test="agency != null">#{agency},</if>
<if test="relationshipId != null">#{relationshipId},</if>
<if test="url != null">#{url},</if>
<if test="title != null">#{title},</if>
</trim>
</insert>
<update id="updateZhyPointRelationship" parameterType="ZhyPointRelationship">
update zhy_point_relationship
<trim prefix="SET" suffixOverrides=",">
<if test="author != null">author = #{author},</if>
<if test="keyword != null">keyword = #{keyword},</if>
<if test="agency != null">agency = #{agency},</if>
<if test="relationshipId != null">relationship_id = #{relationshipId},</if>
<if test="url != null">url = #{url},</if>
<if test="title != null">title = #{title},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZhyPointRelationshipById" parameterType="Long">
delete from zhy_point_relationship where id = #{id}
</delete>
<delete id="deleteZhyPointRelationshipByAuthor" >
delete from zhy_point_relationship where author = #{param1}
</delete>
<delete id="deleteZhyPointRelationshipByKeyword" >
delete from zhy_point_relationship where keyword = #{param1}
</delete>
<delete id="deleteZhyPointRelationshipByAgency" >
delete from zhy_point_relationship where agency = #{param1}
</delete>
<delete id="deleteZhyPointRelationshipByIds" parameterType="String">
delete from zhy_point_relationship where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

44
ruoyi-ui/src/api/system/SysPoint.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询知识点管理列表
export function listSysPoint(query) {
return request({
url: '/system/SysPoint/list',
method: 'get',
params: query
})
}
// 查询知识点管理详细
export function getSysPoint(id) {
return request({
url: '/system/SysPoint/' + id,
method: 'get'
})
}
// 新增知识点管理
export function addSysPoint(data) {
return request({
url: '/system/SysPoint',
method: 'post',
data: data
})
}
// 修改知识点管理
export function updateSysPoint(data) {
return request({
url: '/system/SysPoint',
method: 'put',
data: data
})
}
// 删除知识点管理
export function delSysPoint(id) {
return request({
url: '/system/SysPoint/' + id,
method: 'delete'
})
}

44
ruoyi-ui/src/api/system/relationship1.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询知识点关系列表
export function listRelationship(query) {
return request({
url: '/system/relationship1/list',
method: 'get',
params: query
})
}
// 查询知识点关系详细
export function getRelationship(id) {
return request({
url: '/system/relationship1/' + id,
method: 'get'
})
}
// 新增知识点关系
export function addRelationship(data) {
return request({
url: '/system/relationship1',
method: 'post',
data: data
})
}
// 修改知识点关系
export function updateRelationship(data) {
return request({
url: '/system/relationship1',
method: 'put',
data: data
})
}
// 删除知识点关系
export function delRelationship(id) {
return request({
url: '/system/relationship1/' + id,
method: 'delete'
})
}

272
ruoyi-ui/src/views/system/SysPoint/index.vue

@ -0,0 +1,272 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="知识点名称" prop="pointName">
<el-input
v-model="queryParams.pointName"
placeholder="请输入知识点名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="neo4j ID" prop="uuid">-->
<!-- <el-input-->
<!-- v-model="queryParams.uuid"-->
<!-- placeholder="请输入neo4j ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="类型" prop="type1">
<el-input
v-model="queryParams.type1"
placeholder="请输入类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:SysPoint:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:SysPoint:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:SysPoint:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:SysPoint:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="SysPointList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="${comment}" align="center" prop="id" />-->
<el-table-column label="知识点名称" align="center" prop="pointName" />
<el-table-column label="类型" align="center" prop="type1" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:SysPoint:edit']"-->
<!-- >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:SysPoint:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改知识点管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="知识点名称" prop="pointName">
<el-input v-model="form.pointName" placeholder="请输入知识点名称" />
</el-form-item>
<el-form-item label="neo4j ID" prop="uuid">
<el-input v-model="form.uuid" placeholder="请输入neo4j ID" />
</el-form-item>
<el-form-item label="类型" prop="type1">
<el-input v-model="form.type1" placeholder="请输入类型" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSysPoint, getSysPoint, delSysPoint, addSysPoint, updateSysPoint } from "@/api/system/SysPoint";
export default {
name: "SysPoint",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
SysPointList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
pointName: null,
uuid: null,
type1: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询知识点管理列表 */
getList() {
this.loading = true;
listSysPoint(this.queryParams).then(response => {
this.SysPointList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
pointName: null,
uuid: null,
type1: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加知识点管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getSysPoint(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改知识点管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSysPoint(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSysPoint(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除知识点管理编号为"' + ids + '"的数据项?').then(function() {
return delSysPoint(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/SysPoint/export', {
...this.queryParams
}, `SysPoint_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save