Resolved conflict

This commit is contained in:
rajesh
2025-06-19 19:59:06 +05:30
30 changed files with 1891 additions and 1296 deletions

View File

@@ -18,7 +18,7 @@ public class AppointmentApiConstant {
public static final boolean CREA_ANAGRAFICA = Boolean.TRUE; public static final boolean CREA_ANAGRAFICA = Boolean.TRUE;
public static final boolean SALVA_DOCUMENTI = Boolean.TRUE; public static final boolean SALVA_DOCUMENTI = Boolean.TRUE;
public static final String VISURA_PROVIDER = "cerved"; public static final String VISURA_PROVIDER = "cerved";
public static final String VISURA_TYPE = "StandardReport"; public static final String VISURA_TYPE = "FullReport";
public static final String VISURA_MODE = "visure"; public static final String VISURA_MODE = "visure";
public static final String COD_AGENTE = "UtenzaAPIPortal"; public static final String COD_AGENTE = "UtenzaAPIPortal";
public static final boolean IS_FROM_RATING = Boolean.FALSE; public static final boolean IS_FROM_RATING = Boolean.FALSE;
@@ -38,4 +38,7 @@ public class AppointmentApiConstant {
public static final String COD_OPERAZIONE = "codOperazione"; public static final String COD_OPERAZIONE = "codOperazione";
public static final String MOTIVAZIONE_ID = "id"; public static final String MOTIVAZIONE_ID = "id";
public static final String PRODOTTO_CODE = "code"; public static final String PRODOTTO_CODE = "code";
public static final String WS_ANAGRAFICA_URL= "/WSAnagrafica.getList";
} }

View File

@@ -571,7 +571,9 @@ public class GepafinConstant {
public static final String PROTOCOL_EXTERNAL_NUMBER="NUM_PG"; public static final String PROTOCOL_EXTERNAL_NUMBER="NUM_PG";
public static final String PROTOCOL_EXTERNAL_DATE="DATA_PG_DT"; public static final String PROTOCOL_EXTERNAL_DATE="DATA_PG_DT";
public static final String PROTOCOL_DOC_SUFFIX="#noauth"; public static final String PROTOCOL_DOC_SUFFIX="#noauth";
public static final String CREATE_NDG="CHECK_OR_CREATE_NDG_CODE";
public static final String NDG_NOT_FOUND="ndg.not.found";
public static final String EMAIL_PEC_REQUIRED="email.pec.cannot.null";
} }

View File

