| | |
| | | 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; |
| | |
| | | @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 + "不存在"); |
| | |
| | | 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) { |