Commit 549f2f2b by yangyang

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

parent ff907984
......@@ -27,7 +27,7 @@
<swagger.version>2.9.2</swagger.version>
<aliyun.oss.version>2.8.3</aliyun.oss.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-io.version>2.6</commons-io.version>
<httpclient.version>4.5.1</httpclient.version>
......@@ -285,6 +285,11 @@
<artifactId>poi-scratchpad</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>2.2.6</version>
</dependency>
</dependencies>
</dependencyManagement>
......
......@@ -124,7 +124,7 @@
</dependency>
<!--xls-->
<dependency>
<!--<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</dependency>
......@@ -132,8 +132,28 @@
<dependency>
<groupId>org.apache.poi</groupId>
<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>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
......
......@@ -3,12 +3,15 @@ package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.Param;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 主题研判服务标识号研判mapper
......@@ -69,4 +72,96 @@ public interface TbStZtypFwbshMapper extends BaseMapper<TbStZtypFwbsh> {
* 2022/4/26 19:58
*/
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);
}
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();
}
}
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