资源云图-数据资源增加数据

This commit is contained in:
dinggang 2022-06-22 17:19:42 +08:00
parent fd406c9bfd
commit c4a121464b
2 changed files with 18 additions and 10 deletions

View File

@ -10,6 +10,8 @@ import io.renren.common.constant.Constant;
import io.renren.common.domain.Tsingtao_xhaProperties; import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.modules.processForm.service.TAbilityApplicationService; 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.resource.service.ResourceService;
import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysDeptDTO;
@ -62,6 +64,8 @@ public class CensusControllerV2 {
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
@Autowired @Autowired
private Tsingtao_xhaProperties tsingtao_xhaProperties; private Tsingtao_xhaProperties tsingtao_xhaProperties;
@Autowired
private TsingtaoDataResourceService tsingtaoDataResourceService;
@Value("${census.type}") @Value("${census.type}")
private String[] censusTypes; // 需要进行统计的资源类型 private String[] censusTypes; // 需要进行统计的资源类型
@ -426,15 +430,20 @@ public class CensusControllerV2 {
} }
break; break;
case TSINGTAO: { // TODO 青岛大数据局 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<String, Object>() { result.add(new HashMap<String, Object>() {
{ {
put("amount", 0L); put("amount", data.get("rows"));
put("type", "总数据量"); put("type", "总数据量");
} }
}); });
result.add(new HashMap<String, Object>() { result.add(new HashMap<String, Object>() {
{ {
put("amount", 0l); put("amount", 0L);
put("type", "总申请次数"); put("type", "总申请次数");
} }
}); });
@ -446,7 +455,7 @@ public class CensusControllerV2 {
}); });
result.add(new HashMap<String, Object>() { result.add(new HashMap<String, Object>() {
{ {
put("resourceTop5", new ArrayList<>()); put("resourceTop5", data.get("data"));
} }
}); });
} }
@ -463,10 +472,10 @@ public class CensusControllerV2 {
total = jsonObject.getJSONObject("data").getLongValue("total"); total = jsonObject.getJSONObject("data").getLongValue("total");
} }
} else { } else {
logger.error("包头获取失败"); logger.error("青岛西海岸获取失败");
} }
} catch (Exception exception) { } catch (Exception exception) {
logger.error("包头失败", exception); logger.error("青岛西海岸失败", exception);
} }
return total; return total;
}).thenAccept(sum -> { }).thenAccept(sum -> {
@ -510,10 +519,10 @@ public class CensusControllerV2 {
} }
} else { } else {
logger.error("包头获取失败"); logger.error("青岛西海岸获取失败");
} }
} catch (Exception exception) { } catch (Exception exception) {
logger.error("包头失败", exception); logger.error("青岛西海岸失败", exception);
} }
}); });
} }

View File

@ -1,20 +1,18 @@
package io.renren.modules.resource.dataResource.domain; package io.renren.modules.resource.dataResource.domain;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.renren.common.utils.Result;
import io.renren.common.utils.SpringContextUtils; import io.renren.common.utils.SpringContextUtils;
import io.renren.modules.resource.dataResource.AbstractDataResourceService; import io.renren.modules.resource.dataResource.AbstractDataResourceService;
import io.renren.modules.resource.dto.GetDataResourceListDto; import io.renren.modules.resource.dto.GetDataResourceListDto;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -23,6 +21,7 @@ import java.util.stream.Collectors;
/** /**
* 青岛市局数据资源 * 青岛市局数据资源
*/ */
@Component
public class TsingtaoDataResourceService extends AbstractDataResourceService { public class TsingtaoDataResourceService extends AbstractDataResourceService {
private static final Logger logger = LoggerFactory.getLogger(TsingtaoDataResourceService.class); private static final Logger logger = LoggerFactory.getLogger(TsingtaoDataResourceService.class);