From 796b44ea813a1133beae4f3a67f1c0263510c0c7 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期日, 17 十一月 2024 09:45:07 +0800 Subject: [PATCH] 1 --- src/main/java/com/moon/server/service/show/InquiryService.java | 40 ++++++++-------------------------------- 1 files changed, 8 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/moon/server/service/show/InquiryService.java b/src/main/java/com/moon/server/service/show/InquiryService.java index d9c8e1b..92b6bde 100644 --- a/src/main/java/com/moon/server/service/show/InquiryService.java +++ b/src/main/java/com/moon/server/service/show/InquiryService.java @@ -23,11 +23,8 @@ import java.util.Date; import java.util.List; -/** - * 鏌ヨ鏈嶅姟绫� - * @author WWW - */ @Service +@SuppressWarnings("ALL") public class InquiryService { @Resource PathHelper pathHelper; @@ -40,9 +37,6 @@ private final static Log log = LogFactory.getLog(InquiryService.class); - /** - * 璇诲彇Shp绗竴鏉¤褰曠殑WKT - */ public ShpRecordEntity readShpFirstRecord(List<MetaFileEntity> list) { String fileName = null; for (MetaFileEntity mf : list) { @@ -61,9 +55,6 @@ return sr; } - /** - * 鎵撳寘鐡︾墖 - */ public String zipTiles(DownloadTileEntity dt, PublishEntity pub, UserEntity ue) { if (!isTilePathExist(pub)) { return null; @@ -91,11 +82,8 @@ return rows > 0 ? de.getGuid() : null; } - /** - * 鐡︾墖璺緞鏄惁瀛樺湪 - */ private boolean isTilePathExist(PublishEntity pub) { - String tilePath = pathHelper.getConfig().getTilePath().replace("2d\\tiles", "") + pub.getPath(); + String tilePath = pathHelper.getConfig().getTilePath() + pub.getPath(); File f = new File(tilePath); if (!f.exists() || !f.isDirectory()) { @@ -107,11 +95,14 @@ return true; } - /** - * 鏌ユ壘鐡︾墖 - */ private List<File> findTiles(DownloadTileEntity dt, PublishEntity pub) { List<File> list = new ArrayList<>(); + + File view = new File(pub.getPath() + File.separator + "view.htm"); + if (view.exists() && !view.isDirectory()) { + list.add(view); + } + for (int i = 0; i < StaticData.I23; i++) { List<File> files = findTilesByZoom(dt, pub, i); if (files.size() > 0) { @@ -122,9 +113,6 @@ return list; } - /** - * 鏍规嵁灞傛鏌ユ壘鐡︾墖 - */ private List<File> findTilesByZoom(DownloadTileEntity dt, PublishEntity pub, int zoom) { List<File> list = new ArrayList<>(); File f = new File(pub.getPath() + File.separator + zoom); @@ -149,9 +137,6 @@ return list; } - /** - * 瑙掑害杞暟鍊� - */ private int[] deg2num(int zoom, double x, double y) { double yRad = Math.toRadians(y); double n = Math.pow(2.0, zoom); @@ -162,9 +147,6 @@ return new int[]{xTile, yTile}; } - /** - * 娣诲姞鏂囦欢鑷冲帇缂╁寘 - */ private void addFiles(ZipFile zip, ZipParameters params, List<File> list, String basePath) { for (File f : list) { try { @@ -176,9 +158,6 @@ } } - /** - * 鑾峰彇涓嬭浇瀹炰綋绫� - */ private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) { DownloadEntity de = new DownloadEntity(); de.setName(FileHelper.getFileName(file)); @@ -197,9 +176,6 @@ return de; } - /** - * 鎻掑叆鏁版嵁鍙戝竷-涓嬭浇琛� - */ private void insertPubDown(PublishEntity pub, DownloadEntity de, UserEntity ue) { publishService.insertPubDown(pub.getId(), de.getId(), ue.getId()); } -- Gitblit v1.9.3