Commit c58efed9 authored by caotao's avatar caotao

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

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