diff --git a/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java b/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java index e24e9f4..7d4bd5a 100644 --- a/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java +++ b/gather-app/src/main/java/com/ruoyi/aspect/ImportAspect.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java index b3bcfaa..01a86e6 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java @@ -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>> 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 -> { diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java b/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java index b8e4fad..7082925 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/PerceptionDeviceController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java b/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java index dbf3a74..eae5768 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/utils/JsoupUtils.java b/gather-app/src/main/java/com/ruoyi/common/utils/JsoupUtils.java similarity index 98% rename from gather-app/src/main/java/com/ruoyi/business/controller/utils/JsoupUtils.java rename to gather-app/src/main/java/com/ruoyi/common/utils/JsoupUtils.java index bd3da45..9ff21fd 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/utils/JsoupUtils.java +++ b/gather-app/src/main/java/com/ruoyi/common/utils/JsoupUtils.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/utils/NumKit.java b/gather-app/src/main/java/com/ruoyi/common/utils/NumKit.java similarity index 95% rename from gather-app/src/main/java/com/ruoyi/business/controller/utils/NumKit.java rename to gather-app/src/main/java/com/ruoyi/common/utils/NumKit.java index 9e13ff7..82662f7 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/utils/NumKit.java +++ b/gather-app/src/main/java/com/ruoyi/common/utils/NumKit.java @@ -1,4 +1,4 @@ -package com.ruoyi.business.controller.utils; +package com.ruoyi.common.utils; import java.math.BigDecimal; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/utils/OrderedProperties.java b/gather-app/src/main/java/com/ruoyi/common/utils/OrderedProperties.java similarity index 94% rename from gather-app/src/main/java/com/ruoyi/business/controller/utils/OrderedProperties.java rename to gather-app/src/main/java/com/ruoyi/common/utils/OrderedProperties.java index c138722..058d8e0 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/utils/OrderedProperties.java +++ b/gather-app/src/main/java/com/ruoyi/common/utils/OrderedProperties.java @@ -1,4 +1,4 @@ -package com.ruoyi.business.controller.utils; +package com.ruoyi.common.utils; import java.util.*; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/utils/PropertiesUtil.java b/gather-app/src/main/java/com/ruoyi/common/utils/PropertiesUtil.java similarity index 97% rename from gather-app/src/main/java/com/ruoyi/business/controller/utils/PropertiesUtil.java rename to gather-app/src/main/java/com/ruoyi/common/utils/PropertiesUtil.java index 013ae15..acb56f9 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/utils/PropertiesUtil.java +++ b/gather-app/src/main/java/com/ruoyi/common/utils/PropertiesUtil.java @@ -1,4 +1,4 @@ -package com.ruoyi.business.controller.utils; +package com.ruoyi.common.utils; import org.apache.commons.lang3.StringUtils; diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/utils/StringKit.java b/gather-app/src/main/java/com/ruoyi/common/utils/StringKit.java similarity index 99% rename from gather-app/src/main/java/com/ruoyi/business/controller/utils/StringKit.java rename to gather-app/src/main/java/com/ruoyi/common/utils/StringKit.java index 6f493c8..b7d1c05 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/utils/StringKit.java +++ b/gather-app/src/main/java/com/ruoyi/common/utils/StringKit.java @@ -1,4 +1,4 @@ -package com.ruoyi.business.controller.utils; +package com.ruoyi.common.utils; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java index f9d0500..27bfd30 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java index c93bd5c..e1ea302 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java @@ -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 peripheryUnit(MetaActualUnitInfo metaActualUnitInfo) { + List 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 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); + } } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java index ad5f751..41feb55 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java index aa9e7ff..7d86b10 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java index 038a3db..6b76449 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java index d7833b0..c91e365 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaActualUnitInfoVO.java b/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaActualUnitInfoVO.java new file mode 100644 index 0000000..5026509 --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaActualUnitInfoVO.java @@ -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; + +} diff --git a/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java b/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java index c0a8a80..1adce8e 100644 --- a/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java +++ b/gather-app/src/main/java/com/ruoyi/database/service/impl/DevopsVideoInfoServiceImpl.java @@ -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; diff --git a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java index 6a9c762..cdb213a 100644 --- a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java +++ b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java @@ -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.*;