@@ -1,5 +1,6 @@
package net.gepafin.tendermanagement.dao; package net.gepafin.tendermanagement.dao;
import com.amazonaws.services.dynamodbv2.xspec.S;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
@@ -556,25 +557,69 @@ public class ApplicationDao {
VersionActionTypeEnum actionType = VersionActionTypeEnum.INSERT; VersionActionTypeEnum actionType = VersionActionTypeEnum.INSERT;
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent(); List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
contentResponseBeans.stream() // contentResponseBeans.stream()
.filter(content -> "numberinput".equals(content.getName()) && content.getId().toString().equals(applicationFormFieldRequestBean.getFieldId())) // .filter(content -> "numberinput".equals(content.getName()) && content.getId().toString().equals(applicationFormFieldRequestBean.getFieldId()))
.map(ContentResponseBean::getSettings) // .map(ContentResponseBean::getSettings)
.flatMap(List::stream) // .flatMap(List::stream)
.filter(setting -> "isRequestedAmount".equals(setting.getName()) && Boolean.TRUE.equals(setting.getValue())) // .filter(setting -> "isRequestedAmount".equals(setting.getName()) && Boolean.TRUE.equals(setting.getValue()))
.findFirst() // .findFirst()
.ifPresent(setting -> { // .ifPresent(setting -> {
Object fieldValue = applicationFormFieldRequestBean.getFieldValue(); // Object fieldValue = applicationFormFieldRequestBean.getFieldValue();
if(fieldValue!=null) { // if(fieldValue!=null) {
try { // try {
BigDecimal amountRequested = new BigDecimal(fieldValue.toString()); // BigDecimal amountRequested = new BigDecimal(fieldValue.toString());
applicationFormEntity.getApplication().setAmountRequested(amountRequested); // applicationFormEntity.getApplication().setAmountRequested(amountRequested);
log.info("Set amountRequested to {} for Application ID: {}", amountRequested, applicationFormEntity.getApplication().getId()); // log.info("Set amountRequested to {} for Application ID: {}", amountRequested, applicationFormEntity.getApplication().getId());
} catch (NumberFormatException e) { // } catch (NumberFormatException e) {
log.error("Invalid number format for requested amount: {}", fieldValue, e); // log.error("Invalid number format for requested amount: {}", fieldValue, e);
throw new IllegalArgumentException("Field value is not a valid number: " + fieldValue, e); // throw new IllegalArgumentException("Field value is not a valid number: " + fieldValue, e);
} // }
} // }
}); // });
contentResponseBeans.stream()
.filter(content -> content.getId().toString().equals(applicationFormFieldRequestBean.getFieldId()))
.findFirst()
.ifPresent(content -> {
Object fieldValue = applicationFormFieldRequestBean.getFieldValue();
if (fieldValue == null) {
return;
}
// Convert settings list to a map
Map<String, Object> settingMap = content.getSettings().stream()
.collect(Collectors.toMap(SettingResponseBean::getName, SettingResponseBean::getValue, (v1, v2) -> v1));
String fieldType = content.getName();
// Define handlers for different (fieldType + settingName) combinations
Map<String, Runnable> handlers = new HashMap<>();
// Add handler for isRequestedAmount
if ("numberinput".equals(fieldType) && Boolean.TRUE.equals(settingMap.get("isRequestedAmount"))) {
handlers.put("isRequestedAmount", () -> {
try {
BigDecimal amountRequested = new BigDecimal(fieldValue.toString());
applicationFormEntity.getApplication().setAmountRequested(amountRequested);
log.info("Set amountRequested to {} for Application ID: {}", amountRequested, applicationFormEntity.getApplication().getId());
} catch (NumberFormatException e) {
log.error("Invalid number format for requested amount: {}", fieldValue, e);
throw new IllegalArgumentException("Field value is not a valid number: " + fieldValue, e);
}
});
}
// Add handler for isPecEmail
if ("textinput".equals(fieldType) && Boolean.TRUE.equals(settingMap.get("isPecEmail"))) {
handlers.put("isPecEmail", () -> {
applicationFormEntity.getApplication().setPecEmail(fieldValue.toString());
log.info("Set PEC to {} for Application ID: {}", fieldValue, applicationFormEntity.getApplication().getId());
});
}
// Run all applicable handlers
handlers.values().forEach(Runnable::run);
});
ApplicationFormFieldEntity oldApplicationFormFieldData = null; ApplicationFormFieldEntity oldApplicationFormFieldData = null;
@@ -1158,8 +1203,16 @@ public class ApplicationDao {
// Create the map for body placeholders // Create the map for body placeholders
Map<String, String> bodyPlaceholders = new HashMap<>(); Map<String, String> bodyPlaceholders = new HashMap<>();
bodyPlaceholders.put("{{call_name}}", call.getName()); bodyPlaceholders.put("{{call_name}}", call.getName());
bodyPlaceholders.put("{{protocol_number}}", protocol.getProtocolNumber().toString()); String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
bodyPlaceholders.put("{{date}}", DateTimeUtil.formatLocalDateTime(protocol.getCreatedDate(), GepafinConstant.DD_MM_YYYY)); if(protocolNumber==null){
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
}
bodyPlaceholders.put("{{protocol_number}}",protocolNumber);
String protocolDate= DateTimeUtil.formatLocalDateTime(protocol.getCreatedDate(), GepafinConstant.DD_MM_YYYY);
if(protocol.getExternalProtocolDate()!=null){
protocolDate= DateTimeUtil.formatLocalDateTime(protocol.getExternalProtocolDate(), GepafinConstant.DD_MM_YYYY);
}
bodyPlaceholders.put("{{date}}", protocolDate);
bodyPlaceholders.put("{{time}}", DateTimeUtil.parseLocalTimeToString(protocol.getTime(), GepafinConstant.HH_MM_SS)); bodyPlaceholders.put("{{time}}", DateTimeUtil.parseLocalTimeToString(protocol.getTime(), GepafinConstant.HH_MM_SS));
// Replace placeholders in the subject and body // Replace placeholders in the subject and body
@@ -1209,8 +1262,17 @@ public class ApplicationDao {
// Create the map for body placeholders // Create the map for body placeholders
Map<String, String> bodyPlaceholders = new HashMap<>(); Map<String, String> bodyPlaceholders = new HashMap<>();
bodyPlaceholders.put("{{call_name}}", call.getName()); bodyPlaceholders.put("{{call_name}}", call.getName());
bodyPlaceholders.put("{{protocol_number}}", protocol.getProtocolNumber().toString()); String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
bodyPlaceholders.put("{{date}}", DateTimeUtil.formatLocalDateTime(protocol.getCreatedDate(), GepafinConstant.DD_MM_YYYY));
if(protocolNumber==null){
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
}
String protocolDate= DateTimeUtil.formatLocalDateTime(protocol.getCreatedDate(), GepafinConstant.DD_MM_YYYY);
if(protocol.getExternalProtocolDate()!=null){
protocolDate= DateTimeUtil.formatLocalDateTime(protocol.getExternalProtocolDate(), GepafinConstant.DD_MM_YYYY);
}
bodyPlaceholders.put("{{protocol_number}}", protocolNumber);
bodyPlaceholders.put("{{date}}",protocolDate);
bodyPlaceholders.put("{{time}}", DateTimeUtil.parseLocalTimeToString(protocol.getTime(), GepafinConstant.HH_MM_SS)); bodyPlaceholders.put("{{time}}", DateTimeUtil.parseLocalTimeToString(protocol.getTime(), GepafinConstant.HH_MM_SS));
// Replace placeholders in the subject and body // Replace placeholders in the subject and body
@@ -2328,7 +2390,11 @@ public class ApplicationDao {
bodyPlaceholders.put("{{call_name}}", call.getName()); bodyPlaceholders.put("{{call_name}}", call.getName());
bodyPlaceholders.put("{{application_id}}", applicationEntity.getId().toString()); bodyPlaceholders.put("{{application_id}}", applicationEntity.getId().toString());
bodyPlaceholders.put("{{company_name}}", company.getCompanyName()); bodyPlaceholders.put("{{company_name}}", company.getCompanyName());
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString()); String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
if(protocolNumber==null){
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
}
bodyPlaceholders.put("{{protocol_number}}", protocolNumber);
bodyPlaceholders.put("{{user_action_id}}",emailLogRequest.getUserActionId().toString()); bodyPlaceholders.put("{{user_action_id}}",emailLogRequest.getUserActionId().toString());
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders); String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);

View File

@@ -710,7 +710,11 @@ public class ApplicationEvaluationDao {
Map<String, String> placeHolders = new HashMap<>(); Map<String, String> placeHolders = new HashMap<>();
placeHolders.put("{{call_name}}", application.getCall().getName()); placeHolders.put("{{call_name}}", application.getCall().getName());
placeHolders.put("{{protocol_number}}", String.valueOf(application.getProtocol().getProtocolNumber())); String protocolNumber=application.getProtocol().getExternalProtocolNumber();
if(protocolNumber==null){
protocolNumber= String.valueOf(application.getProtocol().getProtocolNumber());
}
placeHolders.put("{{protocol_number}}", protocolNumber);
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_CREATION); notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_CREATION);
notificationDao.sendNotificationToInstructor(placeHolders,entity,NotificationTypeEnum.EVALUATION_CREATION); notificationDao.sendNotificationToInstructor(placeHolders,entity,NotificationTypeEnum.EVALUATION_CREATION);
@@ -1997,7 +2001,11 @@ public class ApplicationEvaluationDao {
Map<String, String> placeHolders = new HashMap<>(); Map<String, String> placeHolders = new HashMap<>();
placeHolders.put("{{call_name}}", application.getCall().getName()); placeHolders.put("{{call_name}}", application.getCall().getName());
placeHolders.put("{{protocol_number}}", String.valueOf(application.getProtocol().getProtocolNumber())); String protocolNumber=application.getProtocol().getExternalProtocolNumber();
if(protocolNumber==null){
protocolNumber= String.valueOf(application.getProtocol().getProtocolNumber());
}
placeHolders.put("{{protocol_number}}", protocolNumber);
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_RESULT); notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_RESULT);
notificationDao.sendNotificationToInstructor(placeHolders,existingEntity,NotificationTypeEnum.EVALUATION_RESULT); notificationDao.sendNotificationToInstructor(placeHolders,existingEntity,NotificationTypeEnum.EVALUATION_RESULT);

