From 08423a1f8948540b138479e51ed6622b0b575da2 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Fri, 24 Jun 2022 15:19:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=B1=80=E5=AF=B9=E6=8E=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=B5=84=E6=BA=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusControllerV2.java | 18 +++++++++++++----- .../controller/ResourceController.java | 7 ++++++- .../resource/dto/GetDataResourceListDto.java | 2 ++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java index 1268c4cb..760111a8 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java @@ -69,7 +69,8 @@ public class CensusControllerV2 { private String[] censusTypes; // 需要进行统计的资源类型 @GetMapping(value = "/whole_amount") - @ApiOperation("平台概览") + @ApiOperation("能力云图-平台概览") + @LogOperation("能力云图-平台概览") public Result>> wholeAmount() { List> result = new CopyOnWriteArrayList<>(); @@ -429,9 +430,7 @@ public class CensusControllerV2 { break; case TSINGTAO: { // TODO 青岛大数据局 TsingtaoDataResourceService tsingtaoDataResourceService = new TsingtaoDataResourceService(); - GetDataResourceListDto getDataResourceListDto = new GetDataResourceListDto(); - getDataResourceListDto.setPageNum(1); - getDataResourceListDto.setPageSize(5); + GetDataResourceListDto getDataResourceListDto = new GetDataResourceListDto().setPageNum(1).setPageSize(5); HashMap dataResource = (HashMap) tsingtaoDataResourceService.getDataResource(getDataResourceListDto); JSONObject data = JSON.parseObject(JSON.toJSONString(dataResource.get("data"))); result.add(new HashMap() { @@ -454,7 +453,16 @@ public class CensusControllerV2 { }); result.add(new HashMap() { { - put("resourceTop5", data.get("data")); + String ja = data.getString("data"); + List lists = JSON.parseArray(ja, Map.class); + ArrayList list = new ArrayList<>(); + lists.forEach(item -> { + list.add(new HashMap(){{ + put("服务名称", item.get("zyname")); + put("申请次数", item.get("syqk")); + }}); + }); + put("resourceTop5", list); } }); } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index daea105a..211545c0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -130,7 +130,8 @@ public class ResourceController { } @GetMapping("/{id}") - @ApiOperation("信息") + @ApiOperation("查询能力资源详细信息") + @LogOperation("查询能力资源详细信息") public Result get(@PathVariable("id") Long id) { ResourceDTO data = resourceService.get(id); return new Result().ok(data); @@ -276,6 +277,7 @@ public class ResourceController { @GetMapping("ZywMessage") @ApiOperation("资源转发") + @LogOperation("资源转发") public Result ZywMessage() { String url = "http://15.72.158.81/zyjk/ZywMessage.asmx"; String parame = "\n" + @@ -303,6 +305,7 @@ public class ResourceController { @GetMapping("ZywMessage/list") @ApiOperation("资源列表转发") + @LogOperation("资源列表转发") public Result ZywMessageList(@ApiParam("页数") Integer page, @ApiParam("页大小") Integer size, @ApiParam("排序字段;fbrq(发布日期),syqk(申请数量)") String pxcol, @@ -355,6 +358,7 @@ public class ResourceController { @GetMapping("qdyjjWeather") @ApiOperation("青岛应急局-查询青岛市地区天气信息") + @LogOperation("青岛应急局-查询青岛市地区天气信息") public Result qdyjjWeather(String cityName) { String loginUrl = "http://" + ipAndPort + "/service-oauth/login"; String weatherUrl = "http://" + ipAndPort + "/service-map/qxWeather/getTodayWeatherInfo"; @@ -384,6 +388,7 @@ public class ResourceController { @GetMapping("knowledgeBase") @ApiOperation("对接知识库数据") + @LogOperation("对接知识库数据") public Result knowledgeBase() { resourceService.KnowledgeBase(); return new Result().ok("任务开启成功!"); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dto/GetDataResourceListDto.java b/renren-admin/src/main/java/io/renren/modules/resource/dto/GetDataResourceListDto.java index 660df80d..f1693642 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dto/GetDataResourceListDto.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dto/GetDataResourceListDto.java @@ -1,11 +1,13 @@ package io.renren.modules.resource.dto; import lombok.Data; +import lombok.experimental.Accessors; /** * 数据资源查询参数对象 */ @Data +@Accessors(chain=true) public class GetDataResourceListDto { //名称,模糊查询