管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-09 97dfbeaea4939c669c9fddacf2c9b090a8989d21
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -5,6 +5,7 @@
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.data.DirEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.entity.data.VerEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.service.data.UploadService;
@@ -109,13 +110,14 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query", example = "20230109010101"),
            @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "verid", value = "版本ID", dataType = "Integer", paramType = "query", example = "0"),
            @ApiImplicitParam(name = "epsgCode", value = "坐标编码", dataType = "String", paramType = "query", example = "EPSG:4490")
    })
    @GetMapping(value = "/selectMappers")
    public ResponseMsg<Object> selectMappers(String path, Integer dirid, String epsgCode) {
    public ResponseMsg<Object> selectMappers(String path, Integer dirid, Integer verid, String epsgCode, HttpServletRequest req) {
        try {
            if (StringHelper.isEmpty(path) || StringHelper.isEmpty(epsgCode) || null == dirid) {
                return fail("路径、目录ID和坐标编码不能为空");
            if (StringHelper.isEmpty(path) || StringHelper.isEmpty(epsgCode) || null == dirid || null == verid) {
                return fail("路径、目录ID、版本ID和坐标编码不能为空");
            }
            if (1 > uploadService.selectCount4Coord(epsgCode)) {
                return fail("坐标编码" + epsgCode + "不存在");
@@ -124,13 +126,18 @@
            if (null == dir) {
                return fail("目录ID=" + dirid + "不存在");
            }
            VerEntity ver = verService.selectVersion(verid);
            if (null == ver) {
                return fail("版本ID=" + verid + "不存在");
            }
            List<MetaFileEntity> metas = uploadService.selectFiles(path, StaticData.ALL_EXTENSION);
            if (null == metas || metas.isEmpty()) {
                return fail("目录" + path + "下查无文件");
            }
            List<MetaFileEntity> list = uploadService.selectMappers(metas, dir, epsgCode);
            UserEntity ue = tokenService.getCurrentUser(req);
            List<MetaFileEntity> list = uploadService.selectMappers(ue, metas, dir, ver, epsgCode);
            return success(list);
        } catch (Exception ex) {