View File

@@ -2,6 +2,7 @@ package net.gepafin.tendermanagement.dao;
import org.springframework.data.domain.Pageable; // Correct package import org.springframework.data.domain.Pageable; // Correct package
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -413,7 +414,7 @@ public class CompanyDao {
Translator.toLocale(GepafinConstant.INVALID_LIMIT)); Translator.toLocale(GepafinConstant.INVALID_LIMIT));
} }
int successfulUpdates = 0; int successfulUpdates = 0;
int failedUpdates = 0; int failedUpdates = 0;
int invalidVatNumbers = 0; int invalidVatNumbers = 0;
@@ -531,7 +532,11 @@ public class CompanyDao {
Map<String, Object> dataMap = Utils.extractMap(companyDataMap, "data"); Map<String, Object> dataMap = Utils.extractMap(companyDataMap, "data");
Object dataObj = companyDataMap.get("data"); Object dataObj = companyDataMap.get("data");
if (dataMap == null) { if (dataObj instanceof Map<?, ?> singleMap) {
dataMap = (Map<String, Object>) singleMap;
} else if (dataObj instanceof List<?> list && !list.isEmpty() && list.get(0) instanceof Map<?, ?> firstMap) {
dataMap = (Map<String, Object>) firstMap;
} else {
log.warn("Company ID {}: 'data' section is missing or invalid in the JSON.", company.getId()); log.warn("Company ID {}: 'data' section is missing or invalid in the JSON.", company.getId());
return; return;
} }
@@ -540,11 +545,11 @@ public class CompanyDao {
updateCodiceAtecoField(company); updateCodiceAtecoField(company);
} else { } else {
Object pecEmail = Utils.extractMap(dataMap, "pec"); Object pecEmail = dataMap.get("pec");
if (pecEmail == null) { if (pecEmail == null) {
log.warn("Company ID {}: 'pec' section is missing or invalid.", company.getId()); log.warn("Company ID {}: 'pec' section is missing or invalid.", company.getId());
company.setPec((String) pecEmail);
} }
company.setPec((String) pecEmail);
// Extract 'atecoClassification' section // Extract 'atecoClassification' section
Map<String, Object> atecoClassificationMap = Utils.extractMap(dataMap, "atecoClassification"); Map<String, Object> atecoClassificationMap = Utils.extractMap(dataMap, "atecoClassification");
@@ -577,49 +582,79 @@ public class CompanyDao {
} }
public void getCompanyEntity() { public void getCompanyEntity() {
List<CompanyEntity> companyEntities=companyRepository.findAll(); List<CompanyEntity> companyEntities=companyRepository.findByJsonIsNotNullAndPecIsNull();
List<CompanyEntity> companyEntityList=new ArrayList<>();
for (CompanyEntity company:companyEntities){ for (CompanyEntity company:companyEntities){
if(company.getJson()!=null){ if(company.getJson()!=null && company.getPec()==null){
if (company == null || company.getJson() == null || company.getJson().isEmpty()) { if (company == null || company.getJson() == null || company.getJson().isEmpty()) {
log.warn("Company is null or JSON data is empty."); log.warn("Company is null or JSON data is empty.");
return; continue;
} }
Map<String, Object> vatCheckResponse = Utils.convertJsonStringToMap(company.getJson()); Map<String, Object> vatCheckResponse = Utils.convertJsonStringToMap(company.getJson());
if (vatCheckResponse == null) { if (vatCheckResponse == null) {
log.warn("Company ID {}: Invalid JSON response.", company.getId()); log.warn("Company ID {}: Invalid JSON response.", company.getId());
return; continue;
} }
Map<String, Object> companyDataMap = Utils.convertJsonStringToMap(company.getJson()); Map<String, Object> companyDataMap = Utils.convertJsonStringToMap(company.getJson());
if (companyDataMap == null) { if (companyDataMap == null) {
log.warn("Company ID {}: Failed to parse JSON data.", company.getId()); log.warn("Company ID {}: Failed to parse JSON data.", company.getId());
return; continue;
} }
Object dataObj = vatCheckResponse.get("data"); Object dataObj = vatCheckResponse.get("data");
if (!(dataObj instanceof Map<?, ?> dataMap)) { Map<String, Object> dataMap=null;
log.warn("Company ID {}: 'data' is missing or not a valid object.", company.getId()); // if (!(dataObj instanceof Map<?, ?> dataMap)) {
return; // log.warn("Company ID {}: 'data' is missing or not a valid object.", company.getId());
// continue;
// }
if (dataObj instanceof Map<?, ?> singleMap) {
dataMap = (Map<String, Object>) singleMap;
} else if (dataObj instanceof List<?> list && !list.isEmpty() && list.get(0) instanceof Map<?, ?> firstMap) {
dataMap = (Map<String, Object>) firstMap;
} else {
log.warn("Company ID {}: 'data' section is missing or invalid in the JSON.", company.getId());
continue;
} }
if (dataMap.containsKey("pec")) {
Object pecEmailObj = dataMap.get("pec");
if (pecEmailObj instanceof String pec && !pec.isEmpty()) {
company.setPec(pec); // Only set if valid string
companyEntityList.add(company);
} else {
log.warn("Company ID {}: 'pec' is missing, empty, or not a string.", company.getId());
continue;
}
}
if (!dataMap.containsKey("dettaglio")) { if (!dataMap.containsKey("dettaglio")) {
log.warn("Company ID {}: 'dettaglio' not present inside 'data'. Skipping codiceAteco update.", company.getId()); log.warn("Company ID {}: 'dettaglio' not present inside 'data'. Skipping codiceAteco update.", company.getId());
return; continue;
} }
Object dettaglioObj = dataMap.get("dettaglio"); Object dettaglioObj = dataMap.get("dettaglio");
if (!(dettaglioObj instanceof Map<?, ?> dettaglio)) { if (!(dettaglioObj instanceof Map<?, ?> dettaglio)) {
log.warn("Company ID {}: 'dettaglio' is not a valid object.", company.getId()); log.warn("Company ID {}: 'dettaglio' is not a valid object.", company.getId());
return; continue;
} }
Object pecEmailObj = dettaglio.get("pec"); Object pecEmailObj = dettaglio.get("pec");
if (pecEmailObj instanceof String pec && !pec.isEmpty()) { if (pecEmailObj instanceof String pec && !pec.isEmpty()) {
company.setPec(pec); // Only set if valid string if(pec!=null) {
company.setPec(pec); // Only set if valid string
companyEntityList.add(company);
}
} else { } else {
log.warn("Company ID {}: 'pec' is missing, empty, or not a string.", company.getId()); log.warn("Company ID {}: 'pec' is missing, empty, or not a string.", company.getId());
continue;
} }
} }
} }
companyRepository.saveAll(companyEntityList);
} }
} }

