Commit 549f2f2b by yangyang

主题研判可视化相关接口处理(西藏)

parent ff907984
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<swagger.version>2.9.2</swagger.version> <swagger.version>2.9.2</swagger.version>
<aliyun.oss.version>2.8.3</aliyun.oss.version> <aliyun.oss.version>2.8.3</aliyun.oss.version>
<jodatime.version>2.10.1</jodatime.version> <jodatime.version>2.10.1</jodatime.version>
<poi.version>3.17</poi.version> <poi.version>3.7</poi.version>
<commons-fileupload.version>1.3.1</commons-fileupload.version> <commons-fileupload.version>1.3.1</commons-fileupload.version>
<commons-io.version>2.6</commons-io.version> <commons-io.version>2.6</commons-io.version>
<httpclient.version>4.5.1</httpclient.version> <httpclient.version>4.5.1</httpclient.version>
...@@ -285,6 +285,11 @@ ...@@ -285,6 +285,11 @@
<artifactId>poi-scratchpad</artifactId> <artifactId>poi-scratchpad</artifactId>
<version>3.17</version> <version>3.17</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</dependency> </dependency>
<!--xls--> <!--xls-->
<dependency> <!--<dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
</dependency> </dependency>
...@@ -132,8 +132,28 @@ ...@@ -132,8 +132,28 @@
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
</dependency>-->
<!--处理excel、word-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.7</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-fileupload</groupId> <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId> <artifactId>commons-fileupload</artifactId>
......
...@@ -54,7 +54,9 @@ public class ZtypController { ...@@ -54,7 +54,9 @@ public class ZtypController {
} }
} }
@OperLog(message = "标识号查询列表",operation = OperationType.QUERY)
@PostMapping("/list") @PostMapping("/list")
@ApiOperation(value = "标识号查询列表")
public R listFwbshYp(TbStZtypFwbsh fwbsh,HttpServletRequest request){ public R listFwbshYp(TbStZtypFwbsh fwbsh,HttpServletRequest request){
try { try {
fwbsh.setXxdjryGmsfhm(JwtUser.getUser(request).getIdentitycard()); fwbsh.setXxdjryGmsfhm(JwtUser.getUser(request).getIdentitycard());
...@@ -66,7 +68,9 @@ public class ZtypController { ...@@ -66,7 +68,9 @@ public class ZtypController {
} }
} }
@OperLog(message = "标识号更新",operation = OperationType.QUERY)
@PostMapping("/update") @PostMapping("/update")
@ApiOperation(value = "标识号更新")
public R updateFwbshYp(TbStZtypFwbsh fwbsh,HttpServletRequest request){ public R updateFwbshYp(TbStZtypFwbsh fwbsh,HttpServletRequest request){
try { try {
fwbsh.setUpUser(JwtUser.getUser(request)); fwbsh.setUpUser(JwtUser.getUser(request));
...@@ -78,7 +82,9 @@ public class ZtypController { ...@@ -78,7 +82,9 @@ public class ZtypController {
} }
} }
@OperLog(message = "标识号删除",operation = OperationType.QUERY)
@PostMapping("/delete") @PostMapping("/delete")
@ApiOperation(value = "标识号删除")
public R deleteFwbshYp(TbStZtypFwbsh fwbsh,HttpServletRequest request){ public R deleteFwbshYp(TbStZtypFwbsh fwbsh,HttpServletRequest request){
try { try {
fwbsh.setUpUser(JwtUser.getUser(request)); fwbsh.setUpUser(JwtUser.getUser(request));
...@@ -91,9 +97,9 @@ public class ZtypController { ...@@ -91,9 +97,9 @@ public class ZtypController {
} }
} }
@OperLog(message = "群体研判列表",operation = OperationType.QUERY)
@PostMapping("/queryAjypfx") @PostMapping("/queryAjypfx")
@ResponseBody @ApiOperation(value = "群体研判列表")
@ApiOperation(value = "案件团伙分析")
public R queryAjypfx(AjQueryParam requestParam) { public R queryAjypfx(AjQueryParam requestParam) {
requestParam.setPage((requestParam.getPage()-1) * requestParam.getLimit()); requestParam.setPage((requestParam.getPage()-1) * requestParam.getLimit());
requestParam.setLimit(requestParam.getLimit()); requestParam.setLimit(requestParam.getLimit());
...@@ -105,112 +111,297 @@ public class ZtypController { ...@@ -105,112 +111,297 @@ public class ZtypController {
return R.ok().total(count).rows(records); return R.ok().total(count).rows(records);
} }
/*@PostMapping("/getThfxAccompliceBythId") @OperLog(message = "案件团伙分析可视化接口",operation = OperationType.QUERY)
@ResponseBody @PostMapping("/getThfxAccompliceBythId")
@ApiOperation(value = "案件团伙分析可视化接口") @ApiOperation(value = "案件团伙分析可视化接口")
public R getThfxAccompliceBythId(@RequestParam(value = "id") String thbh, @RequestParam(value = "fxwd") String fxwd, public MapRestResult getThfxAccompliceBythId(@RequestBody AjQueryParam requestParam) {
@RequestParam(value = "commonRelationshipNum") String commonRelationshipNum) { return ztypService.getThfxAccompliceBythId(requestParam.getThbh(), requestParam.getFxwd(),requestParam.getCommonRelationshipNum());
Map<String, Object> resultMap = ztypService.getThfxAccompliceBythId(thbh, fxwd,commonRelationshipNum); }
return R.ok().data(resultMap);
}*/ @OperLog(message = "可视化",operation = OperationType.QUERY)
// @PostMapping("/selectJtrwList") @PostMapping("/kshdata")
// @ResponseBody @ApiOperation(value = "可视化")
// @ApiOperation(value = "查询具体任务的list集合", notes = "查询具体任务的list集合") public MapRestResult kshdata(@RequestBody TbStZtypFwbsh fwbsh){
// public R selectJtrwList(TbZxrwb tbZxrwb) { try {
// try { if (StringUtils.isEmpty(fwbsh.getFwbshLb())){
// tbZxrwb.setPage((tbZxrwb.getPage()-1)*tbZxrwb.getLimit()); return MapRestResult.error("类别不能为空");
// tbZxrwb.setLimit(tbZxrwb.getLimit()); }
// Map<String, Object> map = new HashMap<>(); if (StringUtils.isEmpty(fwbsh.getFwbshHm())){
// List<TbZxrwb> list = ztypService.getJtrwList(tbZxrwb); return MapRestResult.error("号码不能为空");
// int count = ztypService.getJtrwCount(tbZxrwb); }
// map.put("rows", list); return ztypService.kshdata(fwbsh);
// map.put("total", count); } catch (Exception e) {
// return R.ok().data(map); e.printStackTrace();
// } catch (Exception e) { return MapRestResult.error(e.getMessage());
// e.printStackTrace(); }
// return R.error(e.getMessage()); }
// }
// } @OperLog(message = "查询团伙关联案件信息",operation = OperationType.QUERY)
// @RequestMapping("/getThgaByThbh")
// @PostMapping("/getTransactionStatistics") @ApiOperation(value = "查询团伙关联案件信息")
// @ResponseBody public R getThgaByThbh(TbYwShseTh tbYwShseTh) {
// @ApiOperation(value = "查询交易信息分析数据", notes = "查询交易信息分析数据") try {
// public R getTransactionStatistics(BankCardNumPojo bankCard) { List<TbStAsj> ajlist = ztypService.getThgaByThbh(tbYwShseTh);
// Map<String, Object> result = ztypService.getTransactionStatistics(bankCard); int count = ztypService.getThgaByThbhCount(tbYwShseTh);
// return R.ok().data(result); return R.ok().data("rows", ajlist).data("total", count);
// } } catch (Exception e) {
// e.printStackTrace();
// @PostMapping("/getTransactionDetailByTaskId") return R.error(e.getMessage());
// @ResponseBody }
// @ApiOperation(value = "获取任务的交易详情", notes = "获取任务的交易详情") }
// public R getTransactionDetailByTaskId(BankCardParamPojo requestParam) {
// Map<String, Object> result = ztypService.getTransactionDetailByTaskId(requestParam); @OperLog(message = "查询团伙关联嫌疑人信息",operation = OperationType.QUERY)
// return R.ok().data(result); @RequestMapping("/getThxyrByThbh")
// } @ApiOperation(value = "查询团伙关联嫌疑人信息")
// public R getThxyrByThbh(TbYwShseTh tbYwShseTh) {
// @PostMapping("/getTradingTimeStatistics") try {
// @ResponseBody List<TbXwZbfzxyr> xyrlist = ztypService.getThxyrByThbh(tbYwShseTh);
// @ApiOperation(value = "获取交易时间规律统计", notes = "获取交易时间规律统计") int count = ztypService.getThxyrByThbhCount(tbYwShseTh);
// public R getTradingTimeStatistics(BankCardParamPojo requestParam) throws ParseException { return R.ok().data("rows", xyrlist).data("total", count);
// Map<String, Object> result = ztypService.getTradingTimeStatistics(requestParam); } catch (Exception e) {
// return R.ok().data(result); e.printStackTrace();
// } return R.error(e.getMessage());
// }
// @PostMapping("/getTradingLocationStatistics") }
// @ResponseBody
// @ApiOperation(value = "获取交易地域规律统计", notes = "获取交易地域规律统计") @OperLog(message = "根据推荐团伙添加犯罪团伙",operation = OperationType.QUERY)
// public R getTradingLocationStatistics(BankCardParamPojo requestParam) { @RequestMapping("/addFzthaj")
// Map<String, Object> result = ztypService.getTradingLocationStatistics(requestParam); @ApiOperation(value = "根据推荐团伙添加犯罪团伙")
// return R.ok().data(result); public R addFzthaj(TbYwCchshzztjb cchshzztjb,HttpServletRequest request){
// } try {
// cchshzztjb.setDjUser(JwtUser.getUser(request));
// @PostMapping("/getTradingHabitStatistics") String xxzjbh = ztypService.addFzthaj(cchshzztjb,request);
// @ResponseBody return R.ok().data("xxzjbh",xxzjbh);
// @ApiOperation(value = "获取交易习惯分析统计", notes = "获取交易习惯分析统计") } catch (Exception e) {
// public R getTradingHabitStatistics(BankCardParamPojo requestParam) { e.printStackTrace();
// Map<String, Object> result = ztypService.getTradingHabitStatistics(requestParam); return R.error(e.getMessage());
// return R.ok().data(result); }
// } }
//
// @PostMapping("/getTradingFrequencyStatistics") @OperLog(message = "获取手机号机主信息",operation = OperationType.QUERY)
// @ResponseBody @ApiOperation(value = "获取手机号机主信息")
// @ApiOperation(value = "获取交易频度分析统计", notes = "获取交易频度分析统计") @PostMapping("/txxx/getSjhJzxx")
// public R getTradingFrequencyStatistics(BankCardParamPojo requestParam) { public R getSjhJzxx(String phoneNum) {
// Map<String, Object> result = ztypService.getTradingFrequencyStatistics(requestParam); Map resultMap = new HashMap();
// return R.ok().data(result); try {
// } resultMap = ztypService.getSjhJzxx(phoneNum);
// return R.ok().data("result",resultMap);
// @PostMapping("/getTradingRelationship") } catch (Exception e) {
// @ResponseBody e.printStackTrace();
// @ApiOperation(value = "获取交易关系可视化分析", notes = "获取交易关系可视化分析") return R.error(e.getMessage());
// public R getTradingRelationship(BankCardParamPojo requestParam) { }
// Map<String, Object> result = ztypService.getTradingRelationship(requestParam); }
// return R.ok().data(result);
// } @OperLog(message = "获取手机号各种数据",operation = OperationType.QUERY)
// @ApiOperation(value = "获取手机号各种数据(包括话单列表、24小时规律分析折线图、通话时长前5、通话次数前5)")
// // 根据银行卡号查询资金流 @PostMapping("/txxx/getSjInfo")
// @PostMapping("/selectJyxxjsList") public R getSjInfo(TxxxParam txxxParam) {
// @ResponseBody Map resultMap = new HashMap();
// @ApiOperation(value = "查询交易信息检索的list集合", notes = "查询交易信息检索的list集合") try {
// public R selectJyxxjsList(TbZjlxxzx tbZjlxxzx) { resultMap = ztypService.getSjInfo(txxxParam);
// try { return R.ok().data("result",resultMap);
// } catch (Exception e) {
// Map<String, Object> map = new HashMap<>(); e.printStackTrace();
// if (tbZjlxxzx.getBfkh() == null || "".equals(tbZjlxxzx.getBfkh())) { return R.error(e.getMessage());
// map.put("rows", new ArrayList<>()); }
// map.put("total", 0); }
// return R.ok().data(map);
// } @OperLog(message = "根据手机号获取案件信息",operation = OperationType.QUERY)
// tbZjlxxzx.setPage((tbZjlxxzx.getPage()-1)*tbZjlxxzx.getLimit()); @ApiOperation(value = "根据手机号获取案件信息")
// tbZjlxxzx.setLimit(tbZjlxxzx.getLimit()); @PostMapping("/txxx/getAsjxxByPhoneNum")
// List<TbZjlxxzx> list = tbZjlxxServcie.selectJyxxjsList(tbZjlxxzx); public R getAsjxxByPhoneNum(TxxxParam txxxParam) {
// int total = tbZjlxxServcie.selectJyxxjsListCount(tbZjlxxzx); Map resultMap = new HashMap();
// map.put("rows", list); try {
// map.put("total", total); resultMap = ztypService.getAsjxxByPhoneNum(txxxParam);
// return R.ok().data(map); return R.ok().data("result",resultMap);
// } catch (Exception e) { } catch (Exception e) {
// e.printStackTrace(); e.printStackTrace();
// return R.error(e.getMessage()); return R.error(e.getMessage());
// } }
// } }
@OperLog(message = "可视化测试",operation = OperationType.QUERY)
@PostMapping("/kshdatatest")
@ApiOperation(value = "可视化测试")
public String kshdatatest(){
return "{\n" +
"\t\"status\": 200,\n" +
"\t\"msg\": \"可视化结果获取成功\",\n" +
"\t\"data\": {\n" +
"\t\t\"nodes\": [\n" +
"\t\t\t{\n" +
"\t\t\t\t\"id\": \"430123196510265891\",\n" +
"\t\t\t\t\"label\": \"证件号码:430123196510265891\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"id\": \"430123196510265891\",\n" +
"\t\t\t\t\t\"label\": \"证件号码:430123196510265891\",\n" +
"\t\t\t\t\t\"imgType\": \"idcard\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"id\": \"15754879533\",\n" +
"\t\t\t\t\"label\": \"15754879533\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"id\": \"15754879533\",\n" +
"\t\t\t\t\t\"label\": \"15754879533\",\n" +
"\t\t\t\t\t\"imgType\": \"sjk\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"id\": \"蒙AKH824\",\n" +
"\t\t\t\t\"label\": \"蒙AKH824\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"id\": \"蒙AKH824\",\n" +
"\t\t\t\t\t\"label\": \"蒙AKH824\",\n" +
"\t\t\t\t\t\"imgType\": \"cph\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"id\": \"6216625552447663148522\",\n" +
"\t\t\t\t\"label\": \"6216625552447663148522\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"id\": \"6216625552447663148522\",\n" +
"\t\t\t\t\t\"label\": \"6216625552447663148522\",\n" +
"\t\t\t\t\t\"imgType\": \"yhk\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"id\": \"A4690035100002025050074\",\n" +
"\t\t\t\t\"label\": \"A4690035100002025050074\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"id\": \"A4690035100002025050074\",\n" +
"\t\t\t\t\t\"label\": \"A4690035100002025050074\",\n" +
"\t\t\t\t\t\"imgType\": \"aj\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"id\": \"A4301025100002022020012\",\n" +
"\t\t\t\t\"label\": \"A4301025100002022020012\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"id\": \"A4301025100002022020012\",\n" +
"\t\t\t\t\t\"label\": \"A4301025100002022020012\",\n" +
"\t\t\t\t\t\"imgType\": \"aj\"\n" +
"\t\t\t\t}\n" +
"\t\t\t}\n" +
"\t\t],\n" +
"\t\t\"links\": [\n" +
"\t\t\t{\n" +
"\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\"target\": \"15754879533\",\n" +
"\t\t\t\t\"label\": \"机主\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"label\": \"机主\",\n" +
"\t\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\t\"target\": \"15754879533\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\"target\": \"蒙AKH824\",\n" +
"\t\t\t\t\"label\": \"车主\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"label\": \"车主\",\n" +
"\t\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\t\"target\": \"蒙AKH824\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\"target\": \"6216625552447663148522\",\n" +
"\t\t\t\t\"label\": \"卡号\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"label\": \"卡号\",\n" +
"\t\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\t\"target\": \"6216625552447663148522\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\"target\": \"A4690035100002025050074\",\n" +
"\t\t\t\t\"label\": \"人案\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"label\": \"人案\",\n" +
"\t\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\t\"target\": \"A4690035100002025050074\"\n" +
"\t\t\t\t}\n" +
"\t\t\t},\n" +
"\t\t\t{\n" +
"\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\"target\": \"A4301025100002022020012\",\n" +
"\t\t\t\t\"label\": \"人案\",\n" +
"\t\t\t\t\"properties\": {\n" +
"\t\t\t\t\t\"label\": \"人案\",\n" +
"\t\t\t\t\t\"source\": \"430123196510265891\",\n" +
"\t\t\t\t\t\"target\": \"A4301025100002022020012\"\n" +
"\t\t\t\t}\n" +
"\t\t\t}\n" +
"\t\t]\n" +
"\t}\n" +
"}";
}
@OperLog(message = "可视化模板话单导入",operation = OperationType.QUERY)
@PostMapping("importHd")
@ApiOperation(value = "可视化模板话单导入", notes = "传入excel")
public MapRestResult importKsjHd(MultipartFile file) {
String filename = file.getOriginalFilename();
if (org.springframework.util.StringUtils.isEmpty(filename)) {
throw new RuntimeException("请上传文件!");
}
if ((!org.springframework.util.StringUtils.endsWithIgnoreCase(filename, ".xls") && !org.springframework.util.StringUtils.endsWithIgnoreCase(filename, ".xlsx"))) {
throw new RuntimeException("请上传正确的excel文件!");
}
InputStream inputStream;
try {
// 处理开始
KshHdImportListener importListener = new KshHdImportListener();
inputStream = new BufferedInputStream(file.getInputStream());
ExcelReaderBuilder builder = EasyExcel.read(inputStream, KshHdExcelImport.class, importListener);
builder.doReadAll();
// 拿到导入成功、失败数
return MapRestResult.ok(importListener.getKsjResultPojo());
} catch (IOException e) {
e.printStackTrace();
return MapRestResult.error("上传失败!"+e);
}
}
@OperLog(message = "可视化模板银行交易记录导入",operation = OperationType.QUERY)
@PostMapping("importYhk")
@ApiOperation(value = "可视化模板银行交易记录导入", notes = "传入excel")
public MapRestResult importYhK(MultipartFile file) {
String filename = file.getOriginalFilename();
if (org.springframework.util.StringUtils.isEmpty(filename)) {
throw new RuntimeException("请上传文件!");
}
if ((!org.springframework.util.StringUtils.endsWithIgnoreCase(filename, ".xls") && !org.springframework.util.StringUtils.endsWithIgnoreCase(filename, ".xlsx"))) {
throw new RuntimeException("请上传正确的excel文件!");
}
InputStream inputStream;
try {
// 处理开始
KshYhkImportListener importListener = new KshYhkImportListener();
inputStream = new BufferedInputStream(file.getInputStream());
ExcelReaderBuilder builder = EasyExcel.read(inputStream, KshYhkExcelImport.class, importListener);
builder.doReadAll();
// 拿到导入成功、失败数
return MapRestResult.ok(importListener.getKsjResultPojo());
} catch (IOException e) {
e.printStackTrace();
return MapRestResult.error("上传失败!"+e);
}
}
@OperLog(message = "判断该手机号是否可以查询信息",operation = OperationType.QUERY)
@PostMapping("/txxx/judgePhone")
@ApiOperation(value = "判断该手机号是否可以查询信息", notes = "判断该手机号是否可以查询信息")
public R judgePhone(String phoneNum){
try {
Integer count = ztypService.judgePhone(phoneNum);
return R.ok().data("count",count);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
} }
...@@ -3,12 +3,15 @@ package com.founder.publicapi.mapper.mysqlMapper; ...@@ -3,12 +3,15 @@ package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.founder.commonutils.model.newPublicEntity.TbStZtypFwbsh; import com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.TbStZtypFwbsh;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* 主题研判服务标识号研判mapper * 主题研判服务标识号研判mapper
...@@ -69,4 +72,96 @@ public interface TbStZtypFwbshMapper extends BaseMapper<TbStZtypFwbsh> { ...@@ -69,4 +72,96 @@ public interface TbStZtypFwbshMapper extends BaseMapper<TbStZtypFwbsh> {
* 2022/4/26 19:58 * 2022/4/26 19:58
*/ */
int selectXgxsCountByHm(@Param("hm") String hm); int selectXgxsCountByHm(@Param("hm") String hm);
/**
* selectHmCountByAsjbh 根据案事件编号查询号码数量(非身份证号)
* @param asjbh: 案事件编号
* @param temp: 缓存记录
* @return java.lang.Integer
* @author lystar
* 2022/4/24 10:19
*/
Integer selectHmCountByAsjbh(@Param("asjbh") String asjbh, @Param("temp") ArrayList<ArrayList<String>> temp);
/**
* selectHmByAsjbh 根据案事件编号查询号码可视化节点(非身份证号)
* @param asjbh: 案事件编号
* @param temp: 缓存记录
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/24 10:26
*/
List<AjThKshfxPojo> selectHmByAsjbh(@Param("asjbh") String asjbh, @Param("temp") ArrayList<ArrayList<String>> temp);
/**
* selectAjByHm 查询根据号码案件可视化节点(非身份证号)
* @param fwbsh: 标识号码
* @param temp: 缓存记录
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/24 10:10
*/
List<AjThKshfxPojo> selectAjByHm(@Param("fwbsh") String fwbsh, @Param("temp") ArrayList<ArrayList<String>> temp);
/**
* getXyrByAsjbhWithOutZjhm 根据案事件编号获取嫌疑人(排除已有)
* @param asjbh: 案件编号
* @param zjhms: 证件号码数组
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/27 09:41
*/
List<AjThKshfxPojo> getXyrByAsjbhWithOutZjhm(@Param("asjbh") String asjbh, @Param("zjhms") List<String> zjhms);
/**
* getTarByZjhm 通过身份证号码查询同案人
* @return java.util.List<java.util.Map<java.lang.String,java.lang.String>>
* @author lystar
* 2022/4/24 16:13
*/
List<Map<String, String>> getTarByZjhm(String zjhm);
/**
* selectAjNodeByZjhmWithOutAsjbh 根据证件号码查询案件信息(排除已有)
* @param zjhm: 证件号码
* @param asjbh: 案件编号
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/27 10:24
*/
List<AjThKshfxPojo> selectAjNodeByZjhmWithOutAsjbh(@Param("zjhm") String zjhm, @Param("asjbh") String asjbh);
/**
* selectAjNodeByZjhmWithOutAsjbh 根据可疑人员证件号码查询案件信息(排除已有)
* @param zjhm: 证件号码
* @param asjbh: 案件编号
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/27 10:24
*/
List<AjThKshfxPojo> selectAjNodeByKyryZjhmWithOutAsjbh(@Param("zjhm") String zjhm, @Param("asjbh") String asjbh);
/**
* selectDhNodeByZjhm 通过证件号码查询电话节点
* @param zjhm: 证件号码
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/27 11:42
*/
List<AjThKshfxPojo> selectDhNodeByZjhm(String zjhm);
/**
* getYhkZjlByZjhm 通过证件号码查询银行资金流
* @param zjhm: 证件号码
* @author lystar
* 2022/4/24 15:41
*/
List<Map<String, String>> getYhkZjlByZjhm(String zjhm);
/**
* selectYhkNodeByZjhm 根据证件号码查询银行卡节点
* @param zjhm: 证件号码
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/27 11:41
*/
List<AjThKshfxPojo> selectYhkNodeByZjhm(String zjhm);
/**
* selectIpNodeByZjhm 通过证件号码查询ip节点
* @param zjhm:
* @return java.util.List<org.springblade.founder.hcyprw.entity.AjThKshfxPojo>
* @author lystar
* 2022/4/27 11:42
*/
List<AjThKshfxPojo> selectIpNodeByZjhm(String zjhm);
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.founder.publicapi.mapper.mysqlMapper.TbStZtypFwbshMapper"> <mapper namespace="com.founder.publicapi.mapper.mysqlMapper.TbStZtypFwbshMapper">
<select id="selectPageByFwbsh" resultType="com.founder.commonutils.model.newPublicEntity.TbStZtypFwbsh"> <select id="selectPageByFwbsh" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbStZtypFwbsh">
select select
(SELECT count(1) FROM tb_xsz_cbyp_qgaj WHERE CBXGFWBZH = fwbsh_hm) as qgajCount, (SELECT count(1) FROM tb_xsz_cbyp_qgaj WHERE CBXGFWBZH = fwbsh_hm) as qgajCount,
<include refid="fwbsh-queryColumn"/> <include refid="fwbsh-queryColumn"/>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<include refid="fwbsh-queryParam"/> <include refid="fwbsh-queryParam"/>
order by djsj desc order by djsj desc
</select> </select>
<select id="selectSfzPageByFwbsh" resultType="com.founder.commonutils.model.newPublicEntity.TbStZtypFwbsh"> <select id="selectSfzPageByFwbsh" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbStZtypFwbsh">
select select
<include refid="fwbsh-queryColumn"/> <include refid="fwbsh-queryColumn"/>
from tb_st_ztyp_fwbsh from tb_st_ztyp_fwbsh
...@@ -68,163 +68,6 @@ ...@@ -68,163 +68,6 @@
WHERE tbsh.XXSC_PDBZ = '0' WHERE tbsh.XXSC_PDBZ = '0'
and tbsh.ASJXGFWBZH_FWBZH = LOWER(#{hm,jdbcType=VARCHAR})) and tbsh.ASJXGFWBZH_FWBZH = LOWER(#{hm,jdbcType=VARCHAR}))
</select> </select>
<select id="queryAjypfxData" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjypFxPojo">
select th.thbh as thbh,
th.thglajsl as ajCount,
ifnull(th.thgljlajsl,0) as jlajCount,
th.thglxyrsl as xyrCount,
th.thglzdgzyrsl as zdgzyrCount
from tb_yw_shse_th th
<where>
1 = 1
<if test="ajlx == '00'">
and th.thglxyrsl <![CDATA[>=]]> 3
and th.thglajsl <![CDATA[>=]]> 3
</if>
<if test="ajlx == '01'">
and th.thglxyrsl <![CDATA[>=]]> 3
and th.thglajsl = 2
</if>
<if test="ajlx == '10'">
and th.thglxyrsl = 2
and th.thglajsl <![CDATA[>=]]> 3
</if>
<if test="ajlx == '11'">
and th.thglxyrsl = 2
and th.thglajsl = 2
</if>
<if test="(ryxm != null and ryxm != '') or (hjd != null and hjd != '')">
and th.thbh in (select thxyr.thbh from tb_yw_shse_thglxyr thxyr
<where>
1 = 1
<if test="ryxm != null and ryxm != ''">
and thxyr.xm = #{ryxm}
</if>
<if test="hjd != null and hjd != ''">
and thxyr.hjddm = #{hjd}
</if>
</where>
)
</if>
<if test="(ladwdm != null and ladwdm != '') or (ajlbdm != null and ajlbdm != '') or (ajmc != null and ajmc != '')
or startDate != null or endDate != null">
and th.thbh in (
select thbh
from tb_yw_shse_thglasj thaj
<where>
1 = 1
<if test="ajlbdm != null and ajlbdm != ''">
and thaj.ajlbdm = #{ajlbdm}
</if>
<if test="ajmc != null and ajmc != ''">
thaj.ajmc like '%${ajmc}%'
</if>
<if test="startDate != null">
and thaj.larq >= #{startDate, jdbcType=DATE}
</if>
<if test="endDate != null">
and thaj.larq <![CDATA[<=]]> #{endDate, jdbcType=DATE}
</if>
<if test="ladwdm != null and ladwdm != ''">
and thaj.ladwdm in (select code from sys_dictitem_xz where code_lev1
=#{ladwdm, jdbcType=VARCHAR}
or code_lev2 =#{ladwdm, jdbcType=VARCHAR} or code_lev3 =#{ladwdm, jdbcType=VARCHAR}
or code_lev4 =#{ladwdm, jdbcType=VARCHAR} or code_lev5 =#{ladwdm, jdbcType=VARCHAR}
)
</if>
</where>
)
</if>
</where>
</select>
<select id="queryAjypfxCount" resultType="java.lang.Integer">
select count(th.THBH)
from tb_yw_shse_th th
<where>
1 = 1
<if test="ajlx == '00'">
and th.thglxyrsl <![CDATA[>=]]> 3
and th.thglajsl <![CDATA[>=]]> 3
</if>
<if test="ajlx == '01'">
and th.thglxyrsl <![CDATA[>=]]> 3
and th.thglajsl = 2
</if>
<if test="ajlx == '10'">
and th.thglxyrsl = 2
and th.thglajsl <![CDATA[>=]]> 3
</if>
<if test="ajlx == '11'">
and th.thglxyrsl = 2
and th.thglajsl = 2
</if>
<if test="(ryxm != null and ryxm != '') or (hjd != null and hjd != '')">
and th.thbh in (select thxyr.thbh from tb_yw_shse_thglxyr thxyr
<where>
1 = 1
<if test="ryxm != null and ryxm != ''">
and thxyr.xm = #{ryxm}
</if>
<if test="hjd != null and hjd != ''">
and thxyr.hjddm = #{hjd}
</if>
</where>
)
</if>
<if test="(ladwdm != null and ladwdm != '') or (ajlbdm != null and ajlbdm != '') or (ajmc != null and ajmc != '')
or startDate != null or endDate != null">
and th.thbh in (
select thbh
from tb_yw_shse_thglasj thaj
<where>
1 = 1
<if test="ajlbdm != null and ajlbdm != ''">
and thaj.ajlbdm = #{ajlbdm}
</if>
<if test="ajmc != null and ajmc != ''">
thaj.ajmc like '%${ajmc}%'
</if>
<if test="startDate != null">
and thaj.larq >= #{startDate, jdbcType=DATE}
</if>
<if test="endDate != null">
and thaj.larq <![CDATA[<=]]> #{endDate, jdbcType=DATE}
</if>
<if test="ladwdm != null and ladwdm != ''">
and thaj.ladwdm in (SELECT code FROM sys_dictitem_xz WHERE code_lev1
=#{ladwdm, jdbcType=VARCHAR}
or code_lev2 =#{ladwdm, jdbcType=VARCHAR} or code_lev3 =#{ladwdm, jdbcType=VARCHAR}
or code_lev4 =#{ladwdm, jdbcType=VARCHAR} or code_lev5 =#{ladwdm, jdbcType=VARCHAR}
)
</if>
</where>
)
</if>
</where>
</select>
<select id="getThConnectPhoneList" resultType="java.util.Map">
select thxyr.ZJHM as "xyrZjhm", callInfo.DFHM as "dfhm"
from TB_YW_SHSE_THGLXYR thxyr
left join HD_CALL_LOG callLog on thxyr.ZJHM = callLog.CKRSFZH and callLog.SCBZ = 0
left join HD_CALL_INFO callInfo
on callLog.JZHM = callInfo.BJHM and callInfo.SCBZ = 0 and length(callInfo.START_TIME) = 16
where thxyr.THBH = #{ thbh,jdbcType= VARCHAR }
group by thxyr.ZJHM, callInfo.DFHM
</select>
<select id="getThConnectIpList" resultType="java.util.Map">
select thxyr.ZJHM as "xyrZjhm", netConn.TGR_IP as "dfip"
from TB_YW_SHSE_THGLXYR thxyr
left join TB_YW_NETWORK_CONN netConn on thxyr.ZJHM = netConn.XYR_ZJHM
where thxyr.THBH = #{ thbh,jdbcType= VARCHAR }
group by thxyr.ZJHM, netConn.TGR_IP
</select>
<select id="getThCashAccountList" resultType="java.util.Map">
select thxyr.ZJHM as "xyrZjhm", bankTrans.SKR_YHKH as "cashAccount"
from TB_YW_SHSE_THGLXYR thxyr
left join TB_YW_BANK_TRANS_INFO bankTrans on thxyr.ZJHM = bankTrans.XYR_ZJHM
where thxyr.THBH = #{ thbh,jdbcType= VARCHAR }
group by thxyr.ZJHM, bankTrans.SKR_YHKH;
</select>
<sql id="fwbsh-queryParam"> <sql id="fwbsh-queryParam">
<if test="fwbsh.fwbshLb != null and fwbsh.fwbshLb != ''"> <if test="fwbsh.fwbshLb != null and fwbsh.fwbshLb != ''">
<choose> <choose>
...@@ -245,6 +88,9 @@ ...@@ -245,6 +88,9 @@
<if test="fwbsh.unitcode != null and fwbsh.unitcode != ''"> <if test="fwbsh.unitcode != null and fwbsh.unitcode != ''">
and XXDJDW_GAJGJGDM = #{fwbsh.unitcode,jdbcType=VARCHAR} and XXDJDW_GAJGJGDM = #{fwbsh.unitcode,jdbcType=VARCHAR}
</if> </if>
<if test="fwbsh.xxdjryXm != null and fwbsh.xxdjryXm != ''">
and XXDJRY_XM like concat('%',#{fwbsh.xxdjryXm,jdbcType=VARCHAR},'%')
</if>
<if test="fwbsh.unitcodeList != null and fwbsh.unitcodeList.size() > 0"> <if test="fwbsh.unitcodeList != null and fwbsh.unitcodeList.size() > 0">
and and
<foreach collection="unitcodeList" item="dws" open="(" close=")" separator=" or "> <foreach collection="unitcodeList" item="dws" open="(" close=")" separator=" or ">
...@@ -279,4 +125,198 @@ ...@@ -279,4 +125,198 @@
xxsc_pdbz, xxsc_pdbz,
(select name from sys_dictitem where GROUPID = 'CODE_CBYP_BSHLX' and code = fwbsh_lb) as fwbshLbStr (select name from sys_dictitem where GROUPID = 'CODE_CBYP_BSHLX' and code = fwbsh_lb) as fwbshLbStr
</sql> </sql>
<select id="selectHmCountByAsjbh" resultType="java.lang.Integer">
select count(1)
from (
select ASJXGFWBZH_FWBZH as GJC, ASJXGFWBZH_FWBZH_FWBZHLBDM as BSHLX
from tb_xw_asjxgfwbzh
where ASJBH = #{asjbh,jdbcType=VARCHAR}
and XXSC_PDBZ = '0'
and
<foreach collection="temp" item="items" open="(" close=")" separator=" and ">
ASJXGFWBZH_FWBZH not in
<foreach collection="items" item="item" open="(" close=")" separator=",">
LOWER(#{item,jdbcType=VARCHAR})
</foreach>
</foreach>
group by ASJXGFWBZH_FWBZH,ASJXGFWBZH_FWBZH_FWBZHLBDM
)a
</select>
<select id="selectHmByAsjbh" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select ASJXGFWBZH_FWBZH AS id,
concat(( SELECT NAME FROM sys_dictitem WHERE GROUPID = 'CODE_CBYP_BSHLX' AND CODE = ASJXGFWBZH_FWBZH_FWBZHLBDM ),':',ASJXGFWBZH_FWBZH) AS NAME,
#{asjbh,jdbcType=VARCHAR} as parentId,
case when ASJXGFWBZH_FWBZH_FWBZHLBDM='01' then 'sjk'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='02' then 'imsi'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='03' then 'yhk'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='04' then 'yhk'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='05' then 'yhk'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='06' then 'yhk'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='07' then 'yhk'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='08' then 'wlzh'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='09' then 'wlzh'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='10' then 'url'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='11' then 'email'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='12' then 'qq'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='13' then 'wxid'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='14' then 'yxh'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='15' then 'wbzh'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='16' then 'idcard'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='17' then 'mac'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='18' then 'cjh'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='19' then 'imei'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='20' then 'ip'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='21' then 'zfb'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='22' then 'cph'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='23' then 'app'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='24' then 'qq'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='25' then 'wxid'
when ASJXGFWBZH_FWBZH_FWBZHLBDM='99' then 'other'
end as Type
from tb_xw_asjxgfwbzh
where ASJBH = #{asjbh,jdbcType=VARCHAR}
and XXSC_PDBZ = '0'
and
<foreach collection="temp" item="items" open="(" close=")" separator=" and ">
ASJXGFWBZH_FWBZH not in
<foreach collection="items" item="item" open="(" close=")" separator=",">
LOWER(#{item,jdbcType=VARCHAR})
</foreach>
</foreach>
group by ASJXGFWBZH_FWBZH, ASJXGFWBZH_FWBZH_FWBZHLBDM
</select>
<select id="selectAjByHm" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select asj.asjbh as id,
concat(asj.asjbh,(select name from sys_dictitem where GROUPID = 'CODE_AJLB' and CODE = asj.AJLBDM)) as name,
#{fwbsh,jdbcType=VARCHAR} as parentId,
'lawcase' as Type
from tb_st_asj asj
where asj.XXSC_PDBZ = '0'
AND ASJBH IN (select tbsh.ASJBH
from tb_xw_asjxgfwbzh tbsh
where XXSC_PDBZ = '0'
AND tbsh.ASJXGFWBZH_FWBZH = LOWER(#{fwbsh,jdbcType=VARCHAR}))
and
<foreach collection="temp" item="items" open="(" close=")" separator=" and ">
ASJBH not in
<foreach collection="items" item="item" open="(" close=")" separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</foreach>
</select>
<select id="getXyrByAsjbhWithOutZjhm" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select ZHFZXYR_CYZJ_ZJHM as id,
concat('嫌疑人:',ZHFZXYR_CYZJ_ZJHM) as name,
'person' as type,
'嫌疑人' as value,
#{asjbh,jdbcType=VARCHAR} as parentId
from tb_xw_zbfzxyr
where XXSC_PDBZ = '0'
and asjbh = #{asjbh,jdbcType=VARCHAR}
<if test="zjhms != null">
and ZHFZXYR_CYZJ_ZJHM not in
<foreach collection="zjhms" item="zjhm" open="(" separator="," close=")">
#{zjhm,jdbcType=VARCHAR}
</foreach>
</if>
group by ZHFZXYR_CYZJ_ZJHM
union
select KYXSRY_ZJHM as id,
'可疑人员:' || KYXSRY_ZJHM as name,
'person' as type,
'可疑人员' as value,
#{asjbh,jdbcType=VARCHAR} as parentId
from tb_xw_kyxs_ry
where XXSC_PDBZ = '0'
and asjbh = #{asjbh,jdbcType=VARCHAR}
<if test="zjhms != null">
and KYXSRY_ZJHM not in
<foreach collection="zjhms" item="zjhm" open="(" separator="," close=")">
#{zjhm,jdbcType=VARCHAR}
</foreach>
</if>
group by KYXSRY_ZJHM
</select>
<select id="getTarByZjhm" resultType="java.util.Map">
select distinct ZHFZXYR_CYZJ_ZJHM as ZJHM,
ZHFZXYR_XM as XM
from tb_xw_zbfzxyr
where XXSC_PDBZ = '0'
and ZHFZXYR_CYZJ_ZJHM != #{zjhm,jdbcType=VARCHAR}
and ASJBH in (
select distinct ASJBH
from tb_xw_zbfzxyr
where ZHFZXYR_CYZJ_ZJHM = #{zjhm,jdbcType=VARCHAR}
and xxsc_pdbz = '0')
</select>
<select id="selectAjNodeByZjhmWithOutAsjbh"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select distinct asj.ASJBH as id,
concat(asj.asjbh,(select name from sys_dictitem where GROUPID = 'CODE_AJLB' and CODE = asj.AJLBDM)) as name,
'lawcase' as type,
'嫌疑人' as value,
#{zjhm,jdbcType=VARCHAR} as parentId
from tb_st_asj asj,
tb_xw_zbfzxyr xyr
where asj.ASJBH = xyr.ASJBH
and asj.XXSC_PDBZ = '0'
and xyr.XXSC_PDBZ = '0'
and xyr.ZHFZXYR_CYZJ_ZJHM = #{zjhm,jdbcType=VARCHAR}
and asj.asjbh != #{asjbh,jdbcType=VARCHAR}
</select>
<select id="selectAjNodeByKyryZjhmWithOutAsjbh"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select distinct asj.ASJBH as id,
concat(asj.asjbh,(select name from sys_dictitem where GROUPID = 'CODE_AJLB' and CODE = asj.AJLBDM)) as name,
'lawcase' as type,
'嫌疑人' as value,
#{zjhm,jdbcType=VARCHAR} as parentId
from tb_st_asj asj,
tb_xw_kyxs_ry xyr
where asj.ASJBH = xyr.ASJBH
and asj.XXSC_PDBZ = '0'
and xyr.XXSC_PDBZ = '0'
and xyr.KYXSRY_ZJHM = #{zjhm,jdbcType=VARCHAR}
and asj.asjbh != #{asjbh,jdbcType=VARCHAR}
</select>
<select id="selectDhNodeByZjhm" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select callInfo.DFHM as id,
concat('共同联系电话:',callInfo.DFHM) as name,
'sjk' as type,
#{zjhm,jdbcType=VARCHAR} as parentId
from hd_call_log callLog
left join hd_call_info callInfo
on callLog.JZHM = callInfo.BJHM and callInfo.SCBZ = 0 and length(callInfo.START_TIME) = 16
where callLog.CKRSFZH = #{zjhm,jdbcType=VARCHAR}
and callLog.SCBZ = 0
group by callInfo.DFHM
</select>
<select id="getYhkZjlByZjhm" resultType="java.util.Map">
select fkr_yhkh as YHKH,
skr_yhkh as DFKH,
skr_zhmc as DFXM,
jyyh as YHMC,
xyr_zjhm as ZJHM
from tb_yw_bank_trans_info
where XYR_ZJHM = #{zjhm,jdbcType=VARCHAR}
</select>
<select id="selectYhkNodeByZjhm" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select SKR_YHKH as id,
concat('共同交易银行卡号:',SKR_YHKH) as name,
'yhk' as type,
#{zjhm,jdbcType=VARCHAR} as parentId
from tb_yw_bank_trans_info
where XYR_ZJHM = #{zjhm,jdbcType=VARCHAR}
and ZZLX = '转出'
group by SKR_YHKH;
</select>
<select id="selectIpNodeByZjhm" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select netConn.TGR_IP as id,
concat('共同访问ip:',TGR_IP) as name,
'ip' as type,
#{zjhm,jdbcType=VARCHAR} as parentId
from tb_yw_network_conn netConn
where netConn.XYR_ZJHM = #{zjhm,jdbcType=VARCHAR}
group by netConn.TGR_IP
</select>
</mapper> </mapper>
package com.founder.publicapi.service;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.KshHdExcelImport;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.KsjResultPojo;
import com.founder.commonutils.util.StringUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
/**
* KshImportListener
*
* @author yangyang
*/
@Data
@RequiredArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class KshHdImportListener extends AnalysisEventListener<KshHdExcelImport> {
private List<KshHdExcelImport> list = new ArrayList<>();// 缓存的数据列表
KsjResultPojo ksjResultPojo = new KsjResultPojo();// 最终对象数据
List<KsjResultPojo.Nodes> nodes = new ArrayList<>();// 存储所有节点去重后数据
List<KsjResultPojo.Links> links = new ArrayList<>();// 存储所有节点关系
@Override
public void invoke(KshHdExcelImport data, AnalysisContext context) {
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
List<String> listGtgxAll = new ArrayList<>();// 高亮节点记录
list.stream().forEach(p->{
List<KshHdExcelImport> listAllSource = new ArrayList<>();// 存储过滤后总数居
List<String> listGtgxSource1And2 = new ArrayList<>();// 存储过滤后总手机号码
List<String> listGtgxSource1And2Distinct = new ArrayList<>();// 存储去重的过滤后总手机号码
List<KshHdExcelImport> listDdGl = list.stream().filter(s -> (p.getSource().equals(s.getSource())&&p.getTarget().equals(s.getTarget()))||(p.getSource().equals(s.getTarget())&&p.getTarget().equals(s.getSource()))).collect(Collectors.toList());// 计算通话次数
List<KshHdExcelImport> listGtgxSource1 = list.stream().filter(s -> (p.getSource().equals(s.getSource()))).collect(Collectors.toList());listAllSource.addAll(listGtgxSource1);
List<KshHdExcelImport> listGtgxSource1Distinct = listGtgxSource1.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshHdExcelImport::getTarget))), ArrayList::new));// 计算共同联系人高亮
List<KshHdExcelImport> listGtgxSource2 = list.stream().filter(s -> (p.getSource().equals(s.getTarget()))).collect(Collectors.toList());listAllSource.addAll(listGtgxSource1);
List<KshHdExcelImport> listGtgxSource2Distinct = listGtgxSource2.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshHdExcelImport::getSource))), ArrayList::new));// 计算共同联系人高亮
listAllSource.stream().forEach(h->{
listGtgxSource1And2.add(h.getSource());
listGtgxSource1And2.add(h.getTarget());
});
listGtgxSource1And2Distinct = listGtgxSource1And2.stream().distinct().collect(Collectors.toList());
// 组装去重数据
KsjResultPojo.Nodes nodeBjhm = new KsjResultPojo.Nodes();
nodeBjhm.setId(p.getSource());
nodeBjhm.setLabel(p.getSource());
KsjResultPojo.Nodes.Properties propertiesBjhm = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeBjhm, propertiesBjhm);
if(listGtgxSource1Distinct.size()>1||listGtgxSource2Distinct.size()>1||listGtgxSource1And2Distinct.size()>2){
propertiesBjhm.setBoderColor("#FA0505");// 高亮
listGtgxAll.add(p.getSource());// 记录高亮节点
}else{
propertiesBjhm.setBoderColor("");// 高亮
}
propertiesBjhm.setImgType("sjk");// 图标
nodeBjhm.setProperties(propertiesBjhm);
nodes.add(nodeBjhm);
List<KshHdExcelImport> listAllTarget = new ArrayList<>();// 存储过滤后总数居
List<String> listGtgxTarget1And2 = new ArrayList<>();// 存储过滤后总手机号码
List<String> listGtgxTarget1And2Distinct = new ArrayList<>();// 存储去重的过滤后总手机号码
List<KshHdExcelImport> listGtgxTarget1 = list.stream().filter(s -> (p.getTarget().equals(s.getSource()))).collect(Collectors.toList());listAllTarget.addAll(listGtgxTarget1);
List<KshHdExcelImport> listGtgxTarget1Distinct = listGtgxTarget1.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshHdExcelImport::getTarget))), ArrayList::new));// 计算共同联系人高亮
List<KshHdExcelImport> listGtgxTarget2 = list.stream().filter(s -> (p.getTarget().equals(s.getTarget()))).collect(Collectors.toList());listAllTarget.addAll(listGtgxTarget2);
List<KshHdExcelImport> listGtgxTarget2Distinct = listGtgxTarget2.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshHdExcelImport::getSource))), ArrayList::new));// 计算共同联系人高亮
listAllTarget.stream().forEach(h->{
listGtgxTarget1And2.add(h.getSource());
listGtgxTarget1And2.add(h.getTarget());
});
listGtgxTarget1And2Distinct = listGtgxTarget1And2.stream().distinct().collect(Collectors.toList());
// 组装去重数据
KsjResultPojo.Nodes nodeDfhm = new KsjResultPojo.Nodes();
nodeDfhm.setId(p.getTarget());
nodeDfhm.setLabel(p.getTarget());
KsjResultPojo.Nodes.Properties propertiesDfhm = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeDfhm, propertiesDfhm);
if (listGtgxTarget1Distinct.size() > 1 || listGtgxTarget2Distinct.size() > 1 || listGtgxTarget1And2Distinct.size() > 2) {
propertiesDfhm.setBoderColor("#FA0505");// 高亮
listGtgxAll.add(p.getTarget());// 记录高亮节点
} else {
propertiesDfhm.setBoderColor("");// 高亮
}
propertiesDfhm.setImgType("sjk");// 图标
nodeDfhm.setProperties(propertiesDfhm);
nodes.add(nodeDfhm);
// 组装关系数据
KsjResultPojo.Links linkBsh = new KsjResultPojo.Links();
linkBsh.setSource(p.getSource());
linkBsh.setTarget(p.getTarget());
linkBsh.setLabel(String.valueOf(listDdGl.size()));
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkBsh, propertiesLink);
linkBsh.setProperties(propertiesLink);
links.add(linkBsh);
});
if(nodes.size()>0){
nodes.stream().forEach(h->{
if(listGtgxAll.contains(h.getId())){// nodes中有存在高亮集合中 数据均进行高亮
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
properties.setBoderColor("#FA0505");
properties.setId(h.getId());
properties.setLabel(h.getLabel());
properties.setImgType(h.getProperties().getImgType());
h.setProperties(properties);
}
});
// nodes数据根据id去重
List<KsjResultPojo.Nodes> nodesDistinct = nodes.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KsjResultPojo.Nodes::getId))), ArrayList::new));
ksjResultPojo.setNodes(nodesDistinct);
ksjResultPojo.setLinks(links);
}
// 存储完成清理list
list.clear();
}
}
package com.founder.publicapi.service;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.KshYhkExcelImport;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.KshYhkExcelImport;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.KsjResultPojo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
/**
* KshImportListener
*
* @author yangyang
*/
@Data
@RequiredArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class KshYhkImportListener extends AnalysisEventListener<KshYhkExcelImport> {
private List<KshYhkExcelImport> list = new ArrayList<>();// 缓存的数据列表
KsjResultPojo ksjResultPojo = new KsjResultPojo();// 最终对象数据
List<KsjResultPojo.Nodes> nodes = new ArrayList<>();// 存储所有节点去重后数据
List<KsjResultPojo.Links> links = new ArrayList<>();// 存储所有节点关系
@Override
public void invoke(KshYhkExcelImport data, AnalysisContext context) {
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
List<String> listGtgxAll = new ArrayList<>();// 高亮节点记录
list.stream().forEach(p->{
List<KshYhkExcelImport> listDdGl = list.stream().filter(s -> (p.getSource().equals(s.getSource())&&p.getTarget().equals(s.getTarget()))||(p.getSource().equals(s.getTarget())&&p.getTarget().equals(s.getSource()))).collect(Collectors.toList());// 计算交易次数
List<KshYhkExcelImport> listAllSource = new ArrayList<>();// 存储过滤后总数居
List<String> listGtgxSource1And2 = new ArrayList<>();// 存储过滤后总手机号码
List<String> listGtgxSource1And2Distinct = new ArrayList<>();// 存储去重的过滤后总手机号码
List<KshYhkExcelImport> listGtgxSource1 = list.stream().filter(s -> (p.getSource().equals(s.getSource()))).collect(Collectors.toList());listAllSource.addAll(listGtgxSource1);
List<KshYhkExcelImport> listGtgxSource1Distinct = listGtgxSource1.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshYhkExcelImport::getTarget))), ArrayList::new));// 计算共同联系人高亮
List<KshYhkExcelImport> listGtgxSource2 = list.stream().filter(s -> (p.getSource().equals(s.getTarget()))).collect(Collectors.toList());listAllSource.addAll(listGtgxSource1);
List<KshYhkExcelImport> listGtgxSource2Distinct = listGtgxSource2.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshYhkExcelImport::getSource))), ArrayList::new));// 计算共同联系人高亮
listAllSource.stream().forEach(h->{
listGtgxSource1And2.add(h.getSource());
listGtgxSource1And2.add(h.getTarget());
});
listGtgxSource1And2Distinct = listGtgxSource1And2.stream().distinct().collect(Collectors.toList());
// 组装去重数据
KsjResultPojo.Nodes nodeBjhm = new KsjResultPojo.Nodes();
nodeBjhm.setId(p.getSource());
nodeBjhm.setLabel(p.getSource());
KsjResultPojo.Nodes.Properties propertiesBjhm = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeBjhm, propertiesBjhm);
if(listGtgxSource1Distinct.size()>1||listGtgxSource2Distinct.size()>1||listGtgxSource1And2Distinct.size()>2){
propertiesBjhm.setBoderColor("#FA0505");// 高亮
listGtgxAll.add(p.getSource());// 记录高亮节点
}else{
propertiesBjhm.setBoderColor("");// 高亮
}
propertiesBjhm.setImgType("yhk");// 图标
nodeBjhm.setProperties(propertiesBjhm);
nodes.add(nodeBjhm);
List<KshYhkExcelImport> listAllTarget = new ArrayList<>();// 存储过滤后总数居
List<String> listGtgxTarget1And2 = new ArrayList<>();// 存储过滤后总手机号码
List<String> listGtgxTarget1And2Distinct = new ArrayList<>();// 存储去重的过滤后总手机号码
List<KshYhkExcelImport> listGtgxTarget1 = list.stream().filter(s -> (p.getTarget().equals(s.getSource()))).collect(Collectors.toList());listAllTarget.addAll(listGtgxTarget1);
List<KshYhkExcelImport> listGtgxTarget1Distinct = listGtgxTarget1.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshYhkExcelImport::getTarget))), ArrayList::new));// 计算共同联系人高亮
List<KshYhkExcelImport> listGtgxTarget2 = list.stream().filter(s -> (p.getTarget().equals(s.getTarget()))).collect(Collectors.toList());listAllTarget.addAll(listGtgxTarget2);
List<KshYhkExcelImport> listGtgxTarget2Distinct = listGtgxTarget2.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KshYhkExcelImport::getSource))), ArrayList::new));// 计算共同联系人高亮
listAllTarget.stream().forEach(h->{
listGtgxTarget1And2.add(h.getSource());
listGtgxTarget1And2.add(h.getTarget());
});
listGtgxTarget1And2Distinct = listGtgxTarget1And2.stream().distinct().collect(Collectors.toList());
// 组装去重数据
KsjResultPojo.Nodes nodeDfhm = new KsjResultPojo.Nodes();
nodeDfhm.setId(p.getTarget());
nodeDfhm.setLabel(p.getTarget());
KsjResultPojo.Nodes.Properties propertiesDfhm = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeDfhm, propertiesDfhm);
if (listGtgxTarget1Distinct.size() > 1 || listGtgxTarget2Distinct.size() > 1 || listGtgxTarget1And2Distinct.size() > 2) {
propertiesDfhm.setBoderColor("#FA0505");// 高亮
listGtgxAll.add(p.getTarget());// 记录高亮节点
} else {
propertiesDfhm.setBoderColor("");// 高亮
}
propertiesDfhm.setImgType("yhk");// 图标
nodeDfhm.setProperties(propertiesDfhm);
nodes.add(nodeDfhm);
// 组装关系数据
KsjResultPojo.Links linkBsh = new KsjResultPojo.Links();
linkBsh.setSource(p.getSource());
linkBsh.setTarget(p.getTarget());
linkBsh.setLabel(String.valueOf(listDdGl.size()));
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkBsh, propertiesLink);
linkBsh.setProperties(propertiesLink);
links.add(linkBsh);
});
if(nodes.size()>0){
nodes.stream().forEach(h->{
if(listGtgxAll.contains(h.getId())){// nodes中有存在高亮集合中 数据均进行高亮
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
properties.setBoderColor("#FA0505");
properties.setId(h.getId());
properties.setLabel(h.getLabel());
properties.setImgType(h.getProperties().getImgType());
h.setProperties(properties);
}
});
// nodes数据根据id去重
List<KsjResultPojo.Nodes> nodesDistinct = nodes.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KsjResultPojo.Nodes::getId))), ArrayList::new));
ksjResultPojo.setNodes(nodesDistinct);
ksjResultPojo.setLinks(links);
}
// 存储完成清理list
list.clear();
}
}
package com.founder.publicapi.service.serviceimpl; package com.founder.publicapi.service.serviceimpl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.founder.commonutils.model.newPublicEntity.*; import com.founder.commonutils.model.newPublicEntity.*;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo; import com.founder.commonutils.model.newPublicEntity.ztypEntity.*;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.AjypFxPojo; import com.founder.commonutils.model.newPublicEntity.ztypEntity.AjQueryParam;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.KsjResultPojo; import com.founder.commonutils.model.newPublicEntity.ztypEntity.TbStZtypFwbsh;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.ZpajxxEntity;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.ZpajxxModel;
import com.founder.commonutils.util.JsonUtils;
import com.founder.commonutils.util.JwtUser;
import com.founder.commonutils.util.KeyUtil;
import com.founder.commonutils.util.StringUtil;
import com.founder.publicapi.mapper.mysqlMapper.TbStAsjMapper; import com.founder.publicapi.mapper.mysqlMapper.TbStAsjMapper;
import com.founder.publicapi.mapper.mysqlMapper.TbStZtypFwbshMapper; import com.founder.publicapi.mapper.mysqlMapper.TbStZtypFwbshMapper;
import com.founder.publicapi.mapper.mysqlMapper.ZtypMapper; import com.founder.publicapi.mapper.mysqlMapper.ZtypMapper;
import com.founder.publicapi.service.ZtypService; import com.founder.publicapi.service.ZtypService;
import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -32,7 +41,40 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -32,7 +41,40 @@ public class ZtypServiceImpl implements ZtypService {
@Override @Override
public List<ZpajxxEntity> getZpajxx(ZpajxxModel model) { public List<ZpajxxEntity> getZpajxx(ZpajxxModel model) {
return ztypMapper.getZpajxx(model);
// 取出分页的案件信息
List<ZpajxxEntity> getZpajxx = ztypMapper.getZpajxx(model);
getZpajxx.stream().forEach(p->{
String ajxlb = ztypMapper.getZpAsjbzxx(p.getAsjbh());
if(null!=ajxlb){
p.setAjxlb(ajxlb);
}
ZpajxxEntity zpajxxEntity = ztypMapper.getZpAsjBshxx(p.getAsjbh());
if(null!=zpajxxEntity){
String mobile = zpajxxEntity.getMobile();
String yhkh = zpajxxEntity.getYhkh();
String wx = zpajxxEntity.getWx();
String personid = zpajxxEntity.getPersonid();
if(null != mobile){
p.setMobile(mobile);
}
if(null != yhkh){
p.setYhkh(yhkh);
}
if(null != wx){
p.setWx(wx);
}
if(null != personid){
p.setPersonid(personid);
}
}
});
return getZpajxx;
} }
@Override @Override
...@@ -95,9 +137,10 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -95,9 +137,10 @@ public class ZtypServiceImpl implements ZtypService {
} }
return records; return records;
} }
@Override @Override
public Integer queryAjypfxCount(AjQueryParam requestParam) { public Integer queryAjypfxCount(AjQueryParam requestParam) {
return ztypMapper .queryAjypfxCount(requestParam); return ztypMapper.queryAjypfxCount(requestParam);
} }
private void setThNames(List<AjypFxPojo> records) { private void setThNames(List<AjypFxPojo> records) {
...@@ -128,6 +171,7 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -128,6 +171,7 @@ public class ZtypServiceImpl implements ZtypService {
} }
} }
} }
private void setThPhoneAndIpAndCashNum(List<AjypFxPojo> records, String fxwd, int commonRelationshipNum) { private void setThPhoneAndIpAndCashNum(List<AjypFxPojo> records, String fxwd, int commonRelationshipNum) {
for (AjypFxPojo thLabel : records) { for (AjypFxPojo thLabel : records) {
String thbh = thLabel.getThbh(); String thbh = thLabel.getThbh();
...@@ -160,6 +204,7 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -160,6 +204,7 @@ public class ZtypServiceImpl implements ZtypService {
} }
} }
} }
private void setThTjCount(List<Map<String, String>> thXyrTjList, String commonPhoneCount, AjypFxPojo thLabel, int commonRelationshipNum) { private void setThTjCount(List<Map<String, String>> thXyrTjList, String commonPhoneCount, AjypFxPojo thLabel, int commonRelationshipNum) {
Map<String, Integer> connectPhoneMap = new HashMap<>(256); Map<String, Integer> connectPhoneMap = new HashMap<>(256);
Integer commonTjCount = 0; Integer commonTjCount = 0;
...@@ -207,29 +252,34 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -207,29 +252,34 @@ public class ZtypServiceImpl implements ZtypService {
return MapRestResult.error("入参类型错误!"); return MapRestResult.error("入参类型错误!");
} }
if ("personid".equals(fwbsh.getFwbshLb())) { // 类型为身份证号 if ("personid".equals(fwbsh.getFwbshLb())) { // 类型为身份证号
CountDownLatch countDownLatch = new CountDownLatch(4); CountDownLatch countDownLatch = new CountDownLatch(6);
String zjhm = root.getId();// 证件号入参 String zjhm = root.getId();// 证件号入参
// 证件号码加入节点 // 证件号码加入节点
KsjResultPojo.Nodes nodeZjhm = new KsjResultPojo.Nodes(); KsjResultPojo.Nodes nodeZjhm = new KsjResultPojo.Nodes();
nodeZjhm.setId(zjhm); nodeZjhm.setId(zjhm);
nodeZjhm.setLabel("证件号码:" + zjhm); nodeZjhm.setLabel("证件号码:" + zjhm);
nodeZjhm.setImgType("idcard"); KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
nodeZjhm.setProperties(JSONObject.toJSON(nodeZjhm)); BeanUtils.copyProperties(nodeZjhm, properties);
properties.setBoderColor("#FA0505");// 高亮
properties.setImgType("idcard");// 图标
nodeZjhm.setProperties(properties);
nodes.add(nodeZjhm); nodes.add(nodeZjhm);
// 查询人员案件信息 // 查询人员案件信息
class Ra extends Thread{ class Ra extends Thread {
String value; String value;
void setValue(String zjbh){
void setValue(String zjbh) {
this.value = zjbh; this.value = zjbh;
} }
@Override @Override
public void run(){ public void run() {
List<String> listResult = new ArrayList<>(); List<String> listResult = new ArrayList<>();
try { try {
List<Map<String,Object>> asjList = tbStAsjMapper.getAsjxxByZjhm(value); List<Map<String, Object>> asjList = tbStAsjMapper.getAsjxxByZjhm(value);
for(Map<String,Object> mapAsj:asjList){ for (Map<String, Object> mapAsj : asjList) {
listResult.add(mapAsj.get("asjbh").toString()); listResult.add(mapAsj.get("asjbh").toString());
} }
listResult.stream().distinct().forEach(obj -> { listResult.stream().distinct().forEach(obj -> {
...@@ -238,8 +288,11 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -238,8 +288,11 @@ public class ZtypServiceImpl implements ZtypService {
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes(); KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(obj); node.setId(obj);
node.setLabel(obj); node.setLabel(obj);
node.setImgType("aj"); KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
node.setProperties(JSONObject.toJSON(node)); BeanUtils.copyProperties(node, properties);
properties.setBoderColor("");// 高亮
properties.setImgType("aj");// 图标
node.setProperties(properties);
nodes.add(node); nodes.add(node);
// 组装关系数据 // 组装关系数据
...@@ -247,25 +300,29 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -247,25 +300,29 @@ public class ZtypServiceImpl implements ZtypService {
link.setSource(value); link.setSource(value);
link.setTarget(obj); link.setTarget(obj);
link.setLabel("人案"); link.setLabel("人案");
link.setImgType("aj"); KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
link.setProperties(JSONObject.toJSON(link)); BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link); links.add(link);
}); });
countDownLatch.countDown(); countDownLatch.countDown();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
countDownLatch.countDown();
} }
} }
} }
// 查询人员手机和相关信息线程 // 查询人员手机和相关信息线程
class Phone extends Thread{ class Phone extends Thread {
String value; String value;
void setValue(String zjbh){
void setValue(String zjbh) {
this.value = zjbh; this.value = zjbh;
} }
@Override @Override
public void run(){ public void run() {
List<String> listResult = new ArrayList<>(); List<String> listResult = new ArrayList<>();
try { try {
String phone = "15754879533";// 模拟接口 String phone = "15754879533";// 模拟接口
...@@ -273,18 +330,17 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -273,18 +330,17 @@ public class ZtypServiceImpl implements ZtypService {
if (listResult == null) { if (listResult == null) {
listResult = new ArrayList<>(); listResult = new ArrayList<>();
} }
} catch (Exception e) {
listResult = new ArrayList<>();
e.printStackTrace();
}
listResult.stream().distinct().forEach(obj -> { listResult.stream().distinct().forEach(obj -> {
// 组装去重数据 // 组装去重数据
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes(); KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(obj); node.setId(obj);
node.setLabel(obj); node.setLabel(obj);
node.setImgType("sjk"); KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
node.setProperties(JSONObject.toJSON(node)); BeanUtils.copyProperties(node, properties);
properties.setBoderColor("");// 高亮
properties.setImgType("sjk");// 图标
node.setProperties(properties);
nodes.add(node); nodes.add(node);
// 组装关系数据 // 组装关系数据
...@@ -292,22 +348,29 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -292,22 +348,29 @@ public class ZtypServiceImpl implements ZtypService {
link.setSource(value); link.setSource(value);
link.setTarget(obj); link.setTarget(obj);
link.setLabel("机主"); link.setLabel("机主");
link.setImgType("sjk"); KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
link.setProperties(JSONObject.toJSON(link)); BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link); links.add(link);
}); });
countDownLatch.countDown(); countDownLatch.countDown();
}; } catch (Exception e) {
countDownLatch.countDown();
e.printStackTrace();
}
}
} }
// 查询人员车辆 // 查询人员车辆
class Car extends Thread{ class Car extends Thread {
String value; String value;
void setValue(String zjbh){
void setValue(String zjbh) {
this.value = zjbh; this.value = zjbh;
} }
@Override @Override
public void run(){ public void run() {
List<String> listResult = new ArrayList<>(); List<String> listResult = new ArrayList<>();
try { try {
String phone = "蒙AKH824";// 模拟接口 String phone = "蒙AKH824";// 模拟接口
...@@ -315,18 +378,17 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -315,18 +378,17 @@ public class ZtypServiceImpl implements ZtypService {
if (listResult == null) { if (listResult == null) {
listResult = new ArrayList<>(); listResult = new ArrayList<>();
} }
} catch (Exception e) {
listResult = new ArrayList<>();
e.printStackTrace();
}
listResult.stream().distinct().forEach(obj -> { listResult.stream().distinct().forEach(obj -> {
// 组装去重数据 // 组装去重数据
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes(); KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(obj); node.setId(obj);
node.setLabel(obj); node.setLabel(obj);
node.setImgType("cph"); KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
node.setProperties(JSONObject.toJSON(node)); BeanUtils.copyProperties(node, properties);
properties.setBoderColor("");// 高亮
properties.setImgType("cph");// 图标
node.setProperties(properties);
nodes.add(node); nodes.add(node);
// 组装关系数据 // 组装关系数据
...@@ -334,53 +396,178 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -334,53 +396,178 @@ public class ZtypServiceImpl implements ZtypService {
link.setSource(value); link.setSource(value);
link.setTarget(obj); link.setTarget(obj);
link.setLabel("车主"); link.setLabel("车主");
link.setImgType("cph"); KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
link.setProperties(JSONObject.toJSON(link)); BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link); links.add(link);
}); });
countDownLatch.countDown(); countDownLatch.countDown();
} catch (Exception e) {
countDownLatch.countDown();
e.printStackTrace();
}
} }
} }
// 查询人员银行卡号 // 查询人员银行卡号
class Yhkh extends Thread{ class Yhkh extends Thread {
String value; String value;
void setValue(String zjbh){
void setValue(String zjbh) {
this.value = zjbh; this.value = zjbh;
} }
@Override @Override
public void run(){ public void run() {
List<String> listResult = new ArrayList<>();
try { try {
String phone = "6216625552447663148522";// 模拟接口 List<Map<String, String>> zjlList = tbStZtypFwbshMapper.getYhkZjlByZjhm(root.getId());
listResult.add(phone); HashMap<String, Map<String, Integer>> hashMap = new HashMap<>();
if (listResult == null) { for (Map<String, String> map : zjlList) {
listResult = new ArrayList<>(); String yhkh = map.get("YHKH");
if (org.apache.commons.lang.StringUtils.isEmpty(yhkh)) {
continue;
}
String dfkh = map.get("DFKH");
String dfxm = map.get("DFXM");
String yhmc = map.get("YHMC")
+ ((org.apache.commons.lang.StringUtils.isEmpty(dfxm) ? ":" + dfkh : "(" + dfxm + "):") + dfkh);
if (hashMap.containsKey(yhkh)) {
Map<String, Integer> child = hashMap.get(yhkh);
if (child.containsKey(yhmc)) {
child.put(yhmc, child.get(yhmc) + 1);
} else {
child.put(yhmc, 1);
}
} else {
HashMap<String, Integer> child = new HashMap<>();
child.put(yhmc, 1);
hashMap.put(yhmc, child);
}
} }
Set<String> yhkhSet = hashMap.keySet();
for (String yhkh : yhkhSet) {
// 组装去重数据
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(yhkh);
node.setLabel(yhkh);
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(node, properties);
properties.setBoderColor("");// 高亮
properties.setImgType("yhk");// 图标
node.setProperties(properties);
nodes.add(node);
// 组装关系数据
KsjResultPojo.Links link = new KsjResultPojo.Links();
link.setSource(value);
link.setTarget(yhkh);
link.setLabel("卡号");
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link);
}
countDownLatch.countDown();
} catch (Exception e) { } catch (Exception e) {
listResult = new ArrayList<>(); countDownLatch.countDown();
e.printStackTrace(); e.printStackTrace();
} }
}
}
// 查询人员同户关系
class Thgx extends Thread {
String value;
void setValue(String zjbh) {
this.value = zjbh;
}
@Override
public void run() {
List<String> listResult = new ArrayList<>();
try {
String zjhm = "626265618551254321";// 模拟接口
listResult.add(zjhm);
if (listResult == null) {
listResult = new ArrayList<>();
}
listResult.stream().distinct().forEach(obj -> { listResult.stream().distinct().forEach(obj -> {
// 组装去重数据 // 组装去重数据
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes(); KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(obj); node.setId(obj);
node.setLabel(obj); node.setLabel(obj);
node.setImgType("yhk"); KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
node.setProperties(JSONObject.toJSON(node)); BeanUtils.copyProperties(node, properties);
properties.setBoderColor("");// 高亮
properties.setImgType("idcard");// 图标
node.setProperties(properties);
nodes.add(node); nodes.add(node);
// 组装关系数据 // 组装关系数据
KsjResultPojo.Links link = new KsjResultPojo.Links(); KsjResultPojo.Links link = new KsjResultPojo.Links();
link.setSource(value); link.setSource(value);
link.setTarget(obj); link.setTarget(obj);
link.setLabel("卡号"); link.setLabel("同户关系(父子)");
link.setImgType("yhk"); KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
link.setProperties(JSONObject.toJSON(link)); BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link); links.add(link);
}); });
countDownLatch.countDown(); countDownLatch.countDown();
} catch (Exception e) {
countDownLatch.countDown();
e.printStackTrace();
}
}
}
// 查询人员同案关系
class Tagx extends Thread {
String value;
void setValue(String zjbh) {
this.value = zjbh;
}
@Override
public void run() {
List<Map<String, String>> listResult = new ArrayList<>();
try {
listResult = tbStZtypFwbshMapper.getTarByZjhm(root.getId());
if (null == listResult) {
listResult = new ArrayList<>();
}
for (Map<String, String> map : listResult) {
// 组装去重数据
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(map.get("ZJHM"));
node.setLabel(map.get("XM") + ":" + map.get("ZJHM"));
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(node, properties);
properties.setBoderColor("");// 高亮
properties.setImgType("idcard");// 图标
node.setProperties(properties);
nodes.add(node);
// 组装关系数据
KsjResultPojo.Links link = new KsjResultPojo.Links();
link.setSource(value);
link.setTarget(map.get("ZJHM"));
link.setLabel("同案关系");
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link);
}
countDownLatch.countDown();
} catch (Exception e) {
countDownLatch.countDown();
e.printStackTrace();
}
} }
} }
Ra ra = new Ra(); Ra ra = new Ra();
...@@ -398,19 +585,985 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -398,19 +585,985 @@ public class ZtypServiceImpl implements ZtypService {
Yhkh yhkh = new Yhkh(); Yhkh yhkh = new Yhkh();
yhkh.setValue(zjhm); yhkh.setValue(zjhm);
cachedThreadPool.execute(yhkh); cachedThreadPool.execute(yhkh);
Thgx thgx = new Thgx();
thgx.setValue(zjhm);
cachedThreadPool.execute(thgx);
Tagx tagx = new Tagx();
tagx.setValue(zjhm);
cachedThreadPool.execute(tagx);
try { try {
countDownLatch.await(); countDownLatch.await();
cachedThreadPool.shutdown(); cachedThreadPool.shutdown();
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} else if ("aj".equals(fwbsh.getFwbshLb())) {
String asjbh = root.getId();// 案件编号入参
// 案件加入节点
KsjResultPojo.Nodes nodeAsjbh = new KsjResultPojo.Nodes();
nodeAsjbh.setId(asjbh);
nodeAsjbh.setLabel("案件编号:" + asjbh);
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeAsjbh, properties);
properties.setBoderColor("#FA0505");// 高亮
properties.setImgType("aj");// 图标
nodeAsjbh.setProperties(properties);
nodes.add(nodeAsjbh);
//查询案件下的嫌疑人和可疑人员信息并加入根节点中
List<AjThKshfxPojo> xryNodeList = tbStZtypFwbshMapper.getXyrByAsjbhWithOutZjhm(root.getId(), null);
root.setChildrenList(xryNodeList);
List<AjThKshfxPojo> children = root.getChildren();
if (children != null && !children.isEmpty()) {
//嫌疑人证件号码缓存记录列表
ArrayList<String> xyrZjhmList = new ArrayList<>();
//队列(加入根的全部子节点)
LinkedList<AjThKshfxPojo> queue = new LinkedList<>(children);
HashSet<String> temp = new HashSet<>();
while (!queue.isEmpty()) {
//节点出队列
AjThKshfxPojo node = queue.removeFirst();
//如果节点类型为案件
if ("lawcase".equals(node.getType())) {
//查询案件下的不在缓存表中的嫌疑人
List<AjThKshfxPojo> xryList = tbStZtypFwbshMapper.getXyrByAsjbhWithOutZjhm(node.getId(), xyrZjhmList);
node.setChildrenList(xryList);
List<AjThKshfxPojo> nodeChildren = node.getChildren();
//将人员节点加入队列
if (nodeChildren != null && !nodeChildren.isEmpty()) {
for (AjThKshfxPojo nodeChild : nodeChildren) {
if (!temp.contains(nodeChild.getId())) {
temp.add(nodeChild.getId());
queue.add(nodeChild);
}
}
}
continue;
}
//证件号码缓存记录
String zjhm = node.getId();
KsjResultPojo.Nodes nodeZjhm = new KsjResultPojo.Nodes();
nodeZjhm.setId(zjhm);
nodeZjhm.setLabel(zjhm);
KsjResultPojo.Nodes.Properties propertiesZjbh = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeZjhm, propertiesZjbh);
propertiesZjbh.setBoderColor("");// 高亮
propertiesZjbh.setImgType("idcard");// 图标
nodeZjhm.setProperties(propertiesZjbh);
nodes.add(nodeZjhm);
// 组装关系数据
KsjResultPojo.Links link = new KsjResultPojo.Links();
link.setSource(asjbh);
link.setTarget(zjhm);
link.setLabel("人案");
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(link, propertiesLink);
link.setProperties(propertiesLink);
links.add(link);
xyrZjhmList.add(zjhm);
// 查询人员案件信息
List<AjThKshfxPojo> ajNodeList = new ArrayList<>();
ajNodeList = tbStZtypFwbshMapper.selectAjNodeByZjhmWithOutAsjbh(zjhm, node.getParentId());
if (ajNodeList == null || ajNodeList.isEmpty()) {
ajNodeList = tbStZtypFwbshMapper.selectAjNodeByKyryZjhmWithOutAsjbh(zjhm, node.getParentId());
}
if (ajNodeList.size() > 0) {
ajNodeList.stream().distinct().forEach(obj -> {
// 组装去重数据
KsjResultPojo.Nodes nodeAj = new KsjResultPojo.Nodes();
nodeAj.setId(obj.getId());
nodeAj.setLabel(obj.getName());
KsjResultPojo.Nodes.Properties propertiesAj = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeAj, propertiesAj);
propertiesAj.setBoderColor("");// 高亮
propertiesAj.setImgType("aj");// 图标
nodeAj.setProperties(propertiesAj);
nodes.add(nodeAj);
// 组装关系数据
KsjResultPojo.Links linkAj = new KsjResultPojo.Links();
linkAj.setSource(zjhm);
linkAj.setTarget(obj.getId());
linkAj.setLabel("人案");
KsjResultPojo.Links.Properties propertiesAjs = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkAj, propertiesAjs);
linkAj.setProperties(propertiesAjs);
links.add(linkAj);
});
node.setChildrenList(ajNodeList);
List<AjThKshfxPojo> nodeChildren = node.getChildren();
if (nodeChildren != null && !nodeChildren.isEmpty()) {
//若子节点中的类型为案件,设为高亮并加入队列
for (AjThKshfxPojo child : nodeChildren) {
if ("lawcase".equals(child.getType())) {
if (!temp.contains(child.getId())) {
temp.add(child.getId());
queue.add(child);
}
}
}
}
}
List<AjThKshfxPojo> listResultGtlxr = new ArrayList<>();
listResultGtlxr = tbStZtypFwbshMapper.selectDhNodeByZjhm(zjhm);
if (listResultGtlxr == null) {
listResultGtlxr = new ArrayList<>();
}
if (listResultGtlxr.size() > 0) {
listResultGtlxr.stream().distinct().forEach(obj -> {
if (!StringUtil.isEmpty(obj.getId())) {
// 组装去重数据
KsjResultPojo.Nodes nodeGtlxr = new KsjResultPojo.Nodes();
nodeGtlxr.setId(obj.getId());
nodeGtlxr.setLabel(obj.getName());
KsjResultPojo.Nodes.Properties propertiesGtlxr = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeGtlxr, propertiesGtlxr);
propertiesGtlxr.setBoderColor("");// 高亮
propertiesGtlxr.setImgType("sjk");// 图标
nodeGtlxr.setProperties(propertiesGtlxr);
nodes.add(nodeGtlxr);
// 组装关系数据
KsjResultPojo.Links linkGtlxr = new KsjResultPojo.Links();
linkGtlxr.setSource(zjhm);
linkGtlxr.setTarget(obj.getId());
linkGtlxr.setLabel("共同联系人");
KsjResultPojo.Links.Properties propertiesLinkGtlxr = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkGtlxr, propertiesLinkGtlxr);
linkGtlxr.setProperties(propertiesLinkGtlxr);
links.add(linkGtlxr);
}
});
}
List<AjThKshfxPojo> yhkCallable = tbStZtypFwbshMapper.selectYhkNodeByZjhm(zjhm);
if (yhkCallable == null) {
yhkCallable = new ArrayList<>();
}
yhkCallable.stream().distinct().forEach(obj -> {
// 组装去重数据
KsjResultPojo.Nodes nodeYhkh = new KsjResultPojo.Nodes();
nodeYhkh.setId(obj.getId());
nodeYhkh.setLabel(obj.getName());
KsjResultPojo.Nodes.Properties propertiesYhkh = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeYhkh, propertiesYhkh);
propertiesYhkh.setBoderColor("");// 高亮
propertiesYhkh.setImgType("yhk");// 图标
nodeYhkh.setProperties(propertiesYhkh);
nodes.add(nodeYhkh);
// 组装关系数据
KsjResultPojo.Links linkYhkh = new KsjResultPojo.Links();
linkYhkh.setSource(zjhm);
linkYhkh.setTarget(obj.getId());
linkYhkh.setLabel("共同交易银行卡号");
KsjResultPojo.Links.Properties propertiesLinkYhkh = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkYhkh, propertiesLinkYhkh);
linkYhkh.setProperties(propertiesLinkYhkh);
links.add(linkYhkh);
});
List<AjThKshfxPojo> ipCallable = tbStZtypFwbshMapper.selectIpNodeByZjhm(zjhm);
if (ipCallable == null) {
ipCallable = new ArrayList<>();
}
ipCallable.stream().distinct().forEach(obj -> {
// 组装去重数据
KsjResultPojo.Nodes nodeIp = new KsjResultPojo.Nodes();
nodeIp.setId(obj.getId());
nodeIp.setLabel(obj.getName());
KsjResultPojo.Nodes.Properties propertiesIp = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeIp, propertiesIp);
propertiesIp.setBoderColor("");// 高亮
propertiesIp.setImgType("ip");// 图标
nodeIp.setProperties(propertiesIp);
nodes.add(nodeIp);
// 组装关系数据
KsjResultPojo.Links linkIp = new KsjResultPojo.Links();
linkIp.setSource(zjhm);
linkIp.setTarget(obj.getId());
linkIp.setLabel("共同访问ip");
KsjResultPojo.Links.Properties propertiesLinkIp = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkIp, propertiesLinkIp);
linkIp.setProperties(propertiesLinkIp);
links.add(linkIp);
});
}
List<KsjResultPojo.Nodes> nodesDistinct = nodes.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KsjResultPojo.Nodes::getId))), ArrayList::new));
ksjResultPojo.setNodes(nodesDistinct);
ksjResultPojo.setLinks(links);
return new MapRestResult(200, "可视化结果获取成功", 1, ksjResultPojo);
}
} else {
// 号码加入节点
KsjResultPojo.Nodes node1 = new KsjResultPojo.Nodes();
node1.setId(root.getId());
node1.setLabel(root.getName());
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(node1, properties);
properties.setBoderColor("#FA0505");// 高亮
properties.setImgType(root.getType());// 图标
node1.setProperties(properties);
nodes.add(node1);
//类型为其他
//定义一个队列(基于双向链表手动达成队列效果),并将根的子节点加入队列中
LinkedList<AjThKshfxPojo> queue = new LinkedList<>();
//定义缓存记录(id)
ArrayList<ArrayList<String>> temp = new ArrayList<>();
//将根节点加入队列和缓存记录中
queue.addLast(root);
ArrayList<String> strings = new ArrayList<>();
strings.add(root.getId());
temp.add(strings);
while (!queue.isEmpty()) {
//队首出队列
AjThKshfxPojo node = queue.removeFirst();
Integer count;
//由于号码有重复,拼接了类型,在这里裁切类型拿到id
String idStr = node.getId();
int i = idStr.indexOf(":");
String id = i == -1 ? idStr : idStr.substring(i + 1);
if ("lawcase".equals(node.getType())) {
//如果当前出队列的节点类型为案件则查询案件信息,并设置子节点,temp为缓存,不查已经存在的数据
count = tbStZtypFwbshMapper.selectHmCountByAsjbh(id, temp);
if (count == null || count <= 0) {
continue;
}
List<AjThKshfxPojo> ajKshList = tbStZtypFwbshMapper.selectHmByAsjbh(id, temp);
for (AjThKshfxPojo pojo : ajKshList) {
// 组装去重数据
KsjResultPojo.Nodes nodeBsh = new KsjResultPojo.Nodes();
nodeBsh.setId(pojo.getId());
nodeBsh.setLabel(pojo.getName());
KsjResultPojo.Nodes.Properties propertiesBsh = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeBsh, propertiesBsh);
propertiesBsh.setBoderColor("");// 高亮
propertiesBsh.setImgType(pojo.getType());// 图标
nodeBsh.setProperties(propertiesBsh);
nodes.add(nodeBsh);
// 组装关系数据
KsjResultPojo.Links linkBsh = new KsjResultPojo.Links();
linkBsh.setSource(id);
linkBsh.setTarget(pojo.getId());
linkBsh.setLabel("标识号");
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkBsh, propertiesLink);
linkBsh.setProperties(propertiesLink);
links.add(linkBsh);
}
node.setChildrenList(ajKshList);
} else {
//如果当前出队列的节点类型为其他标识号则查询标识号信息,并设置子节点,temp为缓存,不查已经存在的数据
count = tbStZtypFwbshMapper.selectAjCountByHm(id, temp);
if (count == null || count <= 0) {
continue;
}
List<AjThKshfxPojo> ajKshList = tbStZtypFwbshMapper.selectAjByHm(id, temp);
for (AjThKshfxPojo pojo : ajKshList) {
// 组装去重数据
KsjResultPojo.Nodes nodeBsh = new KsjResultPojo.Nodes();
nodeBsh.setId(pojo.getId());
nodeBsh.setLabel(pojo.getName());
KsjResultPojo.Nodes.Properties propertiesBsh = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeBsh, propertiesBsh);
propertiesBsh.setBoderColor("");// 高亮
propertiesBsh.setImgType("aj");// 图标
nodeBsh.setProperties(propertiesBsh);
nodes.add(nodeBsh);
// 组装关系数据
KsjResultPojo.Links linkBsh = new KsjResultPojo.Links();
linkBsh.setSource(id);
linkBsh.setTarget(pojo.getId());
linkBsh.setLabel("标识号");
KsjResultPojo.Links.Properties propertiesLink = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkBsh, propertiesLink);
linkBsh.setProperties(propertiesLink);
links.add(linkBsh);
}
node.setChildrenList(ajKshList);
}
//将子节点的信息加入缓存集合中,若缓存集合长度超过1000则分组
List<AjThKshfxPojo> children = node.getChildren();
for (AjThKshfxPojo child : children) {
if (strings.size() >= 1000) {
temp.add(new ArrayList<>(strings));
strings.clear();
}
String childIdStr = child.getId();
int childIdIndex = childIdStr.indexOf(":");
String childId = childIdIndex == -1 ? childIdStr : childIdStr.substring(childIdIndex + 1);
strings.add(childId);
}
queue.addAll(children);
}
//删除案件下的单分支的标识号节点
//deletingSingleBranchBshNodes(root, queue);
} }
ksjResultPojo.setNodes(nodes); ksjResultPojo.setNodes(nodes);
ksjResultPojo.setLinks(links); ksjResultPojo.setLinks(links);
return new MapRestResult(200, "可视化结果获取成功", 1, ksjResultPojo); return new MapRestResult(200, "可视化结果获取成功", 1, ksjResultPojo);
} }
@Override
public List<TbStAsj> getThgaByThbh(TbYwShseTh tbYwShseTh) {
tbYwShseTh.setPage((tbYwShseTh.getPage()-1)*tbYwShseTh.getLimit());
tbYwShseTh.setLimit(tbYwShseTh.getLimit());
return ztypMapper.getThgaByThbh(tbYwShseTh);
}
@Override
public int getThgaByThbhCount(TbYwShseTh tbYwShseTh) {
return ztypMapper.getThgaByThbhCount(tbYwShseTh);
}
@Override
public List<TbXwZbfzxyr> getThxyrByThbh(TbYwShseTh tbYwShseTh) {
tbYwShseTh.setPage((tbYwShseTh.getPage()-1)*tbYwShseTh.getLimit());
tbYwShseTh.setLimit(tbYwShseTh.getLimit());
return ztypMapper.getThxyrByThbh(tbYwShseTh);
}
@Override
public int getThxyrByThbhCount(TbYwShseTh tbYwShseTh) {
return ztypMapper.getThxyrByThbhCount(tbYwShseTh);
}
@Override
public String addFzthaj(TbYwCchshzztjb cchshzztjb, HttpServletRequest request) {
String xxzjbh = KeyUtil.getUUIDKey("th");
cchshzztjb.setXxzjbh(xxzjbh);
String laAjlbdm = cchshzztjb.getLaAjlbdm();
if (!StringUtils.isEmpty(laAjlbdm)) {
if ("06012500".equals(laAjlbdm)||"06012600".equals(laAjlbdm)||"06012700".equals(laAjlbdm)) {
cchshzztjb.setShsedm("0");
}else if ("00000000".equals(laAjlbdm)){
cchshzztjb.setShsedm("1");
}else if ("11111111".equals(laAjlbdm)){
cchshzztjb.setShsedm("3");
}
}
ztypMapper.addCchshzztjb(cchshzztjb);
TbYwShseTh shseTh = new TbYwShseTh();
shseTh.setThbh(cchshzztjb.getThbh());
List<TbStAsj> asj = ztypMapper.getThgaByThbh(shseTh);
List<TbXwLaShse> laShseList = new ArrayList<>();
if (asj != null && asj.size()>0) {
for (TbStAsj tbStAsj : asj) {
String laxxzjbh = KeyUtil.getUUIDKey("la");
TbXwLaShse laShse = new TbXwLaShse();
laShse.setXxzjbh(laxxzjbh);
laShse.setAsjbh(tbStAsj.getAsjbh());
laShse.setXckybh(tbStAsj.getXckybh());
laShse.setGlxxXxzjbh(xxzjbh);
laShse.setLaAjmc(tbStAsj.getAjmc());
laShse.setSfxsaj("1");
laShse.setLaAjlbdm(tbStAsj.getAjlbdm());
laShse.setLaZatzJyqk(tbStAsj.getAjxz());
laShse.setTssddm(tbStAsj.getTssddm());
laShse.setLaAsjfssjAsjfskssj(getDateString(tbStAsj.getAsjfssjfxAsjfskssj()));
laShse.setLaAsjfssjAsjfsjssj(getDateString(tbStAsj.getAsjfssjfxAsjfsjssj()));
laShse.setLaAsjfsddXzqhdm(tbStAsj.getAsjfsddXzqhdm());
laShse.setLaAsjfsddDzmc(tbStAsj.getAsjfsddXzqhmc());
laShse.setLarq(getDateString(tbStAsj.getLarq()));
laShse.setLadwGajgjgdm(tbStAsj.getLadwGajgjgdm());
laShse.setLaJyaq(tbStAsj.getJyaq());
laShse.setGajgfzrXm(tbStAsj.getGajgfzrXm());
laShse.setGajgfzrGmsfhm(tbStAsj.getGajgfzrGmsfhm());
laShse.setGajgfzrLxdh(tbStAsj.getGajgfzrLxdh());
laShse.setXbrXm(tbStAsj.getXbrXm());
laShse.setXbrGmsfhm(tbStAsj.getXbrGmsfhm());
laShse.setXbrLxdh(tbStAsj.getXbrLxdh());
laShse.setDjUser(JwtUser.getUser(request));
laShseList.add(laShse);
}
}
List<TbXwZbfzxyr> xyr = ztypMapper.getThxyrByThbh(shseTh);
List<TbXwZbfzxyrShse> xyrList = new ArrayList<>();
if (xyr != null && xyr.size()>0) {
for (TbXwZbfzxyr tbXwZbfzxyr : xyr) {
TbXwZbfzxyrShse zbxyrShse = new TbXwZbfzxyrShse();
BeanUtils.copyProperties(tbXwZbfzxyr, zbxyrShse);
zbxyrShse.setDjUser(JwtUser.getUser(request));
zbxyrShse.setGlxxXxzjbh(xxzjbh);
xyrList.add(zbxyrShse);
}
}
//线索关联嫌疑人
TbYwXshbXsglxyr xshbXsglxyr = new TbYwXshbXsglxyr();
xshbXsglxyr.setXsbh(cchshzztjb.getThbh());
List<TbYwXshbXsglxyr> xsglxyrList = ztypMapper.getXyrListPage(xshbXsglxyr);
if (xsglxyrList != null && xsglxyrList.size()>0) {
for (TbYwXshbXsglxyr xsglxyr : xsglxyrList) {
TbXwZbfzxyrShse zbxyrShse = new TbXwZbfzxyrShse();
zbxyrShse.setZhfzxyrXm(xsglxyr.getXm());
zbxyrShse.setZhfzxyrXbdm(xsglxyr.getXbdm());
zbxyrShse.setRqgzxxCsrqRqgzsx(xsglxyr.getCsrq());
zbxyrShse.setZhfzxyrCsrqRqgzxx(xsglxyr.getCsrq());
zbxyrShse.setZhfzxyrCyzjZjhm(xsglxyr.getGmsfzh());
zbxyrShse.setZhfzxyrXzzXzqhdm(xsglxyr.getXzzXzqhdm());
zbxyrShse.setZhfzxyrXzzDzmc(xsglxyr.getXzzDzmc());
zbxyrShse.setZhfzxyrHjdzXzqhdm(xsglxyr.getHjdzXzqhdm());
zbxyrShse.setZhfzxyrHjdzDzmc(xsglxyr.getHjdzDzmc());
zbxyrShse.setAsjbh(xsglxyr.getXsbh());
zbxyrShse.setXxzjbh(xsglxyr.getXxzjbh());
zbxyrShse.setDjUser(JwtUser.getUser(request));
zbxyrShse.setGlxxXxzjbh(xxzjbh);
xyrList.add(zbxyrShse);
}
}
new Thread(new Runnable() {
@Override
public void run() {
if (laShseList != null && laShseList.size()>0){
for (TbXwLaShse laShse:laShseList) {
ztypMapper.addLaShse(laShse);
}
}
if (xyrList != null && xyrList.size()>0){
for (TbXwZbfzxyrShse zbfzxyrShse:xyrList) {
ztypMapper.addZbfzxyrShse(zbfzxyrShse);
}
}
}
}).start();
return xxzjbh;
}
@Override
public Map<String, Object> getSjhJzxx(String phoneNum) throws Exception {
Map<String, Object> resMap = new HashMap();
List<Jzxx> jzxxList = simulateJzxxData();
if (jzxxList != null && jzxxList.size() > 0){
handleMapData(jzxxList.get(0), resMap);
}
return resMap;
}
private List<Jzxx> simulateJzxxData(){
List<Jzxx> list = new ArrayList<>();
for (int i = 0; i < 6; i++) {
Jzxx jzxx = new Jzxx();
jzxx.setXm("张三");
jzxx.setAddress("测试数据地址" + i);
jzxx.setZjhm("11111" + i);
list.add(jzxx);
}
return list;
}
private void handleMapData(Jzxx jzxx, Map<String, Object> resMap){
resMap.put("jzxm",jzxx.getXm());
resMap.put("zjhm",jzxx.getZjhm());
resMap.put("hjdz",jzxx.getAddress());
resMap.put("zjlb","居民身份证");
//查询人员常口。
getPeopleInfo(jzxx, resMap);
}
//查询人员常口接口
private void getPeopleInfo(Jzxx jzxx, Map resultMap){
try {
SkRegionalsPerson skRegionalsPerson = JsonUtils.readJsonFromClassPath("data/getRyxx.json", SkRegionalsPerson.class);
resultMap.put("xzz",skRegionalsPerson.getXzzdzmc());
resultMap.put("csd",skRegionalsPerson.getCsdzmc());
resultMap.put("zp",skRegionalsPerson.getImg());
resultMap.put("xb",skRegionalsPerson.getXb());
resultMap.put("mz",skRegionalsPerson.getMz());
resultMap.put("csrq",skRegionalsPerson.getCsrq());
resultMap.put("hjdqh", skRegionalsPerson.getHjdqhdz());
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Map<String, Object> getSjInfo(TxxxParam txxxParam) throws Exception {
Map<String, Object> map = new HashMap<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date start = sdf.parse(txxxParam.getKssj());
Date end = sdf.parse(txxxParam.getJssj());
//话单数据
JSONArray jsonArray = JsonUtils.readJsonFromClassPath("data/getHdfx.json", JSONArray.class);
List<NaoTuHdXx> hdList = jsonArray.toJavaList(NaoTuHdXx.class);
Map<String, Object> resMap = handleHdListByPage(hdList, txxxParam.getPage(), txxxParam.getLimit(),txxxParam.getPhoneNum());
//24小时规律分析折线图
ConcurrentHashMap<String, AtomicInteger> lineChart = getHdLineChart(hdList, txxxParam.getPhoneNum());
//通话时长前5
ArrayList<Map<String, String>> scList = getThscList(hdList, txxxParam.getPhoneNum());
//通话次数前5
ArrayList<Map<String, String>> csList = getThcsList(hdList, txxxParam.getPhoneNum());
map.put("hdList", resMap);
map.put("lineChart", getLineChartMap(lineChart));
map.put("scList", scList);
map.put("csList", csList);
return map;
}
private Map<String, Object> handleHdListByPage(List<NaoTuHdXx> hdList, int page, int limit, String phoneNum){
List<NaoTuHdXx> tempList = new ArrayList<>();
if(hdList.size() > 0){
if (hdList.size() > 1000) {
hdList.stream().parallel().forEach(hdXx -> {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
tempList.add(hdXx);
}
});
}else{
for (NaoTuHdXx hdXx : hdList) {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
tempList.add(hdXx);
}
}
}
}
List<NaoTuHdXx> resList = new ArrayList<>();
if(tempList.size() > 0){
int startIndex = limit * (page - 1);
int endIndex = limit * page - 1;
if(hdList.size() - 1 <= endIndex){
endIndex = tempList.size() - 1;
}
for (int i = startIndex; i <= endIndex; i++){
resList.add(hdList.get(i));
}
}
Map<String, Object> map = new HashMap<>();
map.put("total", tempList.size());
map.put("hdList", resList);
return map;
}
private ConcurrentHashMap<String, AtomicInteger> getHdLineChart(List<NaoTuHdXx> hdList, String phoneNum) {
ConcurrentHashMap<String, AtomicInteger> map = initializedLineChart();
if(hdList.size() > 0){
if (hdList.size() > 1000) {
hdList.stream().parallel().forEach(hdXx -> {
String hjsj = hdXx.getHjsj();
try {
handleMap(hjsj, map);
} catch (Exception e) {
e.printStackTrace();
}
});
}else{
for (NaoTuHdXx hdXx : hdList) {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
String hjsj = hdXx.getHjsj();
try {
handleMap(hjsj, map);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
return map;
}
private String getDfsjhm(String sjhm, NaoTuHdXx hdXx) {
String dfsjhm = sjhm.equals(hdXx.getDfsjhm()) ? hdXx.getYhsjhm() : hdXx.getDfsjhm();
if (sjhm.equals(dfsjhm)) {
return null;
}
return dfsjhm;
}
private ConcurrentHashMap<String, AtomicInteger> initializedLineChart(){
ConcurrentHashMap<String, AtomicInteger> map = new ConcurrentHashMap<>();
map.put("0-2", new AtomicInteger(0));
map.put("2-4", new AtomicInteger(0));
map.put("4-6", new AtomicInteger(0));
map.put("6-8", new AtomicInteger(0));
map.put("8-10", new AtomicInteger(0));
map.put("10-12", new AtomicInteger(0));
map.put("12-14", new AtomicInteger(0));
map.put("14-16", new AtomicInteger(0));
map.put("16-18", new AtomicInteger(0));
map.put("18-20", new AtomicInteger(0));
map.put("20-22", new AtomicInteger(0));
map.put("22-24", new AtomicInteger(0));
return map;
}
private boolean judgeTime(String start, String end, String hjsj) throws Exception {
String time = hjsj.substring(11, 19);
SimpleDateFormat timeSdf = new SimpleDateFormat("HH:mm:ss");
if(timeSdf.parse(start).before(timeSdf.parse(time)) && timeSdf.parse(end).after(timeSdf.parse(time))){
return true;
}else{
return false;
}
}
private void handleMap(String hjsj, ConcurrentHashMap<String, AtomicInteger> map){
try {
if (judgeTime("00:00:00", "02:00:00", hjsj)) {
map.get("0-2").incrementAndGet();
}else if(judgeTime("02:00:00", "04:00:00", hjsj)){
map.get("2-4").incrementAndGet();
}else if(judgeTime("04:00:00", "06:00:00", hjsj)){
map.get("4-6").incrementAndGet();
}else if(judgeTime("06:00:00", "08:00:00", hjsj)){
map.get("6-8").incrementAndGet();
}else if(judgeTime("08:00:00", "10:00:00", hjsj)){
map.get("8-10").incrementAndGet();
}else if(judgeTime("10:00:00", "12:00:00", hjsj)){
map.get("10-12").incrementAndGet();
}else if(judgeTime("12:00:00", "14:00:00", hjsj)){
map.get("12-14").incrementAndGet();
}else if(judgeTime("14:00:00", "16:00:00", hjsj)){
map.get("14-16").incrementAndGet();
}else if(judgeTime("16:00:00", "18:00:00", hjsj)){
map.get("16-18").incrementAndGet();
}else if(judgeTime("18:00:00", "20:00:00", hjsj)){
map.get("18-20").incrementAndGet();
}else if(judgeTime("20:00:00", "22:00:00", hjsj)){
map.get("20-22").incrementAndGet();
}else if(judgeTime("22:00:00", "24:00:00", hjsj)){
map.get("22-24").incrementAndGet();
}
} catch (Exception e) {
e.printStackTrace();
}
}
//通话时长前5列表
private ArrayList<Map<String, String>> getThscList(List<NaoTuHdXx> hdList, String phoneNum){
ArrayList<Map<String, String>> resultList = new ArrayList<>();
if(hdList.size() > 0){
resultList = getList(hdList, "sc", phoneNum);
}
return resultList;
}
//通话次数前5列表
private ArrayList<Map<String, String>> getThcsList(List<NaoTuHdXx> hdList, String phoneNum){
ArrayList<Map<String, String>> resultList = new ArrayList<>();
if(hdList.size() > 0){
resultList = getList(hdList, "pc", phoneNum);
}
return resultList;
}
private LinkedHashMap<String, Integer> getLineChartMap(ConcurrentHashMap<String, AtomicInteger> map){
LinkedHashMap<String, Integer> resMap = new LinkedHashMap<>();
resMap.put("0-2", map.get("0-2").intValue());
resMap.put("2-4", map.get("2-4").intValue());
resMap.put("4-6", map.get("4-6").intValue());
resMap.put("6-8", map.get("6-8").intValue());
resMap.put("8-10", map.get("8-10").intValue());
resMap.put("10-12", map.get("10-12").intValue());
resMap.put("12-14", map.get("12-14").intValue());
resMap.put("14-16", map.get("14-16").intValue());
resMap.put("16-18", map.get("16-18").intValue());
resMap.put("18-20", map.get("18-20").intValue());
resMap.put("20-22", map.get("20-22").intValue());
resMap.put("22-24", map.get("22-24").intValue());
return resMap;
}
private ArrayList<Map<String, String>> getList(List<NaoTuHdXx> hdList, String type, String phoneNum){
ConcurrentHashMap<String, AtomicInteger> map = new ConcurrentHashMap<>();
if (hdList.size() > 1000) {
if ("pc".equals(type)){
hdList.stream().parallel().forEach(hdXx -> {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
if (map.containsKey(dfsjhm)) {
map.get(dfsjhm).incrementAndGet();
} else {
map.put(dfsjhm, new AtomicInteger(1));
}
}
});
} else if ("sc".equals(type)){
hdList.stream().parallel().forEach(hdXx -> {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
int thsc;
try {
thsc = Integer.parseInt(hdXx.getThsc());
} catch (Exception e) {
thsc = 0;
e.printStackTrace();
}
if (map.containsKey(dfsjhm)) {
map.get(dfsjhm).addAndGet(thsc);
} else {
map.put(dfsjhm, new AtomicInteger(thsc));
}
}
});
}
} else{
if ("pc".equals(type)){
for (NaoTuHdXx hdXx : hdList) {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
if (map.containsKey(dfsjhm)) {
map.get(dfsjhm).incrementAndGet();
} else {
map.put(dfsjhm, new AtomicInteger(1));
}
}
}
} else if ("sc".equals(type)){
for (NaoTuHdXx hdXx : hdList) {
String dfsjhm = getDfsjhm(phoneNum, hdXx);
if (org.apache.commons.lang.StringUtils.isNotBlank(dfsjhm) && dfsjhm.length() >= 8) {
int thsc;
try {
thsc = Integer.parseInt(hdXx.getThsc());
} catch (Exception e) {
thsc = 0;
e.printStackTrace();
}
if (map.containsKey(dfsjhm)) {
map.get(dfsjhm).addAndGet(thsc);
} else {
map.put(dfsjhm, new AtomicInteger(thsc));
}
}
}
}
}
ArrayList<Map<String, String>> resultList = new ArrayList<>();
if (!map.isEmpty()){
List<Map.Entry<String, AtomicInteger>> maiList = new ArrayList<>(map.entrySet());
maiList = maiList.stream().parallel().sorted((o1, o2) -> Integer.compare(o2.getValue().get(), o1.getValue().get()))
.limit(5).collect(Collectors.toList());
for (Map.Entry<String, AtomicInteger> entry : maiList) {
HashMap<String, String> item = new HashMap<>();
item.put("phoneNum", entry.getKey());
int value = entry.getValue().get();
String countStr;
if ("pc".equals(type)){
countStr = value + "次";
} else {
countStr = getHourMinuteSecondBySecond(value);
}
item.put("count", countStr);
resultList.add(item);
}
}
return resultList;
}
private String getHourMinuteSecondBySecond(int second) {
int hour = second / 3600;
int minute = (second - hour * 3600) / 60;
second = (second - hour * 3600 - minute * 60);
StringBuilder sb = new StringBuilder();
if (hour > 0) {
sb.append(hour).append("小时");
}
if (minute > 0) {
sb.append(minute).append("分");
}
if (second > 0) {
sb.append(second).append("秒");
}
if (second == 0) {
sb.append("0秒");
}
return sb.toString();
}
@Override
public Map<String, Object> getAsjxxByPhoneNum(TxxxParam txxxParam) throws Exception {
Map<String, Object> map = new HashMap<>();
String phoneNum = txxxParam.getPhoneNum();
int total = getAsjxxListCount(phoneNum);
if (total > 0){
int startIndex = (txxxParam.getPage() - 1) * txxxParam.getLimit();
int endIndex = txxxParam.getLimit();
txxxParam.setStartIndex(startIndex);
txxxParam.setEndIndex(endIndex);
List<TbStAsj3> asjList = getAsjxxList(txxxParam);
map.put("list", asjList);
}else{
map.put("list", new ArrayList<>());
}
map.put("total", total);
return map;
}
@Override
public MapRestResult getThfxAccompliceBythId(String thbh, String fxwd, String commonRelationshipNum) {
KsjResultPojo ksjResultPojo = new KsjResultPojo();// 最终对象数据
List<KsjResultPojo.Nodes> nodes = new ArrayList<>();// 存储所有节点去重后数据
List<KsjResultPojo.Links> links = new ArrayList<>();// 存储所有节点关系
StringBuilder sb = new StringBuilder();
String thName = sb.append("团伙代号:").append(thbh).toString();
sb.delete(0, sb.length());
// 团伙编号加入节点
KsjResultPojo.Nodes node = new KsjResultPojo.Nodes();
node.setId(thbh);
node.setLabel(thName);
KsjResultPojo.Nodes.Properties properties = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(node, properties);
properties.setBoderColor("#FA0505");// 高亮
properties.setImgType("idcard");// 图标
node.setProperties(properties);
nodes.add(node);
List<AjThKshfxPojo> groupXyrList = ztypMapper.getGroupXyrListByThbh(thbh);
if (groupXyrList != null && groupXyrList.size() > 0) {
List<String> fzxyrStrList = new ArrayList<>();
for (AjThKshfxPojo xyrItem : groupXyrList) {
fzxyrStrList.add(xyrItem.getId());
List<AjThKshfxPojo> childList = new ArrayList<>();
xyrItem.setChildren(childList);
}
List<AjThKshfxPojo> groupAsjList = ztypMapper.getGroupAsjList(fzxyrStrList);
for (AjThKshfxPojo xyrItem : groupXyrList) {
for (AjThKshfxPojo asjItem : groupAsjList) {
if (asjItem.getParentId().equals(xyrItem.getId())) {
// 组装去重数据
KsjResultPojo.Nodes nodeXyr = new KsjResultPojo.Nodes();
nodeXyr.setId(xyrItem.getId());
nodeXyr.setLabel(xyrItem.getName());
KsjResultPojo.Nodes.Properties propertiesXyr = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeXyr, propertiesXyr);
propertiesXyr.setBoderColor("");// 高亮
propertiesXyr.setImgType("idcard");// 图标
nodeXyr.setProperties(propertiesXyr);
nodes.add(nodeXyr);
// 组装去重数据
KsjResultPojo.Nodes nodeAj = new KsjResultPojo.Nodes();
nodeAj.setId(asjItem.getId());
nodeAj.setLabel(asjItem.getName());
KsjResultPojo.Nodes.Properties propertiesAj = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeAj, propertiesAj);
propertiesAj.setBoderColor("");// 高亮
propertiesAj.setImgType("aj");// 图标
nodeAj.setProperties(propertiesAj);
nodes.add(nodeAj);
// 组装关系数据
KsjResultPojo.Links linkTh = new KsjResultPojo.Links();
linkTh.setSource(thbh);
linkTh.setTarget(xyrItem.getId());
linkTh.setLabel("团伙");
KsjResultPojo.Links.Properties propertiesTh = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkTh, propertiesTh);
linkTh.setProperties(propertiesTh);
links.add(linkTh);
// 组装关系数据
KsjResultPojo.Links linkAj = new KsjResultPojo.Links();
linkAj.setSource(xyrItem.getId());
linkAj.setTarget(asjItem.getId());
linkAj.setLabel("人案");
KsjResultPojo.Links.Properties propertiesAjs = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkAj, propertiesAjs);
linkAj.setProperties(propertiesAjs);
links.add(linkAj);
}
}
}
List<AjThKshfxPojo> kshConnectAll = new ArrayList<>();
if (fxwd.contains("01")) {
kshConnectAll = ztypMapper.getKshConnectPhoneList(thbh);
}
if (fxwd.contains("02")) {
kshConnectAll = ztypMapper.getkshConnectIpList(thbh);
}
if (fxwd.contains("03")) {
kshConnectAll = ztypMapper.getkshCashAccountList(thbh);
}
if(kshConnectAll.size()>0){
Map<String, Integer> commonChildMap = new HashMap<>(256);
for (AjThKshfxPojo commonChild : kshConnectAll) {
if (org.springframework.util.StringUtils.hasText(commonChild.getId())) {
String childNodeId = commonChild.getId();
if (commonChildMap.get(childNodeId) != null && commonChildMap.get(childNodeId) > 0) {
commonChildMap.put(childNodeId, commonChildMap.get(childNodeId) + 1);
} else {
commonChildMap.put(childNodeId, 1);
}
}
}
List<String> validDataList = new ArrayList<>();
for (Map.Entry<String, Integer> entry : commonChildMap.entrySet()) {
if (org.springframework.util.StringUtils.hasText(entry.getKey()) && entry.getValue() >= Integer.valueOf(commonRelationshipNum)) {
validDataList.add(entry.getKey());
}
}
if (validDataList.size() > 0) {
List<AjThKshfxPojo> validDataPojoList = new ArrayList<>();
for (String validPhone : validDataList) {
for (AjThKshfxPojo kshPhone : kshConnectAll) {
if (validPhone.equals(kshPhone.getId())) {
validDataPojoList.add(kshPhone);
}
}
}
if (validDataPojoList.size() > 0) {
for (AjThKshfxPojo kshPhone : validDataPojoList) {
for (AjThKshfxPojo perItem : groupXyrList) {
if (kshPhone.getParentId().equals(perItem.getId())) {
// 组装去重数据
KsjResultPojo.Nodes nodePhone = new KsjResultPojo.Nodes();
nodePhone.setId(kshPhone.getId());
nodePhone.setLabel(kshPhone.getName());
KsjResultPojo.Nodes.Properties propertiesPhone = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodePhone, propertiesPhone);
propertiesPhone.setBoderColor("");// 高亮
propertiesPhone.setImgType("sjk");// 图标
nodePhone.setProperties(propertiesPhone);
nodes.add(nodePhone);
// 组装去重数据
KsjResultPojo.Nodes nodeZjhm = new KsjResultPojo.Nodes();
nodeZjhm.setId(perItem.getId());
nodeZjhm.setLabel(perItem.getName());
KsjResultPojo.Nodes.Properties propertiesZjhm = new KsjResultPojo.Nodes.Properties();
BeanUtils.copyProperties(nodeZjhm, propertiesZjhm);
propertiesZjhm.setBoderColor("");// 高亮
propertiesZjhm.setImgType("idcard");// 图标
nodeZjhm.setProperties(propertiesZjhm);
nodes.add(nodeZjhm);
// 组装关系数据
KsjResultPojo.Links linkAj = new KsjResultPojo.Links();
linkAj.setSource(perItem.getId());
linkAj.setTarget(kshPhone.getId());
linkAj.setLabel("关联");
KsjResultPojo.Links.Properties propertiesAjs = new KsjResultPojo.Links.Properties();
BeanUtils.copyProperties(linkAj, propertiesAjs);
linkAj.setProperties(propertiesAjs);
links.add(linkAj);
}
}
}
}
}
}
}
List<KsjResultPojo.Nodes> nodesDistinct = nodes.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(KsjResultPojo.Nodes::getId))), ArrayList::new));
ksjResultPojo.setNodes(nodesDistinct);
ksjResultPojo.setLinks(links);
return new MapRestResult(200, "可视化结果获取成功", 1, ksjResultPojo);
}
private int getAsjxxListCount(String phoneNum){
return ztypMapper.getAsjxxListCount(phoneNum);
}
private List<TbStAsj3> getAsjxxList(TxxxParam txxxParam){
return ztypMapper.getAsjxxList(txxxParam);
}
private AjThKshfxPojo getKshDataType(TbStZtypFwbsh fwbsh) { private AjThKshfxPojo getKshDataType(TbStZtypFwbsh fwbsh) {
AjThKshfxPojo root = new AjThKshfxPojo(); AjThKshfxPojo root = new AjThKshfxPojo();
root.setId(fwbsh.getFwbshHm()); root.setId(fwbsh.getFwbshHm());
...@@ -419,25 +1572,25 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -419,25 +1572,25 @@ public class ZtypServiceImpl implements ZtypService {
if (fwbshLb != null) { if (fwbshLb != null) {
switch (fwbshLb) { switch (fwbshLb) {
case "personid": { case "personid": {
root.setType("person"); root.setType("idcard");
root.setName("身份证号:" + fwbsh.getFwbshHm()); root.setName("身份证号:" + fwbsh.getFwbshHm());
root.setParentName("身份证号:" + fwbsh.getFwbshHm()); root.setParentName("身份证号:" + fwbsh.getFwbshHm());
break; break;
} }
case "mobile": { case "mobile": {
root.setType("phone"); root.setType("sjk");
root.setName("手机号码:" + fwbsh.getFwbshHm()); root.setName("手机号码:" + fwbsh.getFwbshHm());
root.setParentName("手机号码:" + fwbsh.getFwbshHm()); root.setParentName("手机号码:" + fwbsh.getFwbshHm());
break; break;
} }
case "yhkh": { case "yhkh": {
root.setType("bankCard"); root.setType("yhk");
root.setName("银行卡号:" + fwbsh.getFwbshHm()); root.setName("银行卡号:" + fwbsh.getFwbshHm());
root.setParentName("银行卡号:" + fwbsh.getFwbshHm()); root.setParentName("银行卡号:" + fwbsh.getFwbshHm());
break; break;
} }
case "carid": { case "carid": {
root.setType("car"); root.setType("cph");
root.setName("车牌号码:" + fwbsh.getFwbshHm()); root.setName("车牌号码:" + fwbsh.getFwbshHm());
root.setParentName("车牌号码:" + fwbsh.getFwbshHm()); root.setParentName("车牌号码:" + fwbsh.getFwbshHm());
break; break;
...@@ -449,11 +1602,17 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -449,11 +1602,17 @@ public class ZtypServiceImpl implements ZtypService {
break; break;
} }
case "wx": { case "wx": {
root.setType("wechat"); root.setType("wxid");
root.setName("微信号码:" + fwbsh.getFwbshHm()); root.setName("微信号码:" + fwbsh.getFwbshHm());
root.setParentName("微信号码:" + fwbsh.getFwbshHm()); root.setParentName("微信号码:" + fwbsh.getFwbshHm());
break; break;
} }
case "aj": {
root.setType("aj");
root.setName("案件编号:" + fwbsh.getFwbshHm());
root.setParentName("案件编号:" + fwbsh.getFwbshHm());
break;
}
default: { default: {
return null; return null;
} }
...@@ -462,4 +1621,71 @@ public class ZtypServiceImpl implements ZtypService { ...@@ -462,4 +1621,71 @@ public class ZtypServiceImpl implements ZtypService {
return root; return root;
} }
/**
* deletingSingleBranchBshNodes 删除案件下的单分支的标识号节点
*
* @param root: 根节点
* @param queue: 队列(避免重复创建使用传递)
* @author lystar
* 2022/4/27 20:23
*/
private void deletingSingleBranchBshNodes(AjThKshfxPojo root, LinkedList<AjThKshfxPojo> queue) {
List<AjThKshfxPojo> childList = root.getChildren();
if (childList != null && !childList.isEmpty()) {
if (queue == null) {
queue = new LinkedList<>();
}
//将根节点的全部子节点加入队列
queue.addAll(childList);
//定义一个hashMap,记录标识号出现次数
HashMap<String, List<AjThKshfxPojo>> hashMap = new HashMap<>();
while (!queue.isEmpty()) {
AjThKshfxPojo node = queue.removeFirst();
List<AjThKshfxPojo> children = node.getChildren();
//子节点不为空时
if (children != null && !children.isEmpty()) {
for (AjThKshfxPojo child : children) {
queue.add(child);
//若子节点类型不是案件,记录标识号类型出现次数
if (!"lawcase".equals(child.getType())) {
String id = child.getId();
if (hashMap.containsKey(id)) {
List<AjThKshfxPojo> list = hashMap.get(id);
list.add(node);
} else {
ArrayList<AjThKshfxPojo> list = new ArrayList<>();
list.add(node);
hashMap.put(id, list);
}
}
}
} else {
//若子节点为空,且当前节点类型不是案件时
if (!"lawcase".equals(node.getType())) {
List<AjThKshfxPojo> list = hashMap.get(node.getId());
//通过haspMap获取该标识号出现次数,若为1次,则直接删除
if (list.size() == 1) {
AjThKshfxPojo parentNode = list.get(0);
List<AjThKshfxPojo> parentNodeChildren = parentNode.getChildren();
parentNodeChildren.removeIf(child -> Objects.equals(node.getId(), child.getId()));
}
}
}
}
}
}
private String getDateString(Date date){
String dateStr = "";
if(date != null){
dateStr = new SimpleDateFormat("yyyy-MM-dd").format(date);
}
return dateStr;
}
@Override
public Integer judgePhone(String phoneNum) {
//判断该手机号是否是串并案件中的手机号
int count = ztypMapper.getXsbkOrCbBshByPhoneNum(phoneNum);
return count;
}
} }
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