| | |
| | | LocalDateTime syncedAt = LocalDateTime.now(clock); |
| | | List<EmindEnergyChain> chains = new ArrayList<>(); |
| | | for (EmindStation station : stations) { |
| | | List<EmindEnergyChainDto> remoteChains = api.getEnergyChains(station.getStationId()); |
| | | for (EmindEnergyChainDto remote : remoteChains) { |
| | | chains.add(toEntity(station, remote, syncedAt)); |
| | | if(station.getSourceType() == 1) { |
| | | List<EmindEnergyChainDto> remoteChains = api.getEnergyChains(station.getStationId()); |
| | | for (EmindEnergyChainDto remote : remoteChains) { |
| | | chains.add(toEntity(station, remote, syncedAt)); |
| | | } |
| | | } |
| | | } |
| | | chainMapper.markAllDeleted(syncedAt); |