View File

@@ -174,8 +174,16 @@ public class EmailNotificationDao {
public Map<String, String> prepareEmailPlaceholders(ApplicationEntity applicationEntity, ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity){ public Map<String, String> prepareEmailPlaceholders(ApplicationEntity applicationEntity, ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity){
Map<String, String> bodyPlaceholders = new HashMap<>(); Map<String, String> bodyPlaceholders = new HashMap<>();
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName()); bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString()); String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
bodyPlaceholders.put("{{protocol_date}}", DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getCreatedDate(), GepafinConstant.DD_MM_YYYY)); if(protocolNumber==null){
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
}
bodyPlaceholders.put("{{protocol_number}}", protocolNumber);
String protocolDate= DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getCreatedDate(), GepafinConstant.DD_MM_YYYY);
if(applicationEntity.getProtocol().getExternalProtocolDate()!=null){
protocolDate= DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getExternalProtocolDate(), GepafinConstant.DD_MM_YYYY);
}
bodyPlaceholders.put("{{protocol_date}}", protocolDate);
bodyPlaceholders.put("{{protocol_time}}", DateTimeUtil.parseLocalTimeToString(applicationEntity.getProtocol().getTime(), GepafinConstant.HH_MM_SS)); bodyPlaceholders.put("{{protocol_time}}", DateTimeUtil.parseLocalTimeToString(applicationEntity.getProtocol().getTime(), GepafinConstant.HH_MM_SS));
bodyPlaceholders.put("{{response_days}}", applicationAmendmentRequestEntity.getResponseDays().toString()); bodyPlaceholders.put("{{response_days}}", applicationAmendmentRequestEntity.getResponseDays().toString());
@@ -259,8 +267,16 @@ public class EmailNotificationDao {
public void sendAdmissibilityNotificationEmailForAdmissibleApplication(ApplicationEntity applicationEntity) { public void sendAdmissibilityNotificationEmailForAdmissibleApplication(ApplicationEntity applicationEntity) {
Map<String, String> bodyPlaceholders = new HashMap<>(); Map<String, String> bodyPlaceholders = new HashMap<>();
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName()); bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString()); String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
bodyPlaceholders.put("{{protocol_date}}", DateTimeUtil.formatCreatedDate(applicationEntity.getProtocol().getCreatedDate())); if(protocolNumber==null){
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
}
bodyPlaceholders.put("{{protocol_number}}", protocolNumber);
String protocolDate= DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getCreatedDate(), GepafinConstant.DD_MM_YYYY);
if(applicationEntity.getProtocol().getExternalProtocolDate()!=null){
protocolDate= DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getExternalProtocolDate(), GepafinConstant.DD_MM_YYYY);
}
bodyPlaceholders.put("{{protocol_date}}", protocolDate);
bodyPlaceholders.put("{{protocol_time}}", DateTimeUtil.parseLocalTimeToString(applicationEntity.getProtocol().getTime(), GepafinConstant.HH_MM_SS)); bodyPlaceholders.put("{{protocol_time}}", DateTimeUtil.parseLocalTimeToString(applicationEntity.getProtocol().getTime(), GepafinConstant.HH_MM_SS));
sendEmail(applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.ADMISSIBILITY_NOTIFICATION, bodyPlaceholders, null,null); sendEmail(applicationEntity, SystemEmailTemplatesEntity.SystemEmailTemplatesEntityTypeEnum.ADMISSIBILITY_NOTIFICATION, bodyPlaceholders, null,null);
@@ -269,8 +285,16 @@ public class EmailNotificationDao {
public void sendInadmissibilityEmailForRejectedApplication(ApplicationEntity applicationEntity,ApplicationEvaluationEntity applicationEvaluationEntity) { public void sendInadmissibilityEmailForRejectedApplication(ApplicationEntity applicationEntity,ApplicationEvaluationEntity applicationEvaluationEntity) {
Map<String, String> bodyPlaceholders = new HashMap<>(); Map<String, String> bodyPlaceholders = new HashMap<>();
bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName()); bodyPlaceholders.put("{{call_name}}", applicationEntity.getCall().getName());
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString()); String protocolNumber=applicationEntity.getProtocol().getExternalProtocolNumber();
bodyPlaceholders.put("{{protocol_date}}", DateTimeUtil.formatCreatedDate(applicationEntity.getProtocol().getCreatedDate())); if(protocolNumber==null){
protocolNumber= String.valueOf(applicationEntity.getProtocol().getProtocolNumber());
}
bodyPlaceholders.put("{{protocol_number}}", protocolNumber);
String protocolDate= DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getCreatedDate(), GepafinConstant.DD_MM_YYYY);
if(applicationEntity.getProtocol().getExternalProtocolDate()!=null){
protocolDate= DateTimeUtil.formatLocalDateTime(applicationEntity.getProtocol().getExternalProtocolDate(), GepafinConstant.DD_MM_YYYY);
}
bodyPlaceholders.put("{{protocol_date}}", protocolDate);
bodyPlaceholders.put("{{protocol_time}}", DateTimeUtil.parseLocalTimeToString(applicationEntity.getProtocol().getTime(), GepafinConstant.HH_MM_SS)); bodyPlaceholders.put("{{protocol_time}}", DateTimeUtil.parseLocalTimeToString(applicationEntity.getProtocol().getTime(), GepafinConstant.HH_MM_SS));
bodyPlaceholders.put("{{form_text}}", applicationEvaluationEntity.getMotivation()); bodyPlaceholders.put("{{form_text}}", applicationEvaluationEntity.getMotivation());

