管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-04-18 48897e3d10652ad6ed1f790357a5839baff8de31
src/main/java/com/lf/server/service/show/MarkService.java
@@ -94,17 +94,17 @@
     * @throws Exception 异常
     */
    public String downloadShp(UserEntity ue, List<MarkJsonEntity> list) throws Exception {
        String parent = pathHelper.getTempPath();
        String path = pathHelper.getTempPath();
        createShapeFiles(ue, list, path);
        String path = createShapeFiles(ue, list, parent);
        File[] files = new File(path).listFiles();
        if (files == null || files.length == 0) {
            return null;
        }
        String zip = getZipPath();
        ZipHelper.zip(zip, parent);
        FileHelper.deleteDir(parent);
        ZipHelper.zip(zip, path);
        FileHelper.deleteDir(path);
        String guid = FileHelper.getFileMd5(zip);
        DownloadEntity entity = downloadService.selectByGuid(guid);
@@ -121,9 +121,7 @@
    /**
     * 创建shp文件
     */
    private String createShapeFiles(UserEntity ue, List<MarkJsonEntity> list, String parent) {
        String path = getShpDir(ue, parent);
    private String createShapeFiles(UserEntity ue, List<MarkJsonEntity> list, String path) {
        List<MarkJsonEntity> points = getMarkByType(list, "POINT");
        if (points.size() > 0) {
            ShpHelper.createShp(points, path, "POINT");
@@ -191,13 +189,14 @@
    private DownloadEntity getDownloadEntity(UserEntity ue, String file) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析,6-统计报告,7-附件文件,8-瓦片文件
        de.setType(1);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
        de.setDcount(0);
        // de.setPwd(null)
        de.setUrl(FileHelper.getRelativePath(file));
        de.setDescr("shp文件");
        de.setDescr("Shp文件");
        de.setGuid(FileHelper.getFileMd5(file));
        de.setCreateUser(ue.getId());
        // de.setGeom(null)