周边单位

develop
hanrenchun 10 months ago
parent ea1e3ae917
commit 6b68847920

@ -5,7 +5,7 @@ import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.cache.DictCache;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanValidators;
import lombok.RequiredArgsConstructor;
import org.aspectj.lang.ProceedingJoinPoint;

@ -3,14 +3,13 @@ package com.ruoyi.business.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.NumKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.business.domain.vo.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.NumKit;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.*;
import com.ruoyi.database.domain.dto.MetaRealEstateInfoDTO;
@ -551,13 +550,13 @@ public class BigScreenController extends BaseController {
})
.collect(Collectors.toList());
Map<String, List<Map<String, String>>> resultMap = modifiedEstateInfoList.stream()
.filter(info -> info.getHomeName() != "0")
.filter(info -> info.getHomeName() != "0" || info.getHomeName().length() < 5)
.collect(Collectors.groupingBy(
info -> {
String homeName = info.getHomeName();
// return homeName.length() == 3 ? String.valueOf(homeName.charAt(0)) :
// homeName.length() == 4 ? homeName.substring(0, 2) : null;
return homeName;
return homeName.length() == 3 ? String.valueOf(homeName.charAt(0)) :
homeName.length() == 4 ? homeName.substring(0, 2) :
homeName.length() < 3 ? "1" : null;
},
Collectors.mapping(
info -> {

@ -6,13 +6,12 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.*;
import com.ruoyi.database.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.checkerframework.checker.units.qual.A;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field;

@ -6,7 +6,7 @@ import com.ruoyi.business.domain.vo.PersonStatissticsVo;
import com.ruoyi.business.domain.vo.PoachingVo;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.MetaHuntersInfo;
import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.database.service.MetaHuntersInfoService;

@ -1,8 +1,7 @@
package com.ruoyi.business.controller.utils;
package com.ruoyi.common.utils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.utils.StringUtils;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

@ -1,4 +1,4 @@
package com.ruoyi.business.controller.utils;
package com.ruoyi.common.utils;
import java.math.BigDecimal;

@ -1,4 +1,4 @@
package com.ruoyi.business.controller.utils;
package com.ruoyi.common.utils;
import org.apache.commons.lang3.StringUtils;

@ -1,4 +1,4 @@
package com.ruoyi.business.controller.utils;
package com.ruoyi.common.utils;
import java.io.PrintWriter;
import java.io.StringWriter;

@ -3,7 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.business.domain.dto.DevopsVideoInfoDto;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus;
import com.ruoyi.database.service.DevopsVideoInfoService;

@ -2,7 +2,9 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.MetaActualUnitInfo;
import com.ruoyi.database.domain.vo.MetaActualUnitInfoVO;
import com.ruoyi.database.service.MetaActualUnitInfoService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -18,6 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
/**
* (MetaActualUnitInfo)Controller
@ -92,4 +95,29 @@ public class MetaActualUnitInfoController extends BaseController {
}
return AjaxResult.success(result);
}
@GetMapping("/distance")
@ApiOperation("周边单位列表")
public TableDataInfo<MetaActualUnitInfoVO> peripheryUnit(MetaActualUnitInfo metaActualUnitInfo) {
List<MetaActualUnitInfo> list = metaActualUnitInfoService.lambdaQuery()
.ne(MetaActualUnitInfo::getUnitId, metaActualUnitInfo.getUnitId())
.between(MetaActualUnitInfo::getLatitude, metaActualUnitInfo.getLatitude() - 0.001, metaActualUnitInfo.getLatitude() + 0.001)
.between(MetaActualUnitInfo::getLongitude, metaActualUnitInfo.getLongitude() - 0.001, metaActualUnitInfo.getLongitude() + 0.001)
.list();
List<MetaActualUnitInfoVO> metaActualUnitInfoVOS = list.stream().map(info -> {
MetaActualUnitInfoVO metaActualUnitInfoVO = new MetaActualUnitInfoVO();
BeanUtils.copyProperties(info, metaActualUnitInfoVO);
double dLat = Math.toRadians(metaActualUnitInfoVO.getLatitude() - metaActualUnitInfo.getLatitude());
double dLon = Math.toRadians(metaActualUnitInfoVO.getLongitude() - metaActualUnitInfo.getLongitude());
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(Math.toRadians(metaActualUnitInfo.getLatitude())) * Math.cos(Math.toRadians(metaActualUnitInfoVO.getLatitude())) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = 6371 * c * 1000;
metaActualUnitInfoVO.setDistance((int)distance + "米");
return metaActualUnitInfoVO;
}).collect(Collectors.toList());
return getDataTable(metaActualUnitInfoVOS);
}
}

@ -3,7 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.service.MetaAlarmInfoService;
import com.ruoyi.common.annotation.Log;

@ -3,7 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.PeopleVehicleFlow;
import com.ruoyi.database.service.PeopleVehicleFlowService;
import io.swagger.annotations.Api;

@ -3,7 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.PeopleVehicleHourFlow;
import com.ruoyi.database.service.PeopleVehicleHourFlowService;
import io.swagger.annotations.Api;

@ -9,8 +9,8 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.business.controller.utils.NumKit;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.NumKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.database.domain.TransitHuntersUserModelRecord;

@ -0,0 +1,87 @@
package com.ruoyi.database.domain.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* (MetaActualUnitInfo)Domain
*
* @author makejava
* @since 2023-12-01 20:06:02
*/
@Data
public class MetaActualUnitInfoVO extends BaseEntity {
/**
* ID
*/
@ApiModelProperty("单位ID")
@Excel(name = "单位ID")
private String unitId;
/**
*
*/
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String uintName;
/**
*
*/
@ApiModelProperty("单位地址")
@Excel(name = "单位地址")
private String uintAddress;
/**
*
*/
@ApiModelProperty("单位类型名称")
@Excel(name = "单位类型名称")
private String unitTypeName;
/**
*
*/
@ApiModelProperty("派出所代码")
@Excel(name = "派出所代码")
private String policeStationCode;
/**
*
*/
@ApiModelProperty("派出所名称")
@Excel(name = "派出所名称")
private String policeStationName;
/**
*
*/
@ApiModelProperty("经度")
@Excel(name = "经度")
private Double longitude;
/**
*
*/
@ApiModelProperty("纬度")
@Excel(name = "纬度")
private Double latitude;
/**
*
*/
@ApiModelProperty("距离")
@Excel(name = "距离")
private String distance;
}

@ -10,10 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.dto.DevopsVideoInfoDto;
import com.ruoyi.business.domain.vo.DevopsVideoInfoVo;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.business.controller.utils.JsoupUtils;
import com.ruoyi.business.controller.utils.NumKit;
import com.ruoyi.business.controller.utils.PropertiesUtil;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.JsoupUtils;
import com.ruoyi.common.utils.NumKit;
import com.ruoyi.common.utils.PropertiesUtil;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus;

@ -5,7 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.cache.DictCache;
import com.ruoyi.business.controller.utils.StringKit;
import com.ruoyi.common.utils.StringKit;
import org.apache.ibatis.executor.resultset.ResultSetHandler;
import org.apache.ibatis.plugin.*;

Loading…
Cancel
Save