Commit 90e969ff by yangyang

轨迹相关提交(西藏)

parent 75e8d73e
......@@ -9,6 +9,7 @@ import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.vo.param.Point;
import com.founder.commonutils.model.vo.param.SkPointlocationParam;
import com.founder.commonutils.model.vo.param.SkPointlocationParams;
import com.founder.commonutils.model.vo.param.SkPointlocationParamsGeo;
import com.founder.commonutils.util.DateUtil;
import com.founder.commonutils.util.KeyUtil;
import com.founder.commonutils.model.newPublicEntity.SkPointlocation;
......@@ -193,27 +194,35 @@ public class SkPointlocationController extends ApiController implements ExcelCon
@PostMapping("queryGroupby")
@ApiOperation(value = "以案侦查_设备点位信息查询")
@OperLog(message = "公共_设备点位信息查询", operation = OperationType.QUERY)
public MapRestResult queryGroupby(@RequestBody SkPointlocationParams skPointlocationParams) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("isDeleted", "0");
//纬度
if (skPointlocationParams.getStartLat() != null && !skPointlocationParams.getStartLat().equals("")) {
queryWrapper.ge("CAST(y AS decimal(16,8))", Double.parseDouble(skPointlocationParams.getStartLat()));
}
if (skPointlocationParams.getEndLat() != null && !skPointlocationParams.getEndLat().equals("")) {
queryWrapper.le("CAST(y AS decimal(16,8))", Double.parseDouble(skPointlocationParams.getEndLat()));
}
//经度
if (skPointlocationParams.getStartLng() != null && !skPointlocationParams.getStartLng().equals("")) {
queryWrapper.ge("CAST(x AS decimal(16,8))", Double.parseDouble(skPointlocationParams.getStartLng()));
public MapRestResult queryGroupby(@RequestBody SkPointlocationParamsGeo skPointlocationaParamsGeo) {
List<SkPointlocation> list = new ArrayList<>();
Map<String, List<SkPointlocation>> listMap = new HashMap<>();
List<Point> geoametrys = skPointlocationaParamsGeo.getGeometrys();
if (null!=geoametrys){
if(geoametrys.size()>0) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("isDeleted", "0");
// 多个点位即为多边形
if (geoametrys.size()>1) {
String geoametryStr = "";
for (int i = 0; i < geoametrys.size(); i++) {
if (i == geoametrys.size()-1) {
geoametryStr += geoametrys.get(i).getX() + " " + geoametrys.get(i).getY();
} else {
geoametryStr += geoametrys.get(i).getX() + " " + geoametrys.get(i).getY() + ",";
}
}
queryWrapper.apply("ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON((" + geoametryStr + "))'), coordinates)");
} else if(StringUtils.isNotEmpty(skPointlocationaParamsGeo.getRadius())){
queryWrapper.apply("ST_Distance_Sphere(coordinates, POINT(" + geoametrys.get(0).getX()+","+ geoametrys.get(0).getY() + ")) < " + skPointlocationaParamsGeo.getRadius());
}
list = skPointlocationService.list(queryWrapper);
}
}
if (skPointlocationParams.getEndLng() != null && !skPointlocationParams.getEndLng().equals("")) {
queryWrapper.le("CAST(x AS decimal(16,8))", Double.parseDouble(skPointlocationParams.getEndLng()));
if(list.size()>0){
listMap = list.stream().collect(Collectors.groupingBy(SkPointlocation::getObjectname));
}
List<SkPointlocation> list = skPointlocationService.list(queryWrapper);
Map<String,List<SkPointlocation>> listMap = list.stream().collect(Collectors.groupingBy(SkPointlocation::getObjectname));
return new MapRestResult(200, "OK", listMap.size(), listMap);
}
......
......@@ -270,7 +270,13 @@ public class InterfaceAPI {
skTrailCf.setY(xy[0]);
}
}
skTrailCf.setAddress(esKoQueryResult.getSiad());
String address = "";
if(StringUtils.isNotBlank(esKoQueryResult.getSiad())){
address = esKoQueryResult.getSiad();
}else{
address = "暂无地址";
}
skTrailCf.setAddress(address);
skTrailCf.setDate(DateUtil.getTimeTz(esKoQueryResult.getStti()));
skTrailCf.setTime(DateUtil.getTimeStamp(DateUtil.getTimeTz(esKoQueryResult.getStti())));
skTrailCf.setDeviceid(esKoQueryResult.getNewa());
......
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