From 534a27c16e9081ac13900b823a9bcf3cbae013dc Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 08 八月 2023 10:34:38 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/data/PublishController.java | 61 ++++++++++++++++++++++-------- 1 files changed, 45 insertions(+), 16 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 c38880a..3360bfd 100644 --- a/src/main/java/com/lf/server/controller/data/PublishController.java +++ b/src/main/java/com/lf/server/controller/data/PublishController.java @@ -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; } } @@ -175,10 +208,10 @@ @SysLog() @ApiOperation(value = "鏌ヨLas鏂囦欢鍧愭爣绯籌D") @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "鍏冩暟鎹甀D闆嗗悎", dataType = "Integer[]", paramType = "query", example = "10285, 10481, 10456, 10483") + @ApiImplicitParam(name = "ids", value = "鍏冩暟鎹甀D闆嗗悎", 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("鍏冩暟鎹甀D闆嗗悎涓嶈兘涓虹┖"); @@ -218,11 +251,9 @@ 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) { @@ -246,7 +277,7 @@ case "BIM": return "/Convert/ToTileset"; case "LAS": - return "/Convert/ToLas"; + return "/Convert/ToLasByPy"; case "OSGB": return "/Convert/ToOsgb"; default: @@ -272,11 +303,11 @@ 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) { @@ -298,10 +329,8 @@ entity.setUpdateUser(ue.getId()); } + layerService.clearCache(); int count = publishService.update(entity); - if (count > 0) { - layerService.clearCache(); - } return success(count); } catch (Exception ex) { -- Gitblit v1.9.3