View File

@@ -174,7 +174,11 @@ public class NotificationDao {
Map<String, String> placeHolders = new HashMap<>(); Map<String, String> placeHolders = new HashMap<>();
placeHolders.put("{{call_name}}", application.getCall().getName()); placeHolders.put("{{call_name}}", application.getCall().getName());
placeHolders.put("{{protocol_number}}", String.valueOf(application.getProtocol().getProtocolNumber())); String protocolNumber=application.getProtocol().getExternalProtocolNumber();
if(protocolNumber==null){
protocolNumber= String.valueOf(application.getProtocol().getProtocolNumber());
}
placeHolders.put("{{protocol_number}}", protocolNumber);
NotificationReq notificationReq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, application.getUserId(), application.getUserWithCompany(), NotificationReq notificationReq = createNotificationReq(notificationTypeEnum.getValue(), placeHolders, application.getUserId(), application.getUserWithCompany(),
listOf(application.getCompanyId())); listOf(application.getCompanyId()));
sendNotification(notificationReq); sendNotification(notificationReq);

View File

@@ -170,7 +170,7 @@ public class ProtocolDao {
vatNumber=company.getVatNumber(); vatNumber=company.getVatNumber();
}else { }else {
mittenteValue = tipoCorrispondenteWithoutCompany; mittenteValue = tipoCorrispondenteWithoutCompany;
vatNumber = company.getCodiceFiscale(); vatNumber = company.getCodiceFiscale();
} }
String companyName = company.getCompanyName() + " " + vatNumber; String companyName = company.getCompanyName() + " " + vatNumber;
String callName = application.getCall().getName()+" "+ application.getCall().getId(); String callName = application.getCall().getName()+" "+ application.getCall().getId();
@@ -181,15 +181,15 @@ public class ProtocolDao {
Map<String, Object> requestBody = new HashMap<>(); Map<String, Object> requestBody = new HashMap<>();
requestBody.put(GepafinConstant.PROTOCOL_DOC_URL,docUrl); requestBody.put(GepafinConstant.PROTOCOL_DOC_URL,docUrl);
requestBody.put(GepafinConstant.PROTOCOL_COMPANY_NAME,companyName);
requestBody.put(GepafinConstant.PROTOCOL_DOC_HASH,applicationSignedDocumentEntity.getFileHash()); requestBody.put(GepafinConstant.PROTOCOL_DOC_HASH,applicationSignedDocumentEntity.getFileHash());
requestBody.put(GepafinConstant.PROTOCOL_TIPO_PROTOCOLLAZIONE,TIPO_PROTOCOLLAZIONE); requestBody.put(GepafinConstant.PROTOCOL_TIPO_PROTOCOLLAZIONE,TIPO_PROTOCOLLAZIONE);
requestBody.put(GepafinConstant.PROTOCOL_COMPANY_NAME_VAT_NUMBER,company.getCompanyName());
Map<String, Object> mittente = new HashMap<>(); Map<String, Object> mittente = new HashMap<>();
mittente.put(GepafinConstant.PROTOCOL_TIPO_CORRISPONDENTE_COMPANY, mittenteValue); mittente.put(GepafinConstant.PROTOCOL_TIPO_CORRISPONDENTE, mittenteValue);
mittente.put(GepafinConstant.PROTOCOL_COMPANY_NAME_VAT_NUMBER,company.getCompanyName());
mittente.put(GepafinConstant.PROTOCOL_MEZZO,mezzo); mittente.put(GepafinConstant.PROTOCOL_MEZZO,mezzo);
mittente.put(GepafinConstant.PROTOCOL_INDIRIZZO_PEC,pecEmail); mittente.put(GepafinConstant.PROTOCOL_INDIRIZZO_PEC,pecEmail);
mittente.put(GepafinConstant.PROTOCOL_COMPANY_VAT_NUMBER,vatNumber); mittente.put(GepafinConstant.PROTOCOL_COMPANY_VAT_NUMBER,vatNumber);
mittente.put(GepafinConstant.PROTOCOL_COMPANY_NAME,company.getCompanyName());
List<Map<String,Object>> destinatariObject=new ArrayList<>(); List<Map<String,Object>> destinatariObject=new ArrayList<>();
Map<String, Object> destinatari = new HashMap<>(); Map<String, Object> destinatari = new HashMap<>();
destinatari.put(GepafinConstant.PROTOCOL_CODICE_UO,codiceUo); destinatari.put(GepafinConstant.PROTOCOL_CODICE_UO,codiceUo);

View File

@@ -73,4 +73,7 @@ public class ApplicationEntity extends BaseEntity {
@Column(name = "APPLICATION_EVALUATION_ID") @Column(name = "APPLICATION_EVALUATION_ID")
private Long applicationEvaluationId; private Long applicationEvaluationId;
@Column(name = "PEC_EMAIL")
private String pecEmail;
} }

