管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-04-23 cc04410259d4ba26c04b3c3278481d260ab77056
1
已添加1个文件
已修改5个文件
201 ■■■■ 文件已修改
data/db_cx.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/all/BaseQueryController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/DataLibController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/InquiryController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/ctrl/DownloadTileEntity.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_cx.sql
@@ -21,7 +21,7 @@
select * from lf.sys_layer order by id desc;
select * from lf.sys_fme_log order by id desc;
select top, bottom, top -(bottom - top) from public.coal2000 order by gid limit 100;
select gid, top, bottom, top -(bottom - top) from public.coal2000 order by gid limit 20;
update public.coal2000 set bottom = top -(bottom - top);
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -28,6 +28,7 @@
import com.lf.server.service.show.DataLibService;
import com.lf.server.service.sys.AttachService;
import com.lf.server.service.sys.DepService;
import com.lf.server.service.sys.DownlogService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -64,7 +65,10 @@
    DataLibService dataLibService;
    @Autowired
    DownloadService downloadService;
    public DownlogService downlogService;
    @Autowired
    public DownloadService downloadService;
    @Autowired
    BaseQueryService baseQueryService;
src/main/java/com/lf/server/controller/show/DataLibController.java
@@ -55,12 +55,6 @@
    DataLibService dataLibService;
    @Autowired
    DownlogService downlogService;
    @Autowired
    DownloadService downloadService;
    @Autowired
    BaseQueryService baseQueryService;
    @Autowired
src/main/java/com/lf/server/controller/show/InquiryController.java
@@ -2,17 +2,23 @@
import com.lf.server.annotation.SysLog;
import com.lf.server.controller.all.BaseQueryController;
import com.lf.server.entity.all.HttpStatus;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.ctrl.DownloadTileEntity;
import com.lf.server.entity.ctrl.ShpRecordEntity;
import com.lf.server.entity.data.DownloadEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.AesHelper;
import com.lf.server.helper.StringHelper;
import com.lf.server.helper.WebHelper;
import com.lf.server.service.all.BaseUploadService;
import com.lf.server.service.show.InquiryService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -64,4 +70,46 @@
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "下载瓦片")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dt", value = "下载瓦片实体类", dataType = "DownloadTileEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/downloadTiles")
    public ResponseMsg<Object> downloadTiles(@RequestBody DownloadTileEntity dt, HttpServletRequest req, HttpServletResponse res) {
        try {
            return success("");
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "下载文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "文件GUID", dataType = "String", paramType = "query")
    })
    @ResponseBody
    @GetMapping(value = "/downloadFile")
    public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) {
        try {
            DownloadEntity de = downloadService.selectByGuid(guid);
            if (null == de) {
                WebHelper.writeInfo(HttpStatus.NOT_FOUND, "文件不存在", res);
                return;
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            downlogService.updateInfos(ue, de, req);
            String filePath = downloadService.getDownloadFilePath(de);
            WebHelper.download(filePath, de.getName(), res);
        } catch (Exception ex) {
            WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res);
        }
    }
}
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -16,45 +16,21 @@
     */
    public static String[] EXCLUDE_PATH = new String[]{"/sign/", "/perms/", "/fmeit/", "/crds/", "/floatserver/", "/wmts/select", "/swagger", "/error"};
    /**
     * æ•°å€¼ï¼š2
     */
    public final static int TWO = 2;
    /**
     * æ•°å€¼ï¼š4
     */
    public final static int FOUR = 4;
    /**
     * æ•°å€¼ï¼š9
     */
    public final static int NINE = 9;
    /**
     * æ•°å€¼ï¼š10
     */
    public final static int TEN = 10;
    /**
     * æ•°å€¼ï¼š16
     */
    public final static int SIXTEEN = 16;
    /**
     * æ•°å€¼ï¼š100
     */
    public final static int ONE_HUNDRED = 100;
    /**
     * æ•°å€¼ï¼š100,000
     */
    public final static int ONE_HUNDRED_THOUSAND = 100000;
    /**
     * æ•°å€¼ï¼š200
     */
    public final static int TWO_HUNDRED = 200;
    public final static int ONE_HUNDRED_THOUSAND = 100000;
    public static final double D1024 = 1024.0;
@@ -68,6 +44,14 @@
    public static final int I60 = 60;
    public static final int I90 = 90;
    public static final int I90_NEG = -90;
    public static final int I180 = 180;
    public static final int I180_NEG = -180;
    public static final int I2050 = 2050;
    public static final int I4490 = 4490;
src/main/java/com/lf/server/entity/ctrl/DownloadTileEntity.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
package com.lf.server.entity.ctrl;
import com.lf.server.entity.all.StaticData;
import java.io.Serializable;
/**
 * ä¸‹è½½ç“¦ç‰‡å®žä½“ç±»
 * @author WWW
 */
public class DownloadTileEntity implements Serializable {
    private static final long serialVersionUID = -229710198271495902L;
    private Double xmin;
    private Double ymin;
    private Double xmax;
    private Double ymax;
    private String title;
    private String url;
    private String pwd;
    public DownloadTileEntity() {
    }
    /**
     * éªŒè¯åæ ‡
     */
    public String verifyCoords() {
        if (null == xmin || null == ymin || null == xmax || null == ymax) {
            return "四至坐标值不能为空";
        }
        if (xmin < StaticData.I180_NEG || xmin > StaticData.I180 || xmax < StaticData.I180_NEG || xmax > StaticData.I180) {
            return "X坐标值不正确";
        }
        if (ymin < StaticData.I90_NEG || ymin > StaticData.I90 || ymax < StaticData.I90_NEG || ymax > StaticData.I90) {
            return "Y坐标值不正确";
        }
        return null;
    }
    public Double getXmin() {
        return xmin;
    }
    public void setXmin(Double xmin) {
        this.xmin = xmin;
    }
    public Double getYmin() {
        return ymin;
    }
    public void setYmin(Double ymin) {
        this.ymin = ymin;
    }
    public Double getXmax() {
        return xmax;
    }
    public void setXmax(Double xmax) {
        this.xmax = xmax;
    }
    public Double getYmax() {
        return ymax;
    }
    public void setYmax(Double ymax) {
        this.ymax = ymax;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getPwd() {
        return pwd;
    }
    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
}