| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.GeomBaseMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return null; |
| | | } |
| | | |
| | | //String tempName = StringHelper.YMDHMS2_FORMAT.format(new Date()); |
| | | //String tempPath = pathHelper.getTempPath(tempName); |
| | | //String filePath = tempPath + File.separator + tempName + ".gdb"; |
| | | |
| | | String filePath = "D:\\LF\\temp\\20221219202706\\20221219202705.gdb"; |
| | | File file = new File(filePath); |
| | | if (!file.exists() || !file.isDirectory()) { |
| | | file.mkdirs(); |
| | | } |
| | | |
| | | filePath = "D:\\LF\\temp\\20221219202706\\2022.gdb"; |
| | | if (file.exists() && file.isDirectory()) { |
| | | FileHelper.deleteDir(filePath); |
| | | } |
| | | GdbHelper.createGdb(filePath, map); |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | if (StringHelper.isNull(tab)) { |
| | | continue; |
| | | } |
| | | |
| | | QueryWrapper wrapper = createWrapper(baseMapper, wkt); |
| | | List<?> list = baseMapper.selectList(wrapper); |
| | | if (null == list || list.size() == 0) { |
| | | continue; |
| | | } |
| | | |
| | | if (!map.containsKey(tab)) { |
| | | map.put(tab, list); |
| | | if (!map.containsKey(enity)) { |
| | | map.put(enity, list); |
| | | } |
| | | } catch (Exception ex) { |
| | | // |
| | |
| | | */ |
| | | private QueryWrapper createWrapper(GeomBaseMapper baseMapper, String wkt) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.select("ST_AsText(geom) as geom"); |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | Integer srid = baseQueryService.getSrid(baseMapper); |
| | | wrapper.apply(String.format("ST_Intersects(ST_PolygonFromText('%s', %d), geom)", wkt, srid)); |
| | | |