From c4a121464b3b3e744412f5038ab274bec2422354 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Wed, 22 Jun 2022 17:19:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=BA=91=E5=9B=BE-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=B5=84=E6=BA=90=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusControllerV2.java | 23 +++++++++++++------ .../domain/TsingtaoDataResourceService.java | 5 ++-- 2 files changed, 18 insertions(+), 10 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 00e3064e..f29f774a 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 @@ -10,6 +10,8 @@ import io.renren.common.constant.Constant; import io.renren.common.domain.Tsingtao_xhaProperties; import io.renren.common.utils.Result; import io.renren.modules.processForm.service.TAbilityApplicationService; +import io.renren.modules.resource.dataResource.domain.TsingtaoDataResourceService; +import io.renren.modules.resource.dto.GetDataResourceListDto; import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.sys.dto.SysDeptDTO; @@ -62,6 +64,8 @@ public class CensusControllerV2 { private JdbcTemplate jdbcTemplate; @Autowired private Tsingtao_xhaProperties tsingtao_xhaProperties; + @Autowired + private TsingtaoDataResourceService tsingtaoDataResourceService; @Value("${census.type}") private String[] censusTypes; // 需要进行统计的资源类型 @@ -426,15 +430,20 @@ public class CensusControllerV2 { } break; case TSINGTAO: { // TODO 青岛大数据局 + GetDataResourceListDto getDataResourceListDto = new GetDataResourceListDto(); + getDataResourceListDto.setPageNum(1); + getDataResourceListDto.setPageSize(5); + JSONObject dataResource = (JSONObject) tsingtaoDataResourceService.getDataResource(getDataResourceListDto); + JSONObject data = dataResource.getJSONObject("data"); result.add(new HashMap() { { - put("amount", 0L); + put("amount", data.get("rows")); put("type", "总数据量"); } }); result.add(new HashMap() { { - put("amount", 0l); + put("amount", 0L); put("type", "总申请次数"); } }); @@ -446,7 +455,7 @@ public class CensusControllerV2 { }); result.add(new HashMap() { { - put("resourceTop5", new ArrayList<>()); + put("resourceTop5", data.get("data")); } }); } @@ -463,10 +472,10 @@ public class CensusControllerV2 { total = jsonObject.getJSONObject("data").getLongValue("total"); } } else { - logger.error("包头获取失败"); + logger.error("青岛西海岸获取失败"); } } catch (Exception exception) { - logger.error("包头失败", exception); + logger.error("青岛西海岸失败", exception); } return total; }).thenAccept(sum -> { @@ -510,10 +519,10 @@ public class CensusControllerV2 { } } else { - logger.error("包头获取失败"); + logger.error("青岛西海岸获取失败"); } } catch (Exception exception) { - logger.error("包头失败", exception); + logger.error("青岛西海岸失败", exception); } }); } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java index 5c1ce373..e0a87505 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java @@ -1,20 +1,18 @@ package io.renren.modules.resource.dataResource.domain; import com.alibaba.fastjson.JSONObject; -import io.renren.common.utils.Result; import io.renren.common.utils.SpringContextUtils; import io.renren.modules.resource.dataResource.AbstractDataResourceService; import io.renren.modules.resource.dto.GetDataResourceListDto; -import io.swagger.annotations.ApiParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import java.nio.charset.Charset; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -23,6 +21,7 @@ import java.util.stream.Collectors; /** * 青岛市局数据资源 */ +@Component public class TsingtaoDataResourceService extends AbstractDataResourceService { private static final Logger logger = LoggerFactory.getLogger(TsingtaoDataResourceService.class);