Commit d91893bf by chentian

区域碰撞时空绘制增加推荐人员功能

parent 85114d19
package com.founder.interservice.VO;
/**
* layui数据表格返回数据处理类
* Created by yutons on 2017/9/1
*/
public class PageBean {
//当前页
private int page;
//页大小
private int limit;
//起始
private int begin;
//结束
private int end;
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getBegin() {
return (this.page-1)*this.limit+1;
}
public void setBegin(Integer begin) {
this.begin = begin;
}
public Integer getEnd() {
return this.page*this.limit;
}
public void setEnd(Integer end) {
this.end = end;
}
}
package com.founder.interservice.VO;
/**
* Created by changc on 2018/9/6.
*/
public class ResultMap {
private String msg;
private int code;
private Object data;
private int count;
public ResultMap() {
super();
}
public ResultMap(int code, String message) {
super();
this.code=code;
this.msg=message;
}
public ResultMap(int code, String message, Object data, int count) {
super();
this.code=code;
this.msg=message;
this.data=data;
this.count=count;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
......@@ -32,4 +32,8 @@ public interface RegionalTaskResultDetailMapper {
public List<Object[]> getFldhBzhCountList(RegionalTaskResultVO vo);
List<Object[]> getsjhmGsdList(RegionalTaskResultVO vo);
public int findRegionalTaskResultTjryCount (RegionalTaskResultDetail param) throws Exception;
public List<RegionalTaskResultDetail> findRegionalTaskResultTjryList (RegionalTaskResultDetail param) throws Exception;
}
......@@ -2,6 +2,7 @@ package com.founder.interservice.regionalanalysis.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.VO.ResultMap;
import com.founder.interservice.VO.ResultVO;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
......@@ -567,6 +568,13 @@ public class RegionalAnalysisController {
modelAndView.addObject("djsj",formatter.format(task.getDjsj()));//发送时间
// modelAndView.addObject("progress",progress);
modelAndView.addObject("taskCaseId",task.getTaskCaseId());
//获取智能推荐人员数量
RegionalTaskResultDetail entity=new RegionalTaskResultDetail();
entity.setTaskId(taskId);
entity.setIsCount("true");
ResultMap resultMap=regionalAnalysisService.tjry(entity);
modelAndView.addObject("tjryCount",resultMap.getCount());
return modelAndView;
}
......@@ -712,10 +720,24 @@ public class RegionalAnalysisController {
}
/**/
@RequestMapping("/toTjDialog")
public ModelAndView toTjDialog(){
@RequestMapping(value = "/toTjDialog",method = {RequestMethod.GET,RequestMethod.POST})
public ModelAndView toTjDialog(String taskId,boolean isCount,String tjCount){
ModelAndView modelAndView = new ModelAndView("qypz/tjDialog");
modelAndView.addObject("taskId",taskId);
modelAndView.addObject("isCount",isCount);
modelAndView.addObject("tjCount",tjCount);
return modelAndView;
}
/**
* 智能推荐推荐人员
* @param
* @return
*/
@RequestMapping(value = "/toTjry",method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody
public ResultMap toTjry(RegionalTaskResultDetail entity){
return regionalAnalysisService.tjry(entity);
}
}
package com.founder.interservice.regionalanalysis.model;
import com.founder.interservice.VO.PageBean;
import lombok.Data;
import javax.persistence.Entity;
......@@ -9,7 +10,7 @@ import java.util.Date;
@Data
@Entity
public class RegionalTaskResultDetail {
public class RegionalTaskResultDetail extends PageBean{
@Id
private String XXZJBH;
......@@ -51,5 +52,13 @@ public class RegionalTaskResultDetail {
private String sjhmgsdsj;//手机号码归属地市级
@Transient
private String sjhmyys;//手机号码运营商
@Transient
private String sfGwryFzxyr;//高危前科
@Transient
private String isCount;//是否只查数量
@Transient
private String tjType;//推荐类型:1:人员 2:号码: 3 车辆
}
package com.founder.interservice.regionalanalysis.service;
import com.founder.interservice.VO.ResultMap;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.regionalanalysis.VO.RegionalTaskResultVO;
import com.founder.interservice.regionalanalysis.model.*;
......@@ -71,8 +72,7 @@ public interface RegionalAnalysisService {
public int deleteRegionalsTaskByTaskId(String taskId);
//根据任务id删除任务结果
public int deleteRegionalTaskResultByTaskId(String taskId);
public ResultMap tjry(RegionalTaskResultDetail entity);
}
package com.founder.interservice.regionalanalysis.service.impl;
import com.founder.interservice.VO.ResultMap;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.mapper.xzxt.RegionalTaskMapper;
import com.founder.interservice.mapper.xzxt.RegionalTaskResultDetailMapper;
......@@ -408,6 +409,62 @@ public class RegionalAnalysisServiceImpl implements RegionalAnalysisService {
public int deleteRegionalTaskResultByTaskId(String taskId){
return regionalTaskResultMapper.deleteRegionalTaskResultByTaskId(taskId);
}
@Override
public ResultMap tjry(RegionalTaskResultDetail entity){
//推荐人员:1.高危,前科。全区域
// 2.高危,全区域/前科,全区域
// 3.高危/前科
// 4.全区域
//按照上述条件依次类推,例如如果没有满足1的数据就推2的。
//根据任务id查询区域
ResultMap resultMap=new ResultMap();
entity.setTjType("1");
try {
int regionalCount=regionalTaskMapper.quertRegionalCountByTaskId(entity.getTaskId());
entity.setSfFzxyr("1");
entity.setSfGwry("1");
entity.setRegionlist(String.valueOf(regionalCount));
//高危,前科。全区域
int count= regionalTaskResultDetailMapper.findRegionalTaskResultTjryCount(entity);
List<RegionalTaskResultDetail> list=new ArrayList<RegionalTaskResultDetail>();
if(count!=0 && "false".equals(entity.getIsCount())){
list=regionalTaskResultDetailMapper.findRegionalTaskResultTjryList(entity);
}else{
entity.setSfFzxyr("");
entity.setSfGwry("");
entity.setSfGwryFzxyr("1");
entity.setRegionlist(String.valueOf(regionalCount));
//高危,全区域/前科,全区域
count= regionalTaskResultDetailMapper.findRegionalTaskResultTjryCount(entity);
if(count!=0&& "false".equals(entity.getIsCount())){
list=regionalTaskResultDetailMapper.findRegionalTaskResultTjryList(entity);
}else{
entity.setRegionlist("");
//高危/前科
count= regionalTaskResultDetailMapper.findRegionalTaskResultTjryCount(entity);
if(count!=0&& "false".equals(entity.getIsCount())){
list=regionalTaskResultDetailMapper.findRegionalTaskResultTjryList(entity);
}else{
entity.setSfGwryFzxyr("");
entity.setRegionlist(String.valueOf(regionalCount));
//全区域
count= regionalTaskResultDetailMapper.findRegionalTaskResultTjryCount(entity);
if(count!=0&& "false".equals(entity.getIsCount())){
System.out.println(entity.getBegin()+":"+entity.getEnd());
list=regionalTaskResultDetailMapper.findRegionalTaskResultTjryList(entity);
}
}
}
}
resultMap.setCount(count);
resultMap.setData(list);
} catch (Exception e) {
e.printStackTrace();
}
return resultMap;
}
}
......@@ -488,4 +488,63 @@
</if>
</select>
<!--区域碰撞,智能推荐,推荐人员-->
<select id = "findRegionalTaskResultTjryCount" parameterType = "com.founder.interservice.regionalanalysis.model.RegionalTaskResultDetail" resultType="int" >
select count(*)
from TB_ST_REGIONALSTASKRESULT t
left join REGIONALTASKRESULTDETAIL td on t.OBJECT_VALUE = td.OBJECT_VALUE AND t.OBJECT_TYPE = td.OBJECT_TYPE
where t.TASK_ID = #{taskId,jdbcType=VARCHAR}
<if test="sfFzxyr!=null and sfFzxyr!=''"> and td.SF_FZXYR =#{sfFzxyr,jdbcType=VARCHAR} </if>
<if test="sfGwry!=null and sfGwry!=''"> and td.SF_GWRY =#{sfGwry,jdbcType=VARCHAR} </if>
<if test="sfGwryFzxyr!=null and sfGwryFzxyr!=''"> and (td.SF_GWRY =1 or td.SF_FZXYR=1) </if>
<if test="regionlist!=null and regionlist!=''">
and LENGTHB(t.regionlist)-LENGTHB(REPLACE(t.regionlist,',',''))+1=#{regionlist,jdbcType=VARCHAR}
</if>
<if test="tjType!=null and tjType!='' and tjType =='1'.toString()"> and td.zjhm is not null </if>
</select>
<select id="findRegionalTaskResultTjryList" parameterType="com.founder.interservice.regionalanalysis.model.RegionalTaskResultDetail" resultType="com.founder.interservice.regionalanalysis.model.RegionalTaskResultDetail">
select t2.*
from (
select t1.*,
rownum as rn
from (
select
td.XXZJBH as xxzjbh,
t.TASK_ID as taskId,
t.OBJECT_TYPE as objectType,
t.OBJECT_TYPE_NAME as objectTypeName,
t.OBJECT_VALUE as objectValue,
t.REGIONLIST as regionlist,
td.TASK_RESULT_ID as taskResultId,
td.BIRTHDAY as birthday,
td.NAME as name,
td.RYZP as ryzp,
td.XZZDZMC as xzzDzmc,
td.CSDDZMC as csdDzmc,
td.ZJLX as zjlx,
td.ZJLX_CODE as zjlxCode,
td.AGE as age,
td.SEX as sex,
td.ZJHM as zjhm,
td.SJHM as sjhm,
td.SF_FZXYR as sfFzxyr,
td.SF_GWRY as sfGwry
from TB_ST_REGIONALSTASKRESULT t
left join REGIONALTASKRESULTDETAIL td on t.OBJECT_VALUE = td.OBJECT_VALUE AND t.OBJECT_TYPE = td.OBJECT_TYPE
where t.TASK_ID = #{taskId,jdbcType=VARCHAR}
<if test="sfFzxyr!=null and sfFzxyr!=''"> and td.SF_FZXYR =#{sfFzxyr,jdbcType=VARCHAR} </if>
<if test="sfGwry!=null and sfGwry!=''"> and td.SF_GWRY =#{sfGwry,jdbcType=VARCHAR} </if>
<if test="sfGwryFzxyr!=null and sfGwryFzxyr!=''"> and (td.SF_GWRY =1 or td.SF_FZXYR=1) </if>
<if test="regionlist!=null and regionlist!=''">
and LENGTHB(t.regionlist)-LENGTHB(REPLACE(t.regionlist,',',''))+1=#{regionlist,jdbcType=VARCHAR}
</if>
<if test="tjType!=null and tjType!='' and tjType =='1'.toString()"> and td.zjhm is not null </if>
order by td.name desc nulls last,td.xxzjbh,t.DJSJ desc
) t1
where rownum <![CDATA[ <= ]]> #{end}
) t2
where rn <![CDATA[ >= ]]>#{begin}
</select>
</mapper>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,6 +36,24 @@ $(function () {
$("#listdiv").hide();
}
});
/*
//查询推荐人员数量
$.ajax({
method: 'post',
url: 'toTjry',
dateType: 'json',
data: {taskId:taskId,yhCate:00,projectName:00,isCount:true},
success: function (data) {
debugger;
$("#count-number").attr("data-to",data.count)
$("#count-number").html(data.count);
//$("#count-number").val(data.count);
},
error: function (e) {
$.messager.alert({title: '提示', msg: "出错:" + e});
}
})*/
});
function loading(type,msg){
......@@ -861,10 +879,12 @@ $("#qyxx").click(function(){
/*推荐人员、车辆弹框*/
function showDialog() {
if( $("#count-number").html()>0){
var dialogId='w';
//alert(JSON.stringify(tjry));
openUrlForm({
id:dialogId,
url:'/toTjDialog?yhCate=00&projectName=刑专智慧侦查脑图',
url:'/toTjDialog?taskId='+taskId+"&isCount=false&tjCount="+ tjryCount+"&yhCate=00&projectName=刑专智慧侦查脑图",
title:'推荐',
width:1000,
height:400,
......@@ -890,6 +910,7 @@ function showDialog() {
])
var tops = $(document).scrollTop();//当页面滚动时,把当前距离赋值给页面,这样保持页面滚动条不动
$(document).bind("scroll",function (){$(document).scrollTop(tops);})
}
}
......
/*$(function () {
//加载列表,分页
//esbfydatathread('','','','');
});*/
function esbfydatathread(page,limit) {
$.ajax({
url: "toTjry",
type: 'post',
dataType: 'json',
//async:false,
//timeout: 0, //超时时间设置,单位毫秒
data: {taskId:taskId,isCount:isCount,page:page,limit:limit,yhCate:00,projectName:00},
success: function (esbdatas) {
if(esbdatas.data.length>0){
//1、所有esb资源遍历
//数据加载...
var esbindex="";
var tjly="";
$.each(esbdatas.data, function (n, data) {
debugger;
$(".result-box:last").clone().appendTo(".dialog-content");
$(".ryzp:last").attr("src", "data:image/gif;base64," + data.ryzp);
$(".eclipse1:last").html(data.zjhm);
if(data.sfGwry=="1"){
tjly="高危";
}else if(data.sfFzxyr=='1'){
if(tjly==""){
tjly="高危";
}else{
tjly=tjly+"、前科";
}
}else{
if(tjly==""){
tjly="全区域";
}else{
tjly=tjly+"、全区域";
}
}
$(".eclipse2:last").html(tjly);
$(".result-box:last").show();
});
}
// layer.close(index);
}
});
}
/**
* 总页数@param(总条数,每页总条数)
*/
function pageTotal(rowCount, pageSize) {
console.log("总条数"+rowCount+"每页总条数"+pageSize)
if (rowCount == null || rowCount == "") {
return 0;
} else {
if (pageSize != 0 &&
rowCount % pageSize == 0) {
return parseInt(rowCount / pageSize);
}
if (pageSize != 0 &&
rowCount % pageSize != 0) {
return parseInt(rowCount / pageSize) + 1;
}
}
}
......@@ -302,7 +302,7 @@
<div class="zntj-wrap">
<div class="counter col_third" onclick="showDialog()">
<div class="ac"><i class="fa fa-address-book fa-2x fa-fw"></i>推荐人员</div>
<h2 class="timer count-title" id="count-number" data-to="300" data-speed="1500"></h2>
<h2 class="timer count-title" id="count-number" data-to="${tjryCount}" data-speed="1500"></h2>
<span class="tj"></span>
</div>
......@@ -314,7 +314,7 @@
<div class="counter col_third">
<div class="ac"><i class="fa fa-car fa-2x fa-fw" style="font-size: 18px;"></i>推荐车辆</div>
<h2 class="timer count-title" id="count-number3" data-to="17" data-speed="1500"></h2>
<h2 class="timer count-title" id="count-number3" data-to="666" data-speed="1500"></h2>
<span class="tj"></span>
</div>
</div>
......@@ -418,6 +418,7 @@
var taskId = "${taskId}";
var djsjStr = "${djsj}";
var gdWrap_H=$(".gd-wrap").height();
var tjryCount="${tjryCount}";
$(window).scroll(function(){
console.log($(document).scrollTop());
if($(document).scrollTop()>=(gdWrap_H-140)){
......
......@@ -4,44 +4,54 @@
<title>Title</title>
<link rel="stylesheet" type="text/css" href="/css/bjzycx.css">
<link rel="stylesheet" type="text/css" href="/css/tjDialog.css">
<script type="text/javascript" src="/js/tjDialog.js"></script>
<script type="text/javascript" src="/js/jquery-1.11.3.js"></script>
<script type="text/javascript" src="/js/jquery.easyui.min.js"></script>
<script src="/js/jquery.js"></script>
<script src="/js/jquery.pagination.js"></script>
</head>
<body>
<div class="dialog-content">
<div class="result-box">
<div class="photo"><img src="/images/img.gif"/></div>
<div class="result-box" style="display: none">
<div class="photo"><img class="ryzp" src=""/></div>
<div class="right-box">
<p><span><span class="border"></span>身份证号:</span><span class="eclipse" title="">111111111111111111</span></p>
<p><span><span class="border"></span>推荐原由:</span><span class="eclipse" title="">111111111111111111</span></p>
</div>
</div>
<div class="result-box">
<div class="photo"><img src="/images/img.gif"/></div>
<div class="right-box">
<p><span><span class="border"></span>身份证号:</span><span class="eclipse" title="">111111111111111111</span></p>
<p><span><span class="border"></span>推荐原由:</span><span class="eclipse" title="">111111111111111111</span></p>
</div>
</div>
<div class="result-box">
<div class="photo"><img src="/images/img.gif"/></div>
<div class="right-box">
<p><span><span class="border"></span>身份证号:</span><span class="eclipse" title="">111111111111111111</span></p>
<p><span><span class="border"></span>推荐原由:</span><span class="eclipse" title="">111111111111111111</span></p>
</div>
</div>
<div class="result-box">
<div class="photo"><img src="/images/img.gif"/></div>
<div class="right-box">
<p><span><span class="border"></span>身份证号:</span><span class="eclipse" title="">111111111111111111</span></p>
<p><span><span class="border"></span>推荐原由:</span><span class="eclipse" title="">111111111111111111</span></p>
</div>
</div>
<div class="result-box">
<div class="photo"><img src="/images/img.gif"/></div>
<div class="right-box">
<p><span><span class="border"></span>身份证号:</span><span class="eclipse" title="">111111111111111111</span></p>
<p><span><span class="border"></span>推荐原由:</span><span class="eclipse" title="">111111111111111111</span></p>
<p><span><span class="border"></span>身份证号:</span><span class="eclipse1" title="">111111111111111111</span></p>
<p><span><span class="border"></span>推荐原由:</span><span class="eclipse2" title="">111111111111111111</span></p>
</div>
</div>
</div>
<div class="M-box3">444</div>
</body>
</html>
<script type="application/javascript">
var taskId='${taskId}';
var isCount='${isCount}';
var tjCount=parseInt('${tjCount}');
var limit=9;
var pageCount=pageTotal(tjCount,limit)
esbfydatathread(1,limit);
/* $('.M-box11').pagination({
mode: 'fixed',
pageCount: pageCount,
callback: function (api) {
console.log(api.getCurrent())
//$(".result-box").remove(":not(:eq(0))");
$(".result-box:not(:eq(0))").remove();//翻页前先清除除了模板以外,其他的div
esbfydatathread(api.getCurrent(),limit);
}
});*/
$('.M-box3').pagination({
pageCount: pageCount,
jump: false,
coping: true,
homePage: '首页',
endPage: '末页',
prevContent: '上页',
nextContent: '下页',
callback: function (api) {
$(".result-box:not(:eq(0))").remove();//翻页前先清除除了模板以外,其他的div
esbfydatathread(api.getCurrent(),limit);
}
});
</script>
\ No newline at end of file
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