Commit 9e22b2e8 by yangyang

同步(西藏)

parent 9a0eccca
package com.founder.publicapi.controller.SkModelService;
import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.vo.param.SkGjglajParam;
import com.founder.publicapi.service.SkGjGlAjService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -8,8 +9,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("skbs")
......@@ -22,9 +21,8 @@ public class SkGjGlAjController {
* 轨迹关联案件
* */
@PostMapping("/getSkgjglaj")
public Map getGjGlAj(@RequestBody SkGjglajParam receiving){
Map map=skGjGlAjService.getSkGjGlAj(receiving);
return map;
public MapRestResult getGjGlAj(@RequestBody SkGjglajParam receiving){
return skGjGlAjService.getSkGjGlAj(receiving);
}
}
......@@ -186,6 +186,8 @@
DATE_FORMAT(T.asjfssj_Asjfskssj,'%Y-%m-%d %H:%i:%S') as asjfssjAsjfskssj,
DATE_FORMAT(T.larq,'%Y-%m-%d %H:%i:%S') as larq,
T.ZUZDW_ZBR_XM AS zuzdwZbrXm,
T.ASJFSDD_DQJD AS x,
T.ASJFSDD_DQWD AS y,
(select name from sys_dictitem where groupid='CODE_UNIT' AND code = T.zuzdw_Gajgjgdm) AS zuzdwGajgjgdmMc,
(select name from sys_dictitem where groupid='CODE_ZCJDDM' AND code = T.zcjddm) AS zcjddmMc,
(select name from sys_dictitem where groupid='CODE_UNIT' AND code = T.ladw_Gajgjgdm) AS ladwGajgjgdmMc,
......
package com.founder.publicapi.service;
import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.vo.param.SkGjglajParam;
import java.util.Map;
public interface SkGjGlAjService {
Map getSkGjGlAj(SkGjglajParam receiving);
MapRestResult getSkGjGlAj(SkGjglajParam receiving);
}
package com.founder.publicapi.service;
import com.founder.commonutils.model.asjEntity.TbStAsjResult;
import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.newPublicEntity.SkRegionalsResultAll;
import com.founder.commonutils.model.newPublicEntity.SkTrail;
import com.founder.commonutils.model.vo.param.SkGjglajParam;
import com.founder.commonutils.model.vo.param.TbStAsjParm;
import com.founder.publicapi.controller.SkModelService.SkTrailController;
import com.founder.publicapi.mapper.mysqlMapper.TbStAsjMapper;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,6 +18,7 @@ import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
@Service
public class SkGjGlAjServiceImpl implements SkGjGlAjService {
......@@ -23,23 +27,21 @@ public class SkGjGlAjServiceImpl implements SkGjGlAjService {
private TbStAsjMapper tbStAsjMapper;
@Override
public Map getSkGjGlAj(SkGjglajParam receiving) {
public MapRestResult getSkGjGlAj(SkGjglajParam receiving) {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Map resultMap = new HashMap();
if (receiving.getStartTime() == null || receiving.getEndTime() == null) {
return resultMap;
return MapRestResult.error("开始时间、结束时间必传");
}
if (receiving.getMinutes() == 0) {
if (receiving.getMinutes() == 0) {// 默认十分钟
receiving.setMinutes(10);
}
if (receiving.getRadius() == 0d) {
if (receiving.getRadius() == 0d) {// 默认500米
receiving.setRadius(500d);
}
TbStAsjParm param = new TbStAsjParm();
param.setKssj(sdf.format(new Date(receiving.getStartTime())));
param.setJssj(sdf.format(new Date(receiving.getEndTime())));
if (StringUtils.isNotBlank(receiving.getAjlbdm())) {
......@@ -56,7 +58,7 @@ public class SkGjGlAjServiceImpl implements SkGjGlAjService {
param.setJyaq(receiving.getJyaq());
}
/*经度*/
// 经度
if (receiving.getStartLng() < receiving.getEndLng()) {
param.setStartLng(String.valueOf(receiving.getStartLng()));
param.setEndLng(String.valueOf(receiving.getEndLng()));
......@@ -65,7 +67,7 @@ public class SkGjGlAjServiceImpl implements SkGjGlAjService {
param.setEndLng(String.valueOf(receiving.getStartLng()));
}
/*纬度*/
// 纬度
if (receiving.getStartLat() < receiving.getEndLat()) {
param.setStartLat(String.valueOf(receiving.getStartLat()));
param.setEndLat(String.valueOf(receiving.getEndLat()));
......@@ -74,26 +76,24 @@ public class SkGjGlAjServiceImpl implements SkGjGlAjService {
param.setEndLat(String.valueOf(receiving.getStartLat()));
}
/*是否破案 0未破案 1破案*/
// 是否破案 0未破案 1破案
param.setPabj_pdbz("0");
Integer a=tbStAsjMapper.selectAsjxxByReceivingListCount(param);
Integer listCount=tbStAsjMapper.selectAsjxxByReceivingListCount(param);
param.setPage(1);
param.setPageSize(a);
param.setPageSize(listCount);
List<TbStAsjResult> asjList = tbStAsjMapper.selectAsjxxByReceivingList(param);
List results = new LinkedList();
results = getAsjBycar(receiving, asjList);
resultMap.put("rows", results);
resultMap.put("total", results.size());
return resultMap;
// 轨迹点位和案件点位比对拿出符合条件得案件
List results = getAsjByBsh(receiving, asjList);
return MapRestResult.build(200, "成功获取轨迹关联案件", results.size(),results);
}
public List getAsjBycar(SkGjglajParam receiving, List<TbStAsjResult> asjs){
public List getAsjByBsh(SkGjglajParam receiving, List<TbStAsjResult> asjs){
List<SkTrail> gjList = receiving.getSkTrails();
ExecutorService executor= Executors.newCachedThreadPool();
List<TbStAsjParm> resultList=new LinkedList<>();
List<TbStAsjResult> resultList=new ArrayList<>();
List<TbStAsjResult> resultListDistinct=new ArrayList<>();
CountDownLatch countDownLatch=new CountDownLatch(gjList.size());
try {
for(SkTrail e:gjList){
......@@ -108,15 +108,17 @@ public class SkGjGlAjServiceImpl implements SkGjGlAjService {
}catch (Exception e){
e.printStackTrace();
}
return resultList;
resultListDistinct = resultList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()
-> new TreeSet<>(Comparator.comparing(TbStAsjResult::getAsjbh))), ArrayList::new));
return resultListDistinct;
}
public List getAsjList(Map<Object,Long> timeM,List<TbStAsjResult> asjs,double j,double w,String address,double radius){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<TbStAsjResult> resultList=new LinkedList<>();
long maxTime=(long)timeM.get("maxTime");
long minTime=(long)timeM.get("minTime");
long maxTime=timeM.get("maxTime");
long minTime=timeM.get("minTime");
for(TbStAsjResult aj:asjs){
Double afjd=Double.parseDouble(aj.getX());
Double afwd=Double.parseDouble(aj.getY());
......@@ -125,8 +127,8 @@ public class SkGjGlAjServiceImpl implements SkGjGlAjService {
if(ajfsTime<maxTime&&ajfsTime>minTime&&afjd!=null&&afwd!=null){
double s=getDistance(afjd,afwd,j,w);
if(s<radius){
double a=Math.abs(radius-s);
String b="距离"+address+a+"米";
double a=radius-s;
String b="距离("+address+")["+a+"(米)]";
aj.setDescripText(b);
resultList.add(aj);
}
......
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