Commit a37b77df by libin

添加区域(车辆)徘徊功能后台代码

parent c97703bc
package com.founder.interservice.mapper.xzxt;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository
public interface QyphMapper {
int queryQyphTaskCount(Map<String,Object> map);
List<SpatiotemporalBackTrack> queryQyphTaskList(Map<String,Object> map);
int queryQyphTaskResultCount(@Param("taskId") String taskId);
List<SpatiotemporalBackTrackResult> queryQyphTaskResults(@Param("taskId") String taskId);
}
package com.founder.interservice.sksjzc.common;
/*
时空数据侦察公共请求,主要用于获取总数等。
*/
public class SksjzcCommenController {
}
package com.founder.interservice.sksjzc.qyph.controller;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.sksjzc.qyph.service.QyphService;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResult;
import com.founder.interservice.util.EasyUIPage;
import com.founder.interservice.util.XdhSpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@CrossOrigin
@Controller
public class QyphController {
@Autowired
private QyphService qyphService;
@RequestMapping("/getQyphTaskList")
@ResponseBody
public EasyUIPage getQyphTaskList(String taskType,String fsrIdentity, String asjbh, EasyUIPage page,Integer rows){
page.setPagePara(rows);
SpatiotemporalBackTrack param = new SpatiotemporalBackTrack();
param.setTaskCaseId(asjbh);
param.setType(taskType);
if(!StringUtils.isEmpty(fsrIdentity)){
param.setFsrSfzh(fsrIdentity);
}
try {
page= qyphService.getQyphTaskList(page,param);
} catch (Exception e) {
e.printStackTrace();
}
return page;
}
@RequestMapping("/getQyphTaskCount")
@ResponseBody
public Map<String,Object> getQyphTaskCount(String taskType,String fsrIdentity, String asjbh){
Map<String,Object> result =new HashMap<>();
SpatiotemporalBackTrack param = new SpatiotemporalBackTrack();
param.setTaskCaseId(asjbh);
param.setType(taskType);
if(!StringUtils.isEmpty(fsrIdentity)){
param.setFsrSfzh(fsrIdentity);
}
try {
Integer count = qyphService.getQyphTaskCount(param);
result.put("state","success");
result.put("data",count);
} catch (Exception e) {
e.printStackTrace();
result.put("state","error");
result.put("data",0);
}
return result;
}
@RequestMapping("/getQyphTaskResult")
@ResponseBody
public Map<String,Object> getQyphTaskResult(String taskId){
Map<String,Object> result =new HashMap<>();
try {
List<SpatiotemporalBackTrackResult> list = qyphService.getQyphTaskResult(taskId);
result.put("state","success");
result.put("data",list);
} catch (Exception e) {
e.printStackTrace();
result.put("state","error");
result.put("data",new ArrayList<>());
}
return result;
}
}
package com.founder.interservice.sksjzc.qyph.service;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResult;
import com.founder.interservice.util.EasyUIPage;
import java.util.List;
public interface QyphService {
/**
* 区域徘徊任务数量
* @param param
* @return
*/
public int getQyphTaskCount(SpatiotemporalBackTrack param);
/**
* 获取区域徘徊任务列表
* @param page
* @param param
* @return
*/
public EasyUIPage getQyphTaskList(EasyUIPage page,SpatiotemporalBackTrack param);
/**
* 获取区域徘徊任务结果
* @param taskId
* @return
*/
public List<SpatiotemporalBackTrackResult> getQyphTaskResult(String taskId);
}
package com.founder.interservice.sksjzc.qyph.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.mapper.xzxt.QyphMapper;
import com.founder.interservice.sksjzc.qyph.service.QyphService;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResult;
import com.founder.interservice.util.EasyUIPage;
import com.founder.interservice.util.XdhSpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class QyphServiceImpl implements QyphService {
private Logger logger = LoggerFactory.getLogger(QyphServiceImpl.class);
@Value(value = "${xdhbigdata.xdhserviceParam.bizCode}")
private String bizCode;
@Value(value = "${xdhbigdata.xdhserviceParam.cjServiceId}")
private String cjServiceId;
@Autowired
private QyphMapper qyphMapper;
@Override
public int getQyphTaskCount(SpatiotemporalBackTrack param) {
Map<String,Object> map = new HashMap<>();
map.put("entity", param);
int total = qyphMapper.queryQyphTaskCount(map);
return total;
}
@Override
public EasyUIPage getQyphTaskList(EasyUIPage page, SpatiotemporalBackTrack param) {
Map<String,Object> map = new HashMap<>();
map.put("startNum", page.getBegin());
map.put("endNum", page.getEnd());
map.put("entity", param);
int total = qyphMapper.queryQyphTaskCount(map);
page.setTotal(total);
if(total>0){
List<SpatiotemporalBackTrack> list = qyphMapper.queryQyphTaskList(map);
XdhSpUtil xdhSpUtil = new XdhSpUtil();
for(SpatiotemporalBackTrack taskVO:list){
//获取taskId最后的字符串
String sqdx = "";
String taskid = taskVO.getTaskId();
if (null != taskid && !"".equals(taskid)){
sqdx = taskid.substring(taskid.lastIndexOf("-")+1);
}
JSONObject obj = xdhSpUtil.getSpResultUtil(taskVO.getTaskCaseId(),taskVO.getFsrSfzh(),sqdx,"时空回溯",bizCode,cjServiceId);
String spzt = "";
if (obj!=null){
spzt = (String) obj.get("data");
if(spzt !="" && "1".equals(spzt)){
//审批通过
taskVO.setSpType("审批通过");
}else if("0".equals(spzt)){
//审批退回
taskVO.setSpType("审批退回");
}else if("2".equals(spzt)){
//正在申请
taskVO.setSpType("正在申请");
}else if("-1".equals(spzt)){
//未发起审批
taskVO.setSpType("发起审批");
}
} else {
//接口没有返回数据,让其发起审批
taskVO.setSpType("发起审批");
}
if (null != taskVO.getState()) {
switch (taskVO.getState()){
case "QUEUEING":
taskVO.setState("任务等待中");
break;
case "STARTING":
taskVO.setState("任务开始");
break;
case "RUNNING":
taskVO.setState("任务进行中");
break;
case "FINISHED":
taskVO.setState("任务已完成");
break;
case "TIMEOUT":
taskVO.setState("任务超时");
break;
case "END":
taskVO.setState("任务比对完成");
break;
case "ERROR":
taskVO.setState("任务异常");
break;
case "default":
taskVO.setState("任务进行中");
break;
}
}
if ("任务比对完成".equals(taskVO.getState()) && "审批通过".equals(taskVO.getSpType())) {
int count = qyphMapper.queryQyphTaskResultCount(taskVO.getTaskId());
taskVO.setSkhsResultCount(count);
}
}
page.setRows(list);
}else{
page.setRows(new ArrayList<>());
}
return page;
}
@Override
public List<SpatiotemporalBackTrackResult> getQyphTaskResult(String taskId) {
List<SpatiotemporalBackTrackResult> list = new ArrayList<>();
try {
list=qyphMapper.queryQyphTaskResults(taskId);
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
}
...@@ -38,5 +38,7 @@ public class SpatiotemporalBackTrack { ...@@ -38,5 +38,7 @@ public class SpatiotemporalBackTrack {
//区分数据来源(时空回溯或案发潜逃-案发或案前踩点-案发或首次出现-案发) //区分数据来源(时空回溯或案发潜逃-案发或案前踩点-案发或首次出现-案发)
private String type; private String type;
private String taskType; private String taskType;
//是否已读
private String sfRead;
} }
...@@ -13,6 +13,12 @@ public class SpatiotemporalBackTrackResult { ...@@ -13,6 +13,12 @@ public class SpatiotemporalBackTrackResult {
private String objectType; //对象类型 private String objectType; //对象类型
private String objectTypeName; //对象类型名称 private String objectTypeName; //对象类型名称
private String objectValue; //对象值 private String objectValue; //对象值
//登记时间
private Date djsj;
//是否发送过关联关系请求 空 无需转换 0发送失败 1成功有数据 2成功无数据
private String sfCheck;
//出现的次数
private Integer count;
private int startNum; private int startNum;
private int endNum; private int endNum;
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.founder.interservice.mapper.xzxt.QyphMapper">
<select id="queryQyphTaskCount" parameterType="map" resultType="int">
select count(1) from TB_ST_SPATIOTEMPORALBACKTRACK
where 1=1
<if test="entity.qyArea != null and entity.qyArea != ''"> AND QY_AREA = #{entity.qyArea , jdbcType=VARCHAR } </if>
<if test="entity.sfRead != null and entity.sfRead != ''"> AND SF_READ = #{entity.sfRead , jdbcType=VARCHAR } </if>
<if test="entity.taskType != null and entity.taskType != ''"> AND TASK_TYPE = #{entity.taskType , jdbcType=VARCHAR } </if>
<if test="entity.taskId != null and entity.taskId != ''"> AND TASK_ID = #{entity.taskId , jdbcType=VARCHAR } </if>
<if test="entity.taskName != null and entity.taskName != ''"> AND TASK_NAME = #{entity.taskName , jdbcType=VARCHAR } </if>
<if test="entity.taskCaseId != null and entity.taskCaseId != ''"> AND TASK_CASE_ID = #{entity.taskCaseId , jdbcType=VARCHAR } </if>
<if test="entity.qyName != null and entity.qyName != ''"> AND QY_NAME = #{entity.qyName , jdbcType=VARCHAR } </if>
<if test="entity.qybj != null and entity.qybj != ''"> AND QYBJ = #{entity.qybj , jdbcType=VARCHAR } </if>
<if test="entity.lc != null and entity.lc != ''"> AND LC = #{entity.lc , jdbcType=VARCHAR } </if>
<if test="entity.progress != null and entity.progress != ''"> AND PROGRESS = #{entity.progress , jdbcType=VARCHAR } </if>
<if test="entity.state != null and entity.state != ''"> AND STATE = #{entity.state , jdbcType=VARCHAR } </if>
<if test="entity.startTime != null"> AND START_TIME = #{entity.startTime , jdbcType=TIMESTAMP } </if>
<if test="entity.endTime != null"> AND END_TIME = #{entity.endTime , jdbcType=TIMESTAMP } </if>
<if test="entity.fsrJh != null and entity.fsrJh != ''"> AND FSR_JH = #{entity.fsrJh , jdbcType=VARCHAR } </if>
<if test="entity.fsrSfzh != null and entity.fsrSfzh != ''"> AND FSR_SFZH = #{entity.fsrSfzh , jdbcType=VARCHAR } </if>
<if test="entity.fsrXm != null and entity.fsrXm != ''"> AND FSR_XM = #{entity.fsrXm , jdbcType=VARCHAR } </if>
<if test="entity.fsrLxdh != null and entity.fsrLxdh != ''"> AND FSR_LXDH = #{entity.fsrLxdh , jdbcType=VARCHAR } </if>
<if test="entity.rksj != null"> AND RKSJ = #{entity.rksj , jdbcType=TIMESTAMP } </if>
</select>
<select id="queryQyphTaskList" parameterType="map" resultType="com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack">
select a.* from (
select t.*,rownum rn from (
select
QY_AREA as qyArea,
SF_READ as sfRead,
TASK_TYPE as taskType,
TASK_ID as taskId,
TASK_NAME as taskName,
TASK_CASE_ID as taskCaseId,
QY_NAME as qyName,
QYBJ as qybj,
LC as lc,
PROGRESS as progress,
STATE as state,
START_TIME as startTime,
END_TIME as endTime,
FSR_JH as fsrJh,
FSR_SFZH as fsrSfzh,
FSR_XM as fsrXm,
FSR_LXDH as fsrLxdh,
RKSJ as rksj
from TB_ST_SPATIOTEMPORALBACKTRACK
where 1=1
<if test="entity.qyArea != null and entity.qyArea != ''"> AND QY_AREA = #{entity.qyArea , jdbcType=VARCHAR } </if>
<if test="entity.sfRead != null and entity.sfRead != ''"> AND SF_READ = #{entity.sfRead , jdbcType=VARCHAR } </if>
<if test="entity.taskType != null and entity.taskType != ''"> AND TASK_TYPE = #{entity.taskType , jdbcType=VARCHAR } </if>
<if test="entity.taskId != null and entity.taskId != ''"> AND TASK_ID = #{entity.taskId , jdbcType=VARCHAR } </if>
<if test="entity.taskName != null and entity.taskName != ''"> AND TASK_NAME = #{entity.taskName , jdbcType=VARCHAR } </if>
<if test="entity.taskCaseId != null and entity.taskCaseId != ''"> AND TASK_CASE_ID = #{entity.taskCaseId , jdbcType=VARCHAR } </if>
<if test="entity.qyName != null and entity.qyName != ''"> AND QY_NAME = #{entity.qyName , jdbcType=VARCHAR } </if>
<if test="entity.qybj != null and entity.qybj != ''"> AND QYBJ = #{entity.qybj , jdbcType=VARCHAR } </if>
<if test="entity.lc != null and entity.lc != ''"> AND LC = #{entity.lc , jdbcType=VARCHAR } </if>
<if test="entity.progress != null and entity.progress != ''"> AND PROGRESS = #{entity.progress , jdbcType=VARCHAR } </if>
<if test="entity.state != null and entity.state != ''"> AND STATE = #{entity.state , jdbcType=VARCHAR } </if>
<if test="entity.startTime != null"> AND START_TIME = #{entity.startTime , jdbcType=TIMESTAMP } </if>
<if test="entity.endTime != null"> AND END_TIME = #{entity.endTime , jdbcType=TIMESTAMP } </if>
<if test="entity.fsrJh != null and entity.fsrJh != ''"> AND FSR_JH = #{entity.fsrJh , jdbcType=VARCHAR } </if>
<if test="entity.fsrSfzh != null and entity.fsrSfzh != ''"> AND FSR_SFZH = #{entity.fsrSfzh , jdbcType=VARCHAR } </if>
<if test="entity.fsrXm != null and entity.fsrXm != ''"> AND FSR_XM = #{entity.fsrXm , jdbcType=VARCHAR } </if>
<if test="entity.fsrLxdh != null and entity.fsrLxdh != ''"> AND FSR_LXDH = #{entity.fsrLxdh , jdbcType=VARCHAR } </if>
<if test='entity.type == "skhs"'>
and t.TASK_NAME LIKE '时空回溯%'
</if>
<if test='entity.type == "afqtaf"'>
and t.TASK_NAME LIKE '案发潜逃-案发%'
</if>
<if test='entity.type == "aqcdaf"'>
and t.TASK_NAME LIKE '案前踩点-案发%'
</if>
<if test='entity.type == "sccxaf"'>
and t.TASK_NAME LIKE '首次出现-案发%'
</if>
<if test="entity.rksj != null"> AND RKSJ = #{entity.rksj , jdbcType=TIMESTAMP } </if>
order by RKSJ desc
) t where rownum <![CDATA[ <= ]]> #{endNum}
) a where rn <![CDATA[ > ]]> #{startNum}
</select>
<select id="queryQyphTaskResultCount" parameterType="string" resultType="int">
select count(1) from TB_ST_SPATIOTEMPORALRESULT
where 1=1
and TASK_ID = #{taskId}
</select>
<select id="queryQyphTaskResults" parameterType="string" resultType="com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResult">
select
COUNT as count,
SF_CHECK as sfCheck,
XXZJBH as xxzjbh,
TASK_ID as taskId,
OBJECT_TYPE as objectType,
OBJECT_TYPE_NAME as objectTypeName,
OBJECT_VALUE as objectValue,
DJSJ as djsj
from TB_ST_SPATIOTEMPORALRESULT
where 1=1
and TASK_ID = #{taskId}
</select>
</mapper>
\ No newline at end of file
...@@ -174,6 +174,9 @@ ...@@ -174,6 +174,9 @@
<if test='fsrSfzh != null and "" != fsrSfzh '> <if test='fsrSfzh != null and "" != fsrSfzh '>
and t.FSR_SFZH = #{fsrSfzh} and t.FSR_SFZH = #{fsrSfzh}
</if> </if>
<if test="taskType != null and '' != taskType">
and t.TASK_TYPE = #{taskType}
</if>
</where> </where>
order by t.rksj desc order by t.rksj desc
) t1 ) t1
...@@ -197,9 +200,12 @@ ...@@ -197,9 +200,12 @@
<if test='type == "sccxaf"'> <if test='type == "sccxaf"'>
and TASK_NAME LIKE '首次出现-案发%' and TASK_NAME LIKE '首次出现-案发%'
</if> </if>
<if test='fsrSfzh != null and "" != fsrSfzh '> <if test='fsrSfzh != null and "" != fsrSfzh '>
and FSR_SFZH = #{fsrSfzh} and FSR_SFZH = #{fsrSfzh}
</if> </if>
<if test="taskType != null and '' != taskType">
and t.TASK_TYPE = #{taskType}
</if>
</select> </select>
<!-- 根据时空回溯任务id,查询相应任务信息 --> <!-- 根据时空回溯任务id,查询相应任务信息 -->
......
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