危险源点
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.gis.xian.controller;
|
||||
|
||||
import com.gis.xian.domain.ApiResponse;
|
||||
import com.gis.xian.vo.XianDangerousSourceBasePointVo;
|
||||
import com.gis.xian.vo.XianDangerousSourcePointDetailVo;
|
||||
import com.gis.xian.service.XianDangerousSourceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dangerous-source")
|
||||
public class XianDangerousSourceController extends BaseController{
|
||||
|
||||
@Resource
|
||||
private XianDangerousSourceService xianDangerousSourceService;
|
||||
|
||||
@GetMapping("/base-points")
|
||||
public ApiResponse<List<XianDangerousSourceBasePointVo>> getBasePoints() {
|
||||
return ApiResponse.ok(xianDangerousSourceService.getBasePoints());
|
||||
}
|
||||
|
||||
@GetMapping("/point-detail/{id}")
|
||||
public ApiResponse<XianDangerousSourcePointDetailVo> getPointDetailById(@PathVariable String id) {
|
||||
return ApiResponse.ok(xianDangerousSourceService.getPointDetailById(Long.parseLong(id)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,361 @@
|
||||
package com.gis.xian.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 危险源点
|
||||
* @TableName xian_dangerous_source
|
||||
*/
|
||||
@Data
|
||||
public class XianDangerousSource {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 全国统一社会信用代码
|
||||
*/
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否位于化工园区
|
||||
*/
|
||||
private String isInchemistry;
|
||||
|
||||
/**
|
||||
* 开业(成立)时间
|
||||
*/
|
||||
private String standTime;
|
||||
|
||||
/**
|
||||
* 企业类型
|
||||
*/
|
||||
private String enterpriseType;
|
||||
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 安全生产标准化等级
|
||||
*/
|
||||
private String safeProductLevel;
|
||||
|
||||
/**
|
||||
* 总容积
|
||||
*/
|
||||
private String sumVolume;
|
||||
|
||||
/**
|
||||
* 储罐类型
|
||||
*/
|
||||
private String tankType;
|
||||
|
||||
/**
|
||||
* 总容积(其他说明1
|
||||
*/
|
||||
private String sumVolumeOther1;
|
||||
|
||||
/**
|
||||
* 总容积(其他说明3
|
||||
*/
|
||||
private String sumVolumeOther3;
|
||||
|
||||
/**
|
||||
* 总容积(其他说明2
|
||||
*/
|
||||
private String sumVolumeOther2;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 填表人
|
||||
*/
|
||||
private String fillName;
|
||||
|
||||
/**
|
||||
* 空间点坐标
|
||||
*/
|
||||
private String position;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 上报时间
|
||||
*/
|
||||
private String reportTime;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 县
|
||||
*/
|
||||
private String county;
|
||||
|
||||
/**
|
||||
* 乡
|
||||
*/
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 单位负责人
|
||||
*/
|
||||
private String unitHead;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 村
|
||||
*/
|
||||
private String village;
|
||||
|
||||
/**
|
||||
* 行政区划代码
|
||||
*/
|
||||
private String governmentCode;
|
||||
|
||||
/**
|
||||
* 街道
|
||||
*/
|
||||
private String street;
|
||||
|
||||
/**
|
||||
* 统计负责人
|
||||
*/
|
||||
private String statisticsHead;
|
||||
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
private String structionCode;
|
||||
|
||||
/**
|
||||
* 物理主键
|
||||
*/
|
||||
private String physicalKey;
|
||||
|
||||
/**
|
||||
* 省编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 县编码
|
||||
*/
|
||||
private String countyCode;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 写入时间
|
||||
*/
|
||||
private String writeTime;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double lon;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Object point;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识,0未删除,1已删除
|
||||
*/
|
||||
private Integer isDelete;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
XianDangerousSource other = (XianDangerousSource) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getUnitCode() == null ? other.getUnitCode() == null : this.getUnitCode().equals(other.getUnitCode()))
|
||||
&& (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
|
||||
&& (this.getIsInchemistry() == null ? other.getIsInchemistry() == null : this.getIsInchemistry().equals(other.getIsInchemistry()))
|
||||
&& (this.getStandTime() == null ? other.getStandTime() == null : this.getStandTime().equals(other.getStandTime()))
|
||||
&& (this.getEnterpriseType() == null ? other.getEnterpriseType() == null : this.getEnterpriseType().equals(other.getEnterpriseType()))
|
||||
&& (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
|
||||
&& (this.getSafeProductLevel() == null ? other.getSafeProductLevel() == null : this.getSafeProductLevel().equals(other.getSafeProductLevel()))
|
||||
&& (this.getSumVolume() == null ? other.getSumVolume() == null : this.getSumVolume().equals(other.getSumVolume()))
|
||||
&& (this.getTankType() == null ? other.getTankType() == null : this.getTankType().equals(other.getTankType()))
|
||||
&& (this.getSumVolumeOther1() == null ? other.getSumVolumeOther1() == null : this.getSumVolumeOther1().equals(other.getSumVolumeOther1()))
|
||||
&& (this.getSumVolumeOther3() == null ? other.getSumVolumeOther3() == null : this.getSumVolumeOther3().equals(other.getSumVolumeOther3()))
|
||||
&& (this.getSumVolumeOther2() == null ? other.getSumVolumeOther2() == null : this.getSumVolumeOther2().equals(other.getSumVolumeOther2()))
|
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
||||
&& (this.getFillName() == null ? other.getFillName() == null : this.getFillName().equals(other.getFillName()))
|
||||
&& (this.getPosition() == null ? other.getPosition() == null : this.getPosition().equals(other.getPosition()))
|
||||
&& (this.getProvince() == null ? other.getProvince() == null : this.getProvince().equals(other.getProvince()))
|
||||
&& (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
|
||||
&& (this.getReportTime() == null ? other.getReportTime() == null : this.getReportTime().equals(other.getReportTime()))
|
||||
&& (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
|
||||
&& (this.getCounty() == null ? other.getCounty() == null : this.getCounty().equals(other.getCounty()))
|
||||
&& (this.getCountry() == null ? other.getCountry() == null : this.getCountry().equals(other.getCountry()))
|
||||
&& (this.getUnitHead() == null ? other.getUnitHead() == null : this.getUnitHead().equals(other.getUnitHead()))
|
||||
&& (this.getCreateName() == null ? other.getCreateName() == null : this.getCreateName().equals(other.getCreateName()))
|
||||
&& (this.getVillage() == null ? other.getVillage() == null : this.getVillage().equals(other.getVillage()))
|
||||
&& (this.getGovernmentCode() == null ? other.getGovernmentCode() == null : this.getGovernmentCode().equals(other.getGovernmentCode()))
|
||||
&& (this.getStreet() == null ? other.getStreet() == null : this.getStreet().equals(other.getStreet()))
|
||||
&& (this.getStatisticsHead() == null ? other.getStatisticsHead() == null : this.getStatisticsHead().equals(other.getStatisticsHead()))
|
||||
&& (this.getStructionCode() == null ? other.getStructionCode() == null : this.getStructionCode().equals(other.getStructionCode()))
|
||||
&& (this.getPhysicalKey() == null ? other.getPhysicalKey() == null : this.getPhysicalKey().equals(other.getPhysicalKey()))
|
||||
&& (this.getProvinceCode() == null ? other.getProvinceCode() == null : this.getProvinceCode().equals(other.getProvinceCode()))
|
||||
&& (this.getCityCode() == null ? other.getCityCode() == null : this.getCityCode().equals(other.getCityCode()))
|
||||
&& (this.getCountyCode() == null ? other.getCountyCode() == null : this.getCountyCode().equals(other.getCountyCode()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
|
||||
&& (this.getWriteTime() == null ? other.getWriteTime() == null : this.getWriteTime().equals(other.getWriteTime()))
|
||||
&& (this.getLon() == null ? other.getLon() == null : this.getLon().equals(other.getLon()))
|
||||
&& (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
|
||||
&& (this.getPoint() == null ? other.getPoint() == null : this.getPoint().equals(other.getPoint()))
|
||||
&& (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getUnitCode() == null) ? 0 : getUnitCode().hashCode());
|
||||
result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
|
||||
result = prime * result + ((getIsInchemistry() == null) ? 0 : getIsInchemistry().hashCode());
|
||||
result = prime * result + ((getStandTime() == null) ? 0 : getStandTime().hashCode());
|
||||
result = prime * result + ((getEnterpriseType() == null) ? 0 : getEnterpriseType().hashCode());
|
||||
result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
|
||||
result = prime * result + ((getSafeProductLevel() == null) ? 0 : getSafeProductLevel().hashCode());
|
||||
result = prime * result + ((getSumVolume() == null) ? 0 : getSumVolume().hashCode());
|
||||
result = prime * result + ((getTankType() == null) ? 0 : getTankType().hashCode());
|
||||
result = prime * result + ((getSumVolumeOther1() == null) ? 0 : getSumVolumeOther1().hashCode());
|
||||
result = prime * result + ((getSumVolumeOther3() == null) ? 0 : getSumVolumeOther3().hashCode());
|
||||
result = prime * result + ((getSumVolumeOther2() == null) ? 0 : getSumVolumeOther2().hashCode());
|
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
||||
result = prime * result + ((getFillName() == null) ? 0 : getFillName().hashCode());
|
||||
result = prime * result + ((getPosition() == null) ? 0 : getPosition().hashCode());
|
||||
result = prime * result + ((getProvince() == null) ? 0 : getProvince().hashCode());
|
||||
result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
|
||||
result = prime * result + ((getReportTime() == null) ? 0 : getReportTime().hashCode());
|
||||
result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
|
||||
result = prime * result + ((getCounty() == null) ? 0 : getCounty().hashCode());
|
||||
result = prime * result + ((getCountry() == null) ? 0 : getCountry().hashCode());
|
||||
result = prime * result + ((getUnitHead() == null) ? 0 : getUnitHead().hashCode());
|
||||
result = prime * result + ((getCreateName() == null) ? 0 : getCreateName().hashCode());
|
||||
result = prime * result + ((getVillage() == null) ? 0 : getVillage().hashCode());
|
||||
result = prime * result + ((getGovernmentCode() == null) ? 0 : getGovernmentCode().hashCode());
|
||||
result = prime * result + ((getStreet() == null) ? 0 : getStreet().hashCode());
|
||||
result = prime * result + ((getStatisticsHead() == null) ? 0 : getStatisticsHead().hashCode());
|
||||
result = prime * result + ((getStructionCode() == null) ? 0 : getStructionCode().hashCode());
|
||||
result = prime * result + ((getPhysicalKey() == null) ? 0 : getPhysicalKey().hashCode());
|
||||
result = prime * result + ((getProvinceCode() == null) ? 0 : getProvinceCode().hashCode());
|
||||
result = prime * result + ((getCityCode() == null) ? 0 : getCityCode().hashCode());
|
||||
result = prime * result + ((getCountyCode() == null) ? 0 : getCountyCode().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
result = prime * result + ((getWriteTime() == null) ? 0 : getWriteTime().hashCode());
|
||||
result = prime * result + ((getLon() == null) ? 0 : getLon().hashCode());
|
||||
result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
|
||||
result = prime * result + ((getPoint() == null) ? 0 : getPoint().hashCode());
|
||||
result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", unitCode=").append(unitCode);
|
||||
sb.append(", address=").append(address);
|
||||
sb.append(", isInchemistry=").append(isInchemistry);
|
||||
sb.append(", standTime=").append(standTime);
|
||||
sb.append(", enterpriseType=").append(enterpriseType);
|
||||
sb.append(", level=").append(level);
|
||||
sb.append(", safeProductLevel=").append(safeProductLevel);
|
||||
sb.append(", sumVolume=").append(sumVolume);
|
||||
sb.append(", tankType=").append(tankType);
|
||||
sb.append(", sumVolumeOther1=").append(sumVolumeOther1);
|
||||
sb.append(", sumVolumeOther3=").append(sumVolumeOther3);
|
||||
sb.append(", sumVolumeOther2=").append(sumVolumeOther2);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", fillName=").append(fillName);
|
||||
sb.append(", position=").append(position);
|
||||
sb.append(", province=").append(province);
|
||||
sb.append(", city=").append(city);
|
||||
sb.append(", reportTime=").append(reportTime);
|
||||
sb.append(", telephone=").append(telephone);
|
||||
sb.append(", county=").append(county);
|
||||
sb.append(", country=").append(country);
|
||||
sb.append(", unitHead=").append(unitHead);
|
||||
sb.append(", createName=").append(createName);
|
||||
sb.append(", village=").append(village);
|
||||
sb.append(", governmentCode=").append(governmentCode);
|
||||
sb.append(", street=").append(street);
|
||||
sb.append(", statisticsHead=").append(statisticsHead);
|
||||
sb.append(", structionCode=").append(structionCode);
|
||||
sb.append(", physicalKey=").append(physicalKey);
|
||||
sb.append(", provinceCode=").append(provinceCode);
|
||||
sb.append(", cityCode=").append(cityCode);
|
||||
sb.append(", countyCode=").append(countyCode);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append(", writeTime=").append(writeTime);
|
||||
sb.append(", lon=").append(lon);
|
||||
sb.append(", lat=").append(lat);
|
||||
sb.append(", point=").append(point);
|
||||
sb.append(", isDelete=").append(isDelete);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.gis.xian.mapper;
|
||||
|
||||
import com.gis.xian.entity.XianDangerousSource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wzy
|
||||
* @description 针对表【xian_dangerous_source(危险源点)】的数据库操作Mapper
|
||||
* @createDate 2026-04-18 00:00:00
|
||||
* @Entity com.gis.xian.entity.XianDangerousSource
|
||||
*/
|
||||
public interface XianDangerousSourceMapper {
|
||||
/**
|
||||
* 获取所有危险源基础点
|
||||
* @return 基础点列表
|
||||
*/
|
||||
List<XianDangerousSource> getBasePoints();
|
||||
|
||||
/**
|
||||
* 根据id获取危险源详情
|
||||
* @param id 危险源id
|
||||
* @return 危险源详情
|
||||
*/
|
||||
XianDangerousSource getPointDetailById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.gis.xian.service;
|
||||
|
||||
import com.gis.xian.vo.XianDangerousSourceBasePointVo;
|
||||
import com.gis.xian.vo.XianDangerousSourcePointDetailVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface XianDangerousSourceService {
|
||||
|
||||
/**
|
||||
* 获取所有危险源基础点
|
||||
* @return 基础点列表
|
||||
*/
|
||||
List<XianDangerousSourceBasePointVo> getBasePoints();
|
||||
|
||||
/**
|
||||
* 根据id获取危险源详情
|
||||
* @param id 危险源id
|
||||
* @return 危险源详情
|
||||
*/
|
||||
XianDangerousSourcePointDetailVo getPointDetailById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gis.xian.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.gis.xian.entity.XianDangerousSource;
|
||||
import com.gis.xian.vo.XianDangerousSourceBasePointVo;
|
||||
import com.gis.xian.vo.XianDangerousSourcePointDetailVo;
|
||||
import com.gis.xian.mapper.XianDangerousSourceMapper;
|
||||
import com.gis.xian.service.XianDangerousSourceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class IXianDangerousSourceServiceImpl implements XianDangerousSourceService {
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Resource
|
||||
private XianDangerousSourceMapper xianDangerousSourceMapper;
|
||||
|
||||
@Value("${init.data.base-points.dangerous-source}")
|
||||
private String dangerousSourceBasePointsKey;
|
||||
|
||||
@Override
|
||||
public List<XianDangerousSourceBasePointVo> getBasePoints() {
|
||||
// 从redis中读取基础点信息
|
||||
Object data = redisTemplate.opsForValue().get(dangerousSourceBasePointsKey);
|
||||
|
||||
if (data == null) {
|
||||
List<XianDangerousSourceBasePointVo> basePoints = XianDangerousSourceBasePointVo.entity2Vo(xianDangerousSourceMapper.getBasePoints());
|
||||
redisTemplate.opsForValue().set(dangerousSourceBasePointsKey, JSON.toJSONString(basePoints));
|
||||
return basePoints;
|
||||
}
|
||||
|
||||
return JSON.parseArray(data.toString(), XianDangerousSourceBasePointVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XianDangerousSourcePointDetailVo getPointDetailById(Long id) {
|
||||
return XianDangerousSourcePointDetailVo.entity2Vo(xianDangerousSourceMapper.getPointDetailById(id));
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@ package com.gis.xian.task;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.gis.xian.enums.DisasterTypeEnum;
|
||||
import com.gis.xian.mapper.XianDangerousSourceMapper;
|
||||
import com.gis.xian.mapper.XianHiddenDangerSpotsMapper;
|
||||
import com.gis.xian.mapper.XianHospitalsMapper;
|
||||
import com.gis.xian.mapper.XianRiskSpotsMapper;
|
||||
import com.gis.xian.vo.XianDangerousSourceBasePointVo;
|
||||
import com.gis.xian.vo.XianHiddenDangerSpotsBasePointVo;
|
||||
import com.gis.xian.vo.XianHospitalsBasePointVo;
|
||||
import com.gis.xian.vo.XianRiskSpotsBasePointVo;
|
||||
@@ -32,6 +34,9 @@ public class InitializeData {
|
||||
@Resource
|
||||
private XianHospitalsMapper xianHospitalsMapper;
|
||||
|
||||
@Resource
|
||||
private XianDangerousSourceMapper xianDangerousSourceMapper;
|
||||
|
||||
@Resource
|
||||
RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@@ -47,6 +52,9 @@ public class InitializeData {
|
||||
@Value("${init.data.base-points.hospitals}")
|
||||
private String hospitalsBasePointsKey;
|
||||
|
||||
@Value("${init.data.base-points.dangerous-source}")
|
||||
private String dangerousSourceBasePointsKey;
|
||||
|
||||
@PostConstruct
|
||||
@Async("xianPool")
|
||||
public void init() {
|
||||
@@ -77,6 +85,13 @@ public class InitializeData {
|
||||
xianHospitalsMapper.getBasePoints())
|
||||
)
|
||||
);
|
||||
|
||||
// 加载危险源基本信息写入redis
|
||||
redisTemplate.opsForValue().set(dangerousSourceBasePointsKey, JSON.toJSONString(
|
||||
XianDangerousSourceBasePointVo.entity2Vo(
|
||||
xianDangerousSourceMapper.getBasePoints())
|
||||
)
|
||||
);
|
||||
log.info("初始化数据完成");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.gis.xian.vo;
|
||||
|
||||
import com.gis.xian.entity.XianDangerousSource;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 危险源-基本点信息
|
||||
* @TableName xian_dangerous_source
|
||||
*/
|
||||
@Data
|
||||
public class XianDangerousSourceBasePointVo {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double lon;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double lat;
|
||||
|
||||
public static XianDangerousSourceBasePointVo entity2Vo(XianDangerousSource entity) {
|
||||
XianDangerousSourceBasePointVo vo = new XianDangerousSourceBasePointVo();
|
||||
vo.setId(entity.getId());
|
||||
vo.setLon(entity.getLon() != null ? entity.getLon().doubleValue() : null);
|
||||
vo.setLat(entity.getLat() != null ? entity.getLat().doubleValue() : null);
|
||||
return vo;
|
||||
}
|
||||
|
||||
public static List<XianDangerousSourceBasePointVo> entity2Vo(List<XianDangerousSource> entityList) {
|
||||
List<XianDangerousSourceBasePointVo> voList = new ArrayList<>();
|
||||
for (XianDangerousSource entity : entityList) {
|
||||
voList.add(entity2Vo(entity));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
XianDangerousSourceBasePointVo that = (XianDangerousSourceBasePointVo) o;
|
||||
return Objects.equals(id, that.id) && Objects.equals(lon, that.lon) && Objects.equals(lat, that.lat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, lon, lat);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.gis.xian.vo;
|
||||
|
||||
import com.gis.xian.entity.XianDangerousSource;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 危险源-详细信息
|
||||
* @TableName xian_dangerous_source
|
||||
*/
|
||||
@Data
|
||||
public class XianDangerousSourcePointDetailVo {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 全国统一社会信用代码
|
||||
*/
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 企业类型
|
||||
*/
|
||||
private String enterpriseType;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double lon;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
* 单位负责人
|
||||
*/
|
||||
private String unitHead;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
public static XianDangerousSourcePointDetailVo entity2Vo(XianDangerousSource entity) {
|
||||
XianDangerousSourcePointDetailVo vo = new XianDangerousSourcePointDetailVo();
|
||||
vo.setId(entity.getId());
|
||||
vo.setName(entity.getName());
|
||||
vo.setUnitCode(entity.getUnitCode());
|
||||
vo.setLevel(entity.getLevel());
|
||||
vo.setEnterpriseType(entity.getEnterpriseType());
|
||||
vo.setAddress(entity.getAddress());
|
||||
vo.setLon(entity.getLon() != null ? entity.getLon().doubleValue() : null);
|
||||
vo.setLat(entity.getLat() != null ? entity.getLat().doubleValue() : null);
|
||||
vo.setUnitHead(entity.getUnitHead());
|
||||
vo.setTelephone(entity.getTelephone());
|
||||
return vo;
|
||||
}
|
||||
|
||||
public static List<XianDangerousSourcePointDetailVo> entity2Vo(List<XianDangerousSource> entityList) {
|
||||
List<XianDangerousSourcePointDetailVo> voList = new ArrayList<>();
|
||||
for (XianDangerousSource entity : entityList) {
|
||||
voList.add(entity2Vo(entity));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
XianDangerousSourcePointDetailVo that = (XianDangerousSourcePointDetailVo) o;
|
||||
return Objects.equals(id, that.id) && Objects.equals(name, that.name)
|
||||
&& Objects.equals(unitCode, that.unitCode) && Objects.equals(level, that.level)
|
||||
&& Objects.equals(enterpriseType, that.enterpriseType) && Objects.equals(address, that.address)
|
||||
&& Objects.equals(lon, that.lon) && Objects.equals(lat, that.lat)
|
||||
&& Objects.equals(unitHead, that.unitHead) && Objects.equals(telephone, that.telephone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, unitCode, level, enterpriseType, address, lon, lat, unitHead, telephone);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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.gis.xian.mapper.XianDangerousSourceMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.gis.xian.entity.XianDangerousSource">
|
||||
<id property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="unitCode" column="unit_code" />
|
||||
<result property="address" column="address" />
|
||||
<result property="isInchemistry" column="is_inchemistry" />
|
||||
<result property="standTime" column="stand_time" />
|
||||
<result property="enterpriseType" column="enterprise_type" />
|
||||
<result property="level" column="level" />
|
||||
<result property="safeProductLevel" column="safe_product_level" />
|
||||
<result property="sumVolume" column="sum_volume" />
|
||||
<result property="tankType" column="tank_type" />
|
||||
<result property="sumVolumeOther1" column="sum_volume_other1" />
|
||||
<result property="sumVolumeOther3" column="sum_volume_other3" />
|
||||
<result property="sumVolumeOther2" column="sum_volume_other2" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="fillName" column="fill_name" />
|
||||
<result property="position" column="position" />
|
||||
<result property="province" column="province" />
|
||||
<result property="city" column="city" />
|
||||
<result property="reportTime" column="report_time" />
|
||||
<result property="telephone" column="telephone" />
|
||||
<result property="county" column="county" />
|
||||
<result property="country" column="country" />
|
||||
<result property="unitHead" column="unit_head" />
|
||||
<result property="createName" column="create_name" />
|
||||
<result property="village" column="village" />
|
||||
<result property="governmentCode" column="government_code" />
|
||||
<result property="street" column="street" />
|
||||
<result property="statisticsHead" column="statistics_head" />
|
||||
<result property="structionCode" column="struction_code" />
|
||||
<result property="physicalKey" column="physical_key" />
|
||||
<result property="provinceCode" column="province_code" />
|
||||
<result property="cityCode" column="city_code" />
|
||||
<result property="countyCode" column="county_code" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="writeTime" column="write_time" />
|
||||
<result property="lon" column="lon" />
|
||||
<result property="lat" column="lat" />
|
||||
<result property="point" column="point" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 获取所有危险源基础点 -->
|
||||
<select id="getBasePoints" resultMap="BaseResultMap">
|
||||
SELECT id, lon, lat FROM xian_dangerous_source
|
||||
<where>
|
||||
is_delete = 0
|
||||
<!-- 确定落在西安境内 -->
|
||||
AND ST_Within(point, (SELECT geom FROM xian_district WHERE id = 1))
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据id获取危险源详情 -->
|
||||
<select id="getPointDetailById" resultMap="BaseResultMap">
|
||||
SELECT id, name, unit_code, level, enterprise_type, address, lon, lat, unit_head, telephone FROM xian_dangerous_source
|
||||
<where>
|
||||
id = #{id} AND is_delete = 0
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -14,4 +14,5 @@ init:
|
||||
rainstorm: 'xian:init:data:base-points:hidden-danger:rainstorm'
|
||||
earthquake: 'xian:init:data:base-points:hidden-danger:earthquake'
|
||||
risk: 'xian:init:data:base-points:risk'
|
||||
hospitals: 'xian:init:data:base-points:hospitals'
|
||||
hospitals: 'xian:init:data:base-points:hospitals'
|
||||
dangerous-source: 'xian:init:data:base-points:dangerous-source'
|
||||
Reference in New Issue
Block a user