View File

@@ -0,0 +1,33 @@
package net.gepafin.tendermanagement.entities;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Where;
@Entity
@Table(name = "NDGANAG")
@Data
@Where(clause = "is_deleted = false")
public class NdganagEntity extends BaseEntity{
@Column(name = "NDG")
private String ndg;
@Column(name = "COMPANY_NAME")
private String companyName;
@Column(name = "VAT_NUMBER")
private String vatNumber;
@Column(name = "CODICE_FISCALE")
private String codiceFiscale;
@Column(name = "JSON")
private String json;
@Column(name = "IS_DELETED")
private Boolean isDeleted;
}

View File

@@ -0,0 +1,18 @@
package net.gepafin.tendermanagement.enums;
import com.fasterxml.jackson.annotation.JsonValue;
public enum HttpMethodEnum {
POST("POST"), PUT("PUT"), GET("GET"), DELETE("DELETE");
private String value;
HttpMethodEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
}

View File

@@ -0,0 +1,22 @@
package net.gepafin.tendermanagement.enums;
import com.fasterxml.jackson.annotation.JsonValue;
public enum NdgStatusEnum {
NDG_INITITATED("NDG_INITITATED"),
NDG_GENERATED("NDG_GENERATED"),
NDG_IN_PROGRESS("NDG_IN_PROGRESS");
private String value;
NdgStatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
}

View File

@@ -67,6 +67,7 @@ public enum UserActionContextEnum {
GET_COMPANY_BY_USER("GET_COMPANY_BY_USER"), GET_COMPANY_BY_USER("GET_COMPANY_BY_USER"),
REMOVE_COMPANY_FROM_USER("REMOVE_COMPANY_FROM_USER"), REMOVE_COMPANY_FROM_USER("REMOVE_COMPANY_FROM_USER"),
UPDATE_COMPANY_JSON("UPDATE_COMPANY_JSON"), UPDATE_COMPANY_JSON("UPDATE_COMPANY_JSON"),
EXTRACT_PEC_FROM_COMPANY("EXTRACT_PEC_FROM_COMPANY"),
/** LookUpData action context **/ /** LookUpData action context **/
CREATE_LOOKUP_DATA("CREATE_LOOKUP_DATA"), CREATE_LOOKUP_DATA("CREATE_LOOKUP_DATA"),
@@ -180,6 +181,7 @@ public enum UserActionContextEnum {
CHECK_OR_CREATE_NDG_CODE("CHECK_OR_CREATE_NDG_CODE"), CHECK_OR_CREATE_NDG_CODE("CHECK_OR_CREATE_NDG_CODE"),
CREATE_APPOINTMENT("CREATE_APPOINTMENT"), CREATE_APPOINTMENT("CREATE_APPOINTMENT"),
UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"), UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM("UPLOAD_DOCUMENT_TO_EXTERNAL_SYSTEM"),
GET_NDG_BY_VAT_NUMBER("GET_NDG_BY_VAT_NUMBER"),
GET_ALL_NOTIFICATION_BY_PAGINATION("GET_ALL_NOTIFICATION_BY_PAGINATION"), GET_ALL_NOTIFICATION_BY_PAGINATION("GET_ALL_NOTIFICATION_BY_PAGINATION"),
GET_ALL_CALL_BY_PAGINATION("GET_ALL_CALL_BY_PAGINATION"), GET_ALL_CALL_BY_PAGINATION("GET_ALL_CALL_BY_PAGINATION"),

View File

@@ -31,5 +31,7 @@ public interface CompanyRepository extends JpaRepository<CompanyEntity, Long> {
""") """)
Page<CompanyEntity> findCompaniesWithMissingVatCheck(Pageable pageable); Page<CompanyEntity> findCompaniesWithMissingVatCheck(Pageable pageable);
List<CompanyEntity> findByJsonIsNotNullAndPecIsNull();
} }

View File

@@ -0,0 +1,14 @@
package net.gepafin.tendermanagement.repositories;
import net.gepafin.tendermanagement.entities.NdganagEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface NdganagRepository extends JpaRepository<NdganagEntity,Long> {
NdganagEntity findByVatNumber(String vatNumber);
}

View File

@@ -91,7 +91,11 @@ public class ApplicationEvaluationScheduler {
// Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.EVALUATION_EXPIRED); // Map<String, String> placeHolders = notificationDao.sendNotificationToBeneficiary(application, NotificationTypeEnum.EVALUATION_EXPIRED);
Map<String, String> placeHolders = new HashMap<>(); Map<String, String> placeHolders = new HashMap<>();
placeHolders.put("{{call_name}}", application.getCall().getName()); placeHolders.put("{{call_name}}", application.getCall().getName());
placeHolders.put("{{protocol_number}}", String.valueOf(application.getProtocol().getProtocolNumber())); String protocolNumber=application.getProtocol().getExternalProtocolNumber();
if(protocolNumber==null){
protocolNumber= String.valueOf(application.getProtocol().getProtocolNumber());
}
placeHolders.put("{{protocol_number}}", protocolNumber);
notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_EXPIRED); notificationDao.sendNotificationToSuperUser(application,placeHolders,NotificationTypeEnum.EVALUATION_EXPIRED);
notificationDao.sendNotificationToInstructor(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED); notificationDao.sendNotificationToInstructor(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED);
notificationDao.sendNotificationToInstructorManager(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED); notificationDao.sendNotificationToInstructorManager(placeHolders,evaluation,NotificationTypeEnum.EVALUATION_EXPIRED);

