Commit cda8363d by chentian

时空回溯分类导航功能开发

parent 9fa47e83
package com.founder.interservice.mapper.xzxt;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.spatiotemporalBackTrack.VO.SpatiotemporalBackTrackResultVO;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import org.springframework.stereotype.Repository;
import javax.persistence.criteria.CriteriaBuilder;
import java.util.List;
......@@ -28,5 +28,7 @@ public interface SBTResultDetailMapper {
SpatiotemporalBackTrack findByTaskId(String taskId);
Integer findSkhsDetailListTotalCount(SBTResultDetail sbtResultDetail);
List<SBTResultDetail> findSkhsTaskResultDetailList(SBTResultDetail sbtResultDetail);
public List<Object[]> getFldhCountList(SpatiotemporalBackTrackResultVO vo);
public List<Object[]> getFldhBzhCountList(SpatiotemporalBackTrackResultVO vo);
}
package com.founder.interservice.spatiotemporalBackTrack.VO;
import lombok.Data;
@Data
public class SpatiotemporalBackTrackResultVO {
private String xxzjbh; //信息主键编号
private String taskId;//任务编号
private String objectType; //对象类型
private String objectTypeName; //对象类型名称
private String objectValue; //对象值
private int startNum;
private int endNum;
private String checkVal;
private String sqlStr;
private String isNullField;
private String groupByField;
}
......@@ -4,13 +4,11 @@ import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.VO.ResultVO;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.regionalanalysis.VO.RegionalTaskVO;
import com.founder.interservice.regionalanalysis.model.RegionalsTask;
import com.founder.interservice.spatiotemporalBackTrack.VO.SpatiotemporalBackTrackResultVO;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.service.SpatiotemporalBackTrackService;
import com.founder.interservice.user.controller.UserContoller;
import com.founder.interservice.user.model.User;
import com.founder.interservice.util.EasyUIPage;
import com.founder.interservice.util.ResultVOUtil;
import com.founder.interservice.util.StringUtil;
......@@ -21,7 +19,6 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.persistence.criteria.CriteriaBuilder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -333,6 +330,9 @@ public class SpatiotemporalBackTrackController {
int end = easyUIPage.getEnd();
param.setStartNum(begin);
param.setEndNum(end);
if(param.getBirthday()!=null && !"".equals(param.getBirthday())){
param.setRqLength(param.getBirthday().length());
}
totalCount = spatiotemporalBackTrackService.findSkhsDetailListTotalCount(param);
sbtResultDetails = spatiotemporalBackTrackService.findSkhsTaskResultDetailList(param);
if (null != sbtResultDetails && sbtResultDetails.size() > 0) {
......@@ -343,8 +343,16 @@ public class SpatiotemporalBackTrackController {
tsaf.setZjlx("--");
tsaf.setZjhm("非本市户籍人员");
}
String edzZp = clzp(tsaf);
tsaf.setRyzpStr(edzZp);
if (tsaf.getAge() == null || "".equals(tsaf.getAge())) {
tsaf.setAge("--");
}
if (tsaf.getXzzDzmc() == null || "".equals(tsaf.getXzzDzmc())) {
tsaf.setXzzDzmc("--");
}
if (tsaf.getCsdDzmc() == null || "".equals(tsaf.getCsdDzmc())) {
tsaf.setCsdDzmc("--");
}
clzpnew(tsaf);
}
}
resultMap.put("total", totalCount);
......@@ -369,4 +377,31 @@ public class SpatiotemporalBackTrackController {
}
return zp;
}
private void clzpnew(SBTResultDetail tsaf){
String zp64bite = "";
if (!"".equals(tsaf.getRyzp()) && tsaf.getRyzp() != null) {
// 对字节数组Base64编码 处理图片
/*BASE64Encoder encoder = new BASE64Encoder();
zp64bite = encoder.encode(tsaf.getRyzp());*/// 返回Base64编码过的字节数组字符串
zp64bite = new String(tsaf.getRyzp());
}
String zp = "data:image/gif;base64," + zp64bite;
tsaf.setZp(zp);
}
/**
* 时空回溯分类导航点击查询,查出分类导航count
* @return
*/
@RequestMapping("/getSkhsFlCountList")
@ResponseBody
public Map<String,Object> getSkhsFlCountList(SpatiotemporalBackTrackResultVO vo){
Map<String, Object> resultMap = new HashMap<>();
//循环checkVal,获取总数
String[] checkVals=vo.getCheckVal().split(",");
for(int i=0;i<checkVals.length;i++){
List<Object[]> list= spatiotemporalBackTrackService.getSkhsFlCountList(checkVals[i],vo);
resultMap.put(checkVals[i],list);
}
return resultMap;
}
}
......@@ -34,5 +34,9 @@ public class SBTResultDetail {
private int startNum;
private int endNum;
private int rqLength;//出生日期长度
private String sfbs;//是否本市
private String zp;
}
......@@ -2,6 +2,7 @@ package com.founder.interservice.spatiotemporalBackTrack.service;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.spatiotemporalBackTrack.VO.SpatiotemporalBackTrackResultVO;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
......@@ -25,5 +26,7 @@ public interface SpatiotemporalBackTrackService {
SpatiotemporalBackTrack findByTaskId(String taskId);
Integer findSkhsDetailListTotalCount(SBTResultDetail sbtResultDetail);
List<SBTResultDetail> findSkhsTaskResultDetailList(SBTResultDetail sbtResultDetail);
public List<Object[]> getSkhsFlCountList(String checkVal,SpatiotemporalBackTrackResultVO vo);
//时空回溯相关 结束
}
......@@ -3,6 +3,7 @@ package com.founder.interservice.spatiotemporalBackTrack.service.impl;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.mapper.xzxt.*;
import com.founder.interservice.spatiotemporalBackTrack.VO.SpatiotemporalBackTrackResultVO;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.service.SpatiotemporalBackTrackService;
......@@ -114,4 +115,50 @@ public class SpatiotemporalBackTrackServiceImpl implements SpatiotemporalBackTra
public List<SBTResultDetail> findSkhsTaskResultDetailList(SBTResultDetail sbtResultDetail) {
return sBTResultDetailMapper.findSkhsTaskResultDetailList(sbtResultDetail);
}
@Override
public List<Object[]> getSkhsFlCountList(String checkVal,SpatiotemporalBackTrackResultVO vo){
List<Object[]> list=new ArrayList<Object[]>();
if("XB".equals(checkVal)){
vo.setSqlStr("count(b.sex) counts," +
" CASE WHEN b.sex =1 THEN '男'" +
" WHEN b.sex =2 THEN '女'" +
" WHEN b.sex =9 THEN '未说明的性别'" +
" WHEN b.sex =0 THEN '未知的性别'" +
" END as names ,b.sex vals");
vo.setIsNullField(" b.sex is not null ");
vo.setGroupByField(" b.sex ");
list=sBTResultDetailMapper.getFldhCountList(vo);
}else if("SFBS".equals(checkVal)){
//本市非两种情况,本市,和非本市
vo.setSqlStr(" count(*) counts,'本市人员' names,1 vals ");
vo.setIsNullField(" (b.zjhm is not null and substr(b.zjhm,1,2)='50') ");
vo.setGroupByField("");
list=sBTResultDetailMapper.getFldhBzhCountList(vo);
vo.setSqlStr(" count(*) counts,'非本市人员' names,0 vals ");
vo.setIsNullField(" (b.zjhm is null or substr(b.zjhm,1,2)!='50') ");
vo.setGroupByField("");
list.addAll(sBTResultDetailMapper.getFldhBzhCountList(vo));
if(list.contains("0")){
System.out.println("");
}
}else if("BZHLX".equals(checkVal)){
vo.setSqlStr(" count(a.object_type) counts,max(a.object_type_name) names,a.object_type vals ");
vo.setIsNullField("");
vo.setGroupByField(" a.object_type ");
list=sBTResultDetailMapper.getFldhBzhCountList(vo);
}else if("CSRQ".equals(checkVal)){
int[] subStr=new int[3];
subStr[0]=4;
subStr[1]=7;
subStr[2]=10;
for(int i=0;i<subStr.length;i++){
vo.setSqlStr(" count(substr(birthday,1,"+subStr[i]+")) counts,substr(birthday,1,"+subStr[i]+") names,substr(birthday,1,"+subStr[i]+") vals ");
vo.setIsNullField(" b.birthday is not null ");
vo.setGroupByField(" substr(birthday,1,"+subStr[i]+") ");
list.addAll(sBTResultDetailMapper.getFldhCountList(vo));
}
}
return list;
}
}
......@@ -212,6 +212,10 @@
<if test="objectValue!= null and objectValue!= ''">and t.OBJECT_VALUE LIKE '%'|| #{objectValue} || '%'</if>
<if test="csrqStart!=null and csrqStart!=''"> and to_date(td.BIRTHDAY,'yyyy-MM-dd') <![CDATA[>=]]> to_date(#{csrqStart},'yyyy-MM-dd') </if>
<if test="csrqEnd!=null and csrqEnd!=''"> and to_date(td.BIRTHDAY,'yyyy-MM-dd') <![CDATA[<=]]> to_date(#{csrqEnd},'yyyy-MM-dd') </if>
<if test="birthday!=null and birthday!=''"> and substr(td.BIRTHDAY,0,${rqLength}) =#{birthday} </if>
<if test='sfbs =="0"'>and (td.ZJHM is null or substr(td.zjhm,1,2)!='50') </if>
<if test='sfbs =="1"'>and (td.ZJHM is not null and substr(td.zjhm,1,2)='50') </if>
<if test="sex!=null and sex!=''"> and td.SEX =#{sex} </if>
</select>
<!-- 获取时空回溯list -->
......@@ -255,10 +259,47 @@
<if test="objectValue!= null and objectValue!= ''">and t.OBJECT_VALUE LIKE '%'|| #{objectValue} || '%'</if>
<if test="csrqStart!=null and csrqStart!=''"> and to_date(td.BIRTHDAY,'yyyy-MM-dd') <![CDATA[>=]]> to_date(#{csrqStart},'yyyy-MM-dd') </if>
<if test="csrqEnd!=null and csrqEnd!=''"> and to_date(td.BIRTHDAY,'yyyy-MM-dd') <![CDATA[<=]]> to_date(#{csrqEnd},'yyyy-MM-dd') </if>
<if test="birthday!=null and birthday!=''"> and substr(td.BIRTHDAY,0,${rqLength}) =#{birthday} </if>
<if test='sfbs =="0"'>and (td.ZJHM is null or substr(td.zjhm,1,2)!='50') </if>
<if test='sfbs =="1"'>and (td.ZJHM is not null and substr(td.zjhm,1,2)='50') </if>
<if test="sex!=null and sex!=''"> and td.SEX =#{sex} </if>
order by td.name desc nulls LAST,t.djsj desc
) t1
where rownum <![CDATA[ <= ]]> #{endNum}
) t2
where rn <![CDATA[ > ]]> #{startNum}
</select>
<select id="getFldhCountList" parameterType="com.founder.interservice.spatiotemporalBackTrack.VO.SpatiotemporalBackTrackResultVO" resultType="java.util.Map" >
select ${sqlStr} from SBT_RESULT_DETAIL b
left join TB_ST_SPATIOTEMPORALRESULT a on a.object_type=b.object_type and a.OBJECT_VALUE = b.OBJECT_VALUE
where a.task_id=#{taskId}
<if test="isNullField!= null and isNullField!= ''">
and ${isNullField}
</if>
<if test="objectValue!= null and objectValue!= ''">
AND a.object_value LIKE '%'|| #{objectValue} || '%'
</if>
<if test="groupByField!= null and groupByField!= ''">
group by ${groupByField}
</if>
</select>
<select id="getFldhBzhCountList" parameterType="com.founder.interservice.spatiotemporalBackTrack.VO.SpatiotemporalBackTrackResultVO" resultType="java.util.Map" >
select ${sqlStr} from TB_ST_SPATIOTEMPORALRESULT a
left join SBT_RESULT_DETAIL b on a.object_type=b.object_type and a.OBJECT_VALUE = b.OBJECT_VALUE
where a.task_id=#{taskId}
<if test="isNullField!= null and isNullField!= ''">
and ${isNullField}
</if>
<if test="objectValue!= null and objectValue!= ''">
AND a.object_value LIKE '%'|| #{objectValue} || '%'
</if>
<if test="groupByField!= null and groupByField!= ''">
group by ${groupByField}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -122,6 +122,11 @@
</legend>
<input type="hidden" id = "yhCate" name="yhCate" value="00" />
<input type="hidden" id = "projectName" name="projectName" value="刑专智慧侦查脑图" />
<input type="hidden" id = "objectType" name="objectType" value="" class="fltj"/>
<input type="hidden" id = "birthday" name="birthday" value="" class="fltj"/>
<input type="hidden" id = "sfbs" name="sfbs" value="" class="fltj"/>
<input type="hidden" id = "sex" name="sex" value="" class="fltj"/>
<input type="hidden" id = "checkVal" name="checkVal" value="" />
<table style="display: none" class="cxtj-table sp_table">
<tbody>
<input type="hidden" name="taskId" value="${taskId}">
......@@ -137,34 +142,6 @@
</td>
</tr>
<tr>
<td class="ar" width="13.3%">出生日期:</td>
<td width="20%">
<span class="textbox" style="border:none;">
<input id="csrqStart" name="csrqStart" class="Wdate" type="text" onkeypress="return checkDateFmt();" style="width:100%;" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'csrqEnd\')}',dateFmt:'yyyy-MM-dd'})"/>
</span>
</td>
<td class="ar" width="13.3%">至:</td>
<td width="20%">
<span class="textbox" style="border:none;">
<input id="csrqEnd" name="csrqEnd" class="Wdate" type="text" onkeypress="return checkDateFmt();" style="width:100%;" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'csrqStart\')}',dateFmt:'yyyy-MM-dd'})"/>
</span>
</td>
</tr>
<tr>
<td class="ar">标识号类型:</td>
<td colspan="3" class="radil_td">
<input type="checkbox" name="objectType" value="558" class="radio_inp"/>QQ
<input type="checkbox" name="objectType" value="4615" class="radio_inp"/>微信ID
<input type="checkbox" name="objectType" value="4314" class="radio_inp"/>IMSI
<input type="checkbox" name="objectType" value="4725" class="radio_inp"/>热点MAC
<input type="checkbox" name="objectType" value="4329" class="radio_inp"/>MAC地址
<input type="checkbox" name="objectType" value="6424" class="radio_inp"/>汽车蓝色号牌
<input type="checkbox" name="objectType" value="6423" class="radio_inp"/>汽车黄色号牌
<input type="checkbox" name="objectType" value="6422" class="radio_inp"/>汽车白色号牌
<input type="checkbox" name="objectType" value="7888" class="radio_inp"/>摩托车黄色号码
</td>
</tr>
<tr>
<td colspan="4" style="text-align:center;">
<a class="btn_a btn_search" onclick="doQuery()">查询</a>
<a class="btn_a btn_empty" onclick="doClear()">清空</a>
......@@ -175,11 +152,49 @@
</table>
</fieldset>
</form>
</div>
<%--分类导航--%>
<div class="cxjg">
<fieldset>
<legend>分类导航
<ul class="searchConfigHead pull-clear">
<li class="pull-right" style="margin-right: 15px;"><input type="radio" showtype="block" class="radio-inline" name="presentType" title="" primary="true" value="EZUIGrid"></li>
<li class="pull-right"><input type="radio" showtype="grid" checked="checked" class="radio-inline" name="presentType" value="DList"></li>
<li class="pull-right"><input type="checkbox" showtype="minCheck" onclick="checkAllNav(this)" id="searchConfigCheckAll"><label for="searchConfigCheckAll">全选</label></li>
</ul>
</legend>
<ul class="searchConfigChecks pull-clear">
<li class="searchConfigCheck pull-left"><input type="checkbox" showtype="minCheck" name="navOption" value="BZHLX" id="searchConfig1"><label for="searchConfig1">标识号分类</label></li>
<li class="searchConfigCheck pull-left"><input type="checkbox" showtype="minCheck" name="navOption" value="CSRQ" id="searchConfig4"><label for="searchConfig4">出生日期分类</label></li>
<li class="searchConfigCheck pull-left"><input type="checkbox" showtype="minCheck" name="navOption" value="SFBS" id="searchConfig3"><label for="searchConfig3">是否本市分类</label></li>
<li class="searchConfigCheck pull-left"><input type="checkbox" showtype="minCheck" name="navOption" value="XB" id="searchConfig2"><label for="searchConfig2">性别分类</label></li>
</ul>
<div style="text-align: right;height: 32px;">
<a class="btn_a btn_search" onclick="doQueryFL()">查询</a>
<a class="btn_a btn_empty" onclick="doClearFl()">清空</a>
</div>
</fieldset>
<legend>查询结果<span class="st-span total">0</span></legend>
<div class="bootPanelHeading pull-left">
<%-- <span>当前结果共<span class="countTotal red">2211</span>条,共<span class="countTotalPage red">148</span></span>--%>
<span><span class="countTotal red"></span><span class="countTotalPage red"></span></span>
</div>
<!--图表1-->
<div class="navCategory" style="display: none" id="fldh">
</div>
</div>
<%--区块--%>
<div id="qkdiv" class="layoutDiv resultList" style="display: none;">
</div>
<div id="listdiv">
<table class="easyui-datagrid" id="skhsjgzsTable" style="border-top:1px dashed #ccc;" width="100%">
</table>
</div>
</div>
</div>
<!--表格设置面板-->
<div id="ryjgzs" class="easyui-dialog" title="人员" data-options="modal:true,closed:true,collapsible:false,minimizable:false,maximizable:false" style="width:520px;height:auto;padding:10px;display:none;">
......
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