管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-04-18 48897e3d10652ad6ed1f790357a5839baff8de31
src/main/java/com/lf/server/service/show/InquiryService.java
@@ -12,6 +12,8 @@
import com.lf.server.service.data.PublishService;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.model.ZipParameters;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -35,6 +37,8 @@
    @Resource
    DownloadService downloadService;
    private final static Log log = LogFactory.getLog(InquiryService.class);
    /**
     * 读取Shp第一条记录的WKT
@@ -91,7 +95,7 @@
     * 瓦片路径是否存在
     */
    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()) {
@@ -108,6 +112,12 @@
     */
    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) {
@@ -166,8 +176,8 @@
            try {
                params.setFileNameInZip(f.getPath().replace(basePath, ""));
                zip.addStream(new FileInputStream(f), params);
            } catch (Exception e) {
                //
            } catch (Exception ex) {
                log.error(ex.getMessage(), ex);
            }
        }
    }