View File

@@ -13,4 +13,7 @@ public interface AppointmentService {
AppointmentCreationResponse createAppointmentForApplication(HttpServletRequest request, Long applicationId, CreateAppointmentRequest createAppointmentRequest); AppointmentCreationResponse createAppointmentForApplication(HttpServletRequest request, Long applicationId, CreateAppointmentRequest createAppointmentRequest);
DocumentUploadResponse uploadDocToExternalSystem(HttpServletRequest request, Long documentId, UploadDocToExternalSystemRequest docToExternalSystemRequest); DocumentUploadResponse uploadDocToExternalSystem(HttpServletRequest request, Long documentId, UploadDocToExternalSystemRequest docToExternalSystemRequest);
NdgResponse getNdgByVatNumber(HttpServletRequest request,String vatNumber);
} }

View File

@@ -47,4 +47,5 @@ public interface CompanyService {
void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest); void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest);
void extractPecFromJson(HttpServletRequest request);
} }

View File

@@ -2,12 +2,14 @@ package net.gepafin.tendermanagement.service.impl;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import net.gepafin.tendermanagement.dao.AppointmentDao; import net.gepafin.tendermanagement.dao.AppointmentDao;
import net.gepafin.tendermanagement.entities.UserEntity;
import net.gepafin.tendermanagement.model.request.CreateAppointmentRequest; import net.gepafin.tendermanagement.model.request.CreateAppointmentRequest;
import net.gepafin.tendermanagement.model.request.UploadDocToExternalSystemRequest; import net.gepafin.tendermanagement.model.request.UploadDocToExternalSystemRequest;
import net.gepafin.tendermanagement.model.response.AppointmentCreationResponse; import net.gepafin.tendermanagement.model.response.AppointmentCreationResponse;
import net.gepafin.tendermanagement.model.response.DocumentUploadResponse; import net.gepafin.tendermanagement.model.response.DocumentUploadResponse;
import net.gepafin.tendermanagement.model.response.NdgResponse; import net.gepafin.tendermanagement.model.response.NdgResponse;
import net.gepafin.tendermanagement.service.AppointmentService; import net.gepafin.tendermanagement.service.AppointmentService;
import net.gepafin.tendermanagement.util.Validator;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -17,6 +19,9 @@ public class AppointmentServiceImpl implements AppointmentService {
@Autowired @Autowired
private AppointmentDao appointmentDao; private AppointmentDao appointmentDao;
@Autowired
private Validator validator;
@Override @Override
public NdgResponse checkNdgForAppointment(HttpServletRequest request, Long applicationId) { public NdgResponse checkNdgForAppointment(HttpServletRequest request, Long applicationId) {
@@ -34,4 +39,11 @@ public class AppointmentServiceImpl implements AppointmentService {
return appointmentDao.uploadDocumentToExternalSystem(documentId, docToExternalSystemRequest); return appointmentDao.uploadDocumentToExternalSystem(documentId, docToExternalSystemRequest);
} }
@Override
public NdgResponse getNdgByVatNumber(HttpServletRequest request,String vatNumber) {
UserEntity userEntity = validator.validateUser(request);
NdgResponse ndgResponse= appointmentDao.getNdgByVatNumber(vatNumber,userEntity);
return ndgResponse;
}
} }

View File

@@ -140,6 +140,12 @@ public class CompanyServiceImpl implements CompanyService {
@Override @Override
public void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest) { public void updateMissingVatCheckResponses(HttpServletRequest request, LimitRequest limitRequest) {
UserEntity userEntity =validator.validateUser(request); UserEntity userEntity =validator.validateUser(request);
companyDao.updateMissingVatCheckResponses(request, limitRequest); companyDao.updateMissingVatCheckResponses(request,limitRequest);
}
@Override
public void extractPecFromJson(HttpServletRequest request) {
UserEntity userEntity =validator.validateUser(request);
companyDao.getCompanyEntity();
} }
} }

View File

@@ -1052,5 +1052,17 @@ public class Utils {
headers.add(org.apache.http.HttpHeaders.USER_AGENT, "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"); headers.add(org.apache.http.HttpHeaders.USER_AGENT, "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0");
return headers; return headers;
} }
public static void setHttpServletRequestForThread(HttpServletRequest request,String methodType, String remoteUser, Long userActionId) {
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
mockRequest.setRequestURI(request.getRequestURI());
mockRequest.setMethod(methodType);
mockRequest.setRemoteUser(remoteUser); // or pass it in if needed
mockRequest.setAttribute(GepafinConstant.USER_ACTION_ID, userActionId);
ServletRequestAttributes attributes = new ServletRequestAttributes(mockRequest);
RequestContextHolder.setRequestAttributes(attributes, true);
}
} }

View File

