Browse Source

2025.1.8 修改

wzx
linsheng0116 1 year ago
parent
commit
146f99df07
  1. 1
      .idea/compiler.xml
  2. 2
      .idea/misc.xml
  3. 1
      .idea/vcs.xml
  4. 45
      pom.xml
  5. 72
      src/main/java/com/main/woka/Web/Service/impl/GraphServiceImpl.java
  6. 4
      src/main/resources/application.yml
  7. 6
      woka.iml

1
.idea/compiler.xml

@ -7,6 +7,7 @@
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="woka" />
<module name="spring-test" />
</profile>
</annotationProcessing>
</component>

2
.idea/misc.xml

@ -5,8 +5,10 @@
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$MAVEN_REPOSITORY$/org/springframework/spring-test/5.0.8.RELEASE/spring-test-5.0.8.RELEASE.pom" />
</list>
</option>
<option name="workspaceImportForciblyTurnedOn" value="true" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />

1
.idea/vcs.xml

@ -2,6 +2,5 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/ui" vcs="Git" />
</component>
</project>

45
pom.xml

@ -15,13 +15,44 @@
<description>woka</description>
<properties>
<java.version>1.8</java.version>
<poi.version>5.2.3</poi.version>
</properties>
<dependencies>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.1</version>
</dependency>
<dependency>
<groupId>com.lucene</groupId>
<artifactId>ikAnalyzer</artifactId>
<version>6.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-smartcn</artifactId>
<version>8.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>8.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>8.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>8.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
@ -109,6 +140,20 @@
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
<build>

72
src/main/java/com/main/woka/Web/Service/impl/GraphServiceImpl.java

