| | |
| | | import com.xiaopeng.map.mapper.XpPointMapper; |
| | | import com.xiaopeng.map.mapper.XpRegionMapper; |
| | | import com.xiaopeng.map.service.XpElectronicFenceService; |
| | | import com.xiaopeng.map.utils.GDMapGeocodingUtil; |
| | | import com.xiaopeng.map.utils.PolygonOverlapService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | |
| | | private XpPointMapper xpPointMapper; |
| | | @Autowired |
| | | private XpRegionMapper xpRegionMapper; |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Override |
| | | public PageInfo<XpElectronicFence> pageList(ElectronicPageListQuery query) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //根据经纬度获取当前城市code |
| | | XpElectronicFenceArea xpElectronicFenceArea = dto.getElectronicFenceAreas().get(0); |
| | | String[] split = xpElectronicFenceArea.getFencePoints().split(",")[0].split("_"); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(split[0], split[1]); |
| | | if(null == geocode){ |
| | | return R.fail("经纬度转换城市code失败"); |
| | | } |
| | | String cityCode = geocode.get("cityCode"); |
| | | dto.setCityCode(cityCode); |
| | | xpElectronicFence.setCityCode(dto.getCityCode()); |
| | | // 生成围栏id 规则:城市首字母-类型简写-4位自增流水号(如 SZ-OP-001),支持复制;数据停用或删除后,流水号不回收 |
| | | XpRegion xpRegion = xpRegionMapper.selectOne(new LambdaQueryWrapper<XpRegion>() |
| | |
| | | } |
| | | } |
| | | } |
| | | //根据经纬度获取当前城市code |
| | | XpElectronicFenceArea electronicFenceArea = dto.getElectronicFenceAreas().get(0); |
| | | String[] split = electronicFenceArea.getFencePoints().split(",")[0].split("_"); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(split[0], split[1]); |
| | | if(null == geocode){ |
| | | return R.fail("经纬度转换城市code失败"); |
| | | } |
| | | String cityCode = geocode.get("cityCode"); |
| | | dto.setCityCode(cityCode); |
| | | xpElectronicFence.setCityCode(dto.getCityCode()); |
| | | |
| | | this.updateById(xpElectronicFence); |