From ccc1f3ab97a58ad54f81fad08ce4cc1ca0d96c28 Mon Sep 17 00:00:00 2001 From: jzy <928294064@qq.com> Date: Sat, 20 Sep 2025 18:46:24 +0800 Subject: [PATCH] yangshi --- gyxtp/src/view/small.vue | 17 +- .../web/controller/system/ZhyPointController.java | 141 ++++++++++ .../system/ZhyPointRelationshipController.java | 157 +++++++++++ .../com/ruoyi/api/controller/LoginController.java | 1 + .../api/controller/TestXiaoTuPuController.java | 15 +- .../com/ruoyi/api/service/impl/PointService.java | 42 ++- .../main/resources/mapper/api/ZhyPointMapper.xml | 3 + .../java/com/ruoyi/system/domain/ZhyPoint.java | 78 ++++++ .../ruoyi/system/domain/ZhyPointRelationship.java | 139 ++++++++++ .../com/ruoyi/system/mapper/SysPointMapper.java | 61 +++++ .../system/mapper/ZhyPointRelationshipMapper.java | 65 +++++ .../service/IZhyPointRelationshipService.java | 61 +++++ .../com/ruoyi/system/service/IZhyPointService.java | 61 +++++ .../impl/ZhyPointRelationshipServiceImpl.java | 93 +++++++ .../system/service/impl/ZhyPointServiceImpl.java | 93 +++++++ .../resources/mapper/system/SysPointMapper.xml | 66 +++++ .../mapper/system/ZhyPointRelationshipMapper.xml | 90 +++++++ ruoyi-ui/src/api/system/SysPoint.js | 44 ++++ ruoyi-ui/src/api/system/relationship1.js | 44 ++++ ruoyi-ui/src/views/system/SysPoint/index.vue | 272 +++++++++++++++++++ ruoyi-ui/src/views/system/relationship/index.vue | 290 +++++++++++++++++++++ 21 files changed, 1822 insertions(+), 11 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointRelationshipController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPoint.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPointRelationship.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPointMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZhyPointRelationshipMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointRelationshipService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointRelationshipServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/SysPointMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/ZhyPointRelationshipMapper.xml create mode 100644 ruoyi-ui/src/api/system/SysPoint.js create mode 100644 ruoyi-ui/src/api/system/relationship1.js create mode 100644 ruoyi-ui/src/views/system/SysPoint/index.vue create mode 100644 ruoyi-ui/src/views/system/relationship/index.vue diff --git a/gyxtp/src/view/small.vue b/gyxtp/src/view/small.vue index 45789c3..989e447 100644 --- a/gyxtp/src/view/small.vue +++ b/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' @@ -270,7 +270,7 @@ export default { } ], defaultProps: { - children: 'level2', + children: 'children', label: 'docTitle', level: 'titleLevel', docLevel: 'docLevel', @@ -412,6 +412,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) + }) }, } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java new file mode 100644 index 0000000..1acfbc8 --- /dev/null +++ b/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 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 list = zhyPointService.selectZhyPointList(zhyPoint); + ExcelUtil util = new ExcelUtil(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 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 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 list = zhyPointRelationshipService.selectZhyPointRelationshipList(zhyPointRelationship); + ExcelUtil util = new ExcelUtil(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 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 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 graphNode = neo4jUtil.getGraphNodeAndShip(cypher); diff --git a/ruoyi-api/src/main/java/com/ruoyi/api/service/impl/PointService.java b/ruoyi-api/src/main/java/com/ruoyi/api/service/impl/PointService.java index e07976a..0425fac 100644 --- a/ruoyi-api/src/main/java/com/ruoyi/api/service/impl/PointService.java +++ b/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> dataList = getCsvLine(url); - System.out.println("2222222222222222222222"); - System.out.println(dataList); Map nameToId = new HashMap<>(); for (Map record : dataList) { List> relationshipList = new ArrayList<>(); @@ -362,7 +362,7 @@ public class PointService { return result.toArray(new String[0]); } - private int createPoint(String name, Map data) { + public int createPoint(String name, Map 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 " + diff --git a/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml b/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml index 8aa1acf..83cb680 100644 --- a/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml +++ b/ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml @@ -61,4 +61,7 @@ + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPoint.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPoint.java new file mode 100644 index 0000000..f509cd0 --- /dev/null +++ b/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(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPointRelationship.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyPointRelationship.java new file mode 100644 index 0000000..379d34c --- /dev/null +++ b/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(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPointMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPointMapper.java new file mode 100644 index 0000000..454c650 --- /dev/null +++ b/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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZhyPointRelationshipMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZhyPointRelationshipMapper.java new file mode 100644 index 0000000..e4eee16 --- /dev/null +++ b/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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointRelationshipService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointRelationshipService.java new file mode 100644 index 0000000..bc0640f --- /dev/null +++ b/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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IZhyPointService.java new file mode 100644 index 0000000..7379748 --- /dev/null +++ b/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 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); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointRelationshipServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointRelationshipServiceImpl.java new file mode 100644 index 0000000..7e30412 --- /dev/null +++ b/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 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); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyPointServiceImpl.java new file mode 100644 index 0000000..6af1853 --- /dev/null +++ b/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 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); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPointMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPointMapper.xml new file mode 100644 index 0000000..11eda1d --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysPointMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + select id, point_name, uuid, type1 from zhy_point + + + + + + + + insert into zhy_point + + point_name, + uuid, + type1, + + + #{pointName}, + #{uuid}, + #{type1}, + + + + + update zhy_point + + point_name = #{pointName}, + uuid = #{uuid}, + type1 = #{type1}, + + where id = #{id} + + + + delete from zhy_point where id = #{id} + + + + delete from zhy_point where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/ZhyPointRelationshipMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ZhyPointRelationshipMapper.xml new file mode 100644 index 0000000..aa87f7f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ZhyPointRelationshipMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + select id, author, keyword, agency, relationship_id, url, title from zhy_point_relationship + + + + + + + + insert into zhy_point_relationship + + author, + keyword, + agency, + relationship_id, + url, + title, + + + #{author}, + #{keyword}, + #{agency}, + #{relationshipId}, + #{url}, + #{title}, + + + + + update zhy_point_relationship + + author = #{author}, + keyword = #{keyword}, + agency = #{agency}, + relationship_id = #{relationshipId}, + url = #{url}, + title = #{title}, + + where id = #{id} + + + + delete from zhy_point_relationship where id = #{id} + + + delete from zhy_point_relationship where author = #{param1} + + + delete from zhy_point_relationship where keyword = #{param1} + + + delete from zhy_point_relationship where agency = #{param1} + + + + delete from zhy_point_relationship where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/SysPoint.js b/ruoyi-ui/src/api/system/SysPoint.js new file mode 100644 index 0000000..00650f0 --- /dev/null +++ b/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' + }) +} diff --git a/ruoyi-ui/src/api/system/relationship1.js b/ruoyi-ui/src/api/system/relationship1.js new file mode 100644 index 0000000..f33c081 --- /dev/null +++ b/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' + }) +} diff --git a/ruoyi-ui/src/views/system/SysPoint/index.vue b/ruoyi-ui/src/views/system/SysPoint/index.vue new file mode 100644 index 0000000..a179096 --- /dev/null +++ b/ruoyi-ui/src/views/system/SysPoint/index.vue @@ -0,0 +1,272 @@ + + + diff --git a/ruoyi-ui/src/views/system/relationship/index.vue b/ruoyi-ui/src/views/system/relationship/index.vue new file mode 100644 index 0000000..0d7edff --- /dev/null +++ b/ruoyi-ui/src/views/system/relationship/index.vue @@ -0,0 +1,290 @@ + + +