@@ -56,4 +56,15 @@ public interface AppointmentApi {
ResponseEntity<Response<DocumentUploadResponse>> uploadDocumentToExternalSystem(HttpServletRequest request, ResponseEntity<Response<DocumentUploadResponse>> uploadDocumentToExternalSystem(HttpServletRequest request,
@Parameter(description = "The document id", required = true) @PathVariable(value = "documentId", required = true) Long documentId, @Parameter(description = "The document id", required = true) @PathVariable(value = "documentId", required = true) Long documentId,
@RequestBody UploadDocToExternalSystemRequest docToExternalSystemRequest); @RequestBody UploadDocToExternalSystemRequest docToExternalSystemRequest);
@Operation(summary = "API to get ndg by vatNumber", responses = { @ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "/vatNumber/{vatNumber}", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<Response<NdgResponse>> getNdgByVatNumber(HttpServletRequest request,@PathVariable(value = "vatNumber", required = true) @Parameter(description = "vatNumber",required = true)String vatNumber);
} }

View File

@@ -169,4 +169,17 @@ public interface CompanyApi {
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') ") @PreAuthorize("hasRole('ROLE_SUPER_ADMIN') ")
ResponseEntity<Response<Void>> updateMissingVatCheckResponses(HttpServletRequest request, ResponseEntity<Response<Void>> updateMissingVatCheckResponses(HttpServletRequest request,
@Parameter(description = "Limit request object ", required = true) @RequestBody LimitRequest limitRequest); @Parameter(description = "Limit request object ", required = true) @RequestBody LimitRequest limitRequest);
@Operation(summary = "Api to extract pec from the company json", responses = { @ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "/pec", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') ")
ResponseEntity<Response<Void>> extractPecFromJson(HttpServletRequest request);
} }

View File

@@ -17,6 +17,7 @@ import net.gepafin.tendermanagement.service.AppointmentService;
import net.gepafin.tendermanagement.util.LoggingUtil; import net.gepafin.tendermanagement.util.LoggingUtil;
import net.gepafin.tendermanagement.web.rest.api.AppointmentApi; import net.gepafin.tendermanagement.web.rest.api.AppointmentApi;
import net.gepafin.tendermanagement.web.rest.api.errors.Status; import net.gepafin.tendermanagement.web.rest.api.errors.Status;
import org.opensaml.xmlsec.signature.G;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@@ -81,4 +82,19 @@ public class AppointmentController implements AppointmentApi {
.body(new Response<>(documentUploadResponse, Status.SUCCESS, Translator.toLocale(message))); .body(new Response<>(documentUploadResponse, Status.SUCCESS, Translator.toLocale(message)));
} }
@Override
public ResponseEntity<Response<NdgResponse>> getNdgByVatNumber(HttpServletRequest request,String vatNumber) {
loggingUtil.logUserAction(
UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPLOAD).actionContext(UserActionContextEnum.GET_NDG_BY_VAT_NUMBER).build());
NdgResponse ndgResponse= appointmentService.getNdgByVatNumber(request,vatNumber);
if(ndgResponse==null){
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(ndgResponse, Status.NOT_FOUND, Translator.toLocale(GepafinConstant.NDG_NOT_FOUND)));
}
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(ndgResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.NDG_FETCH_SUCCESSFULLY)));
}
} }

View File

@@ -201,4 +201,17 @@ public class CompanyApiController implements CompanyApi{
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_UPDATED_SUCCESS_MSG))); .body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_UPDATED_SUCCESS_MSG)));
} }
@Override
public ResponseEntity<Response<Void>> extractPecFromJson(HttpServletRequest request) {
log.info("Api to set pec from json field");
companyService.extractPecFromJson(request);
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.EXTRACT_PEC_FROM_COMPANY).build());
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_UPDATED_SUCCESS_MSG)));
}
} }

View File

@@ -83,7 +83,7 @@ sviluppumbria.username=protocollatoresvilumbria
password=8e85ea4265e49497d697168fd3d34916 password=8e85ea4265e49497d697168fd3d34916
CLASSIFICA=06.004.3 CLASSIFICA=06.004.3
TIPO_PROTOCOLLAZIONE=E TIPO_PROTOCOLLAZIONE=E
tipoCorrispondenteCompany=PersonaGiuridica tipoCorrispondenteCompany=PersonaGiuridica
tipoCorrispondenteWithoutCompany=Persona tipoCorrispondenteWithoutCompany=Persona
mezzo=Altro mezzo=Altro
indirizzoPec=ufficio01@domain.com indirizzoPec=ufficio01@domain.com

View File

@@ -2960,4 +2960,24 @@
path="db/dump/updated_form_field_05_06_2025.sql"/> path="db/dump/updated_form_field_05_06_2025.sql"/>
</changeSet> </changeSet>
<changeSet id="06-06-2025_RK_180524" author="Rajesh Khore">
<createTable tableName="ndganag">
<column name="id" type="INTEGER" autoIncrement="true">
<constraints primaryKey="true" primaryKeyName="ndganag_pkey" nullable="false"/>
</column>
<column name="ndg" type="VARCHAR(255)" />
<column name="company_name" type="VARCHAR(255)"/>
<column name="vat_number" type="VARCHAR(255)" />
<column name="codice_fiscale" type="VARCHAR(255)" />
<column name="json" type="TEXT"/>
<column name="is_deleted" type="BOOLEAN"/>
<column name="created_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="updated_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
</createTable>
<addColumn tableName="application">
<column name="pec_email" type="VARCHAR(255)"></column>
</addColumn>
</changeSet>
</databaseChangeLog> </databaseChangeLog>

View File

@@ -408,3 +408,5 @@ resend.email.sent.failed.msg = Failed to resend the email.
application.readmit.success=Application has been readmitted successfully. application.readmit.success=Application has been readmitted successfully.
no.email.log.msg = No failed emails found for given userActionId. no.email.log.msg = No failed emails found for given userActionId.
user.action.id.not.found = User Action id not found. user.action.id.not.found = User Action id not found.
ndg.not.found=NDG not found.
email.pec.cannot.null=Email pec is required.

View File

@@ -399,3 +399,5 @@ resend.email.sent.failed.msg = Impossibile inviare nuovamente l'e-mail.
application.readmit.success=L'applicazione è stata riammessa con successo. application.readmit.success=L'applicazione è stata riammessa con successo.
no.email.log.msg = Nessuna email trovata per userActionId specificato. no.email.log.msg = Nessuna email trovata per userActionId specificato.
user.action.id.not.found = ID azione utente non trovato. user.action.id.not.found = ID azione utente non trovato.
ndg.not.found=NDG non trovato.
email.pec.cannot.null=L'indirizzo email pec è obbligatorio.