修改时空回溯的表名

parent c2aedeb2
package com.founder.interservice.mapper.xzxt;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SBTResultDetailMapper {
int spatiotemporalBackTrackResultDetailIsExist(SBTResultDetail results);
int saveSpatiotemporalBackTrackResultDetail(SBTResultDetail detail);
int updateSpatiotemporalBackTrackResultDetail(SBTResultDetail detail);
List<SBTResultDetail> pageSBTResultDetail(SBTResultDetail detail) throws InterServiceException;
Integer pageSBTResultDetailTotalcount(SBTResultDetail detail) throws InterServiceException;
}
package com.founder.interservice.mapper.xzxt;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SpatiotemporalBackTrackResultDetailMapper {
int spatiotemporalBackTrackResultDetailIsExist(SpatiotemporalBackTrackResultDetail results);
int saveSpatiotemporalBackTrackResultDetail(SpatiotemporalBackTrackResultDetail detail);
int updateSpatiotemporalBackTrackResultDetail(SpatiotemporalBackTrackResultDetail detail);
List<SpatiotemporalBackTrackResultDetail> pageSpatiotemporalBackTrackResultDetail(SpatiotemporalBackTrackResultDetail detail) throws InterServiceException;
Integer pageSpatiotemporalBackTrackResultDetailTotalcount(SpatiotemporalBackTrackResultDetail detail) throws InterServiceException;
}
......@@ -2,13 +2,11 @@ package com.founder.interservice.spatiotemporalBackTrack.controller;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.VO.ResultVO;
import com.founder.interservice.dzgz.model.DzgzTask;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.service.SpatiotemporalBackTrackService;
import com.founder.interservice.spatiotemporalBackTrack.service.impl.SpatiotemporalBackTrackScheduledService;
import com.founder.interservice.user.controller.UserContoller;
import com.founder.interservice.user.model.User;
import com.founder.interservice.util.EasyUIPage;
......@@ -18,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -77,8 +74,8 @@ public class SpatiotemporalBackTrackController {
return resultVO;
}
@RequestMapping(value = "/pageSpatiotemporalBackTrackResultDetail",method = {RequestMethod.GET,RequestMethod.POST})
public Map<String,Object> pageSpatiotemporalBackTrackResultDetail(String taskResultId, @RequestParam(value = "page", defaultValue = "0") int page,
@RequestMapping(value = "/pageSBTResultDetail",method = {RequestMethod.GET,RequestMethod.POST})
public Map<String,Object> pageSBTResultDetail(String taskResultId, @RequestParam(value = "page", defaultValue = "0") int page,
@RequestParam(value = "rows", defaultValue = "0") int rows){
Map<String,Object> resultMap = new HashMap<>();
try {
......@@ -87,12 +84,12 @@ public class SpatiotemporalBackTrackController {
easyUIPage.setPagePara(rows);
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
SpatiotemporalBackTrackResultDetail detail = new SpatiotemporalBackTrackResultDetail();
SBTResultDetail detail = new SBTResultDetail();
detail.setStartNum(begin);
detail.setEndNum(end);
detail.setTaskResultId(taskResultId);
List<SpatiotemporalBackTrackResultDetail> resultList = spatiotemporalBackTrackService.pageSpatiotemporalBackTrackResultDetail(detail);
Integer total = spatiotemporalBackTrackService.pageSpatiotemporalBackTrackResultDetailTotalcount(detail);
List<SBTResultDetail> resultList = spatiotemporalBackTrackService.pageSBTResultDetail(detail);
Integer total = spatiotemporalBackTrackService.pageSBTResultDetailTotalcount(detail);
if(resultList.size()>0 && null != resultList){
resultMap.put("msg",ResultEnum.SUCCESS.getMessage());
resultMap.put("code",ResultEnum.SUCCESS.getCode());
......
......@@ -7,7 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class SpatiotemporalBackTrackResultDetail {
public class SBTResultDetail {
private String XXZJBH;
private String taskResultId;//案件编号
private String objectType;
......
......@@ -3,20 +3,20 @@ package com.founder.interservice.spatiotemporalBackTrack.service;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import java.util.List;
public interface SpatiotemporalBackTrackService {
boolean spatiotemporalBackTrackResultDetailIsExist(SpatiotemporalBackTrackResultDetail results);
boolean spatiotemporalBackTrackResultDetailIsExist(SBTResultDetail results);
String getTaskId(String asjbh,String taskName,String paramStr) throws InterServiceException;
void saveSpatiotemporalBackTrack(SpatiotemporalBackTrack spatiotemporalBackTrack) throws InterServiceException;
List<SpatiotemporalBackTrackResultDetail> pageSpatiotemporalBackTrackResultDetail(SpatiotemporalBackTrackResultDetail detail) throws InterServiceException;
List<SBTResultDetail> pageSBTResultDetail(SBTResultDetail detail) throws InterServiceException;
Integer pageSpatiotemporalBackTrackResultDetailTotalcount(SpatiotemporalBackTrackResultDetail detail) throws InterServiceException;
Integer pageSBTResultDetailTotalcount(SBTResultDetail detail) throws InterServiceException;
}
......@@ -5,14 +5,13 @@ import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.mapper.xzxt.SpatiotemporalBackTrackMapper;
import com.founder.interservice.mapper.xzxt.SpatiotemporalBackTrackResultDetailMapper;
import com.founder.interservice.mapper.xzxt.SBTResultDetailMapper;
import com.founder.interservice.mapper.xzxt.SpatiotemporalBackTrackResultMapper;
import com.founder.interservice.model.AutoTbStRy;
import com.founder.interservice.regionalanalysis.model.RegionalTaskResultDetail;
import com.founder.interservice.service.PushWaDataService;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResult;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.service.SpatiotemporalBackTrackService;
import com.founder.interservice.util.DateUtil;
import com.founder.interservice.util.KeyUtil;
......@@ -45,7 +44,7 @@ public class SpatiotemporalBackTrackScheduledService {
@Autowired
private SpatiotemporalBackTrackService spatiotemporalBackTrackService;
@Autowired
private SpatiotemporalBackTrackResultDetailMapper spatiotemporalBackTrackResultDetailMapper;
private SBTResultDetailMapper sBTResultDetailMapper;
/**
*
* @Description: 查取任务结果的定时方法
......@@ -237,23 +236,23 @@ public class SpatiotemporalBackTrackScheduledService {
/**
* 通过身份证号获取二代证信息
*
* @param spatiotemporalBackTrackResultDetail
* @param sBTResultDetail
* @return
*/
private SpatiotemporalBackTrackResultDetail getEdzxxForSfzh(SpatiotemporalBackTrackResultDetail spatiotemporalBackTrackResultDetail) {
AutoTbStRy tbStRy = new Qgckzp().getQgckAllxxXml(spatiotemporalBackTrackResultDetail.getZjhm());
spatiotemporalBackTrackResultDetail.setXzzDzmc(tbStRy.getXzzDzmc());//现住址
spatiotemporalBackTrackResultDetail.setCsdDzmc(tbStRy.getCsdDzmc());//出生地
private SBTResultDetail getEdzxxForSfzh(SBTResultDetail sBTResultDetail) {
AutoTbStRy tbStRy = new Qgckzp().getQgckAllxxXml(sBTResultDetail.getZjhm());
sBTResultDetail.setXzzDzmc(tbStRy.getXzzDzmc());//现住址
sBTResultDetail.setCsdDzmc(tbStRy.getCsdDzmc());//出生地
if (tbStRy.getCsrqRqgzxx() != null) {
spatiotemporalBackTrackResultDetail.setBirthday(DateUtil.convertDateToChineseString(tbStRy.getCsrqRqgzxx()));//出生日期
spatiotemporalBackTrackResultDetail.setAge(String.valueOf(DateUtil.getAge(tbStRy.getCsrqRqgzxx()))); //age
sBTResultDetail.setBirthday(DateUtil.convertDateToChineseString(tbStRy.getCsrqRqgzxx()));//出生日期
sBTResultDetail.setAge(String.valueOf(DateUtil.getAge(tbStRy.getCsrqRqgzxx()))); //age
}
spatiotemporalBackTrackResultDetail.setName(tbStRy.getXm());//姓名
spatiotemporalBackTrackResultDetail.setSex(tbStRy.getXbdm());//性别
sBTResultDetail.setName(tbStRy.getXm());//姓名
sBTResultDetail.setSex(tbStRy.getXbdm());//性别
if (tbStRy.getEdzzplj() != null) {
spatiotemporalBackTrackResultDetail.setRyzp(tbStRy.getEdzzplj().getBytes());//人员照片
sBTResultDetail.setRyzp(tbStRy.getEdzzplj().getBytes());//人员照片
}
return spatiotemporalBackTrackResultDetail;
return sBTResultDetail;
}
/**
......@@ -352,7 +351,7 @@ public class SpatiotemporalBackTrackScheduledService {
jsonObj = json.getJSONObject("data");
}
if (jsonObj != null && !jsonObj.isEmpty()) {
SpatiotemporalBackTrackResultDetail detail = new SpatiotemporalBackTrackResultDetail();
SBTResultDetail detail = new SBTResultDetail();
detail.setTaskResultId(result.getXxzjbh());
detail.setXXZJBH(KeyUtil.getUniqueKey("HSD"));
detail.setObjectType(objType);
......@@ -366,26 +365,26 @@ public class SpatiotemporalBackTrackScheduledService {
detail.setZjhm(objValue2);
detail = getEdzxxForSfzh(detail); //获取二代证信息
//根据身份证判断是否存在 如果存在更新 不存在新增
SpatiotemporalBackTrackResultDetail param = new SpatiotemporalBackTrackResultDetail();
SBTResultDetail param = new SBTResultDetail();
param.setObjectType(objType);
param.setObjectValue(objValue);
boolean isExist = spatiotemporalBackTrackService.spatiotemporalBackTrackResultDetailIsExist(param);
if (!isExist) {
spatiotemporalBackTrackResultDetailMapper.saveSpatiotemporalBackTrackResultDetail(detail);
sBTResultDetailMapper.saveSpatiotemporalBackTrackResultDetail(detail);
} else {
spatiotemporalBackTrackResultDetailMapper.updateSpatiotemporalBackTrackResultDetail(detail);
sBTResultDetailMapper.updateSpatiotemporalBackTrackResultDetail(detail);
}
}else if(Arrays.asList("20","4394","3996","6003").contains(objType2)){
//手机号码
detail.setSjhm(objValue2);
SpatiotemporalBackTrackResultDetail param = new SpatiotemporalBackTrackResultDetail();
SBTResultDetail param = new SBTResultDetail();
param.setObjectType(objType);
param.setObjectValue(objValue);
boolean isExist = spatiotemporalBackTrackService.spatiotemporalBackTrackResultDetailIsExist(param);
if (!isExist) {
spatiotemporalBackTrackResultDetailMapper.saveSpatiotemporalBackTrackResultDetail(detail);
sBTResultDetailMapper.saveSpatiotemporalBackTrackResultDetail(detail);
} else {
spatiotemporalBackTrackResultDetailMapper.updateSpatiotemporalBackTrackResultDetail(detail);
sBTResultDetailMapper.updateSpatiotemporalBackTrackResultDetail(detail);
}
}
}
......
......@@ -3,25 +3,15 @@ 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.regionalanalysis.model.*;
import com.founder.interservice.regionalanalysis.repository.RegionalRepository;
import com.founder.interservice.regionalanalysis.repository.RegionalTaskRepository;
import com.founder.interservice.regionalanalysis.repository.RegionalTaskResultRepository;
import com.founder.interservice.regionalanalysis.repository.RegionalsTaskRepository;
import com.founder.interservice.regionalanalysis.service.RegionalAnalysisService;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrack;
import com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail;
import com.founder.interservice.spatiotemporalBackTrack.service.SpatiotemporalBackTrackService;
import com.founder.interservice.util.HttpUtil;
import com.founder.interservice.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.*;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.criteria.*;
import java.util.*;
@Transactional
......@@ -31,14 +21,14 @@ public class SpatiotemporalBackTrackServiceImpl implements SpatiotemporalBackTra
@Autowired
private SpatiotemporalBackTrackMapper spatiotemporalBackTrackMapper;
@Autowired
private SpatiotemporalBackTrackResultDetailMapper spatiotemporalBackTrackResultDetailMapper;
private SBTResultDetailMapper sBTResultDetailMapper;
@Value("${wabigdata.fixedEvidenceByRegionTask.url}")
private String DZGZ_COMMIT_URL;
@Override
public boolean spatiotemporalBackTrackResultDetailIsExist(SpatiotemporalBackTrackResultDetail results) {
public boolean spatiotemporalBackTrackResultDetailIsExist(SBTResultDetail results) {
boolean flag = false;
int i= spatiotemporalBackTrackResultDetailMapper.spatiotemporalBackTrackResultDetailIsExist(results);
int i= sBTResultDetailMapper.spatiotemporalBackTrackResultDetailIsExist(results);
if(i>0){
flag = true;
}
......@@ -77,10 +67,10 @@ public class SpatiotemporalBackTrackServiceImpl implements SpatiotemporalBackTra
}
@Override
public List<SpatiotemporalBackTrackResultDetail> pageSpatiotemporalBackTrackResultDetail(SpatiotemporalBackTrackResultDetail detail) throws InterServiceException {
List<SpatiotemporalBackTrackResultDetail> lists = new ArrayList<>();
public List<SBTResultDetail> pageSBTResultDetail(SBTResultDetail detail) throws InterServiceException {
List<SBTResultDetail> lists = new ArrayList<>();
try{
lists = spatiotemporalBackTrackResultDetailMapper.pageSpatiotemporalBackTrackResultDetail(detail);
lists = sBTResultDetailMapper.pageSBTResultDetail(detail);
}catch (Exception e){
e.printStackTrace();
throw new InterServiceException(ResultEnum.DB_QUERYERROR.getCode(),ResultEnum.DB_QUERYERROR.getMessage(),e);
......@@ -89,10 +79,10 @@ public class SpatiotemporalBackTrackServiceImpl implements SpatiotemporalBackTra
}
@Override
public Integer pageSpatiotemporalBackTrackResultDetailTotalcount(SpatiotemporalBackTrackResultDetail detail) throws InterServiceException {
public Integer pageSBTResultDetailTotalcount(SBTResultDetail detail) throws InterServiceException {
Integer total = 0;
try{
total = spatiotemporalBackTrackResultDetailMapper.pageSpatiotemporalBackTrackResultDetailTotalcount(detail);
total = sBTResultDetailMapper.pageSBTResultDetailTotalcount(detail);
}catch (Exception e){
e.printStackTrace();
throw new InterServiceException(ResultEnum.DB_QUERYERROR.getCode(),ResultEnum.DB_QUERYERROR.getMessage(),e);
......
<?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.SpatiotemporalBackTrackResultDetailMapper">
<mapper namespace="com.founder.interservice.mapper.xzxt.SBTResultDetailMapper">
<select id="spatiotemporalBackTrackResultDetailIsExist" resultType="int" parameterType="com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail">
<select id="spatiotemporalBackTrackResultDetailIsExist" resultType="int" parameterType="com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail">
select count(*)
FROM SPATIOTEMPORALBACKTRACKRESULTDETAIL t
FROM SBT_RESULT_DETAIL t
WHERE t.OBJECT_TYPE = #{objectType} and
t.OBJECT_VALUE = #{objectValue}
</select>
<insert id="saveSpatiotemporalBackTrackResultDetail" parameterType="com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail">
INSERT INTO SPATIOTEMPORALBACKTRACKRESULTDETAIL(
<insert id="saveSpatiotemporalBackTrackResultDetail" parameterType="com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail">
INSERT INTO SBT_RESULT_DETAIL(
XXZJBH,
TASK_RESULT_ID,
OBJECT_TYPE,
......@@ -65,8 +65,8 @@
SYSDATE
)
</insert>
<update id="updateSpatiotemporalBackTrackResultDetail" parameterType="com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail">
UPDATE SPATIOTEMPORALBACKTRACKRESULTDETAIL t
<update id="updateSpatiotemporalBackTrackResultDetail" parameterType="com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail">
UPDATE SBT_RESULT_DETAIL t
<set>
<if test="objectType != null and objectType !=''">t.OBJECT_TYPE = #{objectType},</if>
<if test="objectTypeName != null and objectTypeName !=''">t.OBJECT_TYPE_NAME = #{objectTypeName},</if>
......@@ -88,7 +88,7 @@
t.OBJECT_TYPE = #{objectType}
and t.OBJECT_VALUE = #{objectValue}
</update>
<select id = "pageSpatiotemporalBackTrackResultDetail" parameterType = "com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail" resultType="com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail" >
<select id = "pageSBTResultDetail" parameterType = "com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail" resultType="com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail" >
select t2.*
from (
select t1.*,
......@@ -112,7 +112,7 @@
t.ZJLX as zjlx,
t.ZJLX_CODE as zjlxCode,
t.DJSJ as djsj
from SPATIOTEMPORALBACKTRACKRESULTDETAIL t
from SBT_RESULT_DETAIL t
where t.TASK_RESULT_ID = #{taskResultId}
order by t.DJSJ
) t1
......@@ -121,9 +121,9 @@
where rn <![CDATA[ > ]]> #{startNum }
</select>
<select id = "pageSpatiotemporalBackTrackResultDetailTotalcount" parameterType = "com.founder.interservice.spatiotemporalBackTrack.model.SpatiotemporalBackTrackResultDetail" resultType="java.lang.Integer" >
<select id = "pageSBTResultDetailTotalcount" parameterType = "com.founder.interservice.spatiotemporalBackTrack.model.SBTResultDetail" resultType="java.lang.Integer" >
select count(*) from SPATIOTEMPORALBACKTRACKRESULTDETAIL
select count(*) from SBT_RESULT_DETAIL
where TASK_RESULT_ID = #{taskResultId}
</select>
......
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