| | |
| | | try { |
| | | PointPageListListQuery queryPoint = new PointPageListListQuery(); |
| | | queryPoint.setElectronicId(xpElectronicFence.getId()); |
| | | // queryPoint.setOperationStatus(2); |
| | | List<XpPoint> xpPoints = xpPointMapper.pageList( queryPoint); |
| | | |
| | | if(CollUtil.isNotEmpty(xpPoints)){ |
| | |
| | | } |
| | | |
| | | //根据经纬度获取当前城市code |
| | | // XpElectronicFenceArea xpElectronicFenceArea = dto.getElectronicFenceAreas().get(0); |
| | | // String[] split = xpElectronicFenceArea.getFencePoints().split(","); |
| | | // Coordinate[] coordinates = new Coordinate[split.length + 1]; |
| | | // for (int i = 0; i < split.length; i++) { |
| | | // String[] split1 = split[i].split("_"); |
| | | // coordinates[i] = new Coordinate(Double.parseDouble(split1[0]), Double.parseDouble(split1[1])); |
| | | // } |
| | | // org.locationtech.jts.geom.Point point = calculateCentroid(coordinates); |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(point.getX() + "", point.getY() + ""); |
| | | // if (null == geocode) { |
| | | // return R.fail("经纬度转换城市code失败"); |
| | | // } |
| | | // String cityCode = geocode.get("cityCode"); |
| | | // dto.setCityCode(cityCode); |
| | | XpElectronicFenceArea xpElectronicFenceArea = dto.getElectronicFenceAreas().get(0); |
| | | String[] split = xpElectronicFenceArea.getFencePoints().split(","); |
| | | Coordinate[] coordinates = new Coordinate[split.length + 1]; |
| | | for (int i = 0; i < split.length; i++) { |
| | | String[] split1 = split[i].split("_"); |
| | | coordinates[i] = new Coordinate(Double.parseDouble(split1[0]), Double.parseDouble(split1[1])); |
| | | } |
| | | org.locationtech.jts.geom.Point point = calculateCentroid(coordinates); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(point.getX() + "", point.getY() + ""); |
| | | if (null == geocode) { |
| | | return R.fail("经纬度转换城市code失败"); |
| | | } |
| | | String cityCode = geocode.get("cityCode"); |
| | | dto.setCityCode(cityCode); |
| | | |
| | | xpElectronicFence.setCityCode(dto.getCityCode()); |
| | | |
| | |
| | | QuartzManager.removeJob((ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT); |
| | | QuartzManager.removeJob((ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE); |
| | | } |
| | | /* |
| | | |
| | | //根据经纬度获取当前城市code |
| | | XpElectronicFenceArea electronicFenceArea = dto.getElectronicFenceAreas().get(0); |
| | | String[] split = electronicFenceArea.getFencePoints().split(","); |
| | |
| | | } |
| | | String cityCode = geocode.get("cityCode"); |
| | | dto.setCityCode(cityCode); |
| | | */ |
| | | |
| | | xpElectronicFence.setCityCode(dto.getCityCode()); |
| | | |