Commit 47116736 authored by caotao's avatar caotao

固德威数据采集调整

parent 58685b41
...@@ -25,6 +25,11 @@ public class HouseholdPvUtils { ...@@ -25,6 +25,11 @@ public class HouseholdPvUtils {
private HouseholdPvApiServiceImpl householdPvApiServiceImpl; private HouseholdPvApiServiceImpl householdPvApiServiceImpl;
/**
* @deprecated 根据厂商编码获取厂商的hearer
* @param code 厂商code
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
*/
public HashMap<String, Object> getHeaderByProducerCode(String code) { public HashMap<String, Object> getHeaderByProducerCode(String code) {
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
HashMap<String, String> hashMaphead = new HashMap<>(); HashMap<String, String> hashMaphead = new HashMap<>();
...@@ -34,7 +39,7 @@ public class HouseholdPvUtils { ...@@ -34,7 +39,7 @@ public class HouseholdPvUtils {
if (PVProducerInfoEnum.GDW.getCode().equals(code)) { if (PVProducerInfoEnum.GDW.getCode().equals(code)) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("account", householdPvProducerInfo.getProdcerAccount()); map.put("account", householdPvProducerInfo.getProdcerAccount());
map.put("pwd", "Ljf5705@sems"); map.put("pwd", householdPvProducerInfo.getProdcerPassword());
String body = JSON.toJSONString(map); String body = JSON.toJSONString(map);
String response = HttpUtil.createPost(url).body(body).execute().body(); String response = HttpUtil.createPost(url).body(body).execute().body();
JSONObject jsonObject = JSON.parseObject(response); JSONObject jsonObject = JSON.parseObject(response);
...@@ -65,6 +70,9 @@ public class HouseholdPvUtils { ...@@ -65,6 +70,9 @@ public class HouseholdPvUtils {
} }
return hashMap; return hashMap;
} }
/** @return String 请求返回的response字符串
* @param seq apiId 数据库中维护的的apiId
* */
public String gerResponseByAPiID(Long seq){ public String gerResponseByAPiID(Long seq){
HouseholdPvApiDto householdPvApiDto = this.householdPvApiServiceImpl.queryBySeq(seq); HouseholdPvApiDto householdPvApiDto = this.householdPvApiServiceImpl.queryBySeq(seq);
HashMap<String,Object> producerInfo = this.getHeaderByProducerCode(householdPvApiDto.getProducerId()); HashMap<String,Object> producerInfo = this.getHeaderByProducerCode(householdPvApiDto.getProducerId());
......
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