Commit 670fed7a by 宋珺琪

Hn可视化接口管理修改bug

parent c76c0410
package com.founder.commonutils.model.newPublicEntity.hnkshEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class HnRygxExport {
@ApiModelProperty(value = "标签")
private String describe;
private String description;
@ApiModelProperty(value = "标识")
private String name;
......@@ -17,41 +18,56 @@ public class HnRygxExport {
@ApiModelProperty(value = "性别")
private String xb;
@ApiModelProperty(value = "年龄")
private String nl;
@ApiModelProperty(value = "民族")
private String mz;
@ApiModelProperty(value = "身份证号")
private String sfzh;
@ApiModelProperty(value = "背景")
private String bj;
@ApiModelProperty(value = "综合评分")
private String zhpf;
@ApiModelProperty(value = "民族")
private String mz;
@ApiModelProperty(value = "同住址")
private String tzz;
@ApiModelProperty(value = "同户号")
private String thh;
@ApiModelProperty(value = "婚姻")
private String hy;
@ApiModelProperty(value = "邻居")
private String lj;
@ApiModelProperty(value = "同机构")
private String tjg;
@ApiModelProperty(value = "出生日期")
private String csrq;
@ApiModelProperty(value = "铁路同乘车")
private String tltcc;
@ApiModelProperty(value = "服务处所")
private String fwcs;
@ApiModelProperty(value = "同乘机")
private String tzj;
@ApiModelProperty(value = "出生地国家")
private String csdgj;
@ApiModelProperty(value = "同出入境")
private String tcrj;
@ApiModelProperty(value = "出生地")
private String csd;
@ApiModelProperty(value = "同车违章")
private String tcwz;
@ApiModelProperty(value = "籍贯")
private String jg;
@ApiModelProperty(value = "同案人员")
private String tary;
@ApiModelProperty(value = "职业")
private String zy;
@ApiModelProperty(value = "同住宿")
private String tzs;
@ApiModelProperty(value = "户籍登记地址")
private String hjdjdz;
@ApiModelProperty(value = "在逃同案人员")
private String zttary;
@ApiModelProperty(value = "姓名注音")
private String xmpy;
@ApiModelProperty(value = "在逃同撤销")
private String zttcx;
@ApiModelProperty(value = "关系集合")
private String value;
......
......@@ -27,7 +27,7 @@ public class HnTbStRygx implements Serializable {
@ApiModelProperty(value = "标签")
@TableField("DESCRIPTION")
private String describe;
private String description;
@ApiModelProperty(value = "标识")
@TableField("NAME")
......@@ -41,14 +41,18 @@ public class HnTbStRygx implements Serializable {
@TableField("XB")
private String xb;
@ApiModelProperty(value = "年龄")
@TableField("NL")
private String nl;
@ApiModelProperty(value = "民族")
@TableField("MZ")
private String mz;
@ApiModelProperty(value = "身份证号")
@TableField("SFZH")
private String sfzh;
@ApiModelProperty(value = "背景")
@TableField("BJ")
private String bj;
@ApiModelProperty(value = "综合评分")
@TableField("ZHPF")
private String zhpf;
......@@ -57,6 +61,14 @@ public class HnTbStRygx implements Serializable {
@TableField("TZZ")
private String tzz;
@ApiModelProperty(value = "同户号")
@TableField("THH")
private String thh;
@ApiModelProperty(value = "婚姻")
@TableField("HY")
private String hy;
@ApiModelProperty(value = "邻居")
@TableField("LJ")
private String lj;
......@@ -65,19 +77,11 @@ public class HnTbStRygx implements Serializable {
@TableField("TJG")
private String tjg;
@ApiModelProperty(value = "民航同订票")
@TableField("MHTDP")
private String mhtdp;
@ApiModelProperty(value = "民航同换票")
@TableField("MHTHP")
private String mhthp;
@ApiModelProperty(value = "铁路同乘车")
@TableField("TLTCC")
private String tltcc;
@ApiModelProperty(value = "同机")
@ApiModelProperty(value = "同机")
@TableField("TZJ")
private String tzj;
......@@ -93,18 +97,10 @@ public class HnTbStRygx implements Serializable {
@TableField("TARY")
private String tary;
@ApiModelProperty(value = "婚姻")
@TableField("HY")
private String hy;
@ApiModelProperty(value = "同住宿")
@TableField("TZS")
private String tzs;
@ApiModelProperty(value = "同户号")
@TableField("THH")
private String thh;
@ApiModelProperty(value = "在逃同案人员")
@TableField("ZTTARY")
private String zttary;
......@@ -113,42 +109,6 @@ public class HnTbStRygx implements Serializable {
@TableField("ZTTCX")
private String zttcx;
@ApiModelProperty(value = "民族")
@TableField("MZ")
private String mz;
@ApiModelProperty(value = "出生日期")
@TableField("CSRQ")
private String csrq;
@ApiModelProperty(value = "服务处所")
@TableField("FWCS")
private String fwcs;
@ApiModelProperty(value = "出生地国家")
@TableField("CSDGJ")
private String csdgj;
@ApiModelProperty(value = "出生地")
@TableField("CSD")
private String csd;
@ApiModelProperty(value = "籍贯")
@TableField("JG")
private String jg;
@ApiModelProperty(value = "职业")
@TableField("ZY")
private String zy;
@ApiModelProperty(value = "户籍登记地址")
@TableField("HJDJDZ")
private String hjdjdz;
@ApiModelProperty(value = "姓名注音")
@TableField("XMPY")
private String xmpy;
@TableField("TYPE")
private String type;
......
package com.founder.commonutils.model.newPublicEntity.hnkshEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
......@@ -18,39 +17,9 @@ public class HnTbStRygxDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "标签")
private String describe;
@ApiModelProperty(value = "标识")
private String name;
/* @ApiModelProperty(value = "姓名")
private String xm;
@ApiModelProperty(value = "身份证号")
private String sfzh;*/
@ApiModelProperty(value = "ID随机")
private String id;
private String label;
@ApiModelProperty(value = "图片")
private String img;
@ApiModelProperty(value = "类型")
private String type;
private String value;
/**
* 是否为黑色节点
*/
private Boolean gen;
/**
* 是否为黄色节点
*/
private Boolean yellow;
private List<HnTbStRygxDTO> children;
private Kshpropertice properties;
}
......@@ -11,7 +11,7 @@ import java.io.Serializable;
public class Hnkshresult implements Serializable {
private kshdata kshdata;
private kshdata kshData;
}
package com.founder.commonutils.model.newPublicEntity.hnkshEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class Kshpropertice implements Serializable {
private String id;
private String label;
private String imgType;
private String borderColor;
/* @ApiModelProperty(value = "标签")
private String describe;
@ApiModelProperty(value = "标识")
private String name;
*//* @ApiModelProperty(value = "姓名")
private String xm;
@ApiModelProperty(value = "身份证号")
private String sfzh;*//*
@ApiModelProperty(value = "ID随机")
private String id;
@ApiModelProperty(value = "图片")
private String img;
@ApiModelProperty(value = "类型")
private String type;
private String value;
*//**
* 是否为黑色节点
*//*
private Boolean gen;
*//**
* 是否为黄色节点
*//*
private Boolean yellow;*/
}
......@@ -9,5 +9,5 @@ public class kshdata {
private List<HnTbStRygxDTO> nodes;
private List<HnTbStRygxDTO> links;
private List<kshlinks> links;
}
package com.founder.commonutils.model.newPublicEntity.hnkshEntity;
import lombok.Data;
import java.io.Serializable;
@Data
public class kshlinks implements Serializable {
private String source;
private String target;
private String label;
private kshlinks properties;
}
......@@ -190,7 +190,7 @@ public class ExcelUtil {
Cell cell;
//标签
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getDescribe()) ? "" : data.getDescribe());
cell.setCellValue(StringUtils.isBlank(data.getDescription()) ? "" : data.getDescription());
//标识
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getName()) ? "" : data.getName());
......@@ -200,25 +200,20 @@ public class ExcelUtil {
//性别
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getXb()) ? "" : data.getXb());
//年龄
//民族
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getNl()) ? "" : data.getNl());
cell.setCellValue(StringUtils.isBlank(data.getMz()) ? "" : data.getMz());
//身份证号
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getSfzh()) ? "" : data.getSfzh());
//背景
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getBj()) ? "" : data.getBj());
//综合评分
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getZhpf()) ? "" : data.getZhpf());
//关系
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getValue()) ? "" : data.getValue());
//民族
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getMz()) ? "" : data.getMz());
//出生日期
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getCsrq()) ? "" : data.getCsrq());
//服务处所
/*//服务处所
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getFwcs()) ? "" : data.getFwcs());
//出生地国家
......@@ -238,7 +233,7 @@ public class ExcelUtil {
cell.setCellValue(StringUtils.isBlank(data.getHjdjdz()) ? "" : data.getHjdjdz());
//姓名拼音
cell = row.createCell(cellNum++);
cell.setCellValue(StringUtils.isBlank(data.getXmpy()) ? "" : data.getXmpy());
cell.setCellValue(StringUtils.isBlank(data.getXmpy()) ? "" : data.getXmpy());*/
}
......
......@@ -163,7 +163,7 @@ public class HnTbStRygxController {
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) map.get("children");
for (HnTbStRygx item : lxrList) {
if (StringUtils.isNotBlank(lxrxm) && StringUtils.isNotBlank(lxrsfz)) {
if (lxrxm.equals(item.getDescribe()) && lxrsfz.equals(item.getName())) {
if (lxrxm.equals(item.getDescription()) && lxrsfz.equals(item.getName())) {
flag1 = true;
break;
}
......@@ -173,7 +173,7 @@ public class HnTbStRygxController {
break;
}
} else if (StringUtils.isNotBlank(lxrxm)) {
if (lxrxm.equals(item.getDescribe())) {
if (lxrxm.equals(item.getDescription())) {
flag1 = true;
break;
}
......@@ -270,209 +270,6 @@ public class HnTbStRygxController {
}
/**
* 根据团伙ID返回可视化展示的格式
*
* @param id 团伙ID
* @param teamNum 共同联系人数量
* @param username 用户名
* @param taskId 任务ID
* @param rygx 人员关系
* @param lxrXm 联系人姓名
* @param lxrSfz 联系人身份证
* @param bLxrXm 被联系人姓名
* @param bLxrSfz 被联系人身份证
* @return
*/
@PostMapping("getRythInfoById")
public MapRestResult getRythInfoById(@RequestParam("id") String id,
@RequestParam("teamNum") Integer teamNum,
@RequestParam("username") String username,
@RequestParam("taskId") String taskId,
@RequestParam(name = "rygx", required = false) String rygx,
@RequestParam(name = "lxrXm", required = false) String lxrXm,
@RequestParam(name = "lxrSfz", required = false) String lxrSfz,
@RequestParam(name = "bLxrXm", required = false) String bLxrXm,
@RequestParam(name = "bLxrSfz", required = false) String bLxrSfz) {
//团伙信息集合
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(username + ":" + taskId + ":" + TEAM_KEY + teamNum);
//指定团伙集合
List<Map<String, Object>> rythInfoByIdList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
rythInfoByIdList.add(map);
break;
}
}
//根据人员关系过滤children的值
if (StringUtils.isNotBlank(rygx)) {
Map<String, Object> conditionMap = rythInfoByIdList.get(0);
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) conditionMap.get("children");
Set<HnTbStRygx> childSet = new HashSet<>();
for (HnTbStRygx item : lxrList) {
if (strMatch(item.getValue(), rygx)) {
childSet.add(item);
}
}
conditionMap.put("children", childSet);
}
//查询出所有联系人的身份证
List<String> nameList = hnKshService.getGroupNameByRwid(taskId);
Hnkshresult hnkshresult = packingData(rythInfoByIdList, nameList, lxrXm, lxrSfz, bLxrXm, bLxrSfz);
ArrayList<Object> re = new ArrayList<>();
re.add(hnkshresult);
// List<Hnkshresult> hnTbStRygxDTOS = packingData(rythInfoByIdList, nameList, lxrXm, lxrSfz, bLxrXm, bLxrSfz);
return new MapRestResult(200,"ok",re.size(),re);
// return Result.ok().data("rows", hnTbStRygxDTOS);
}
/**
* 按照可视化的格式返回
*
* @param data 团伙的信息
* @param nameList 联系人的身份证集合
* @param lxrXm 联系人姓名
* @param lxrSfz 联系人身份证
* @param bLxrXm 被联系姓名
* @param bLxrSfz 被联系人身份证
* @return
*/
public Hnkshresult packingData(List<Map<String, Object>> data, List<String> nameList, String lxrXm, String lxrSfz, String bLxrXm, String bLxrSfz) {
Hnkshresult hnkshresult = new Hnkshresult();
kshdata kshdata = new kshdata();
List<HnTbStRygxDTO> resultList = new ArrayList<>();
for (Map<String, Object> team : data) {
//拿出name(被联系人)
Set<Map<String, String>> nameSet = (Set<Map<String, String>>) team.get("name");
//拿出children(联系人)
Set<HnTbStRygx> childrenList = (Set<HnTbStRygx>) team.get("children");
for (Map<String, String> stringMap : nameSet) {
String sfzh = stringMap.get("sfzh");
String xm = stringMap.get("xm");
String bimg = null;
//去children找出被联系人所有的联系人
List<HnTbStRygxDTO> singlePersonOfChildrenList = new ArrayList<>();
//children
for (HnTbStRygx rygx : childrenList) {
if (sfzh.equals(rygx.getSfzh())) {
//联系人和被联系人的姓名和身份证互换
String describe = rygx.getDescribe();
String name = rygx.getName();
String value = rygx.getValue();
String img = rygx.getImg();
bimg = rygx.getBimg();
HnTbStRygxDTO dto = new HnTbStRygxDTO();
dto.setDescribe(describe);
dto.setName(name);
dto.setId(IdUtil.simpleUUID());
dto.setType("person");
dto.setImg(img);
dto.setValue(value);
//判断是否为联系人
if (nameList.contains(name)) {
dto.setGen(true);
}
//判断是否查询条件中的人
if (StringUtils.isNotBlank(lxrXm) || StringUtils.isNotBlank(lxrSfz) || StringUtils.isNotBlank(bLxrXm) || StringUtils.isNotBlank(bLxrSfz)) {
if (describe.equals(lxrXm) || name.equals(lxrSfz) || describe.equals(bLxrXm) || name.equals(bLxrSfz)) {
dto.setYellow(true);
}
}
singlePersonOfChildrenList.add(dto);
}
}
if (singlePersonOfChildrenList.isEmpty()) {
continue;
}
//组装
HnTbStRygxDTO mergeDTO = new HnTbStRygxDTO();
mergeDTO.setName(sfzh);
mergeDTO.setDescribe(xm);
mergeDTO.setId(IdUtil.simpleUUID());
mergeDTO.setType("person");
mergeDTO.setImg(bimg);
//判断是否为联系人
if (nameList.contains(sfzh)) {
mergeDTO.setGen(true);
}
//判断是否查询条件中的人
if (StringUtils.isNotBlank(bLxrXm) || StringUtils.isNotBlank(bLxrSfz) || StringUtils.isNotBlank(lxrXm) || StringUtils.isNotBlank(lxrSfz)) {
if (xm.equals(bLxrXm) || sfzh.equals(bLxrSfz) || xm.equals(lxrXm) || sfzh.equals(lxrSfz)) {
mergeDTO.setYellow(true);
}
}
mergeDTO.setChildren(singlePersonOfChildrenList);
resultList.add(mergeDTO);
kshdata.setNodes(resultList);kshdata.setLinks(resultList);
hnkshresult.setKshdata(kshdata);
}
}
return hnkshresult;
}
/**
* 根据指定团伙获取并保存人员图片到数据库
*
* @param id
* @param teamNum
* @param taskId
* @param username
* @return
*/
@GetMapping("getAndSaveImg")
public Result getAndSaveImg(@RequestParam(name = "id") String id,
@RequestParam(name = "teamNum") Integer teamNum,
@RequestParam(name = "taskId") String taskId,
@RequestParam(name = "username") String username) {
//图片key
String imgKey = IMG_TASK_KEY + ":" + username + ":" + taskId + ":" + id;
//团伙信息key
String infoKey = username + ":" + taskId + ":" + TEAM_KEY + teamNum;
//判断任务是否在执行中
//执行中
if (redisTemplate.hasKey(imgKey)) {
throw new ApiException(207, "图片正在导入中,请勿重复操作");
}
//获取团伙信息集合
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(infoKey);
if (rythInfoList.isEmpty()) {
return Result.error().message("无团伙信息,获取照片失败");
}
//查询出指定团伙集合
List<Map<String, Object>> rythInfoByIdList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
rythInfoByIdList.add(map);
break;
}
}
try {
//创建任务
redisTemplate.opsForValue().set(imgKey, "1", 1, TimeUnit.DAYS);
//保存
hnKshService.getAndSaveImg(rythInfoByIdList, taskId, teamNum);
} catch (Exception e) {
//出现异常时删除redis上的任务
deleteByPrexInRedis(imgKey);
}
//获取保存后的数据
List<Map<String, Object>> rythInfo = hnKshService.getRythInfo(teamNum, taskId);
if (rythInfo == null) {
throw new ApiException(210, "重新获取数据失败,请检查");
}
for (int i = 0; i < rythInfo.size(); i++) {
//替换children数据
rythInfoList.get(i).put("children", rythInfo.get(i).get("children"));
}
//更新redis上的数据
redisTemplate.opsForValue().set(infoKey, rythInfoList);
//删除任务
deleteByPrexInRedis(imgKey);
return Result.ok();
}
/**
......@@ -772,22 +569,27 @@ public class HnTbStRygxController {
List<HnRygxExport> exportList = new ArrayList();
for (HnTbStRygx hnTbStRygx : children) {
HnRygxExport export = new HnRygxExport();
export.setDescribe(hnTbStRygx.getDescribe());
export.setDescription(hnTbStRygx.getDescription());
export.setName(hnTbStRygx.getName());
export.setXm(hnTbStRygx.getXm());
export.setXb(hnTbStRygx.getXb());
export.setNl(hnTbStRygx.getNl());
export.setMz(hnTbStRygx.getMz());
export.setSfzh(hnTbStRygx.getSfzh());
export.setBj(hnTbStRygx.getBj());
export.setZhpf(hnTbStRygx.getZhpf());
export.setMz(hnTbStRygx.getMz());
export.setCsrq(hnTbStRygx.getCsrq());
export.setFwcs(hnTbStRygx.getFwcs());
export.setCsdgj(hnTbStRygx.getCsdgj());
export.setCsd(hnTbStRygx.getCsd());
export.setJg(hnTbStRygx.getJg());
export.setZy(hnTbStRygx.getZy());
export.setHjdjdz(hnTbStRygx.getHjdjdz());
export.setXmpy(hnTbStRygx.getXmpy());
/*export.setTzz(hnTbStRygx.getTzz());
export.setThh(hnTbStRygx.getThh());
export.setHy(hnTbStRygx.getHy());
export.setLj(hnTbStRygx.getLj());
export.setTjg(hnTbStRygx.getTjg());
export.setTltcc(hnTbStRygx.getTltcc());
export.setTzj(hnTbStRygx.getTzj());
export.setTcrj(hnTbStRygx.getTcrj());
export.setTcwz(hnTbStRygx.getTcwz());
export.setTary(hnTbStRygx.getTary());
export.setTzj(hnTbStRygx.getTzj());
export.setZttary(hnTbStRygx.getZttary());
export.setZttcx(hnTbStRygx.getZttcx());*/
export.setValue(hnTbStRygx.getValue());
exportList.add(export);
}
......@@ -815,5 +617,192 @@ public class HnTbStRygxController {
redisTemplate.delete(keys);
}
}
}
/**
* 根据指定团伙获取并保存人员图片到数据库
*
* @param id
* @param teamNum
* @param taskId
* @param username
* @return
*/
@GetMapping("getAndSaveImg")
public Result getAndSaveImg(@RequestParam(name = "id") String id,
@RequestParam(name = "teamNum") Integer teamNum,
@RequestParam(name = "taskId") String taskId,
@RequestParam(name = "username") String username) {
//图片key
String imgKey = IMG_TASK_KEY + ":" + username + ":" + taskId + ":" + id;
//团伙信息key
String infoKey = username + ":" + taskId + ":" + TEAM_KEY + teamNum;
//判断任务是否在执行中
//执行中
if (redisTemplate.hasKey(imgKey)) {
throw new ApiException(207, "图片正在导入中,请勿重复操作");
}
//获取团伙信息集合
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(infoKey);
if (rythInfoList.isEmpty()) {
return Result.error().message("无团伙信息,获取照片失败");
}
//查询出指定团伙集合
List<Map<String, Object>> rythInfoByIdList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
rythInfoByIdList.add(map);
break;
}
}
try {
//创建任务
redisTemplate.opsForValue().set(imgKey, "1", 1, TimeUnit.DAYS);
//保存
hnKshService.getAndSaveImg(rythInfoByIdList, taskId, teamNum);
} catch (Exception e) {
//出现异常时删除redis上的任务
deleteByPrexInRedis(imgKey);
}
//获取保存后的数据
List<Map<String, Object>> rythInfo = hnKshService.getRythInfo(teamNum, taskId);
if (rythInfo == null) {
throw new ApiException(210, "重新获取数据失败,请检查");
}
for (int i = 0; i < rythInfo.size(); i++) {
//替换children数据
rythInfoList.get(i).put("children", rythInfo.get(i).get("children"));
}
//更新redis上的数据
redisTemplate.opsForValue().set(infoKey, rythInfoList);
//删除任务
deleteByPrexInRedis(imgKey);
return Result.ok();
}
/**
* 根据团伙ID返回可视化展示的格式
*
* @param id 团伙ID
* @param username 用户名
* @param taskId 任务ID
* @param rygx 人员关系
* @param lxrXm 联系人姓名
* @param lxrSfz 联系人身份证
* @param bLxrXm 被联系人姓名
* @param bLxrSfz 被联系人身份证
* @return
*/
@PostMapping("getRythInfoById")
public MapRestResult getRythInfoById(@RequestParam("id") String id,
@RequestParam("username") String username,
@RequestParam("taskId") String taskId,
@RequestParam(name = "rygx", required = false) String rygx,
@RequestParam(name = "lxrXm", required = false) String lxrXm,
@RequestParam(name = "lxrSfz", required = false) String lxrSfz,
@RequestParam(name = "bLxrXm", required = false) String bLxrXm,
@RequestParam(name = "bLxrSfz", required = false) String bLxrSfz) {
String teamNum ="1";
//团伙信息集合
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(username + ":" + taskId + ":" + TEAM_KEY + teamNum);
//指定团伙集合
List<Map<String, Object>> rythInfoByIdList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
rythInfoByIdList.add(map);
break;
}
}
//根据人员关系过滤children的值
if (StringUtils.isNotBlank(rygx)) {
Map<String, Object> conditionMap = rythInfoByIdList.get(0);
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) conditionMap.get("children");
Set<HnTbStRygx> childSet = new HashSet<>();
for (HnTbStRygx item : lxrList) {
if (strMatch(item.getValue(), rygx)) {
childSet.add(item);
}
}
conditionMap.put("children", childSet);
}
//查询出所有联系人的name
List<String> nameList = hnKshService.getGroupNameByRwid(taskId);
Hnkshresult hnTbStRygxDTOS = packingData(rythInfoByIdList, nameList, lxrXm, lxrSfz, bLxrXm, bLxrSfz);
ArrayList<Object> re = new ArrayList<>();
re.add(hnTbStRygxDTOS);
return new MapRestResult(200,"ok",re.size(),hnTbStRygxDTOS);
}
/**
* 按照可视化的格式返回
*
* @param data 团伙的信息
* @param nameList 联系人的身份证集合
* @param lxrXm 联系人姓名
* @param lxrSfz 联系人身份证
* @param bLxrXm 被联系姓名
* @param bLxrSfz 被联系人身份证
* @return
*/
public Hnkshresult packingData(List<Map<String, Object>> data, List<String> nameList, String lxrXm, String lxrSfz, String bLxrXm, String bLxrSfz) {
Hnkshresult hnkshresult = new Hnkshresult();
kshdata kshdata = new kshdata();
List<HnTbStRygxDTO> resultList = new ArrayList<>();
for (Map<String, Object> team : data) {
//h获取指定团伙里的name 和sfzh
Set<Map<String, String>> nameSet = (Set<Map<String, String>>) team.get("name");
//拿出children
Set<HnTbStRygx> childrenList = (Set<HnTbStRygx>) team.get("children");
for (Map<String, String> stringMap : nameSet) {
String sfzh = stringMap.get("sfzh");
String xm = stringMap.get("xm");
//去children找出被联系人所有的联系人
List<kshlinks> re =new ArrayList<>();
for (HnTbStRygx rygx : childrenList) {
if (sfzh.equals(rygx.getSfzh())) {
kshlinks ks= new kshlinks();
String description = rygx.getDescription();
String sfzh1 = rygx.getSfzh();
String xm1 = rygx.getXm();
String name = rygx.getName();
String value = rygx.getValue();
kshlinks kshlink = new kshlinks();
kshlink.setSource(sfzh1);
kshlink.setTarget(xm1+"\n"+sfzh1);
kshlink.setLabel(value);
ks.setSource(sfzh1);
ks.setTarget(xm1+"\n"+sfzh1);
ks.setLabel(value);
ks.setProperties(kshlink);
re.add(ks);
}
}
//组装 nodes
HnTbStRygxDTO mergeDTO = new HnTbStRygxDTO();
mergeDTO.setId(sfzh);
mergeDTO.setLabel(xm+"\n"+sfzh);
Kshpropertice kshpropertice = new Kshpropertice();
kshpropertice.setId(sfzh);
kshpropertice.setLabel(xm+"\n"+sfzh);
kshpropertice.setImgType("idcard");
kshpropertice.setBorderColor(null);
mergeDTO.setProperties(kshpropertice);
resultList.add(mergeDTO);
//添加到kshadata
kshdata.setNodes(resultList);
kshdata.setLinks(re);
hnkshresult.setKshData(kshdata);
}
}
return hnkshresult;
}
}
......@@ -25,21 +25,19 @@
<select id="getInfoBySfzh" resultType="com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx">
select
name,description,xm,sfzh,type,img,bimg,nl,xb,mz,csrq,fwcs,csdgj,zhpf,csd,jg,zy,hjdjdz,xmpy,
name,description,xm,xb,mz,sfzh,bj,zhpf,
trim( TRAILING ',' FROM RTRIM( CONCAT (
case when tzz != '0' then '同住址,' else '' end ,
case when thh != '0' then '同户号,' else ''end ,
case when hy != '0' then '婚姻,' else '' end ,
case when lj != '0' then '邻居,' else '' end ,
case when tjg != '0' then '同机构,' else '' end ,
case when mhtdp != '0' then '民航同订票,' else '' end ,
case when mhthp != '0' then '民航同订票,' else ''end ,
case when tltcc != '0' then '铁路同乘车,' else '' end ,
case when tzj != '0' then '同值机,' else '' end ,
case when tcrj != '0' then '同出入境,' else ''end ,
case when tcwz != '0' then '同车违章,' else ''end ,
case when tary != '0' then '同案人员,' else ''end ,
case when hy != '0' then '婚姻,' else '' end ,
case when tzs != '0' then '同住宿,' else ''end ,
case when thh != '0' then '同户号,' else ''end ,
case when zttary != '0' then '在逃同案人员' when zttcx != '0' then '在逃同撤销' else ''end
))) as value
from hn_tb_st_rygx where rwid = #{taskId} and sfzh = #{sfzh} and name in
......
......@@ -138,8 +138,10 @@ public class HnTbStRygxServiceImpl extends ServiceImpl<HnTbStRygxMapper, HnTbStR
Set map_nameSet = new HashSet();
Map<String, Object> resultMap = new HashMap();
for (String n : sfzhList) {
// nameSet根据sfz和rwid查xm和sfz
List<Map<String, Object>> maps = baseMapper.getXmAndSfzhBySfzh(n, taskId);
map_nameSet.addAll(maps);
// childrenSet 根据sfz namelist rwid
List<HnTbStRygx> list = baseMapper.getInfoBySfzh(n, nameList, taskId);
map_childrenSet.addAll(list);
}
......
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