Commit 01fcc8cd authored by yangyang's avatar yangyang

对接 碳银电站接口

parent cf90321e
......@@ -216,8 +216,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
long ts = System.currentTimeMillis();
log.info("-------碳银同步电站开始: {} ------- ", ts);
List<String> projectNos = tanYinCustomerInfoMapper.listProjectNo();
projectNos.add("TF2024060312382700202");
String powerDate = "2024-07-17";
// projectNos.add("TF2024060312382700202");
// String powerDate = "2024-07-17";
String powerDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
if (CollectionUtils.isEmpty(projectNos)) {
return;
}
......@@ -427,7 +428,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
if (CollectionUtils.isEmpty(tanYinInveterInfos)) {
return;
}
Map<String, TanYinInveterInfo> tanYinInveterInfoMap = tanYinInveterInfos.stream().collect(Collectors.toMap(TanYinInveterInfo::getSn, v -> v, (k1, k2) -> k1));
List<String> stationIds = tanYinInveterInfos.stream().map(TanYinInveterInfo::getProjectNo).collect(Collectors.toList());
List<JpStation> jpStations = jpStationMapper.selectList(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.TANYIN.getCode()).in("third_station_id", stationIds));
Map<String, JpStation> jpStationMap = jpStations.stream().collect(Collectors.toMap(JpStation::getThirdStationId, Function.identity()));
......@@ -471,6 +471,11 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
jpInverter.setUpdateTime(tanYinInveterInfoDTO.getGmtCreate() != null ? new Date(Long.parseLong(tanYinInveterInfoDTO.getGmtCreate())) : new Date());
JpStation jpStation = jpStationMap.get(tanYinInveterInfo.getProjectNo());
if (jpStation != null) {
if (!"离线".equals(jpStation.getState()) && !"异常".equals(jpStation.getState())) {
jpStation.setState(TanYinConstant.stationStatus.get(tanYinInveterInfoDTO.getStatus()));
jpStationMapper.updateById(jpStation);
jpStationMap.put(tanYinInveterInfo.getProjectNo(), jpStation);
}
// 逆变器没有就空着
// jpInverter.setDayPowerGeneration(jpStation.getDayGenerate());
// jpInverter.setMonthPowerGeneration(jpStation.getMonthGenerate());
......
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