Commit 1cfcc238 by yangyang

群体研判相关提交

parent 9eabbfd2
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.HashSet;
import java.util.Set;
/**
* 团伙类
* create by lystar
* 2021/8/2 18:23
*/
@Data
public class Accomplicee {
//团伙编号
String thbh;
//嫌疑人数量
Integer xyrCount;
//重点关注人员数量
Integer zdgzyrCount;
//案件数量
Integer ajCount;
//九类案件数量
Integer jlajCount;
//标记案件数量
int bjajCount;
}
......@@ -69,4 +69,7 @@ public class AjQueryParam {
@ApiModelProperty(value = "共同关系系数")
private String commonRelationshipNum;
@ApiModelProperty(value = "0否 1是")
private String sfdj;
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.Data;
import java.util.Date;
/**
* 案件查询返回类
*/
@Data
public class AjQueryResult {
//信息主键编号
String xxzjbh;
//团伙编号
String thbh;
//案事件编号
String asjbh;
//案件类证
String ajlbdm;
//案件名称
String ajmc;
//立案单位代码
String ladwdm;
//立案日期
Date larq;
//是否刑事案件
String isXsAj;
// 是否九类案件
String isNine;
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.Data;
import java.util.Objects;
/**
* 嫌疑人证件号码及是否被使用
* create by lystar
* 2021/8/2 18:55
*/
@Data
public class AjXyrResult {
//信息主键编号
String xxzjbh;
//团伙编号
String thbh;
//证件号码
String zjhm;
//户籍地代码
String hjd;
//人员姓名
String xm;
//是否重点关注人员
String isZdgzyr = "0";
}
......@@ -118,6 +118,10 @@ public class TbStZtypFwbsh {
@TableField(exist = false)
private List<List<String>> unitcodeList;
@ApiModelProperty(value = "标识号表入参")
@TableField(exist = false)
private List<String> bshlb;
//登录人员
public void setDjUser(SysUser user){
this.xxdjryXm=user.getTrueName();
......
......@@ -323,6 +323,12 @@ public class TbYwCchshzztjb{
@ApiModelProperty(value = "信息操作单位_联系电话")
protected String xxczryLxdh;
@ApiModelProperty(value = "可视化案件编号集合")
protected List<String> asjbhList;
@ApiModelProperty(value = "可视化证件号集合")
protected List<String> zjhmList;
public void setDjUser(SysUser user){
this.xxdjryXm=user.getTrueName();
this.xxdjdwGajgjgdm=user.getUnitcode();
......
......@@ -117,21 +117,37 @@ public class ZtypController {
@PostMapping("/queryAjypfx")
@ApiOperation(value = "群体研判列表")
public R queryAjypfx(AjQueryParam requestParam) {
requestParam.setPage((requestParam.getPage()-1) * requestParam.getLimit());
requestParam.setLimit(requestParam.getLimit());
Integer count = ztypService.queryAjypfxCount(requestParam);
Integer count = 0;
List<AjypFxPojo> records = new ArrayList<>();
if (count != null && count > 0) {
records = ztypService.queryAjypfxData(requestParam);
if("0".equals(requestParam.getSfdj())){
requestParam.setPage((requestParam.getPage()-1) * requestParam.getLimit());
requestParam.setLimit(requestParam.getLimit());
count = ztypService.queryAjypfxCount(requestParam);
if (count != null && count > 0) {
records = ztypService.queryAjypfxData(requestParam);
}
}else if("1".equals(requestParam.getSfdj())){
requestParam.setPage((requestParam.getPage()-1) * requestParam.getLimit());
requestParam.setLimit(requestParam.getLimit());
count = ztypService.queryAjypfxCountDj(requestParam);
if (count != null && count > 0) {
records = ztypService.queryAjypfxDataDj(requestParam);
}
}
return R.ok().total(count).rows(records);
}
@OperLog(message = "案件团伙分析可视化接口",operation = OperationType.QUERY)
@PostMapping("/getThfxAccompliceBythId")
@ApiOperation(value = "案件团伙分析可视化接口")
public MapRestResult getThfxAccompliceBythId(@RequestBody AjQueryParam requestParam) {
return ztypService.getThfxAccompliceBythId(requestParam.getThbh(), requestParam.getFxwd(),requestParam.getCommonRelationshipNum());
if("0".equals(requestParam.getSfdj())){
return ztypService.getThfxAccompliceBythId(requestParam.getThbh(), requestParam.getFxwd(),requestParam.getCommonRelationshipNum());
}else if("1".equals(requestParam.getSfdj())){
return ztypService.getThfxAccompliceBythIdDj(requestParam.getThbh(), requestParam.getFxwd(),requestParam.getCommonRelationshipNum());
}
return null;
}
@OperLog(message = "可视化",operation = OperationType.QUERY)
......@@ -194,6 +210,20 @@ public class ZtypController {
}
}
@OperLog(message = "根据可视化登记为犯罪团伙",operation = OperationType.QUERY)
@PostMapping("/addFzthajKsh")
@ApiOperation(value = "根据可视化登记为犯罪团伙")
public R addFzthajKsh(TbYwCchshzztjb cchshzztjb,HttpServletRequest request){
try {
cchshzztjb.setDjUser(JwtUser.getUser(request));
String xxzjbh = ztypService.addFzthajKsh(cchshzztjb,request);
return R.ok().data("xxzjbh",xxzjbh);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("getThgaByKsh")
@ApiOperation(value = "查询可视化关联案件信息")
@OperLog(message = "查询可视化关联案件信息", operation = OperationType.QUERY)
......
......@@ -27,8 +27,8 @@ public interface TbStZtypFwbshMapper extends BaseMapper<TbStZtypFwbsh> {
* @author yangyang
* 2022/4/24 10:07
*/
IPage<TbStZtypFwbsh> selectPageByFwbsh(Page<TbStZtypFwbsh> page, @Param("fwbsh") TbStZtypFwbsh fwbsh);
List<TbStZtypFwbsh> selectPageByFwbsh(@Param("fwbsh") TbStZtypFwbsh fwbsh);
int selectPageByFwbshCount(@Param("fwbsh") TbStZtypFwbsh fwbsh);
/**
* selectSfzPageByFwbsh 根据号码分页查询(身份证号码)
* @return com.baomidou.mybatisplus.core.metadata.IPage<org.springblade.founder.ztyp.entity.TbStZtypFwbsh>
......
......@@ -27,6 +27,12 @@ public interface ZtypMapper{
//案件团伙分析count
Integer queryAjypfxCount(AjQueryParam requestParam);
//案件团伙分析登记主数据
List<AjypFxPojo> queryAjypfxDataDj(AjQueryParam requestParam);
//案件团伙分析登记count
Integer queryAjypfxCountDj(AjQueryParam requestParam);
//获取团伙的通话记录
List<Map<String, String>> getThConnectPhoneList(String thbh);
......@@ -73,6 +79,10 @@ public interface ZtypMapper{
List<AjThKshfxPojo> getGroupAsjList(@Param("fzXyrList") List<String> fzXyrList);
List<AjThKshfxPojo> getGroupXyrListByThbhDj(String thbh);
List<AjThKshfxPojo> getGroupAsjListDj(@Param("fzXyrList") List<String> fzXyrList);
List<AjThKshfxPojo> getKshConnectPhoneList(String thbh);
List<AjThKshfxPojo> getkshConnectIpList(String thbh);
......@@ -81,4 +91,26 @@ public interface ZtypMapper{
int getXsbkOrCbBshByPhoneNum(@Value("phoneNum") String phoneNum);
/**
* insertThGlXYR 在团伙关联嫌疑人中间表中插入数据
*
* @param xyr: 嫌疑人信息
*/
void insertThGlXYRDj(AjXyrResult xyr);
/**
* insertThGlASJ 在团伙关联案件中间表中插入数据
*
* @param aj: 案件信息
*/
void insertThGlASJDj(AjQueryResult aj);
/**
* insertTh 插入团伙信息
*
* @param accomplicee: 团伙信息
*/
void insertThDj(Accomplicee accomplicee);
Integer findZdmzyrByZjhm(String zjhm);
}
......@@ -2,13 +2,75 @@
<!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">
<select id="selectPageByFwbsh" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbStZtypFwbsh">
select
(SELECT count(1) FROM tb_xsz_cbyp_qgaj WHERE CBXGFWBZH = fwbsh_hm) as qgajCount,
<include refid="fwbsh-queryColumn"/>
from tb_st_ztyp_fwbsh
SELECT xxzjbh,
fwbsh_lb as fwbshLb,
(SELECT count(*) FROM tb_xsz_cbyp_qgaj WHERE CBXGFWBZH = fwbsh_hm) as qgajCount,
(select name from sys_dictitem where GROUPID = 'CODE_CBYP_BSHLX' and code = fwbsh_lb) as fwbshLbStr,
fwbsh_hm as fwbshHm,
fwbsh_ms as fwbshMs,
djsj as djsj,
xxdjdw_gajgjgdm as xxdjdwGajgjgdm,
xxdjdw_gajgmc as xxdjdwGajgmc,
xxdjry_xm as xxdjryxm,
xxdjry_gmsfhm as xxdjryGmsfhm,
xxdjry_lxdh as xxdjryLxdh
FROM tb_st_ztyp_fwbsh
where XXSC_PDBZ = '0'
<include refid="fwbsh-queryParam"/>
UNION ALL
SELECT xxzjbh as xxzjbh ,
ASJXGFWBZH_FWBZH_FWBZHLBDM as fwbshLb,
(SELECT count(*) FROM tb_xsz_cbyp_qgaj WHERE CBXGFWBZH = asjxgfwbzh_fwbzh) as qgajCount,
(select name from sys_dictitem where groupid = 'CODE_FWBSH' and code = ASJXGFWBZH_FWBZH_FWBZHLBDM) as fwbshLbStr,
asjxgfwbzh_fwbzh as fwbshHm,
'系统自动提取' as fwbshMs,
djsj as djsj ,
'系统' as xxdjdwGajgjgdm,
'系统' as xxdjdwGajgmc,
'系统' as xxdjryxm,
'系统' as xxdjryGmsfhm,
'系统' as xxdjryLxdh
FROM tb_xw_asjxgfwbzh
where xxsc_pdbz=0
and ASJXGFWBZH_FWBZH_FWBZHLBDM in
<foreach collection="fwbsh.bshlb" item="bsh" open="(" separator="," close=")">
#{bsh,jdbcType=VARCHAR}
</foreach>
<if test="fwbsh.fwbshHm != null and fwbsh.fwbshHm != ''">
and instr(asjxgfwbzh_fwbzh, #{fwbsh.fwbshHm,jdbcType=VARCHAR}) > 0
</if>
<if test="fwbsh.xxdjryXm != null and fwbsh.xxdjryXm != ''">
and '系统' like concat('%',#{fwbsh.xxdjryXm,jdbcType=VARCHAR},'%')
</if>
order by djsj desc
limit #{fwbsh.page},#{fwbsh.limit}
</select>
<select id="selectPageByFwbshCount" resultType="java.lang.Integer">
select sum(a.x) from (
SELECT count(*) as x
FROM tb_st_ztyp_fwbsh
where XXSC_PDBZ = '0'
<include refid="fwbsh-queryParam"/>
UNION ALL
SELECT count(*) as x
FROM tb_xw_asjxgfwbzh
where xxsc_pdbz=0
and ASJXGFWBZH_FWBZH_FWBZHLBDM in
<foreach collection="fwbsh.bshlb" item="bsh" open="(" separator="," close=")">
#{bsh,jdbcType=VARCHAR}
</foreach>
<if test="fwbsh.fwbshHm != null and fwbsh.fwbshHm != ''">
and instr(asjxgfwbzh_fwbzh, #{fwbsh.fwbshHm,jdbcType=VARCHAR}) > 0
</if>
<if test="fwbsh.xxdjryXm != null and fwbsh.xxdjryXm != ''">
and '系统' like concat('%',#{fwbsh.xxdjryXm,jdbcType=VARCHAR},'%')
</if>
) as a
</select>
<select id="selectSfzPageByFwbsh" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbStZtypFwbsh">
select
......
......@@ -251,6 +251,141 @@
</if>
</where>
</select>
<select id="queryAjypfxDataDj" 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_thdj 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_thglxyrdj 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_thglasjdj 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>
limit #{page},#{limit}
</select>
<select id="queryAjypfxCountDj" resultType="java.lang.Integer">
select count(th.THBH)
from tb_yw_shse_thdj 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_thglxyrdj 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_thglasjdj 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
......@@ -1999,6 +2134,16 @@
FROM tb_yw_shse_thglxyr
where THBH = #{ thbh , jdbcType=VARCHAR }
</select>
<select id="getGroupXyrListByThbhDj"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
SELECT ZJHM as id,
concat('嫌疑人身份证号:',ZJHM) as name,
'person' as Type,
'group' as parentType,
#{thbh} as parentId
FROM tb_yw_shse_thglxyrdj
where THBH = #{ thbh , jdbcType=VARCHAR }
</select>
<select id="getKshConnectPhoneList"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select thxyr.ZJHM as parentId,
......@@ -2054,6 +2199,27 @@
</foreach>
group by thxyr.ZJHM, asj.ASJBH, asj.AJLBDM
</select>
<select id="getGroupAsjListDj" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select thxyr.ZJHM as parentId,
'person' as parentType,
asj.ASJBH as id,
CONCAT(asj.ASJBH,(select a.name
from sys_dictitem a
where a.GROUPID = 'CODE_AJLB'
and a.CODE = asj.AJLBDM)) as name,
'asjbh' as type
from tb_yw_shse_thglxyrdj thxyr
join tb_xw_zbfzxyr zbxyr on thxyr.ZJHM = zbxyr.ZHFZXYR_CYZJ_ZJHM
join tb_st_asj asj on zbxyr.ASJBH = asj.ASJBH and asj.LARQ between DATE_FORMAT('2015-1-1','%Y-%m-%d %H:%i:%S')
and now()
where zbxyr.XXSC_PDBZ = '0' and asj.XXSC_PDBZ = '0'
and thxyr.ZJHM in
<foreach collection="fzXyrList" separator="," close=")" open="(" item="item" index="index">
#{item}
</foreach>
group by thxyr.ZJHM, asj.ASJBH, asj.AJLBDM
</select>
<select id="getkshCashAccountList"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
select thxyr.ZJHM as parentId,
......@@ -2073,4 +2239,44 @@
) + (
SELECT count( 1 ) FROM tb_yw_xsz_cbaj WHERE XXSC_PDBZ = '0' AND CBXGFWBZH = #{phoneNum})total
</select>
<insert id="insertThGlXYRDj" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjXyrResult">
insert into tb_yw_shse_thglxyrdj(xxzjbh, thbh, zjhm, sfzdgzyr_pdbz, hjddm, xm)
values (#{xxzjbh, jdbcType=VARCHAR},
#{thbh, jdbcType=VARCHAR},
#{zjhm, jdbcType=VARCHAR},
#{isZdgzyr, jdbcType=VARCHAR},
#{hjd, jdbcType=VARCHAR},
#{xm, jdbcType=VARCHAR})
</insert>
<insert id="insertThGlASJDj" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjQueryResult">
insert into tb_yw_shse_thglasjdj(xxzjbh, thbh, asjbh, sfjlaj_pdbz, sfxsaj_pdbz, ajmc, ladwdm, ajlbdm, larq)
VALUES (#{xxzjbh, jdbcType=VARCHAR},
#{thbh, jdbcType=VARCHAR},
#{asjbh, jdbcType=VARCHAR},
#{isNine, jdbcType=VARCHAR},
#{isXsAj, jdbcType=VARCHAR},
#{ajmc, jdbcType=VARCHAR},
#{ladwdm, jdbcType=VARCHAR},
#{ajlbdm, jdbcType=VARCHAR},
#{larq, jdbcType=DATE})
</insert>
<insert id="insertThDj" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.Accomplicee">
insert into tb_yw_shse_thdj(thbh, thglxyrsl, thglzdgzyrsl, thglajsl, thgljlajsl, sfsc_pdbz)
VALUES (#{thbh, jdbcType=VARCHAR},
#{xyrCount, jdbcType=DOUBLE},
#{zdgzyrCount, jdbcType=DOUBLE},
#{ajCount, jdbcType=DOUBLE},
#{jlajCount, jdbcType=DOUBLE},
'0')
</insert>
<select id="findZdmzyrByZjhm" resultType="java.lang.Integer">
select count(1)
from tb_st_rybz
where zjhm = #{zjhm,jdbcType=VARCHAR}
and xxsc_pdbz = 0
</select>
</mapper>
......@@ -40,6 +40,8 @@ public interface ZtypService{
void updateFwbshYp(TbStZtypFwbsh fwbsh);
List<AjypFxPojo> queryAjypfxData(AjQueryParam requestParam);
Integer queryAjypfxCount(AjQueryParam requestParam);
List<AjypFxPojo> queryAjypfxDataDj(AjQueryParam requestParam);
Integer queryAjypfxCountDj(AjQueryParam requestParam);
/**
* kshdata 标识号可视化
* @param fwbsh: 标识号
......@@ -69,6 +71,9 @@ public interface ZtypService{
//根据推荐的团伙信息添加犯罪团伙
String addFzthaj(TbYwCchshzztjb cchshzztjb, HttpServletRequest request);
//根据可视化团伙信息添加犯罪团伙
String addFzthajKsh(TbYwCchshzztjb cchshzztjb, HttpServletRequest request);
Map<String, Object> getSjhJzxx(String phoneNum) throws Exception;
Map<String, Object> getSjInfo(TxxxParam txxxParam) throws Exception;
......@@ -77,5 +82,7 @@ public interface ZtypService{
MapRestResult getThfxAccompliceBythId(String thbh, String fxwd, String commonRelationshipNum);
MapRestResult getThfxAccompliceBythIdDj(String thbh, String fxwd, String commonRelationshipNum);
Integer judgePhone(String phoneNum);
}
......@@ -16,6 +16,7 @@ import com.founder.publicapi.service.ZtypService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
......@@ -86,12 +87,16 @@ public class ZtypServiceImpl implements ZtypService {
@Override
public Map<String, Object> listFwbshYp(TbStZtypFwbsh fwbsh) {
HashMap<String, Object> resultMap = new HashMap<>();
IPage<TbStZtypFwbsh> iPage;
List<TbStZtypFwbsh> rows;
fwbsh.setPage((fwbsh.getPage()-1)*fwbsh.getLimit());
List<TbStZtypFwbsh> iPage;
int count = 0;
List<String> fwbshlb = new ArrayList<>();
if ("personid".equals(fwbsh.getFwbshLb())) {
iPage = tbStZtypFwbshMapper.selectSfzPageByFwbsh(new Page<>(fwbsh.getPage(), fwbsh.getLimit()), fwbsh);
rows = iPage.getRecords();
rows.stream().parallel().forEach(item -> {
fwbshlb.add("16");
fwbsh.setBshlb(fwbshlb);
iPage = tbStZtypFwbshMapper.selectPageByFwbsh(fwbsh);
count = tbStZtypFwbshMapper.selectPageByFwbshCount(fwbsh);
iPage.stream().parallel().forEach(item -> {
//查询全国涉案数量 TODO @author: lystar
item.setQgajCount(0);
//查询全省涉案数量
......@@ -101,17 +106,28 @@ public class ZtypServiceImpl implements ZtypService {
});
} else {
//查询QQ、微信、手机号、车牌号、银行卡
iPage = tbStZtypFwbshMapper.selectPageByFwbsh(new Page<>(fwbsh.getPage(), fwbsh.getLimit()), fwbsh);
rows = iPage.getRecords();
rows.stream().parallel().forEach(item -> {
if("mobile".equals(fwbsh.getFwbshLb())){
fwbshlb.add("01");
}else if("yhkh".equals(fwbsh.getFwbshLb())){
fwbshlb.add("04");
}else if("carid".equals(fwbsh.getFwbshLb())){
fwbshlb.add("22");
}else if("99".equals(fwbsh.getFwbshLb())){
fwbshlb.add("12");
fwbshlb.add("13");
}
fwbsh.setBshlb(fwbshlb);
iPage = tbStZtypFwbshMapper.selectPageByFwbsh(fwbsh);
count = tbStZtypFwbshMapper.selectPageByFwbshCount(fwbsh);
iPage.stream().parallel().forEach(item -> {
//查询全省涉案数量
item.setQsajCount(tbStZtypFwbshMapper.selectAjCountByHm(item.getFwbshHm(), null));
//查询相关线索数量
item.setGlxsCount(tbStZtypFwbshMapper.selectXgxsCountByHm(item.getFwbshHm()));
});
}
resultMap.put("rows", rows);
resultMap.put("total", iPage.getTotal());
resultMap.put("rows", iPage);
resultMap.put("total", count);
return resultMap;
}
......@@ -135,10 +151,29 @@ public class ZtypServiceImpl implements ZtypService {
}
@Override
public List<AjypFxPojo> queryAjypfxDataDj(AjQueryParam requestParam) {
List<AjypFxPojo> records = ztypMapper.queryAjypfxDataDj(requestParam);
if (records.size() > 0) {
setThNames(records);
String fxwd = requestParam.getFxwd();
if (org.springframework.util.StringUtils.hasText(fxwd)) {
int commonRelationshipNum = Integer.valueOf(requestParam.getCommonRelationshipNum());
setThPhoneAndIpAndCashNum(records, fxwd, commonRelationshipNum);
}
}
return records;
}
@Override
public Integer queryAjypfxCount(AjQueryParam requestParam) {
return ztypMapper.queryAjypfxCount(requestParam);
}
@Override
public Integer queryAjypfxCountDj(AjQueryParam requestParam) {
return ztypMapper.queryAjypfxCountDj(requestParam);
}
private void setThNames(List<AjypFxPojo> records) {
int startNum = 1;
Set<String> thSetList = new HashSet<>();
......@@ -947,104 +982,119 @@ public class ZtypServiceImpl implements ZtypService {
@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);
String thbh = KeyUtil.getUUIDKey("th");
TbYwShseTh shseTh = new TbYwShseTh();
shseTh.setThbh(cchshzztjb.getThbh());
List<TbStAsj> asj = ztypMapper.getThgaByThbh(shseTh);
List<TbStAsj> asjbhList = 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<TbXwZbfzxyr> zjhmList = 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);
int jlajCount = 0;
int zdgzyrCount = 0;
// 团伙案件登记表新增
asjbhList.stream().forEach(aj->{
String xxzjbh = KeyUtil.getUUIDKey("xx");
AjQueryResult ajQueryResult = new AjQueryResult();
ajQueryResult.setXxzjbh(xxzjbh);
ajQueryResult.setThbh(thbh);
ajQueryResult.setAsjbh(aj.getAsjbh());
ajQueryResult.setAjlbdm(aj.getAjlbdm());
ajQueryResult.setAjmc(aj.getAjmc());
ajQueryResult.setLadwdm(aj.getLadwGajgjgdm());
ajQueryResult.setLarq(aj.getLarq());
ajQueryResult.setIsXsAj("1");
if(Arrays.asList("03080700","04000900","05001000","05001100","05001100","06012300","06012400","06013900","06080100","06080200").contains(aj.getAjlbdm())){
ajQueryResult.setIsNine("1");
}else{
ajQueryResult.setIsNine("0");
}
}
//线索关联嫌疑人
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);
ztypMapper.insertThGlASJDj(ajQueryResult);
});
// 团伙嫌疑人登记表新增
zjhmList.stream().forEach(zj->{
String xxzjbh = KeyUtil.getUUIDKey("xx");
AjXyrResult ajXyrResultt = new AjXyrResult();
Integer zdryCount = ztypMapper.findZdmzyrByZjhm(zj.getZhfzxyrCyzjZjhm());
if (zdryCount != null && zdryCount > 0) {
ajXyrResultt.setIsZdgzyr("1");
}
}
ajXyrResultt.setThbh(thbh);
ajXyrResultt.setXxzjbh(xxzjbh);
ajXyrResultt.setHjd(zj.getHjd());
ajXyrResultt.setXm(zj.getZhfzxyrXm());
ajXyrResultt.setZjhm(zj.getZhfzxyrCyzjZjhm());
ztypMapper.insertThGlXYRDj(ajXyrResultt);
});
// 团伙登记表新增
Accomplicee accomplicee = new Accomplicee();
accomplicee.setThbh(thbh);
accomplicee.setAjCount(asjbhList.size());
accomplicee.setXyrCount(zjhmList.size());
accomplicee.setJlajCount(jlajCount);
accomplicee.setZdgzyrCount(zdgzyrCount);
ztypMapper.insertThDj(accomplicee);
return thbh;
}
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);
}
}
@Transactional
@Override
public String addFzthajKsh(TbYwCchshzztjb cchshzztjb, HttpServletRequest request) {
String thbh = KeyUtil.getUUIDKey("th");
// 案件集合
List<String> listAsjbhs = cchshzztjb.getAsjbhList();
TbYwShseTh tbYwShseTh = new TbYwShseTh();
tbYwShseTh.setListBhs(listAsjbhs);
List<TbStAsj> asjbhList = ztypMapper.getThgaByKsh(tbYwShseTh);
// 嫌疑人集合
List<String> listZjbhs = cchshzztjb.getZjhmList();
TbYwShseTh tbYwShseThXyr = new TbYwShseTh();
tbYwShseThXyr.setListBhs(listZjbhs);
List<TbXwZbfzxyr> zjhmList = ztypMapper.getThxyrByKsh(tbYwShseThXyr);
int jlajCount = 0;
int zdgzyrCount = 0;
// 团伙案件登记表新增
asjbhList.stream().forEach(aj->{
String xxzjbh = KeyUtil.getUUIDKey("xx");
AjQueryResult ajQueryResult = new AjQueryResult();
ajQueryResult.setXxzjbh(xxzjbh);
ajQueryResult.setThbh(thbh);
ajQueryResult.setAsjbh(aj.getAsjbh());
ajQueryResult.setAjlbdm(aj.getAjlbdm());
ajQueryResult.setAjmc(aj.getAjmc());
ajQueryResult.setLadwdm(aj.getLadwGajgjgdm());
ajQueryResult.setLarq(aj.getLarq());
ajQueryResult.setIsXsAj("1");
if(Arrays.asList("03080700","04000900","05001000","05001100","05001100","06012300","06012400","06013900","06080100","06080200").contains(aj.getAjlbdm())){
ajQueryResult.setIsNine("1");
}else{
ajQueryResult.setIsNine("0");
}
ztypMapper.insertThGlASJDj(ajQueryResult);
});
// 团伙嫌疑人登记表新增
zjhmList.stream().forEach(zj->{
String xxzjbh = KeyUtil.getUUIDKey("xx");
AjXyrResult ajXyrResultt = new AjXyrResult();
Integer zdryCount = ztypMapper.findZdmzyrByZjhm(zj.getZhfzxyrCyzjZjhm());
if (zdryCount != null && zdryCount > 0) {
ajXyrResultt.setIsZdgzyr("1");
}
}).start();
return xxzjbh;
ajXyrResultt.setThbh(thbh);
ajXyrResultt.setXxzjbh(xxzjbh);
ajXyrResultt.setHjd(zj.getHjd());
ajXyrResultt.setXm(zj.getZhfzxyrXm());
ajXyrResultt.setZjhm(zj.getZhfzxyrCyzjZjhm());
ztypMapper.insertThGlXYRDj(ajXyrResultt);
});
// 团伙登记表新增
Accomplicee accomplicee = new Accomplicee();
accomplicee.setThbh(thbh);
accomplicee.setAjCount(asjbhList.size());
accomplicee.setXyrCount(zjhmList.size());
accomplicee.setJlajCount(jlajCount);
accomplicee.setZdgzyrCount(zdgzyrCount);
ztypMapper.insertThDj(accomplicee);
return thbh;
}
@Override
......@@ -1562,6 +1612,166 @@ public class ZtypServiceImpl implements ZtypService {
ksjResultPojo.setLinks(links);
return new MapRestResult(200, "可视化结果获取成功", 1, ksjResultPojo);
}
@Override
public MapRestResult getThfxAccompliceBythIdDj(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.getGroupXyrListByThbhDj(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.getGroupAsjListDj(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);
......
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