Skip to content

Commit

Permalink
πŸ› Bug(owner): fix dpe value content in property (MTES-MCT#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattboll authored Jun 17, 2024
1 parent 1c505ce commit d9e92e7
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import java.net.http.HttpResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -133,6 +135,11 @@ private void setAdemeResult(PropertyForm propertyForm, Property property) throws
property.setAdemeNumber(ademeApiResultModel.getNumero());
ObjectMapper mapper = new ObjectMapper();
property.setAdemeApiResult(mapper.valueToTree(ademeApiResultModel));
property.setEnergyConsumption(Float.valueOf(ademeApiResultModel.getConsommationEnergieFinale()).intValue());
property.setCo2Emission(Float.valueOf(ademeApiResultModel.getEmission()).intValue());
Instant instant = Instant.parse(ademeApiResultModel.getDateRealisation());
Date dateRealisation = Date.from(instant);
property.setDpeDate(dateRealisation);
if (response.statusCode() == 404) {
throw new DPENotFoundException("DPE not found");
}
Expand Down

0 comments on commit d9e92e7

Please sign in to comment.