管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-05 d91c78e445e49cda5430bd33ef281f60f56a0a2d
src/main/java/com/lf/server/service/show/MarkService.java
@@ -2,6 +2,7 @@
import com.lf.server.entity.ctrl.MarkJsonEntity;
import com.lf.server.entity.data.DownloadEntity;
import com.lf.server.entity.data.MetaEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.entity.show.MarkEntity;
import com.lf.server.entity.sys.UserEntity;
@@ -15,6 +16,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -93,7 +95,7 @@
     * @throws Exception 异常
     */
    public String downloadShp(UserEntity ue, List<MarkJsonEntity> list, HttpServletRequest req, HttpServletResponse res) throws Exception {
        String parent = pathHelper.getTempPath(ue.getId());
        String parent = pathHelper.getTempPath();
        String path = createShapeFiles(ue, list, parent);
        File[] files = new File(path).listFiles();
@@ -162,7 +164,7 @@
    }
    private String getZip() {
        String path = pathHelper.getDownloadFullPath() + File.separator + WebHelper.getRandomInt(100000, 1000000) + ".zip";
        String path = pathHelper.getDownloadFullPath() + File.separator + StringHelper.YMDHMS2_FORMAT.format(new Date()) + ".zip";
        File file = new File(path);
        if (file.exists() && !file.isDirectory()) {
@@ -176,11 +178,12 @@
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        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("下载ShapeFile文件");
        de.setDescr("ShapeFile文件");
        de.setGuid(FileHelper.getFileMd5(file));
        de.setCreateUser(ue.getId());
        // de.setGeom(null)
@@ -207,7 +210,7 @@
    public List<MarkJsonEntity> readShpForMarks(List<MetaFileEntity> list) {
        String fileName = null;
        for (MetaFileEntity mf : list) {
            if (mf.getName().toLowerCase().indexOf(".shp") > -1) {
            if (mf.getName().toLowerCase().contains(".shp")) {
                fileName = mf.getPath();
                break;
            }