| | |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "dircode", value = "目录", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "type", value = "类别", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<PublishEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<PublishEntity>> selectByPageAndCount(String name, String dircode, String type, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | type = getPubType(type); |
| | | |
| | | int count = publishService.selectCount(name); |
| | | int count = publishService.selectCount(name, dircode, type); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<PublishEntity> rs = publishService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | List<PublishEntity> rs = publishService.selectByPage(name, dircode, type, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取发布类型 |
| | | */ |
| | | private String getPubType(String type) { |
| | | if (StringHelper.isEmpty(type)) { |
| | | return null; |
| | | } |
| | | |
| | | switch (type) { |
| | | case "DOM": |
| | | return "type = 'DOM'"; |
| | | case "DEM": |
| | | return "type = 'DEM'"; |
| | | case "MPT": |
| | | return "type = 'mpt'"; |
| | | case "3DML": |
| | | return "type = '3dml'"; |
| | | case "CPT": |
| | | return "type = 'cpt'"; |
| | | case "BIM": |
| | | return "type in ('ifc', 'fbx', 'rvt')"; |
| | | case "LAS": |
| | | return "type in ('las', 'laz')"; |
| | | case "OSGB": |
| | | return "type = 'osgb'"; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询Las文件坐标系ID") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "元数据ID集合", dataType = "Integer[]", paramType = "query", example = "10285, 10481, 10456, 10483") |
| | | @ApiImplicitParam(name = "ids", value = "元数据ID集合", dataType = "Integer[]", paramType = "query", example = "10483,10481,10456,10285") |
| | | }) |
| | | @GetMapping(value = "/selectLasCs") |
| | | public ResponseMsg<Object> selectLasCs(@RequestParam(value = "ids[]") Integer[] ids, HttpServletRequest req) { |
| | | public ResponseMsg<Object> selectLasCs(Integer[] ids, HttpServletRequest req) { |
| | | try { |
| | | if (null == ids || ids.length == 0) { |
| | | return fail("元数据ID集合不能为空"); |
| | |
| | | entity.setToken(WebHelper.getToken(req)); |
| | | } |
| | | |
| | | layerService.clearCache(); |
| | | String method = getConvertMethod(entity.getType()); |
| | | long count = publishService.postForPub(entity, method, req); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | case "BIM": |
| | | return "/Convert/ToTileset"; |
| | | case "LAS": |
| | | return "/Convert/ToLas"; |
| | | return "/Convert/ToLasByPy"; |
| | | case "OSGB": |
| | | return "/Convert/ToOsgb"; |
| | | default: |
| | |
| | | return fail("没有找到要删除的数据", -1); |
| | | } |
| | | |
| | | publishService.deleteFiles(list); |
| | | // publishService.deleteFiles(list) |
| | | layerService.clearCache(); |
| | | publishService.deleteFiles(ids, req); |
| | | |
| | | int count = publishService.deletes(ids, req); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | layerService.clearCache(); |
| | | int count = publishService.update(entity); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |