From bf9f5d506d34cbbcc68f77cdf71e30a6cf3cd7d4 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 09 八月 2023 13:50:07 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/data/PublishController.java | 84 ++++++++++++++++++++++++++++++++++------- 1 files changed, 69 insertions(+), 15 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..3360bfd 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; } } @@ -167,6 +200,31 @@ PublishEntity entity = publishService.selectById(id); return success(entity); + } catch (Exception ex) { + return fail(ex.getMessage(), null); + } + } + + @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); } @@ -193,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) { @@ -221,7 +277,7 @@ case "BIM": return "/Convert/ToTileset"; case "LAS": - return "/Convert/ToLas"; + return "/Convert/ToLasByPy"; case "OSGB": return "/Convert/ToOsgb"; default: @@ -247,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) { @@ -273,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