|
@@ -121,18 +121,18 @@ public class DataTools {
|
|
|
|
|
|
public void getBuildingData(){
|
|
|
LargeBuilding largeBuilding = new LargeBuilding();
|
|
|
- largeBuilding.setJsonFrequency(repeat(ApiUrlConfig.getBuildCarbonEmissionStatistics(), null));
|
|
|
- largeBuilding.setJsonPatrol(repeat(ApiUrlConfig.getBuildEnergyForYear(), null));
|
|
|
- largeBuilding.setJsonPatrolPoint(repeat(ApiUrlConfig.getBuildEnergyStatistics(), null));
|
|
|
- largeBuilding.setJsonPowerWaterMonth((repeat(ApiUrlConfig.getBuildPowerForYear(), String.valueOf(LocalDate.now().getMonthValue()))));
|
|
|
- largeBuilding.setJsonAir(repeat(ApiUrlConfig.getBuildElectricityStatistics(), null));
|
|
|
- largeBuilding.setJsonTarget(repeat(ApiUrlConfig.getBuildWaterForYear(), null));
|
|
|
- largeBuilding.setJsonUseElectricity(repeat(ApiUrlConfig.getBuildWaterStatistics(), null));
|
|
|
- largeBuilding.setJsonGreenElectricity(repeat(ApiUrlConfig.getBuildNonHeatingEnergyForYear(), null));
|
|
|
- largeBuilding.setJsonCarbon(repeat(ApiUrlConfig.getBuildUsePowerStatistics(), null));
|
|
|
- largeBuilding.setJsonEnergyYear(repeat(ApiUrlConfig.getBuildPowerForMonth(), null));
|
|
|
- largeBuilding.setJsonPowerYear(repeat(ApiUrlConfig.getBuildUseHeatGas(), null));
|
|
|
- largeBuilding.setJsonWaterYear(repeat(ApiUrlConfig.getBuildUseWater(), null));
|
|
|
+ largeBuilding.setJsonFrequency(repeat(ApiUrlConfig.getJsonFrequency(), null));
|
|
|
+ largeBuilding.setJsonPatrol(repeat(ApiUrlConfig.getJsonPatrol(), null));
|
|
|
+ largeBuilding.setJsonPatrolPoint(repeat(ApiUrlConfig.getJsonPatrolPoint(), null));
|
|
|
+ largeBuilding.setJsonPowerWaterMonth((repeat(ApiUrlConfig.getJsonPowerWaterMonth(), String.valueOf(LocalDate.now().getMonthValue()))));
|
|
|
+ largeBuilding.setJsonAir(repeat(ApiUrlConfig.getJsonAir(), null));
|
|
|
+ largeBuilding.setJsonTarget(repeat(ApiUrlConfig.getJsonTarget(), null));
|
|
|
+ largeBuilding.setJsonUseElectricity(repeat(ApiUrlConfig.getJsonUseElectricity(), null));
|
|
|
+ largeBuilding.setJsonGreenElectricity(repeat(ApiUrlConfig.getJsonGreenElectricity(), null));
|
|
|
+ largeBuilding.setJsonCarbon(repeat(ApiUrlConfig.getJsonCarbon(), null));
|
|
|
+ largeBuilding.setJsonEnergyYear(repeat(ApiUrlConfig.getJsonEnergyYear(), null));
|
|
|
+ largeBuilding.setJsonPowerYear(repeat(ApiUrlConfig.getJsonPowerYear(), null));
|
|
|
+ largeBuilding.setJsonWaterYear(repeat(ApiUrlConfig.getJsonWaterYear(), null));
|
|
|
if (platBuildingMapper.getCount() > 0){
|
|
|
platBuildingMapper.updateBuilding(largeBuilding);
|
|
|
}
|
|
@@ -154,358 +154,6 @@ public class DataTools {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 碳排放量月度变化趋势图接口
|
|
|
- */
|
|
|
- public void getCarbonData(String appOrg) {
|
|
|
- String url = ApiUrlConfig.getBuildCarbonEmissionStatistics();
|
|
|
-// String params = "startTime=''&endTime=''";
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg(appOrg);
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
|
|
|
- iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,0,"");
|
|
|
- iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度累计综合能耗
|
|
|
- */
|
|
|
- public void getEnergyData() {
|
|
|
- String url = ApiUrlConfig.getBuildEnergyForYear();
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
|
|
|
- PlatBuildParams platBuildParams = new PlatBuildParams();
|
|
|
- List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
|
|
|
- iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,0,"");
|
|
|
- iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度综合能耗趋势接口
|
|
|
- */
|
|
|
- public void getEnergyStatisticsData() {
|
|
|
- String url = ApiUrlConfig.getBuildEnergyStatistics();
|
|
|
- // String params = "startTime=''&endTime=''";
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
|
|
|
- iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,1,"");
|
|
|
- iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度累计电耗接口
|
|
|
- */
|
|
|
- public void getPowerStatisticsData() {
|
|
|
- String url = ApiUrlConfig.getBuildPowerForYear();
|
|
|
-// String url = "http://192.168.1.189/fxkj/php/public/home/Wechat/test";
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
|
|
|
- PlatBuildParams platBuildParams = new PlatBuildParams();
|
|
|
- List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
|
|
|
- iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,1,"");
|
|
|
- iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度电耗趋势接口
|
|
|
- */
|
|
|
- public void getElectricityStatisticsData() {
|
|
|
- String url = ApiUrlConfig.getBuildElectricityStatistics();
|
|
|
- // String params = "startTime=''&endTime=''";
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
|
|
|
- iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,2,"");
|
|
|
- iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度累计水耗接口
|
|
|
- */
|
|
|
- public void getWaterData() {
|
|
|
- String url = ApiUrlConfig.getBuildWaterForYear();
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
|
|
|
- PlatBuildParams platBuildParams = new PlatBuildParams();
|
|
|
- List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
|
|
|
- iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,2,"");
|
|
|
- iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度水耗趋势接口
|
|
|
- */
|
|
|
- public void getWaterStatisticsData() {
|
|
|
- String url = ApiUrlConfig.getBuildWaterStatistics();
|
|
|
- // String params = "startTime=''&endTime=''";
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
|
|
|
- iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,3,"");
|
|
|
- iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度累计非供暖能耗接口
|
|
|
- */
|
|
|
- public void getNonHeatingData(String appOrg) {
|
|
|
- String url = ApiUrlConfig.getBuildNonHeatingEnergyForYear();
|
|
|
- String params = "appOrg=" + appOrg;
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg(appOrg);
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
|
|
|
- PlatBuildParams platBuildParams = new PlatBuildParams();
|
|
|
- List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
|
|
|
- iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,0,"");
|
|
|
- iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 年度非供暖能耗趋势接口
|
|
|
- */
|
|
|
- public void getUsePowerStatistics(String appOrg) {
|
|
|
- String url = ApiUrlConfig.getBuildUsePowerStatistics();
|
|
|
- String params = "appOrg=" + appOrg;
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg(appOrg);
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
|
|
|
- iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,4,"");
|
|
|
- iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 月用电量信息接口
|
|
|
- */
|
|
|
- public void getPowerForMonth() {
|
|
|
- String url = ApiUrlConfig.getBuildPowerForMonth();
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildParams platBuildParams = new PlatBuildParams();
|
|
|
- iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,4,"");
|
|
|
- iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 楼宇月用水电热信息接口
|
|
|
- */
|
|
|
- public void getUseHeatGas() {
|
|
|
- String url = ApiUrlConfig.getBuildUseHeatGas();
|
|
|
- String params = "";
|
|
|
- String result = HttpUtils.sendGet(url, params);
|
|
|
-
|
|
|
- // 添加接口请求记录
|
|
|
- PlatApiRecord platApiRecord = new PlatApiRecord();
|
|
|
- platApiRecord.setApiUrl(url);
|
|
|
- platApiRecord.setApiResult(result);
|
|
|
- platApiRecord.setAppOrg("");
|
|
|
- iPlatApiRecordService.save(platApiRecord);
|
|
|
-
|
|
|
- System.out.printf("------------接口返回:%s", result);
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(result)) {
|
|
|
- Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
|
|
|
- if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
|
|
|
- List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
|
|
|
- if (!dataList.isEmpty()) {
|
|
|
- List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
|
|
|
- for (Map<String, Object> map : dataList) {
|
|
|
- PlatBuildParams platBuildParams = new PlatBuildParams();
|
|
|
- iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,5,"");
|
|
|
- iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 数据中心机房信息接口
|
|
|
*/
|