From 3fff35d0d156b985bf3cae868561642b919d4e40 Mon Sep 17 00:00:00 2001 From: rajesh Date: Wed, 15 Jan 2025 15:11:29 +0530 Subject: [PATCH] Updated code --- .../tendermanagement/dao/CompanyDao.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java b/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java index 1b3a6798..b014b779 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/CompanyDao.java @@ -143,17 +143,20 @@ public class CompanyDao { entity.setNumberOfEmployees(request.getNumberOfEmployees()); entity.setAnnualRevenue(request.getAnnualRevenue()); entity.setHub(userEntity.getHub()); - Map vatCheckResponse = request.getVatCheckResponse(); if (request.getVatCheckResponse() != null) { - if (vatCheckResponse.containsKey("dettaglio")) { - Map dettaglio = (Map) vatCheckResponse.get("dettaglio"); - if (dettaglio != null) { - if (dettaglio.containsKey("codice_ateco")) { - Object codiceAtecoObj = dettaglio.get("codice_ateco"); - String codiceAteco = (codiceAtecoObj != null) ? codiceAtecoObj.toString() : null; + Map vatCheckResponse = request.getVatCheckResponse(); + Map data = (Map) vatCheckResponse.get("data"); + if (data != null) { + if (data.containsKey("dettaglio")) { + Map dettaglio = (Map) data.get("dettaglio"); + if (dettaglio != null) { + if (dettaglio.containsKey("codice_ateco")) { + Object codiceAtecoObj = dettaglio.get("codice_ateco"); + String codiceAteco = (codiceAtecoObj != null) ? codiceAtecoObj.toString() : null; - if (codiceAteco != null) { - entity.setCodiceAteco(codiceAteco); + if (codiceAteco != null) { + entity.setCodiceAteco(codiceAteco); + } } } }