Browse Source

导入文件夹

hanyuqing
hanyuqing 5 months ago
parent
commit
bc51fb0be6
  1. 8
      gyxtp/src/view/graphPageNB927.vue
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java
  3. 67
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java
  4. 4
      ruoyi-system/src/main/resources/mapper/system/Test1Mapper.xml
  5. 1
      ruoyi-system/src/main/resources/mapper/system/ZhyDocRelationMapper.xml
  6. 35
      ruoyi-ui/src/views/system/docmuban/index.vue
  7. 4
      ruoyi-ui/src/views/system/fileManage/index.vue

8
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) {

4
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());

67
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();

4
ruoyi-system/src/main/resources/mapper/system/Test1Mapper.xml

@ -120,7 +120,7 @@ select * from zhy_doc where isgraph = 0 and file_id = #{fileId}
<if test="docTitle != null and docTitle != ''">doc_title = #{docTitle},</if>
<if test="docUrl != null and docUrl != ''">doc_url = #{docUrl},</if>
<if test="docVideo != null and docVideo != ''">doc_video = #{docVideo},</if>
<if test="docImgs != null and docImgs != ''">doc_imgs = #{docImgs},</if>
<if test="docImgs != null ">doc_imgs = #{docImgs},</if>
<if test="docParentId != null">doc_parent_id = #{docParentId},</if>
<if test="docLevel != null">doc_level = #{docLevel},</if>
<if test="prodectName != null and prodectName != ''">prodect_name = #{prodectName},</if>
@ -351,7 +351,7 @@ select * from zhy_doc where isgraph = 0 and file_id = #{fileId}
<select id="getDocByLevel" resultMap="ZhyDocResult">
select *
from zhy_doc
where doc_level =#{docLevel}
where doc_level =#{docLevel} and group_id !=-1
</select>
<select id="getFileByName" resultMap="ZhyFileResult">
select *

1
ruoyi-system/src/main/resources/mapper/system/ZhyDocRelationMapper.xml

@ -121,6 +121,7 @@ from zhy_relationship </sql>
<select id="selectZhyRelationshipListLeft" parameterType="ZhyDocRelation" resultType="map">
<include refid="selectArticleWithLeftJoin"/>
<where>
AND r.relationship !='包含'
<if test="relationship != null and relationship != ''">
AND r.relationship = #{relationship}
</if>

35
ruoyi-ui/src/views/system/docmuban/index.vue

@ -322,12 +322,12 @@
<!-- 添加ZhyDocmuban对话框 -->
<el-dialog :title="title" :visible.sync="addZhyDocmubanOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form ref="form" :model="addform" :rules="rules" label-width="80px">
<el-form-item label="名称">
<el-input v-model="form.text"></el-input>
<el-input v-model="addform.text"></el-input>
</el-form-item>
<el-form-item label="层级">
<el-input v-model="form.type" disabled></el-input>
<el-input v-model="addform.type" disabled></el-input>
</el-form-item>
<!-- <el-form-item label="父级节点">-->
<!-- <el-select v-model="form.parentId" placeholder="请选择父级节点" :disabled="this.form.type=='方向'|| this.form.type=='业务系统' || this.form.type=='模型'">-->
@ -335,7 +335,7 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item style="position: relative ;" label="内容">
<Editor v-model="form.content"></Editor>
<Editor v-model="addform.content"></Editor>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -446,6 +446,7 @@ export default {
//
open: false,
addZhyDocmubanOpen: false,
addform:{},
updateZhyDocmubanOpen:false,
//
queryParams: {
@ -550,28 +551,28 @@ export default {
},
//zhyDoc
addZhyDoc(type){
this.addform = {}
this.handleAdd()
this.form.type = type;
this.addform.type = type;
if(this.form.type == "方向" || this.form.type == "作战" || this.form.type == "装备" || this.form.type == "环境"){
if(this.addform.type == "方向" || this.addform.type == "作战" || this.addform.type == "装备" || this.addform.type == "环境"){
this.form.groupId = 0;
this.addform.groupId = 0;
}
if(this.form.type == "业务系统" || this.form.type == "模型库" || this.form.type == "大类" || this.form.type == "小类"){
this.form.groupId = 1;
if(this.addform.type == "业务系统" || this.addform.type == "模型库" || this.addform.type == "大类" || this.addform.type == "小类"){
this.addform.groupId = 1;
}
if(this.form.type == "模型" || this.form.type == "指标"){
this.form.groupId = 2;
if(this.addform.type == "模型" || this.addform.type == "指标"){
this.addform.groupId = 2;
}
getParentList( this.form).then((res)=>{
getParentList( this.addform).then((res)=>{
console.log(res)
if(res.data.length!=0){
this.parentsList = res.data;
}
})
//
this.addZhyDocmubanOpen = true
},
@ -625,17 +626,11 @@ export default {
getDocmuban(id).then(response => {
this.form = response.data;
getParentList( this.form).then((res)=>{
console.log(res)
if(res.data.length!=0){
this.parentsList = res.data;
}
})
this.updateZhyDocmubanOpen = true;
this.title = "修改图谱模板";
});
@ -651,7 +646,7 @@ export default {
this.getList();
});
} else {
addDocmuban(this.form).then(response => {
addDocmuban(this.addform).then(response => {
this.$modal.msgSuccess("新增成功");
this.addZhyDocmubanOpen = false;
this.getList();

4
ruoyi-ui/src/views/system/fileManage/index.vue

@ -574,7 +574,7 @@ import {
getAllTxtListP,
insertNode,
reset,
getAllTxtListByGroupAndLevel, lockAll, selectRemark, uploadFolder
getAllTxtListByGroupAndLevel, lockAll, selectRemark, uploadFolder, addTxt1
} from "../../../api/system/file";
import {updateTemplate} from "../../../api/system/titleTemplate";
@ -1589,7 +1589,7 @@ export default {
relation: this.relaTion,
groupId:this.groupId
}
addTxtC(data).then((res) => {
addTxt1(data).then((res) => {
if (res.code == 200) {
this.$message.success("新增成功")
this.addTxt = false

Loading…
Cancel
Save