Commit e60aa06f by qiuchaofei

1,添加上传文件,2对关系进行排序

parent 1ff1be19
......@@ -5,7 +5,10 @@ import com.ulisesbocchio.jasyptspringboot.environment.StandardEncryptableEnviron
import org.jasypt.encryption.StringEncryptor;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
......@@ -32,5 +35,15 @@ public class MetadataRelationApplication {
}
};
}
@Bean
public TomcatServletWebServerFactory tomcatServletWebServerFactory (){
// 修改内置的 tomcat 容器配置
TomcatServletWebServerFactory tomcatServlet = new TomcatServletWebServerFactory();
tomcatServlet .addConnectorCustomizers(
(TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "[]{}")
);
return tomcatServlet ;
}
}
......@@ -10,7 +10,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
......@@ -149,4 +151,15 @@ public class DataRelationAnalyController {
return "";
}
//解析excel,存入neo4j
@ApiOperation(tags = "", value = "从excel生成neo4j的节点与关系。")
@RequestMapping(path = "/uploadExcelToNeo4j", method = RequestMethod.POST)
public String uploadExcelToNeo4j(@RequestParam(value = "excelFile") MultipartFile file) {
logger.info("上传excel文件节点与关系:"+file.getOriginalFilename() );
excel2Neo4jService.uploadExcel(file) ;
logger.info("上传excel文件节点与关系完成。" );
return "";
}
}
package com.keymobile.metadata.metadataRelation.service;
import org.springframework.web.multipart.MultipartFile;
public interface Excel2Neo4jService {
String generalRelationFromExcel(String filePath);
// fileName, file
String uploadExcel(MultipartFile file) ;
}
......@@ -563,7 +563,7 @@ public class MetadataServiceImpl implements IMetadataService {
Map<Long, ReturnNode> nodesMap = new HashMap<>();
Map<String, MetaModel> metaModelMap = new HashMap<>();
Map<String ,ReturnEdge> returnEdgeMap = new HashMap<>();
Map<String ,ReturnEdge> returnEdgeMap = new TreeMap<>();
Map<String,String> colorMap = new HashMap<>();
while (statementResult.hasNext()) {
......@@ -606,7 +606,7 @@ public class MetadataServiceImpl implements IMetadataService {
* asMap 相当于 节点的properties属性信息
*/
// relationship.id();
//
String xuhao =""+ relationship.asMap().get("序号");
String xieyi =""+ relationship.asMap().get("协议");
String yanse =""+ relationship.asMap().get("颜色");
String yewuleibie =""+ relationship.asMap().get("业务类别");
......@@ -636,7 +636,7 @@ public class MetadataServiceImpl implements IMetadataService {
edge.getAttributeMaps().put("业务说明",yewushuoming);
//
returnEdgeMap .put(edgeId,edge );
returnEdgeMap .put(xuhao,edge );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment