Browse Source

导入文件夹

hanyuqing
hanyuqing 5 months ago
parent
commit
287bb30b99
  1. 8
      gyxtp/src/api/api/graph.js
  2. 47
      gyxtp/src/view/docInfo.vue
  3. 24
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java
  4. 17
      ruoyi-api/src/main/java/com/ruoyi/api/controller/DocApiController.java
  5. 11
      ruoyi-api/src/main/java/com/ruoyi/api/controller/GraphApiController.java
  6. 1
      ruoyi-api/src/main/resources/mapper/api/ZhyDocApiMapper.xml
  7. 5
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java
  8. 6
      ruoyi-ui/src/views/system/fileManage/index.vue

8
gyxtp/src/api/api/graph.js

@ -62,7 +62,13 @@ export const getInfoTest = (params) => {
data:params,
});
};
export const getInfoTest1 = (params) => {
return request({
url: '/api/graph/getInfoTest1',
method: 'post',
data:params,
});
};
export const getInfoTestAdd = (params) => {
return request({
url: '/api/graph/getInfoTestAdd',

47
gyxtp/src/view/docInfo.vue

@ -1,7 +1,7 @@
<template>
<div class="about">
<HeaderInfo style="height: 5.65vw;float: left;"></HeaderInfo>
<leftInfo style="width: 5vw;position: absolute;top: 5.4vw;" :leftNum="1" :zhedie="zhedie" v-if="zhedie==0"
<leftInfo style="width: 5vw;position: absolute;top: 5.4vw;" :leftNum="leftNum" :zhedie="zhedie" v-if="zhedie==0"
@show="isZhe"></leftInfo>
<div v-if="zhedie==0" @click="this.zhedie = 1"
style="position: absolute;height: 3vw;width: 3vw;font-size: 2vw;border-radius: 0 50% 50% 0;z-index: 1000;bottom:45%;left:5vw;">
@ -362,7 +362,7 @@ import {
updateShou, getShouList, updateShou11, getDocOne, updateStudentAnswer, addDocCount
} from '../api/api/doc';
// import d3graph from '../components/d3graph.vue'
import {getInfoTest, getInfoTestAdd, getWordToHtml} from '../api/api/graph'
import {getInfoTest, getInfoTest1, getInfoTestAdd, getWordToHtml} from '../api/api/graph'
import RelationGraph from 'relation-graph-vue3';
// import * as vis from 'vis-network/dist/vis-network.esm.js';
import HeaderInfo from '../components/UseAll/headerInfo'
@ -450,6 +450,7 @@ export default {
},
data() {
return {
leftNum:0,
htmlContent:"",
videoUrls: [], //
isWorkVisible1look: false,
@ -534,6 +535,7 @@ export default {
noCount: 0,
haveScore: 0,
addInfo: true,
groupId:0,
};
},
methods: {
@ -890,7 +892,12 @@ export default {
var data = {
id: res.data.id
}
this.loadDocx(res.data.url)
if(res.data.groupId==-1){
this.groupId=res.data.groupId
this.loadDocx(res.data.url)
this.leftNum=1
}
addDocCount(data).then((res) => {
console.log(res);
})
@ -1012,18 +1019,34 @@ export default {
id: this.$route.query.docId,
// pageSize: this.valueNum == '' ? this.limit || 50 : this.valueNum,
};
getInfoTest(params).then((res) => {
if (res.code == 200) {
if (res.data.node!=null){
if (res.data.node.length != 0) {
this.zhengl(res.data)
if(this.groupId==-1){
getInfoTest1(params).then((res) => {
if (res.code == 200) {
if (res.data.node!=null){
if (res.data.node.length != 0) {
this.zhengl(res.data)
}
}
} else {
console.log("错误")
}
});
}else{
getInfoTest(params).then((res) => {
if (res.code == 200) {
if (res.data.node!=null){
if (res.data.node.length != 0) {
this.zhengl(res.data)
}
}
} else {
console.log("错误")
}
});
}
} else {
console.log("错误")
}
});
},
zhengl(data) {

24
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyFileManageController.java

@ -3279,7 +3279,7 @@ public class ZhyFileManageController extends BaseController {
zhyDoc.setProdectName(prodectName);
test1Mapper.updateDocById(zhyDoc);
String cql1 = "match (r{docId:'" + id + "'}) SET r.docTitle = '" + name1 + "'";
String cql2 = "match (r{docId:'" + id + "'}) SET r.docLeve = '" + docLevelNew+ "'";
String cql2 = "match (r{docId:'" + id + "'}) SET r.docLeve = 'leve" + docLevelNew+ "'";
String cql3 = "match (r{docId:'" + id + "'}) SET r.groupId = '" + groupId + "'";
neo4jUtil.excuteCypherSql(cql1);
neo4jUtil.excuteCypherSql(cql2);
@ -3316,6 +3316,28 @@ public class ZhyFileManageController extends BaseController {
}
}
ZhyArticle article1=new ZhyArticle();
article1.setSourceId(id);
List<ZhyArticle> zhyArticles1=zhyArticleMapper.selectZhyArticleList(article1);
if(zhyArticles1.size()>0){
for(int i=0;i<zhyArticles1.size();i++){
ZhyArticle zhyArticle=zhyArticles1.get(i);
zhyArticle.setSourceName(name1);
zhyArticleMapper.updateZhyArticle(zhyArticle);
}
}
ZhyArticle article2=new ZhyArticle();
article2.setSourceId(id);
List<ZhyArticle> zhyArticles2=zhyArticleMapper.selectZhyArticleList(article2);
if(zhyArticles2.size()>0){
for(int i=0;i<zhyArticles2.size();i++){
ZhyArticle zhyArticle=zhyArticles2.get(i);
zhyArticle.setSourceName(name1);
zhyArticleMapper.updateZhyArticle(zhyArticle);
}
}
return AjaxResult.success("File renamed and updated successfully");
} catch (IOException e) {
e.printStackTrace();

17
ruoyi-api/src/main/java/com/ruoyi/api/controller/DocApiController.java

@ -350,14 +350,15 @@ public class DocApiController extends BaseController {
zhyDocApi.setDocTitle("");
//先去查询
ZhyDocApi zz = zhyDocApiMapper.selectDoc(zhyDocApi);
if(zz.getDocUrl()!=null){
String url=zz.getDocUrl();
System.out.println(url);
url=url.replace("D:\\tupudata\\fileManager\\","");
url=url.replace("txt","docx");
zz.setUrl(url);
}
if (zz != null) {
if(zz.getDocUrl()!=null){
String url=zz.getDocUrl();
System.out.println(url);
url=url.replace("D:\\tupudata\\fileManager\\","");
url=url.replace("txt","docx");
zz.setUrl(url);
}
// Long pId = zz.getDocParentId();
// if (pId != 0) {
// ZhyDocApi old1 = new ZhyDocApi();
@ -1289,7 +1290,7 @@ public class DocApiController extends BaseController {
mapAll.put("g22",map22);
List<ZhyDoc> docs=test1Mapper.selectAllDoc1();
if(docs.size()>0){
ZhyFileManage fileManage=test1Mapper.getFileById(docs.get(0).getFileId());
ZhyFileManage fileManage=test1Mapper.getFileByName("联合作战气象海洋影响评估与决策支撑体系.docx");
Map file=new HashMap<>();
file.put("id",fileManage.getId());
file.put("name",fileManage.getFileName().replaceAll("(?i)\\.docx$", ""));

11
ruoyi-api/src/main/java/com/ruoyi/api/controller/GraphApiController.java

@ -69,7 +69,6 @@ public class GraphApiController extends BaseController {
@PostMapping(value = "/getDomainGraphTest")
public AjaxResult getDomainGraphTest(@RequestBody GraphQuery query) {
try {
HashMap<String, Object> graphData = new HashMap<>();
if (StringUtils.isNotEmpty(query.getDomain())) {
@ -78,8 +77,6 @@ public class GraphApiController extends BaseController {
graphData = graphService.getGraphDataInfo(query);
}
return AjaxResult.success(graphData);
} catch (Exception e) {
return AjaxResult.error("查询图节点和关系异常");
@ -579,7 +576,7 @@ public class GraphApiController extends BaseController {
System.out.println("chjbcsbchabhc");
String sql1 = "MATCH (n:Doc) -[r]->(m:Doc) where n.docId='"+pa.getId()+"' return n,m,r";
String sql1 = "MATCH (n:Local) -[r]->(m:Local) where n.docId='"+pa.getId()+"' return n,m,r";
System.out.println(sql1);
HashMap<String, Object> graphNode = neo4jUtil.getGraphNodeAndShip(sql1);
Object node1 = graphNode.get("node");
@ -588,7 +585,7 @@ public class GraphApiController extends BaseController {
List<Map> kk1 = (List<Map>) node1;
List<Map> rrk1 = (List<Map>) graphNode.get("relationship");
String sql2 = "MATCH (n:Doc) -[r]->(m:Doc) where n.docId='"+pa1.getId()+"' return n,m,r";
String sql2 = "MATCH (n:Local) -[r]->(m:Local) where n.docId='"+pa1.getId()+"' return n,m,r";
System.out.println(sql2);
HashMap<String, Object> graphNode1 = neo4jUtil.getGraphNodeAndShip(sql2);
@ -635,7 +632,7 @@ public class GraphApiController extends BaseController {
rr1.setSource(pa.getId());
String sql1 = "MATCH (n:Doc) -[r]->(m:Doc) where n.docId='"+pa.getId()+"' return n,m,r";
String sql1 = "MATCH (n:Local) -[r]->(m:Local) where n.docId='"+pa.getId()+"' return n,m,r";
System.out.println("idgjjfdsj--------");
System.out.println(sql1);
HashMap<String, Object> graphNode = neo4jUtil.getGraphNodeAndShip(sql1);
@ -688,7 +685,7 @@ public class GraphApiController extends BaseController {
}
if(aa.getDocLevel()==1){
String sql1 = "MATCH (n:Doc) -[r]->(m:Doc) where n.docId='"+aa.getId()+"' return n,m,r";
String sql1 = "MATCH (n:Local) -[r]->(m:Local) where n.docId='"+aa.getId()+"' return n,m,r";
System.out.println("idgjjfdsj--------");
System.out.println(sql1);
HashMap<String, Object> graphNode = neo4jUtil.getGraphNodeAndShip(sql1);

1
ruoyi-api/src/main/resources/mapper/api/ZhyDocApiMapper.xml

@ -23,6 +23,7 @@
<result property="docVideo" column="doc_video"/>
<result property="docImgs" column="doc_imgs"/>
<result property="openDowload" column="open_dowload"/>
<result property="groupId" column="group_id"/>
</resultMap>

5
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java

@ -1024,9 +1024,10 @@ SimpleParagraphSaver simpleParagraphSaver;
}
public void handWord(String outputFolder,List<ZhyDoc> list) throws IOException {
StringBuilder sb = new StringBuilder();
String all = "";
for(int i=0;i<list.size();i++){
StringBuilder sb = new StringBuilder();
String all = "";
String fileName = list.get(i).getDocTitle().replaceAll(" ", "");
System.out.println(fileName);
fileName = fileName.replace("//","&");

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

@ -560,7 +560,7 @@ import {
deletAllInfoNew,
deleteDocTitleOnly,
addTxtC,
deleteTxt,
deleteTxt1,
getFileList,
getTxt,
getTxtList,
@ -1564,7 +1564,7 @@ export default {
url: row.docUrl
}
this.$modal.confirm('是否确认删除"' + row.docTitle + '"的数据项?').then(function () {
return deleteTxt(data);
return deleteTxt1(data);
}).then(() => {
this.getFileListInfo()
this.$modal.msgSuccess("删除成功");
@ -1697,7 +1697,7 @@ export default {
this.level1 = row.docLevel + "";
this.videoFileList = [];
this.showVideoPath = "";
if (row.docImgs != null) {
if (row.docImgs != null && row.docImgs!="") {
this.fileListImgs = [];
this.fileListImgs1 = [];
let imgArr = row.docImgs.split(',')

Loading…
Cancel
Save