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);