From b672d835f9314c10a8fd949e309816ee766df22b Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 27 七月 2023 10:49:50 +0800 Subject: [PATCH] 修改发布清单的分页查询接口,添加数据目录、数据类别参数 --- src/main/java/com/lf/server/controller/data/PublishController.java | 66 +++++++++++++++++++++++++++++++-- 1 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/lf/server/controller/data/PublishController.java b/src/main/java/com/lf/server/controller/data/PublishController.java index bd61d51..7d45cc5 100644 --- a/src/main/java/com/lf/server/controller/data/PublishController.java +++ b/src/main/java/com/lf/server/controller/data/PublishController.java @@ -16,11 +16,11 @@ 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.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; import java.util.List; /** @@ -133,26 +133,59 @@ @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; } } @@ -173,6 +206,31 @@ } @SysLog() + @ApiOperation(value = "鏌ヨLas鏂囦欢鍧愭爣绯籌D") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "鍏冩暟鎹甀D闆嗗悎", dataType = "Integer[]", paramType = "query", example = "10483,10481,10456,10285") + }) + @GetMapping(value = "/selectLasCs") + public ResponseMsg<Object> selectLasCs(Integer[] ids, HttpServletRequest req) { + try { + if (null == ids || ids.length == 0) { + return fail("鍏冩暟鎹甀D闆嗗悎涓嶈兘涓虹┖"); + } + + PubEntity entity = new PubEntity(); + entity.setIds(Arrays.asList(ids)); + entity.setDircode("00"); + entity.setToken(WebHelper.getToken(req)); + + List<Integer> list = publishService.selectLasCs(entity, "/Convert/ReadLasCs", req); + + return success(list); + } catch (Exception ex) { + return fail(ex.getMessage(), null); + } + } + + @SysLog() @ApiOperation(value = "鎻掑叆鍙戝竷鏁版嵁") @ApiImplicitParams({ @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "PubEntity", paramType = "body") -- Gitblit v1.9.3