Commit c12f7f05 authored by tangwei's avatar tangwei

解决冲突

parents 66f50370 70daa26e
...@@ -19,5 +19,11 @@ ...@@ -19,5 +19,11 @@
<artifactId>amos-boot-module-common-api</artifactId> <artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.22</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>
package com.yeejoin.amos.boot.module.jxiop.api.dto;
import lombok.Data;
@Data
public class BuDunGenDto {
private Double day;
private Double month;
private Double year;
private Double year_complete;
private Double year_hour_number;
}
package com.yeejoin.amos.boot.module.jxiop.api.dto;
import lombok.Data;
import java.util.List;
@Data
public class BuDunPvFanDto {
List<BudunStationValueDto> fan;
List<BudunStationValueDto> pv;
}
package com.yeejoin.amos.boot.module.jxiop.api.dto;
import lombok.Data;
@Data
public class BudunStationValueDto {
private String station_name;
private Double value;
}
...@@ -69,6 +69,17 @@ public class Constants { ...@@ -69,6 +69,17 @@ public class Constants {
* 江西电建证书字典key * 江西电建证书字典key
*/ */
public static final String JXIOP_DICT_CERTIFICATES = "jxIop:dict:certificates"; public static final String JXIOP_DICT_CERTIFICATES = "jxIop:dict:certificates";
public static final String BASE_URL = "http://iiet-jepcc.powerchina.cn:8088/screen_api";
public static final String REQUEST_GET="GET";
public static final String REQUEST_POST="POST";
public static final String get_province_item_url="method=scene_screen.data_interface.get_province_item";
public static final String get_month_generation_trend_url="method=scene_screen.data_interface.get_month_generation_trend";
public static final String get_area_item_url="method=scene_screen.data_interface.get_area_item";
public static final String get_month_top_url="method=scene_screen.data_interface.get_month_top";
public static final String get_hours_num_top="scene_screen.data_interface.get_hours_num_top";
public static final String resovleRule_data = "data";
public static final String areaChinese="区域";
} }
package com.yeejoin.amos.boot.module.jxiop.api.util;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Component
public class HttpRequestUtil {
public String sendRequest(String requestMethod, String url, String params, HashMap<String, String> headMap) {
String respone = "";
if (requestMethod.equals("POST")) {
respone = HttpUtil.createPost(url).headerMap(headMap, false).
body(params).execute().body();
}
if (requestMethod.equals("GET")) {
respone = HttpUtil.createGet(url).headerMap(headMap, true).
body(params).execute().body();
}
return respone;
}
public JSONArray handlerResponseByResultResolverule(String resultResovle, String response) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONArray jsonArray = new JSONArray();
if (ObjectUtil.isNotEmpty(resultResovle)) {
String[] rules = resultResovle.split(",");
if (rules.length > 0) {
for (int i = 0; i < rules.length; i++) {
try {
jsonObject = (JSONObject) jsonObject.get(rules[i]);
if (jsonObject == null) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
} catch (Exception exception) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
}
}
if (jsonArray.size() == 0) {
jsonArray.add(jsonObject);
}
}
return jsonArray;
}
public <T> List<T> getResPonse(String apiurl, String requestMethod, String requestParmInfo, String ResultResolveRule, Class<T> tClass) {
String respone = "";
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
try {
respone = sendRequest(requestMethod, apiurl, requestParmInfo, null);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
} catch (Exception exception) {
return result;
}
return result;
}
}
...@@ -27,4 +27,6 @@ public interface MonitorService { ...@@ -27,4 +27,6 @@ public interface MonitorService {
* @return Map<String, Object> * @return Map<String, Object>
*/ */
Map<String, Object> qyAccessSituation(); Map<String, Object> qyAccessSituation();
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.constants; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import com.sun.javafx.logging.PulseLogger; import com.sun.javafx.logging.PulseLogger;
import org.checkerframework.checker.units.qual.C; import org.checkerframework.checker.units.qual.C;
import org.elasticsearch.search.fetch.subphase.FieldAndFormat;
import java.util.*; import java.util.*;
...@@ -181,7 +182,6 @@ public class CommonConstans { ...@@ -181,7 +182,6 @@ public class CommonConstans {
public static final String TOTAL_RADIATION = "辐照度"; public static final String TOTAL_RADIATION = "辐照度";
public static final String ACTIVE_POWER = "有功功率"; public static final String ACTIVE_POWER = "有功功率";
//------------------监盘服务改造新增常量结束------------------------------ //------------------监盘服务改造新增常量结束------------------------------
} }
...@@ -94,8 +94,8 @@ public class DemoController extends BaseController { ...@@ -94,8 +94,8 @@ public class DemoController extends BaseController {
Logger logger = LoggerFactory.getLogger(DemoController.class); Logger logger = LoggerFactory.getLogger(DemoController.class);
@Autowired @Autowired
StationBasicServiceImpl stationBasicServiceimpl; StationBasicServiceImpl stationBasicServiceimpl;
@Autowired // @Autowired
TestServiceImpl testServiceimpl; // TestServiceImpl testServiceimpl;
@Autowired @Autowired
EmqKeeper emqKeeper; EmqKeeper emqKeeper;
@Autowired @Autowired
...@@ -511,16 +511,16 @@ public class DemoController extends BaseController { ...@@ -511,16 +511,16 @@ public class DemoController extends BaseController {
commonServiceImpl.getListDataByCondtions(queryConditon, null, ESEquipments.class); commonServiceImpl.getListDataByCondtions(queryConditon, null, ESEquipments.class);
} }
@TycloudOperation( ApiLevel = UserType.AGENCY) @TycloudOperation( ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "测试feign调用") @ApiOperation(value = "测试feign调用")
@GetMapping("/testFeignCall") @GetMapping("/testFeignCall")
public List<CoreValuesDto> testFeignCall() { public List<CoreValuesDto> testFeignCall() {
List<CoreValuesDto> coreValuesDtos =coreCommonService.getValuesByStationNamesAndPointsNames(null,null); // List<CoreValuesDto> coreValuesDtos =coreCommonService.getValuesByStationNamesAndPointsNames(null,null);
// monitorService.getTotalData(); // monitorService.getTotalData();
// monitorService.getNationWideInfo("江西省","gis"); monitorService.getNationWideInfo("江西省","gis");
monitorService.getCompletionOfPowerIndicatorsByProvinceName(1,20,"陕西省"); // monitorService.getCompletionOfPowerIndicatorsByProvinceName(1,20,"陕西省");
// Double sum = coreCommonService.getSumOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION); // Double sum = coreCommonService.getSumOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
// Double avg = coreCommonService.getAverageOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION); // Double avg = coreCommonService.getAverageOfByPointName(coreValuesDtos, CommonConstans.DAY_POWER_GENERATION);
return coreValuesDtos; return null;
} }
} }
package com.yeejoin.amos.boot.module.jxiop.biz.service; package com.yeejoin.amos.boot.module.jxiop.biz.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData; import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -35,4 +37,28 @@ public interface MonitorService { ...@@ -35,4 +37,28 @@ public interface MonitorService {
* @return 有功功率 * @return 有功功率
*/ */
public HashMap<String, String> getActivePowerByAreaName(String areaName); public HashMap<String, String> getActivePowerByAreaName(String areaName);
/**
* @description 根据地区名称获取发电数据
* @param areaName
* @return
*/
public Page<HashMap<String, String>> getDetailsOnPowergeneration(String areaName);
/**
* @description 根据地区名称获取社会贡献数据
* @param areaName
* @param stationId
* @return
*/
public Page<SocialContributionDto> getSocialContributionDtoList(String areaName, String stationId) ;
/**
* @description 根据地区名称获取发电量完成度排名前五的数据
* @param areaName
* @return
*/
public Page<HashMap<String, String>> getPowerGenerationTrendsOfCompletionTopFive(String areaName);
public Page<HashMap<String, String>> getPowerGenerationTrendsOfCompletionTopThree(String tabValue, String areaName);
} }
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.netflix.loadbalancer.RetryRule;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TestMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.ItestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TestServiceImpl implements ItestService {
@Autowired
TestMapper testMapper;
public List<Test> getList(){
return testMapper.selectList(new QueryWrapper<Test>().isNotNull("name"));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment