Commit c58efed9 authored by caotao's avatar caotao

采集器与逆变器数量与第三方不一致问题修改处理。

parent c0ac0241
...@@ -297,15 +297,15 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -297,15 +297,15 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
@Scheduled(cron = "${dataRequstScheduled.jinlangyun}") @Scheduled(cron = "${dataRequstScheduled.jinlangyun}")
@Override @Override
public void collectorList() { public void collectorList() {
List<String> stationIds = golangStationMapper.getStationIds(); // List<String> stationIds = golangStationMapper.getStationIds();
for (int i = 0; i < stationIds.size(); i++) { // for (int i = 0; i < stationIds.size(); i++) {
try { try {
TimeUnit.SECONDS.sleep(1); TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
HashMap<String, Object> requestInfo = new HashMap<>(); HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationId", Long.valueOf(stationIds.get(i))); // requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
requestInfo.put("pageNo", 1); requestInfo.put("pageNo", 1);
requestInfo.put("pageSize", 100); requestInfo.put("pageSize", 100);
String requestParaminfo = JSON.toJSONString(requestInfo); String requestParaminfo = JSON.toJSONString(requestInfo);
...@@ -320,7 +320,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -320,7 +320,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
golangCollectorList.setCreatedTime(System.currentTimeMillis()); golangCollectorList.setCreatedTime(System.currentTimeMillis());
golangCollectorListMapper.insert(golangCollectorList); golangCollectorListMapper.insert(golangCollectorList);
} }
} // }
} }
@Scheduled(cron = "${dataRequstScheduled.jinlangyun}") @Scheduled(cron = "${dataRequstScheduled.jinlangyun}")
...@@ -401,22 +401,22 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -401,22 +401,22 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
@Scheduled(cron = "${dataRequstScheduled.jinlangyun}") @Scheduled(cron = "${dataRequstScheduled.jinlangyun}")
@Override @Override
public void inverterList() { public void inverterList() {
List<String> stationIds = golangStationMapper.getStationIds(); // List<String> stationIds = golangStationMapper.getStationIds();
for (int i = 0; i < stationIds.size(); i++) { // for (int i = 0; i < stationIds.size(); i++) {
try { try {
TimeUnit.SECONDS.sleep(1); TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
HashMap<String, Object> requestInfo = new HashMap<>(); HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationId", Long.valueOf(stationIds.get(i))); // requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
requestInfo.put("pageNo", 1); requestInfo.put("pageNo", 1);
requestInfo.put("pageSize", 100); requestInfo.put("pageSize", 100);
String requestParaminfo = JSON.toJSONString(requestInfo); String requestParaminfo = JSON.toJSONString(requestInfo);
List<GolangInverterList> result = golangRequestUtil.getResPonse(GoLangConstant.inverterListUrl, List<GolangInverterList> result = golangRequestUtil.getResPonse(GoLangConstant.inverterListUrl,
GoLangConstant.requestPost, GoLangConstant.requestPost,
requestParaminfo, requestParaminfo,
GoLangConstant.resovleRule_data, GoLangConstant.resovleRule_data_page_records,
GolangInverterList.class GolangInverterList.class
); );
for (int j = 0; j < result.size(); j++) { for (int j = 0; j < result.size(); j++) {
...@@ -424,7 +424,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -424,7 +424,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
golangInverterList.setCreatedTime(System.currentTimeMillis()); golangInverterList.setCreatedTime(System.currentTimeMillis());
golangInverterListMapper.insert(golangInverterList); golangInverterListMapper.insert(golangInverterList);
} }
} // }
} }
@Scheduled(cron = "${dataRequstScheduled.jinlangyun}") @Scheduled(cron = "${dataRequstScheduled.jinlangyun}")
......
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