| | |
| | | tSiteService.insert(tSite); |
| | | |
| | | //添加站点区域 |
| | | addLocation(subArr,tSite.getId()); |
| | | String s = addLocation(subArr, tSite.getId()); |
| | | if (s.equals("false")){ |
| | | return ResultUtil.error("面积过大,请清除后重新绘制"); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | * @param subArr |
| | | * @param id |
| | | */ |
| | | public void addLocation(String subArr,Integer id){ |
| | | public String addLocation(String subArr,Integer id){ |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | |
| | | |
| | | if(type == 2){ |
| | | List<String> fence = gdMapElectricFenceUtil.createFence(location.getId().toString(), location.getCoordinate()); |
| | | if (fence.contains("-1")){ |
| | | return "false"; |
| | | |
| | | } |
| | | TLocation location1 = itLocationService.selectById(location.getId()); |
| | | String s = ""; |
| | | for(String gid : fence){ |
| | |
| | | itLocationService.updateById(location1); |
| | | } |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | /** |