Commit 9ff72a72 authored by wuqinghua's avatar wuqinghua

2022/1/11 吴卿华 更新EXCEL上传功能, 增加两种图形算法,优化生成速度

parent f9bd15b9
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- mybatis数据库依赖--> <!-- 连接数据库依赖-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>8.0.19</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
......
package com.example.gajz; package com.example.gajz;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package com.example.gajz.config;
import org.neo4j.cypher.internal.frontend.v2_3.ast.functions.Str;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 时间工具类
*/
public class TimeConFig {
/**
* 获取String类型当前时间
* @return
*/
public String getDateTime(){
Date date = new Date();
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
String DateTime =dateFormat.format(date);
return DateTime;
}
}
package com.example.gajz.transferrelationship;
import org.junit.Test;
import java.awt.*;
import java.util.Random;
public class TEST {
public static void main(String[] args) {
}
@Test
public void RandomHexColor_test() {
Random random = new Random();
float hue = random.nextFloat();
float saturation = (random.nextInt(7000) + 4000) / 10000f;
float luminance = 1f;
Color color = Color.getHSBColor(hue, saturation, luminance);
System.out.println(color);
System.out.println("#" + Integer.toHexString((color.getRGB() & 0xffffff) | 0x1000000).substring(1));
//红色
String red;
//绿色
String green;
//蓝色
String blue;
//生成红色颜色代码
red = Integer.toHexString(random.nextInt(256)).toUpperCase();
//生成绿色颜色代码
green = Integer.toHexString(random.nextInt(256)).toUpperCase();
//生成蓝色颜色代码
blue = Integer.toHexString(random.nextInt(256)).toUpperCase();
//判断红色代码的位数
red = red.length()==1 ? "0" + red : red ;
//判断绿色代码的位数
green = green.length()==1 ? "0" + green : green ;
//判断蓝色代码的位数
blue = blue.length()==1 ? "0" + blue : blue ;
//生成十六进制颜色值
String color1 = "0x"+red+green+blue;
System.out.println(color1);
}
}
package com.example.gajz.transferrelationship.bean.param;
import lombok.Data;
import lombok.ToString;
/**
* 关系图 点位置生成 参数封装类
*/
@Data
@ToString
public class DiagramSpotParam {
/**
* numerical 参数
* 传0不重新刷新 数据从Redis里面取出
* 传1重新刷新 数据从数据库里取出 并且重新生成位置
*/
private String numerical;
/**
* drawingNumber 参数
* 传数字 是代表对应的各种图形算法
*/
private int drawingNumber;
}
...@@ -27,12 +27,12 @@ public class Dot { ...@@ -27,12 +27,12 @@ public class Dot {
/** /**
* 圆点x轴 * 圆点x轴
*/ */
private int x; private double x;
/** /**
* 圆点y轴 * 圆点y轴
*/ */
private int y; private double y;
/** /**
* 圆点大小 * 圆点大小
......
...@@ -18,10 +18,10 @@ public class EchartsUserVo { ...@@ -18,10 +18,10 @@ public class EchartsUserVo {
/** /**
* x轴 * x轴
*/ */
private int x; private double x;
/** /**
* y轴 * y轴
*/ */
private int y; private double y;
} }
...@@ -49,12 +49,12 @@ public class SearchRelationshipVo { ...@@ -49,12 +49,12 @@ public class SearchRelationshipVo {
/** /**
* x轴 * x轴
*/ */
private int x; private double x;
/** /**
* y轴 * y轴
*/ */
private int y; private double y;
/** /**
* 层级 * 层级
......
package com.example.gajz.transferrelationship.neo4j; package com.example.gajz.transferrelationship.config;
import java.awt.*; import java.awt.*;
import java.util.Random; import java.util.Random;
......
...@@ -3,10 +3,11 @@ import com.alibaba.excel.EasyExcel; ...@@ -3,10 +3,11 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.example.gajz.config.TimeConFig;
import com.example.gajz.result.Result; import com.example.gajz.result.Result;
import com.example.gajz.result.ResultCode; import com.example.gajz.result.ResultCode;
import com.example.gajz.transferrelationship.bean.dto.data;
import com.example.gajz.transferrelationship.bean.excel.abcExcie; import com.example.gajz.transferrelationship.bean.excel.abcExcie;
import com.example.gajz.transferrelationship.bean.param.DiagramSpotParam;
import com.example.gajz.transferrelationship.bean.param.TransferAssociationParam; import com.example.gajz.transferrelationship.bean.param.TransferAssociationParam;
import com.example.gajz.transferrelationship.bean.vo.EchartsUserVo; import com.example.gajz.transferrelationship.bean.vo.EchartsUserVo;
import com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo; import com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo;
...@@ -23,30 +24,36 @@ import java.util.List; ...@@ -23,30 +24,36 @@ import java.util.List;
/** /**
* @author lenovo * @author lenovo
*/ */
/**跨域注解*/
@CrossOrigin(origins = "*") @CrossOrigin(origins = "*")
@Controller @Controller
public class TransferRelationshipController { public class TransferRelationshipController {
@Autowired @Autowired
TransferRelationshipService transferRelationshipService; private TransferRelationshipService transferRelationshipService;
/** /**
* 转账关系 * 转账关系
*/ */
@ResponseBody @ResponseBody
@RequestMapping("/edge") @RequestMapping("edge")
private List<data> edge(){ private List<com.example.gajz.transferrelationship.bean.param.data> edge(){
List<data> edge = transferRelationshipService.edge(); List<com.example.gajz.transferrelationship.bean.param.data> edge = transferRelationshipService.edge();
return edge; return edge;
} }
/** /**
* 点 * 点
* numerical 参数
* 传0不重新刷新 数据从Redis里面取出
* 传1重新刷新 数据从数据库里取出 并且重新生成位置
* drawingNumber 参数
* 传数字 是代表对应的各种图形算法
*/ */
@ResponseBody @ResponseBody
@RequestMapping("/diagramSpot") @RequestMapping("/diagramSpot")
private List diagramSpot(){ private List diagramSpot(DiagramSpotParam diagramSpotParam){
List list = transferRelationshipService.diagramSpot(); List list = transferRelationshipService.diagramSpot(diagramSpotParam);
return list; return list;
} }
...@@ -94,7 +101,7 @@ public class TransferRelationshipController { ...@@ -94,7 +101,7 @@ public class TransferRelationshipController {
*/ */
@ResponseBody @ResponseBody
@RequestMapping("/specificLocation") @RequestMapping("/specificLocation")
private Result specificLocation(String id){ private Result specificLocation(@RequestParam("id")String id){
Result result = transferRelationshipService.specificLocation(id); Result result = transferRelationshipService.specificLocation(id);
return result; return result;
} }
...@@ -311,7 +318,7 @@ public class TransferRelationshipController { ...@@ -311,7 +318,7 @@ public class TransferRelationshipController {
} }
} }
}).sheet().doRead();//sheet()参数指定,默认读取第一张工作表 }).sheet().doRead();//sheet()参数指定,默认读取第一张工作表
return new Result(ResultCode.SUCCESS,eSerialsList); return new Result(ResultCode.SUCCESS);
} }
......
package com.example.gajz.transferrelationship.dao; package com.example.gajz.transferrelationship.dao;
import com.example.gajz.transferrelationship.bean.excel.abcExcie; import com.example.gajz.transferrelationship.bean.excel.abcExcie;
import com.example.gajz.transferrelationship.bean.param.data;
import com.example.gajz.transferrelationship.bean.vo.CenterPointVo; import com.example.gajz.transferrelationship.bean.vo.CenterPointVo;
import com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo; import com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo;
import com.example.gajz.transferrelationship.bean.vo.TransferCardVo; import com.example.gajz.transferrelationship.bean.vo.TransferCardVo;
...@@ -125,4 +126,23 @@ public interface TransferRelationshipMapper { ...@@ -125,4 +126,23 @@ public interface TransferRelationshipMapper {
* @return * @return
*/ */
List<CenterPointVo> centerPointMethod(List<TransferCardVo> transferCardVoList, String bankCardNo); List<CenterPointVo> centerPointMethod(List<TransferCardVo> transferCardVoList, String bankCardNo);
/**
* 查询共有多少点 根据点的数量决定生成随机范围大小
* @return
*/
List<com.example.gajz.transferrelationship.bean.param.data> selectNumberPoints();
/**
* 查询拥有多人转账关系的点
* @return
*/
List<TransferCardVo> selectmanyPeople();
/**
* 查询与中心点所有相关联的点
* @param bankCardNo
* @return
*/
List<data> correlationPoint(String bankCardNo);
} }
package com.example.gajz.transferrelationship.hugegraphclient;
import com.baidu.hugegraph.driver.*;
import com.baidu.hugegraph.structure.constant.T;
import com.baidu.hugegraph.structure.graph.Vertex;
import java.io.IOException;
/**
* @author lenovo
*/
public class SingleExample {
public static void main(String[] args) throws IOException {
// If connect failed will throw a exception.
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
try {
SchemaManager schema = hugeClient.schema();
//删除顶点
// schema.propertyKey("姓名").remove();
// schema.propertyKey("卡号").remove();
// schema.propertyKey("转账次数").remove();
// schema.propertyKey("转账金额").remove();
//创建属性
// schema.propertyKey("姓名").asText().ifNotExist().create();
// schema.propertyKey("卡号").asText().ifNotExist().create();
// schema.propertyKey("转账次数").asText().ifNotExist().create();
// schema.propertyKey("转账金额").asText().ifNotExist().create();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("age").asInt().ifNotExist().create();
schema.propertyKey("city").asText().ifNotExist().create();
schema.propertyKey("weight").asDouble().ifNotExist().create();
schema.propertyKey("lang").asText().ifNotExist().create();
schema.propertyKey("date").asDate().ifNotExist().create();
schema.propertyKey("price").asInt().ifNotExist().create();
schema.vertexLabel("person")
.properties("name", "age", "city")
.primaryKeys("name")
.ifNotExist()
.create();
schema.vertexLabel("software")
.properties("name", "lang", "price")
.primaryKeys("name")
.ifNotExist()
.create();
schema.indexLabel("personByCity")
.onV("person")
.by("city")
.secondary()
.ifNotExist()
.create();
schema.indexLabel("personByAgeAndCity")
.onV("person")
.by("age", "city")
.secondary()
.ifNotExist()
.create();
schema.indexLabel("softwareByPrice")
.onV("software")
.by("price")
.range()
.ifNotExist()
.create();
schema.edgeLabel("knows")
.sourceLabel("person")
.targetLabel("person")
.properties("date", "weight")
.ifNotExist()
.create();
schema.edgeLabel("created")
.sourceLabel("person").targetLabel("software")
.properties("date", "weight")
.ifNotExist()
.create();
schema.indexLabel("createdByDate")
.onE("created")
.by("date")
.secondary()
.ifNotExist()
.create();
schema.indexLabel("createdByWeight")
.onE("created")
.by("weight")
.range()
.ifNotExist()
.create();
schema.indexLabel("knowsByWeight")
.onE("knows")
.by("weight")
.range()
.ifNotExist()
.create();
GraphManager graph = hugeClient.graph();
Vertex marko = graph.addVertex(T.label, "person", "name", "marko",
"age", 29, "city", "Beijing");
Vertex vadas = graph.addVertex(T.label, "person", "name", "vadas",
"age", 27, "city", "Hongkong");
Vertex lop = graph.addVertex(T.label, "software", "name", "lop",
"lang", "java", "price", 328);
Vertex josh = graph.addVertex(T.label, "person", "name", "josh",
"age", 32, "city", "Beijing");
Vertex ripple = graph.addVertex(T.label, "software", "name", "ripple",
"lang", "java", "price", 199);
Vertex peter = graph.addVertex(T.label, "person", "name", "peter",
"age", 35, "city", "Shanghai");
//
marko.addEdge("knows", vadas, "date", "2016-01-10", "weight", 0.5);
// marko.addEdge("knows", josh, "date", "2013-02-20", "weight", 1.0);
// marko.addEdge("created", lop, "date", "2017-12-10", "weight", 0.4);
// josh.addEdge("created", lop, "date", "2009-11-11", "weight", 0.4);
// josh.addEdge("created", ripple, "date", "2017-12-10", "weight", 1.0);
// peter.addEdge("created", lop, "date", "2017-03-24", "weight", 0.2);
// GremlinManager gremlin = hugeClient.gremlin();
// System.out.println("==== Path ====");
// ResultSet resultSet = gremlin.gremlin("g.V().outE().path()").execute();
// Iterator<Result> results = resultSet.iterator();
// results.forEachRemaining(result -> {
// System.out.println(result.getObject().getClass());
// Object object = result.getObject();
// if (object instanceof Vertex) {
// System.out.println(((Vertex) object).id());
// } else if (object instanceof Edge) {
// System.out.println(((Edge) object).id());
// } else if (object instanceof Path) {
// List<Object> elements = ((Path) object).objects();
// elements.forEach(element -> {
// System.out.println(element.getClass());
// System.out.println(element);
// });
// } else {
// System.out.println(object);
// }
// });
hugeClient.close();
}catch (Exception e){
hugeClient.close();
}
}
}
package com.example.gajz.transferrelationship.hugegraphclient;
public class test {
public static void main(String[] args) {
Test2 test2 = new Test2();
Test3 test3=new Test3();
test2.ts2(1);
Thread thread = new Thread(test2);
Thread thread1 = new Thread(test3);
thread.start();
thread1.start();
}
}
class Test2 implements Runnable {
private int t2;
public void ts2(int s){
t2=s;
}
@Override
public void run() {
for (int i = 0; i < 1000; i++) {
System.out.println("------Test2"+this.t2);
}
}
}
class Test3 implements Runnable {
@Override
public void run() {
for (int i=0;i<1000;i++){
System.out.println("Test3------");
}
}
}
package com.example.gajz.transferrelationship.neo4j;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferCardVo;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import com.example.gajz.transferrelationship.dao.TransferRelationshipMapper;
import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.neo4j.driver.Result;
import org.neo4j.driver.Session;
import org.neo4j.driver.Transaction;
import org.neo4j.driver.TransactionWork;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import static org.neo4j.driver.Values.parameters;
public class HelloWorldExample implements AutoCloseable {
private final Driver driver;
public HelloWorldExample( String uri, String user, String password ) {
driver = GraphDatabase.driver( uri, AuthTokens.basic( user, password ) );
}
@Override
public void close() throws Exception
{
driver.close();
}
public void printGreeting( final String message )
{
try ( Session session = driver.session() )
{
String greeting = session.writeTransaction( new TransactionWork<String>()
{
@Override
public String execute( Transaction tx )
{
Result result = tx.run( "CREATE (a:Greeting) " +
"SET a.message = $message " +
"RETURN a.message + ', from node ' + id(a)",
parameters( "message", message ) );
return result.single().get( 0 ).asString();
}
} );
System.out.println( greeting );
}
}
public static void main(List<TransferredPersonVo> args) throws Exception {
try ( HelloWorldExample greeter = new HelloWorldExample( "bolt://localhost:7687", "neo4j", "123456" ) ) {
System.out.println(args.size());
for (int i=0;i<args.size();i++){
System.out.println(i);
greeter.printGreeting( args.get(i).getEndCardNo());
}
}
}
}
\ No newline at end of file
package com.example.gajz.transferrelationship.neo4j;
import com.example.gajz.redis.ConFigRedis;
import redis.clients.jedis.Jedis;
import java.util.*;
public class test {
public static void main(String[] args) {
int START = 1;
int END = 100;
Random random = new Random();
for (int idx = 1; idx <= 1; ++idx){
showRandomInteger(START, END, random);
}
}
private static void showRandomInteger(int aStart, int aEnd, Random aRandom){
if ( aStart > aEnd ) {
throw new IllegalArgumentException("Start cannot exceed End.");
}
//get the range, casting to long to avoid overflow problems
long range = (long)aEnd - (long)aStart + 1;
// compute a fraction of the range, 0 <= frac < range
long fraction = (long)(range * aRandom.nextDouble());
int randomNumber = (int)(fraction + aStart);
log("Generated : " + randomNumber);
}
private static void log(String aMessage){
System.out.println(aMessage);
}
}
...@@ -96,8 +96,8 @@ public class TransferLocation { ...@@ -96,8 +96,8 @@ public class TransferLocation {
searchRelationshipVoList.get(i).setY(300); searchRelationshipVoList.get(i).setY(300);
searchRelationshipVoList.get(i).setX(300); searchRelationshipVoList.get(i).setX(300);
searList.add(searchRelationshipVoList.get(i)); searList.add(searchRelationshipVoList.get(i));
int centerPointX=searchRelationshipVoList.get(i).getX(); double centerPointX=searchRelationshipVoList.get(i).getX();
int centerPointY=searchRelationshipVoList.get(i).getY(); double centerPointY=searchRelationshipVoList.get(i).getY();
/**循环次数*/ /**循环次数*/
int numberCycles =0; int numberCycles =0;
/**循环下级点数 计算下级X Y轴位置*/ /**循环下级点数 计算下级X Y轴位置*/
...@@ -192,8 +192,8 @@ public class TransferLocation { ...@@ -192,8 +192,8 @@ public class TransferLocation {
for (int f=0;f<searList.size();f++){ for (int f=0;f<searList.size();f++){
/**中心点对比已经存储好的返回值 获取X Y轴*/ /**中心点对比已经存储好的返回值 获取X Y轴*/
if (cardNumber.equals(searList.get(f).getCardNumber())){ if (cardNumber.equals(searList.get(f).getCardNumber())){
int centerPointX = searList.get(f).getX(); double centerPointX = searList.get(f).getX();
int centerPointY = searList.get(f).getY(); double centerPointY = searList.get(f).getY();
/**循环次数*/ /**循环次数*/
int numberCycles =0; int numberCycles =0;
/**循环下级点数 计算下级X Y轴位置*/ /**循环下级点数 计算下级X Y轴位置*/
......
package com.example.gajz.transferrelationship.service; package com.example.gajz.transferrelationship.service;
import com.example.gajz.result.Result; import com.example.gajz.result.Result;
import com.example.gajz.transferrelationship.bean.dto.data;
import com.example.gajz.transferrelationship.bean.excel.abcExcie; import com.example.gajz.transferrelationship.bean.excel.abcExcie;
import com.example.gajz.transferrelationship.bean.param.Dot; import com.example.gajz.transferrelationship.bean.param.DiagramSpotParam;
import com.example.gajz.transferrelationship.bean.param.TransferAssociationParam; import com.example.gajz.transferrelationship.bean.param.TransferAssociationParam;
import com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo; import com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo;
import java.util.List; import java.util.List;
...@@ -18,14 +17,14 @@ public interface TransferRelationshipService { ...@@ -18,14 +17,14 @@ public interface TransferRelationshipService {
* 边 * 边
* @return * @return
*/ */
List<data> edge(); List<com.example.gajz.transferrelationship.bean.param.data> edge();
/** /**
* 点 * 点
* @return * @return
*/ */
List diagramSpot(); List diagramSpot(DiagramSpotParam diagramSpotParam);
/** /**
......
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程8
* @author lenovo
*/
public class ThreadsMultipleVerticesEight implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesEightList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程8开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程8结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程11
* @author lenovo
*/
public class ThreadsMultipleVerticesEleven implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesElevenList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程11开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程11结束"+df.format(new Date()));
hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程5
* @author lenovo
*/
public class ThreadsMultipleVerticesFive implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesFiveList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程5开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程5结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程4
* @author lenovo
*/
public class ThreadsMultipleVerticesFour implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesFourList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程4开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程4结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程9
* @author lenovo
*/
public class ThreadsMultipleVerticesNine implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesNineList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程9开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程9结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程1
* @author lenovo
*/
public class ThreadsMultipleVerticesOne implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesOneList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程1开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程1结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程7
* @author lenovo
*/
public class ThreadsMultipleVerticesSeven implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesSevenList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程7开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程7结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程6
* @author lenovo
*/
public class ThreadsMultipleVerticesSix implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesSixList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程6开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程6结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程10
* @author lenovo
*/
public class ThreadsMultipleVerticesTen implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesTenList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程10开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程10结束"+df.format(new Date()));
hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程3
* @author lenovo
*/
public class ThreadsMultipleVerticesThree implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesThreeList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程3开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程3结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程12
* @author lenovo
*/
public class ThreadsMultipleVerticesTwelve implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesTwelveList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程12开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程12结束"+df.format(new Date()));
hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.constant.T;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 收款人顶点数据导入线程2
* @author lenovo
*/
public class ThreadsMultipleVerticesTwo implements Runnable{
List<TransferredPersonVo> transferredPersonList;
public void ThreadsMultipleVerticesTwoList(List<TransferredPersonVo> transferredPersonVos){
this.transferredPersonList=transferredPersonVos;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("顶点数据导入线程2开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferredPersonList.size();i++){
/**添加收款人顶点数据*/
graph.addVertex(
/**设置ID*/
T.id, transferredPersonList.get(i).getEndCardNo(),
T.label, "收款人",
/**设置收款次数*/
"收款次数", transferredPersonList.get(i).getNumber());
}
System.out.println("顶点数据导入线程2结束"+df.format(new Date()));
// hugeClient.close();
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系8号线程
* @author lenovo
*/
public class TransferAccountsEight implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsEightList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程8开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程8结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系18号线程
* @author lenovo
*/
public class TransferAccountsEighteen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsEighteenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程18开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程18结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系11号线程
* @author lenovo
*/
public class TransferAccountsEleven implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsElevenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程11开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程11结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系15号线程
* @author lenovo
*/
public class TransferAccountsFifteen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsFifteenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程15开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程15结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @author lenovo
*/
public class TransferAccountsFive implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsFiveList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程5开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程5结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @author lenovo
*/
public class TransferAccountsFour implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsFourList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程4开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程4结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系14号线程
* @author lenovo
*/
public class TransferAccountsFourteen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsFourteenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程14开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程14结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系9号线程
* @author lenovo
*/
public class TransferAccountsNine implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsNineList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程9开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程9结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系19号线程
* @author lenovo
*/
public class TransferAccountsNineteen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsNineteenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程19开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程19结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @author lenovo
*/
public class TransferAccountsOne implements Runnable {
List<TransferredPersonVo> transferList;
public void TransferAccountsOneList(List<TransferredPersonVo> transferCollectionList){
System.out.println(transferCollectionList.size());
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程1开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程1结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系7号线程
* @author lenovo
*/
public class TransferAccountsSeven implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsSevenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程7开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程7结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系17号线程
* @author lenovo
*/
public class TransferAccountsSeventeen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsSeventeenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程17开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程17结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 线程6
* @author lenovo
*/
public class TransferAccountsSix implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsSixList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程6开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程6结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系16号线程
* @author lenovo
*/
public class TransferAccountsSixteen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsSixteenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程16开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程16结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系10号线程
* @author lenovo
*/
public class TransferAccountsTen implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsTenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程10开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程10结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系13号线程
* @author lenovo
*/
public class TransferAccountsThirteen implements Runnable {
List<TransferredPersonVo> transferList;
public void TransferAccountsThirteenList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程13开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程13结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @author lenovo
*/
public class TransferAccountsThree implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsThreeList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程3开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程3结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系12号线程
* @author lenovo
*/
public class TransferAccountsTwelve implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsTwelveList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程12开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程12结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 导入转账关系20号线程
* @author lenovo
*/
public class TransferAccountsTwenty implements Runnable{
List<TransferredPersonVo> transferList;
public void TransferAccountsTwentyList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程20开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程20结束"+df.format(new Date()));
}
}
package com.example.gajz.transferrelationship.thread;
import com.baidu.hugegraph.driver.GraphManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.structure.graph.Vertex;
import com.example.gajz.transferrelationship.bean.vo.TransferredPersonVo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @author lenovo
*/
public class TransferAccountsTwo implements Runnable {
List<TransferredPersonVo> transferList;
public void TransferAccountsTwoList(List<TransferredPersonVo> transferCollectionList){
this.transferList=transferCollectionList;
}
@Override
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("线程2开始"+df.format(new Date()));
HugeClient hugeClient = HugeClient.builder("http://36.148.1.253:8289","hugegraph2")
/*** 默认未开启用户权限*/
.configUser("**", "**")
.build();
GraphManager graph = hugeClient.graph();
for (int i=0;i<transferList.size();i++){
Vertex transferor = graph.getVertex(transferList.get(i).getBankCardNo());
Vertex payee = graph.getVertex(transferList.get(i).getEndCardNo());
//创建转账关系
transferor.addEdge("多人转账", payee, "转账次数", transferList.get(i).getNumber());
}
hugeClient.close();
System.out.println("线程2结束"+df.format(new Date()));
}
}
...@@ -13,3 +13,4 @@ server.port=8090 ...@@ -13,3 +13,4 @@ server.port=8090
spring.servlet.multipart.max-file-size= 50MB spring.servlet.multipart.max-file-size= 50MB
#设置单次请求文件的总大小 #设置单次请求文件的总大小
spring.servlet.multipart.max-request-size= 50MB spring.servlet.multipart.max-request-size= 50MB
...@@ -50,3 +50,4 @@ spring: ...@@ -50,3 +50,4 @@ spring:
#logging: #logging:
## level: ## level:
## com.example.demo.mapper: DEBUG ## com.example.demo.mapper: DEBUG
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!--查询全部转账卡号方法(中心点)--> <!--查询全部转账卡号方法(中心点)-->
<select id="selectTransferCard" resultType="com.example.gajz.transferrelationship.bean.vo.TransferCardVo"> <select id="selectTransferCard" resultType="com.example.gajz.transferrelationship.bean.vo.TransferCardVo">
SELECT bank_card_no as bankCardNo,bank_account_name as name FROM abc_statement where bank_card_no is not null and bank_card_no != '' group by bank_card_no SELECT bank_card_no as bankCardNo,bank_account_name as name FROM abc_statement where bank_card_no is not null and bank_card_no != '' group by bank_card_no
</select> </select>
...@@ -17,16 +17,29 @@ ...@@ -17,16 +17,29 @@
<!--查询被转账人全部信息--> <!--查询被转账人全部信息-->
<select id="transferRelationship" resultType="com.example.gajz.transferrelationship.bean.param.data"> <select id="correlationPoint" resultType="com.example.gajz.transferrelationship.bean.param.data">
select distinct end_account_name as name,end_card_no as target from abc_statement where bank_card_no=#{bankCardNo} select distinct end_account_name as name,end_card_no as target from abc_statement where bank_card_no=#{bankCardNo}
HAVING end_card_no not in HAVING end_card_no not in
(select distinct bank_card_no from abc_statement where bank_card_no is not null and end_card_no is not null) (select distinct bank_card_no from abc_statement where bank_card_no is not null and end_card_no is not null)
</select> </select>
<!--查询被转账人全部信息 只查询跟中心点有关系的被转账人信息-->
<select id="transferRelationship" resultType="com.example.gajz.transferrelationship.bean.param.data">
select end_account_name as name,end_card_no as target from (
select end_account_name,bank_card_no,end_card_no from (
select count(id),end_account_name,bank_card_no,end_card_no from abc_statement
where bank_card_no is not null and end_card_no is not null
GROUP BY bank_card_no, end_card_no ) a
group by a.end_card_no HAVING count(end_card_no)=1 ) b
where b.bank_card_no=#{bankCardNo}
HAVING b.end_card_no not in
(select distinct bank_card_no from abc_statement where bank_card_no is not null and end_card_no is not null)
</select>
<!--关系图搜索接口 查询搜索人转账关系--> <!--关系图搜索接口 查询搜索人转账关系-->
<select id="transferRecord" resultType="com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo"> <select id="transferRecord" resultType="com.example.gajz.transferrelationship.bean.vo.SearchRelationshipVo">
select "转账" as relationship,end_account_name as name,end_card_no as cardNumber from abc_statement select "转账" as relationship,end_account_name as name,end_card_no as cardNumber from abc_statement
where 1=1 where 1=1
<if test="fullName!=null and fullName!=''"> <if test="fullName!=null and fullName!=''">
and bank_account_name=#{fullName} and bank_account_name=#{fullName}
</if> </if>
...@@ -161,5 +174,19 @@ ...@@ -161,5 +174,19 @@
) )
</select> </select>
<!--查询共有多少点 根据点的数量决定生成随机范围大小-->
<select id="selectNumberPoints" resultType="com.example.gajz.transferrelationship.bean.param.data">
SELECT bank_card_no as source,end_card_no as target FROM `abc_statement` where bank_card_no is not null and bank_card_no != '' and end_card_no is not null
group by source ,target
</select>
<!--查询拥有多人转账关系的点-->
<select id="selectmanyPeople" resultType="com.example.gajz.transferrelationship.bean.vo.TransferCardVo">
select end_account_name as name,end_card_no as bankCardNo from (
select count(id),end_account_name,bank_card_no,end_card_no from abc_statement
where bank_card_no is not null and end_card_no is not null
GROUP BY bank_card_no, end_card_no ) a
group by a.end_card_no HAVING count(end_card_no)>1
</select>
</mapper> </mapper>
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