@ -96,7 +96,7 @@ public class GraphServiceImpl implements GraphService {
if (query.getRelation() != null && query.getRelation().length > 0) {
for (String r : query.getRelation()) {
// String it = String.format("r.name='%s'", r);
String it = String.format("r.docTitle='%s'", r);
String it = String.format("r.name='%s'", r);
lis.add(it);
}
cqr = String.join(" or ", lis);
@ -106,11 +106,11 @@ public class GraphServiceImpl implements GraphService {
if (!StringUtils.isBlank(query.getNodename())) {
if (query.getMatchtype() == 1) {
cqWhere = String.format("where n.docTitle ='%s' ", query.getNodename());
cqWhere = String.format("where n.name ='%s' ", query.getNodename());
} else {
// cqWhere = String.format("where n.name contains('%s')", query.getNodename());
cqWhere = String.format("where n.docTitle contains('%s')", query.getNodename());
cqWhere = String.format("where n.name contains('%s')", query.getNodename());
}
}
String nodeOnly = cqWhere;
@ -184,7 +184,7 @@ public class GraphServiceImpl implements GraphService {
} else {
// cqWhere = String.format("where n.name contains('%s')", query.getNodename());
cqWhere = String.format("where n.docTitle ='%s'", query.getNodename());
cqWhere = String.format("where n.name ='%s'", query.getNodename());
}
}
String nodeOnly = cqWhere;
@ -247,7 +247,7 @@ public class GraphServiceImpl implements GraphService {
List<String> lis = new ArrayList<String>();
if (query.getNameList() != null && query.getNameList().length > 0) {
for (String r : query.getNameList()) {
String it = String.format("n.docTitle='%s'", r);
String it = String.format("n.name='%s'", r);
lis.add(it);
}
cqr = String.join(" or ", lis);
@ -259,11 +259,11 @@ public class GraphServiceImpl implements GraphService {
if (!StringUtils.isBlank(query.getNodename())) {
if (query.getMatchtype() == 1) {
cqWhere = String.format("where n.docTitle ='%s' ", query.getNodename());
cqWhere = String.format("where n.name ='%s' ", query.getNodename());
} else {
// cqWhere = String.format("where n.name contains('%s')", query.getNodename());
cqWhere = String.format("where n.docTitle contains('%s')", query.getNodename());
cqWhere = String.format("where n.name contains('%s')", query.getNodename());
}
}
String nodeOnly = cqWhere;
@ -333,7 +333,7 @@ public class GraphServiceImpl implements GraphService {
} else {
// cqWhere = String.format("where n.name contains('%s')", query.getNodename());
cqWhere = String.format("where n.docTitle =('%s')", query.getNodename());
cqWhere = String.format("where n.name =('%s')", query.getNodename());
}
}
String nodeOnly = cqWhere;
@ -404,7 +404,7 @@ public class GraphServiceImpl implements GraphService {
} else {
// cqWhere = String.format("where n.name contains('%s')", query.getNodename());
cqWhere = String.format("where n.docTitle contains('%s')", query.getNodename());
cqWhere = String.format("where n.name contains('%s')", query.getNodename());
}
}
String nodeOnly = cqWhere;
@ -430,28 +430,28 @@ public class GraphServiceImpl implements GraphService {
for(int a=0;a<nno.size();a++){
HashMap<String, Object> aa = new HashMap<>();
aa.put("id",nno.get(a).get("uuid"));
aa.put("name",nno.get(a).get("docTitle"));
aa.put("name",nno.get(a).get("name"));
aa.put("docId",nno.get(a).get("docId"));
aa.put("docParentId",nno.get(a).get("docParentId"));
if(nno.get(a).get("docLeve").equals("leve0")){
aa.put("parentId",nno.get(a).get("parentId"));
if(nno.get(a).get("leve").equals("leve0")){
aa.put("group","0");
}
if(nno.get(a).get("docLeve").equals("leve1")){
if(nno.get(a).get("leve").equals("leve1")){
aa.put("group","1");
}
if(nno.get(a).get("docLeve").equals("leve2")){
if(nno.get(a).get("leve").equals("leve2")){
aa.put("group","2");
}
if(nno.get(a).get("docLeve").equals("leve3")){
if(nno.get(a).get("leve").equals("leve3")){
aa.put("group","3");
}
if(nno.get(a).get("docLeve").equals("leve4")){
if(nno.get(a).get("leve").equals("leve4")){
aa.put("group","4");
}
if(nno.get(a).get("docLeve").equals("leve5")){
if(nno.get(a).get("leve").equals("leve5")){
aa.put("group","5");
}
if(nno.get(a).get("docLeve").equals("leve6")){
if(nno.get(a).get("leve").equals("leve6")){
aa.put("group","6");
}
@ -492,28 +492,28 @@ public class GraphServiceImpl implements GraphService {
for(int a=0;a<nodeItem.size();a++){
HashMap<String, Object> aa = new HashMap<>();
aa.put("id",nodeItem.get(a).get("docId"));
aa.put("name",nodeItem.get(a).get("docTitle"));
aa.put("docParentId",nodeItem.get(a).get("docParentId"));
aa.put("name",nodeItem.get(a).get("name"));
aa.put("parentId",nodeItem.get(a).get("parentId"));
if(nodeItem.get(a).get("docLeve").equals("leve0")){
if(nodeItem.get(a).get("leve").equals("leve0")){
aa.put("group",nodeItem.get(a).get("0"));
}
if(nodeItem.get(a).get("docLeve").equals("leve1")){
if(nodeItem.get(a).get("leve").equals("leve1")){
aa.put("group",nodeItem.get(a).get("1"));
}
if(nodeItem.get(a).get("docLeve").equals("leve2")){
if(nodeItem.get(a).get("leve").equals("leve2")){
aa.put("group",nodeItem.get(a).get("2"));
}
if(nodeItem.get(a).get("docLeve").equals("leve3")){
if(nodeItem.get(a).get("leve").equals("leve3")){
aa.put("group",nodeItem.get(a).get("3"));
}
if(nodeItem.get(a).get("docLeve").equals("leve4")){
if(nodeItem.get(a).get("leve").equals("leve4")){
aa.put("group",nodeItem.get(a).get("4"));
}
if(nodeItem.get(a).get("docLeve").equals("leve5")){
if(nodeItem.get(a).get("leve").equals("leve5")){
aa.put("group",nodeItem.get(a).get("5"));
}
if(nodeItem.get(a).get("docLeve").equals("leve6")){
if(nodeItem.get(a).get("leve").equals("leve6")){
aa.put("group",nodeItem.get(a).get("6"));
}
@ -536,29 +536,29 @@ public class GraphServiceImpl implements GraphService {
for(int a=0;a<graphNode.size();a++){
HashMap<String, Object> aa = new HashMap<>();
aa.put("id",graphNode.get(a).get("uuid"));
aa.put("name",graphNode.get(a).get("docTitle"));
aa.put("name",graphNode.get(a).get("name"));
aa.put("docId",graphNode.get(a).get("docId"));
aa.put("docParentId",graphNode.get(a).get("docParentId"));
aa.put("parentId",graphNode.get(a).get("parentId"));
if(graphNode.get(a).get("docLeve").equals("leve0")){
if(graphNode.get(a).get("leve").equals("leve0")){
aa.put("group","0");
}
if(graphNode.get(a).get("docLeve").equals("leve1")){
if(graphNode.get(a).get("leve").equals("leve1")){
aa.put("group","1");
}
if(graphNode.get(a).get("docLeve").equals("leve2")){
if(graphNode.get(a).get("leve").equals("leve2")){
aa.put("group","2");
}
if(graphNode.get(a).get("docLeve").equals("leve3")){
if(graphNode.get(a).get("leve").equals("leve3")){
aa.put("group","3");
}
if(graphNode.get(a).get("docLeve").equals("leve4")){
if(graphNode.get(a).get("leve").equals("leve4")){
aa.put("group","4");
}
if(graphNode.get(a).get("docLeve").equals("leve5")){
if(graphNode.get(a).get("leve").equals("leve5")){
aa.put("group","5");
}
if(graphNode.get(a).get("docLeve").equals("leve6")){
if(graphNode.get(a).get("leve").equals("leve6")){
aa.put("group","6");
}

4
src/main/resources/application.yml

@ -20,9 +20,9 @@ sa-token:
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/zhy?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306/kcfz?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true
username: root
password: root
password: 123456
mybatis:
mapper-locations: classpath*:/mapper/**/*.xml

6
woka.iml

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<component name="CheckStyle-IDEA-Module" serialisationVersion="2">
<option name="activeLocationsIds" />
</component>
</module>
Loading…
Cancel
Save