|
|
|
@ -3,7 +3,9 @@ package com.ruoyi.web.controller.system; |
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.ruoyi.TxtFileReader; |
|
|
|
import com.ruoyi.api.domain.ESDao; |
|
|
|
import com.ruoyi.api.domain.ZhyDocApi; |
|
|
|
import com.ruoyi.api.service.impl.ESService; |
|
|
|
import com.ruoyi.common.config.RuoYiConfig; |
|
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
@ -95,7 +97,8 @@ public class ZhyFileManageController extends BaseController { |
|
|
|
ZhyArticleMapper zhyArticleMapper; |
|
|
|
@Autowired |
|
|
|
ZhyDocmubanMapper zhyDocmubanMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
ESService esService; |
|
|
|
@PostMapping("/exportList") |
|
|
|
public void export(HttpServletResponse response) |
|
|
|
{ |
|
|
|
@ -519,7 +522,7 @@ public class ZhyFileManageController extends BaseController { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
@GetMapping("/reset") |
|
|
|
public AjaxResult reset() throws IOException { |
|
|
|
public AjaxResult reset() throws Throwable { |
|
|
|
String url = saveFileWithStructure1(); |
|
|
|
List<ZhyDoc> nodeList=new ArrayList<>(); |
|
|
|
|
|
|
|
@ -1168,7 +1171,22 @@ public class ZhyFileManageController extends BaseController { |
|
|
|
test1Mapper.updateGraphStatus(node.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
//创建索引
|
|
|
|
List<ESDao> esDaos=new ArrayList<>(); |
|
|
|
|
|
|
|
for (int i=0;i<list.size();i++){ |
|
|
|
String abstracts = list.get(i).getDocTitle(); |
|
|
|
String id = String.valueOf(list.get(i).getId()); |
|
|
|
|
|
|
|
ESDao esDao = new ESDao(); |
|
|
|
esDao.id = id; |
|
|
|
esDao.DBid = id; |
|
|
|
esDao.type = "node"; |
|
|
|
esDao.abstracts = abstracts; |
|
|
|
esDao.data = null; |
|
|
|
esDaos.add(esDao); |
|
|
|
} |
|
|
|
esService.insertDocsById("nodes",esDaos); |
|
|
|
//获取所有关系
|
|
|
|
List<ZhyDocRelation> listR = zhyDocRelationMapper.getAllRelation(); |
|
|
|
|
|
|
|
@ -1197,7 +1215,6 @@ public class ZhyFileManageController extends BaseController { |
|
|
|
neo4jUtil.excuteCypherSql(cql); |
|
|
|
test1Mapper.updateGraphRelation(listR.get(i)); |
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.success().put("msg", "成功"); |
|
|
|
} |
|
|
|
//一键删除方法
|
|
|
|
@ -2261,7 +2278,6 @@ public class ZhyFileManageController extends BaseController { |
|
|
|
return AjaxResult.success().put("data", ll); |
|
|
|
} |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
@PostMapping("/getTxt") |
|
|
|
public ResponseEntity<String> getTxt(@RequestBody Map<String, String> requestBody) { |
|
|
|
@ -2330,8 +2346,8 @@ public class ZhyFileManageController extends BaseController { |
|
|
|
zhyDoc.setDocLevel(docLevelNew); |
|
|
|
zhyDoc.setProdectName(prodectName); |
|
|
|
test1Mapper.updateDocById(zhyDoc); |
|
|
|
luceneUtil.deleteIndexByUrl(String.valueOf(id)); |
|
|
|
luceneUtil.createSingleIndex1(String.valueOf(newPath), id); |
|
|
|
// luceneUtil.deleteIndexByUrl(String.valueOf(id));
|
|
|
|
// luceneUtil.createSingleIndex1(String.valueOf(newPath), id);
|
|
|
|
|
|
|
|
|
|
|
|
String cql = "match (r{docId:'" + id + "'}) SET r.docTitle = '" + name1 + "'"; |
|
|
|
|