From bc51fb0be63df68050f0e5fa4646822b23146426 Mon Sep 17 00:00:00 2001 From: hanyuqing <1106611654@qq.com> Date: Tue, 4 Nov 2025 18:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gyxtp/src/view/graphPageNB927.vue | 8 ++- .../controller/system/ZhyDocmubanController.java | 4 ++ .../controller/system/ZhyFileManageController.java | 67 +++++++++++----------- .../main/resources/mapper/system/Test1Mapper.xml | 4 +- .../mapper/system/ZhyDocRelationMapper.xml | 1 + ruoyi-ui/src/views/system/docmuban/index.vue | 35 +++++------ ruoyi-ui/src/views/system/fileManage/index.vue | 4 +- 7 files changed, 63 insertions(+), 60 deletions(-) diff --git a/gyxtp/src/view/graphPageNB927.vue b/gyxtp/src/view/graphPageNB927.vue index b9a13ef..292d405 100644 --- a/gyxtp/src/view/graphPageNB927.vue +++ b/gyxtp/src/view/graphPageNB927.vue @@ -593,9 +593,11 @@ export default { async getAll() { console.log(this.selectedFileId) - await getAllTitle1(this.selectedFileId).then((res) => { - this.data1 = res; - }) + if (this.selectedFileId!=""){ + await getAllTitle1(this.selectedFileId).then((res) => { + this.data1 = res; + }) + } }, opending() { if (this.isDing == true) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java index 260f904..319eb81 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java @@ -2387,6 +2387,10 @@ public class ZhyDocmubanController extends BaseController ZhyDocmuban zb = zhyDocmubanMapper.selectZhyDocmubanById(ids[0]); ZhyDoc zz = test1Mapper.selectDocByTitle(zb.getText()); + if(zz==null){ + zhyDocmubanMapper.deleteZhyDocmubanById(zb.getId()); + return AjaxResult.success(); + } //并且删除和他有关的关系 test1Mapper.deleteTxtById(zz.getId()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java index 4f2887c..bf4dc0b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java @@ -3232,6 +3232,11 @@ public class ZhyFileManageController extends BaseController { Long id = Long.valueOf(requestBody.get("id")); String videoUrl = requestBody.get("videoUrl"); String imgs = requestBody.get("imgs"); + + + System.out.println(imgs); + + String prodectName = requestBody.get("prodectName"); // ZhyDoc docParent=test1Mapper.selectDocByIdId(parentInd); @@ -3590,12 +3595,9 @@ public class ZhyFileManageController extends BaseController { if(relation1.equals("")){ relation1=relation; } - Long docParentId = Long.valueOf(requestBody.get("docParentId")); - ZhyDoc docParent=test1Mapper.selectDocByIdId(docParentId); - Long groupId=0l; - if(docParent!=null){ - groupId=docParent.getGroupId(); - } + Long groupId = Long.valueOf(requestBody.get("groupId")); + + Long docLevel = Long.valueOf(requestBody.get("docLevel")); ZhyFileManage zhyFileManage = test1Mapper.getFileById(fileId); String url = zhyFileManage.getFileUrl(); @@ -3611,7 +3613,6 @@ public class ZhyFileManageController extends BaseController { zhyDoc.setCreateTime(new Date()); zhyDoc.setDocUrl(txtUrl); zhyDoc.setDocTitle(txtName); - zhyDoc.setDocParentId(docParentId); zhyDoc.setDocLevel(docLevel); zhyDoc.setCreateTime(new Date()); zhyDoc.setCreateBy(String.valueOf(getUserId())); @@ -3712,34 +3713,34 @@ public class ZhyFileManageController extends BaseController { //创建关系 - ZhyDocRelation zz = new ZhyDocRelation(); - zz.setRelationship(relation1); - if(docParentId==0){ - zz.setSource(fileId.longValue()); - }else{ - zz.setSource(docParentId); - } - zz.setTarget(zhyDoc.getId()); - //查询上级 - ZhyDoc zz1 = new ZhyDoc(); - zz1.setId(docParentId); - ZhyDoc oldDoc = test1Mapper.selectDocById(zz1); - if(docParentId==0){ - zz.setSourceName(name); - }else{ - zz.setSourceName(oldDoc.getDocTitle()); - } - zz.setTargetName(txtName); - zz.setCreateTime(new Date()); - zhyDocRelationMapper.insertZhyRelationship(zz); - +// ZhyDocRelation zz = new ZhyDocRelation(); +// zz.setRelationship(relation1); +// if(docParentId==0){ +// zz.setSource(fileId.longValue()); +// }else{ +// zz.setSource(docParentId); +// } +// zz.setTarget(zhyDoc.getId()); +// //查询上级 +// ZhyDoc zz1 = new ZhyDoc(); +// zz1.setId(docParentId); +// ZhyDoc oldDoc = test1Mapper.selectDocById(zz1); +// if(docParentId==0){ +// zz.setSourceName(name); +// }else{ +// zz.setSourceName(oldDoc.getDocTitle()); +// } +// zz.setTargetName(txtName); +// zz.setCreateTime(new Date()); +// zhyDocRelationMapper.insertZhyRelationship(zz); - //创建图谱 - String cqr = "MATCH (a:Doc),(b:Doc) WHERE a.docId = '" + zz.getSource() + "' AND b.docId = '" + zz.getTarget() + "' CREATE (a)-[r:" + zz.getRelationship() + " { name: '" + zz.getRelationship() + "' }] -> (b) RETURN r"; - neo4jUtil.excuteCypherSql(cqr); - zz.setIsgraph(1l); - zhyDocRelationMapper.updateZhyRelationship(zz); +// //创建图谱 +// String cqr = "MATCH (a:Doc),(b:Doc) WHERE a.docId = '" + zz.getSource() + "' AND b.docId = '" + zz.getTarget() + "' CREATE (a)-[r:" + zz.getRelationship() + " { name: '" + zz.getRelationship() + "' }] -> (b) RETURN r"; +// neo4jUtil.excuteCypherSql(cqr); +// +// zz.setIsgraph(1l); +// zhyDocRelationMapper.updateZhyRelationship(zz); return AjaxResult.success(); diff --git a/ruoyi-system/src/main/resources/mapper/system/Test1Mapper.xml b/ruoyi-system/src/main/resources/mapper/system/Test1Mapper.xml index c486604..5f20c7c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/Test1Mapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/Test1Mapper.xml @@ -120,7 +120,7 @@ select * from zhy_doc where isgraph = 0 and file_id = #{fileId} doc_title = #{docTitle}, doc_url = #{docUrl}, doc_video = #{docVideo}, - doc_imgs = #{docImgs}, + doc_imgs = #{docImgs}, doc_parent_id = #{docParentId}, doc_level = #{docLevel}, prodect_name = #{prodectName}, @@ -351,7 +351,7 @@ select * from zhy_doc where isgraph = 0 and file_id = #{fileId} + AND r.relationship !='包含' AND r.relationship = #{relationship} diff --git a/ruoyi-ui/src/views/system/docmuban/index.vue b/ruoyi-ui/src/views/system/docmuban/index.vue index 480e32d..0163e60 100644 --- a/ruoyi-ui/src/views/system/docmuban/index.vue +++ b/ruoyi-ui/src/views/system/docmuban/index.vue @@ -322,12 +322,12 @@ - + - + - + @@ -335,7 +335,7 @@ - +