From ed8c7a5effd0d423ce1118b680ecdca6fe732609 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 02 七月 2025 16:43:13 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.11.205:9000/r/P2022036_Service --- src/main/java/com/lf/server/controller/data/upload/UploadController.java | 64 ++++++++++++++++++++++---------- 1 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/lf/server/controller/data/upload/UploadController.java b/src/main/java/com/lf/server/controller/data/upload/UploadController.java index 6a3253e..b9ab916 100644 --- a/src/main/java/com/lf/server/controller/data/upload/UploadController.java +++ b/src/main/java/com/lf/server/controller/data/upload/UploadController.java @@ -2,7 +2,6 @@ import com.lf.server.annotation.SysLog; import com.lf.server.entity.all.ResponseMsg; -import com.lf.server.entity.all.StaticData; import com.lf.server.entity.ctrl.KeyValueEntity; import com.lf.server.entity.data.DirEntity; import com.lf.server.entity.data.MetaEntity; @@ -47,7 +46,7 @@ return success(pathName); } catch (Exception ex) { log.error(ex.getMessage(), ex); - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -69,7 +68,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -83,7 +82,7 @@ @ApiOperation(value = "涓婁紶Excel闄勪欢") @ApiImplicitParams({ @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query"), - @ApiImplicitParam(name = "ids", value = "婧愭暟鎹泦鍚�", dataType = "Integer", paramType = "query") + @ApiImplicitParam(name = "ids", value = "鍏冩暟鎹泦鍚�", dataType = "Integer", allowMultiple = true, paramType = "query") }) @ResponseBody @PostMapping(value = "/uploadXlsAnnex") @@ -94,12 +93,12 @@ return fail("鐢ㄦ埛鏈櫥褰�", null); } if (null == ids || ids.length == 0) { - return fail("鎵句笉鍒版簮鏁版嵁鐨処D闆嗗悎"); + return fail("鎵句笉鍒板厓鏁版嵁鐨処D闆嗗悎"); } List<MetaEntity> ms = metaService.selectXlsAnnex(ids, UploadAttachService.getTabs()); if (null == ms || ms.isEmpty()) { - return fail("鎵句笉鍒拌涓婁紶闄勪欢鐨勬簮鏁版嵁"); + return fail("鎵句笉鍒拌涓婁紶闄勪欢鐨勫厓鏁版嵁"); } List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res); @@ -109,12 +108,12 @@ List<KeyValueEntity> rs = uploadAttachService.uploadXlsAnnex(ue, ms, list, path); if (null == rs || rs.size() == 0) { - return fail("娌℃湁瑕佹洿鏂扮殑婧愭暟鎹�"); + return fail("娌℃湁瑕佹洿鏂扮殑鍏冩暟鎹�"); } return success(rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -126,11 +125,11 @@ @GetMapping(value = "/selectFiles") public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) { try { - List<MetaFileEntity> list = uploadService.selectFiles(path, StaticData.ALL_EXTENSION); + List<MetaFileEntity> list = uploadService.selectFiles(path, false); return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -155,15 +154,15 @@ return success("鎴愬姛", rows); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @SysLog() @ApiOperation(value = "鏌ヨ鏄犲皠") @ApiImplicitParams({ - @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query", example = "20230110010101"), - @ApiImplicitParam(name = "dirid", value = "鐩綍ID", dataType = "Integer", paramType = "query", example = "163"), + @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query", example = "20230722"), + @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") }) @@ -190,14 +189,14 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @SysLog() @ApiOperation(value = "鎻掑叆鏂囦欢") @ApiImplicitParams({ - @ApiImplicitParam(name = "list", value = "婧愭暟鎹枃浠堕泦鍚�", dataType = "MetaFileEntity", paramType = "body") + @ApiImplicitParam(name = "list", value = "鍏冩暟鎹枃浠堕泦鍚�", dataType = "MetaFileEntity", paramType = "body") }) @ResponseBody @PostMapping(value = "/insertFiles") @@ -208,21 +207,46 @@ return fail("鐢ㄦ埛鏈櫥褰�", null); } if (null == list || list.isEmpty()) { - return fail("婧愭暟鎹枃浠堕泦鍚堜负绌�", null); + return fail("鍏冩暟鎹枃浠堕泦鍚堜负绌�", null); } uploadService.insertFiles(ue, list, req); return success("鎴愬姛", list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @SysLog() - @ApiOperation(value = "鍒犻櫎婧愭暟鎹�") + @ApiOperation(value = "鎻掑叆KML鏂囦欢") @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "1,2") + @ApiImplicitParam(name = "list", value = "鍏冩暟鎹枃浠堕泦鍚�", dataType = "MetaFileEntity", paramType = "body") + }) + @ResponseBody + @PostMapping(value = "/insertKml") + public ResponseMsg<Object> insertKml(@RequestBody List<MetaFileEntity> list, HttpServletRequest req){ + try { + UserEntity ue = tokenService.getCurrentUser(req); + if (null == ue) { + return fail("鐢ㄦ埛鏈櫥褰�", null); + } + if (null == list || list.isEmpty()) { + return fail("鍏冩暟鎹枃浠堕泦鍚堜负绌�", null); + } + + uploadService.insertKml(ue, list); + + return success("鎴愬姛", list); + } catch (Exception ex) { + return fail(ex, null); + } + } + + @SysLog() + @ApiOperation(value = "鍒犻櫎鍏冩暟鎹�") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1") }) @GetMapping(value = "/deleteMetas") public ResponseMsg<Integer> deleteMetas(@RequestParam List<Integer> ids) { @@ -235,7 +259,7 @@ return success(count); } catch (Exception ex) { - return fail(ex.getMessage(), -1); + return fail(ex, -1); } } } -- Gitblit v1.9.3