diff --git a/pom.xml b/pom.xml
index 9c84bcc4..daa067ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -258,6 +258,17 @@
+
+
+
+
+
+ com.sun.mail
+ jakarta.mail
+ 2.0.1
+
+
+
diff --git a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java
index 4f15580c..5c849a47 100644
--- a/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java
+++ b/src/main/java/net/gepafin/tendermanagement/constants/GepafinConstant.java
@@ -101,6 +101,7 @@ public class GepafinConstant {
public static final String STATUS_SAME_ERROR = "status.same.error";
public static final String INVALID_STATUS_CHANGE_FROM_DRAFT = "invalid.status.change.from.draft";
public static final String INVALID_STATUS_CHANGE_FROM_PUBLISH = "invalid.status.change.from.publish";
+ public static final String INVALID_STATUS_CHANGE_FROM_PUBLISH_TO_DRAFT = "invalid.status.change.from.publish.to.draft";
public static final String STATUS_CANNOT_BE_CHANGED = "status.cannot.be.changed";
public static final String PUBLISHED_CALL_NOT_UPDATE = "published.call.not.update";
public static final String INVALID_USER = "invalid_user";
@@ -136,7 +137,9 @@ public class GepafinConstant {
public static final String UPDATING_FORM_VALUE_IMPACT_ON_FLOW = "updating.form.value.impact.on.flow";
public static final String APPLICATION_IS_INCOMPLETE_MSG = "application.is.incomplete";
public static final String AUTHORIZATION = "Authorization";
- public static final String CHECK_VATNUMBER_V2_NEW_URL = "https://imprese.openapi.it/advance";
+ public static final String CHECK_VATNUMBER_URL_V1 = "https://imprese.openapi.it/advance";
+ public static final String CHECK_VATNUMBER_URL_V2 = "https://company.openapi.com/IT-advanced";
+ public static final String VAT_CHECK_API_VERSION = "VAT_CHECK_API_VERSION";
public static final String VALIDATION_FIELD_CUSTOM = "validation.field.custom";
public static final String VALIDATION_CODICE_FISCALE = "validation.codice.fiscale";
public static final String VALIDATION_CAP = "validation.cap";
@@ -529,6 +532,11 @@ public class GepafinConstant {
public static final String GET_FIELD_VALUE="getFieldValue";
public static final String GET_REPORT_ENABLE="getReportEnable";
public static final String GET_REPORT_HEADER="getReportHeader";
+
+ public static final String APPOINTMENT_ID="appointmentId";
+ public static final String APPLICATION_STATUS="applicationStatus";
+
+ public static final String RINALDO_EMAIL = "rinaldo.bonazzo@bflows.net";
}
diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java
index a766d1a5..daa4391b 100644
--- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java
+++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java
@@ -134,6 +134,12 @@ public class ApplicationAmendmentRequestDao {
@Autowired
private ApplicationEvaluationFormRepository applicationEvaluationFormRepository;
+ @Autowired
+ private ApplicationAmendmentRequestViewRepository applicationAmendmentRequestViewRepository;
+
+ @Autowired
+ private ApplicationDao applicationDao;
+
public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(Long applicationEvaluationId) {
log.info("Fetching the application data for the Amendment process {}", applicationEvaluationId);
ApplicationEvaluationEntity applicationEvaluationEntity = applicationEvaluationService.validateApplicationEvaluation(applicationEvaluationId);
@@ -1268,7 +1274,122 @@ public class ApplicationAmendmentRequestDao {
documentService.deleteFile(documentId);
}
- public PageableResponseBean> getApplicationAmendmentByPaginnation(Long userId, ApplicationAmendmentPaginationRequestBean applicationAmendmentPaginationRequestBean) {
+// public PageableResponseBean> getApplicationAmendmentByPaginnation(Long userId, ApplicationAmendmentPaginationRequestBean applicationAmendmentPaginationRequestBean) {
+// Integer pageNo = null;
+// Integer pageLimit = null;
+// if (applicationAmendmentPaginationRequestBean.getGlobalFilters() != null) {
+// pageNo = applicationAmendmentPaginationRequestBean.getGlobalFilters().getPage();
+// pageLimit = applicationAmendmentPaginationRequestBean.getGlobalFilters().getLimit();
+// }
+// if (pageLimit == null || pageLimit <= 0) {
+// pageLimit = GepafinConstant.DEFAULT_PAGE_LIMIT;
+// }
+// if (pageNo == null || pageNo <= 0) {
+// pageNo = GepafinConstant.DEFAULT_PAGE;
+// }
+// Specification spec = searchPagination(userId,applicationAmendmentPaginationRequestBean);
+// Page entityPage = applicationAmendmentRequestRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit));
+//
+//
+// List applicationResponses = entityPage.getContent().stream()
+// .map(application -> {
+// ApplicationAmendmentRequestResponse response = convertEntityToResponse(application,false);
+// return response;
+// })
+// .collect(Collectors.toList());
+//
+//
+// PageableResponseBean> pageableResponseBean = new PageableResponseBean<>();
+// pageableResponseBean.setBody(applicationResponses);
+// pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing
+// pageableResponseBean.setTotalPages(entityPage.getTotalPages());
+// pageableResponseBean.setTotalRecords(entityPage.getTotalElements());
+// pageableResponseBean.setPageSize(entityPage.getSize());
+//
+// return pageableResponseBean;
+// }
+//
+// public Specification searchPagination(Long userId,ApplicationAmendmentPaginationRequestBean applicationAmendmentPaginationRequestBean) {
+// return (root, query, criteriaBuilder) -> {
+//
+// List predicates = getPredicates(applicationAmendmentPaginationRequestBean, criteriaBuilder, root,userId);
+// SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
+//
+// if (applicationAmendmentPaginationRequestBean .getGlobalFilters() != null
+// && applicationAmendmentPaginationRequestBean.getGlobalFilters().getSortBy() != null &&
+// applicationAmendmentPaginationRequestBean.getGlobalFilters().getSortBy().getColumnName() != null && Boolean.FALSE.equals(
+// isEmpty(applicationAmendmentPaginationRequestBean.getGlobalFilters().getSortBy().getColumnName()))) {
+// sortBy.setColumnName(applicationAmendmentPaginationRequestBean.getGlobalFilters().getSortBy().getColumnName());
+// sortBy.setSortDesc(true);
+// if (applicationAmendmentPaginationRequestBean.getGlobalFilters().getSortBy().getSortDesc() != null) {
+// sortBy.setSortDesc(applicationAmendmentPaginationRequestBean.getGlobalFilters().getSortBy().getSortDesc());
+// }
+// }
+//
+// query.orderBy(criteriaBuilder.desc(root.get(sortBy.getColumnName())));
+// if (Boolean.FALSE.equals(sortBy.getSortDesc())) {
+// query.orderBy(criteriaBuilder.asc(root.get(sortBy.getColumnName())));
+// }
+// return query.where(criteriaBuilder.and(predicates.toArray(new Predicate[0]))).getRestriction();
+// };
+// }
+//
+//
+// private List getPredicates(ApplicationAmendmentPaginationRequestBean amendmentPaginationRequestBean,
+// CriteriaBuilder criteriaBuilder, Root root,Long userId) {
+//
+// Integer year = null;
+// String search = null;
+// if (amendmentPaginationRequestBean.getGlobalFilters() != null) {
+// year = amendmentPaginationRequestBean.getGlobalFilters().getYear();
+// search = amendmentPaginationRequestBean.getGlobalFilters().getSearch();
+// }
+// List predicates = new ArrayList<>();
+//
+// if (year != null && year > 0) {
+// int filterYear = amendmentPaginationRequestBean.getGlobalFilters().getYear();
+//
+//// Create LocalDateTime boundaries for the start and end of the year
+// LocalDateTime startOfYear = LocalDateTime.of(filterYear, 1, 1, 0, 0);
+// LocalDateTime endOfYear = LocalDateTime.of(filterYear, 12, 31, 23, 59, 59);
+//
+//// Add the range comparison to filter records within the year
+// predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear));
+//
+// }
+// // Search in `title` and `message` (if search term is provided)
+// if (search != null && !search.isEmpty()) {
+// Predicate notePredicate = criteriaBuilder.like(
+// criteriaBuilder.upper(root.get(GepafinConstant.NOTE)),
+// "%" + search.toUpperCase() + "%"
+// );
+// predicates.add(criteriaBuilder.or(notePredicate));
+// Predicate internalNotePredicate = criteriaBuilder.like(
+// criteriaBuilder.upper(root.get(GepafinConstant.INTERNAL_NOTE)),
+// "%" + search.toUpperCase() + "%"
+// );
+// predicates.add(criteriaBuilder.or(internalNotePredicate));
+// }
+//
+// // Filter by `status` (if status list is provided)
+// if (amendmentPaginationRequestBean.getStatus() != null && !amendmentPaginationRequestBean.getStatus().isEmpty()) {
+// List statusValues = amendmentPaginationRequestBean.getStatus().stream()
+// .map(ApplicationAmendmentRequestEnum::name) // Convert enum to string
+// .toList();
+// predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
+// }
+// if(Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
+// predicates.add(root.get("applicationEvaluationEntity").get("assignedApplicationsEntity").get("application").get("userId").in(userId));
+// }
+// else {
+// predicates.add(root.get("applicationEvaluationEntity").get("assignedApplicationsEntity").get("userId").in(userId));
+// }
+//
+// return predicates;
+//
+// }
+
+ public PageableResponseBean> getApplicationAmendmentByPaginationByView(Long userId, ApplicationAmendmentPaginationRequestBean applicationAmendmentPaginationRequestBean) {
Integer pageNo = null;
Integer pageLimit = null;
if (applicationAmendmentPaginationRequestBean.getGlobalFilters() != null) {
@@ -1281,20 +1402,20 @@ public class ApplicationAmendmentRequestDao {
if (pageNo == null || pageNo <= 0) {
pageNo = GepafinConstant.DEFAULT_PAGE;
}
- Specification spec = searchPagination(userId,applicationAmendmentPaginationRequestBean);
- Page entityPage = applicationAmendmentRequestRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit));
+ Specification spec = searchPaginationByView(userId,applicationAmendmentPaginationRequestBean);
+ Page entityPage = applicationAmendmentRequestViewRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit));
- List applicationResponses = entityPage.getContent().stream()
- .map(application -> {
- ApplicationAmendmentRequestResponse response = convertEntityToResponse(application,false);
+ List applicationAmendmentRequestViewResponses = entityPage.getContent().stream()
+ .map(amendmentRequestView -> {
+ ApplicationAmendmentRequestViewResponse response = convertAmendmentEntityToApplicationAmendmentRequestViewResponse(amendmentRequestView);
return response;
})
.collect(Collectors.toList());
- PageableResponseBean> pageableResponseBean = new PageableResponseBean<>();
- pageableResponseBean.setBody(applicationResponses);
+ PageableResponseBean> pageableResponseBean = new PageableResponseBean<>();
+ pageableResponseBean.setBody(applicationAmendmentRequestViewResponses);
pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing
pageableResponseBean.setTotalPages(entityPage.getTotalPages());
pageableResponseBean.setTotalRecords(entityPage.getTotalElements());
@@ -1302,11 +1423,10 @@ public class ApplicationAmendmentRequestDao {
return pageableResponseBean;
}
-
- public Specification searchPagination(Long userId,ApplicationAmendmentPaginationRequestBean applicationAmendmentPaginationRequestBean) {
+ public Specification searchPaginationByView(Long userId,ApplicationAmendmentPaginationRequestBean applicationAmendmentPaginationRequestBean) {
return (root, query, criteriaBuilder) -> {
- List predicates = getPredicates(applicationAmendmentPaginationRequestBean, criteriaBuilder, root,userId);
+ List predicates = getPredicatesByView(applicationAmendmentPaginationRequestBean, criteriaBuilder, root,userId);
SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
if (applicationAmendmentPaginationRequestBean .getGlobalFilters() != null
@@ -1329,15 +1449,19 @@ public class ApplicationAmendmentRequestDao {
}
- private List getPredicates(ApplicationAmendmentPaginationRequestBean amendmentPaginationRequestBean,
- CriteriaBuilder criteriaBuilder, Root root,Long userId) {
+ private List getPredicatesByView(ApplicationAmendmentPaginationRequestBean amendmentPaginationRequestBean,
+ CriteriaBuilder criteriaBuilder, Root root,Long userId) {
Integer year = null;
String search = null;
+ Map filters = new HashMap<>();
if (amendmentPaginationRequestBean.getGlobalFilters() != null) {
year = amendmentPaginationRequestBean.getGlobalFilters().getYear();
search = amendmentPaginationRequestBean.getGlobalFilters().getSearch();
}
+ if (amendmentPaginationRequestBean.getFilters() != null) {
+ filters = amendmentPaginationRequestBean.getFilters();
+ }
List predicates = new ArrayList<>();
if (year != null && year > 0) {
@@ -1351,19 +1475,37 @@ public class ApplicationAmendmentRequestDao {
predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear));
}
- // Search in `title` and `message` (if search term is provided)
+
if (search != null && !search.isEmpty()) {
- Predicate notePredicate = criteriaBuilder.like(
- criteriaBuilder.upper(root.get(GepafinConstant.NOTE)),
+ List searchPredicates = new ArrayList<>();
+
+ searchPredicates.add(criteriaBuilder.like(
+ criteriaBuilder.upper(root.get(GepafinConstant.CALL_NAME)),
"%" + search.toUpperCase() + "%"
- );
- predicates.add(criteriaBuilder.or(notePredicate));
- Predicate internalNotePredicate = criteriaBuilder.like(
- criteriaBuilder.upper(root.get(GepafinConstant.INTERNAL_NOTE)),
+ ));
+
+ searchPredicates.add(criteriaBuilder.like(
+ criteriaBuilder.upper(root.get(GepafinConstant.COMPANY_NAME)),
"%" + search.toUpperCase() + "%"
- );
- predicates.add(criteriaBuilder.or(internalNotePredicate));
+ ));
+
+ // Uncomment these if needed
+ // searchPredicates.add(criteriaBuilder.like(
+ // criteriaBuilder.upper(root.get(GepafinConstant.NOTE)),
+ // "%" + search.toUpperCase() + "%"
+ // ));
+ //
+ // searchPredicates.add(criteriaBuilder.like(
+ // criteriaBuilder.upper(root.get(GepafinConstant.INTERNAL_NOTE)),
+ // "%" + search.toUpperCase() + "%"
+ // ));
+
+ Predicate finalPredicate = criteriaBuilder.or(searchPredicates.toArray(new Predicate[0]));
+
+ predicates.add(finalPredicate);
}
+ Utils.applyFiltersByPagination(root, criteriaBuilder, predicates, filters);
+
// Filter by `status` (if status list is provided)
if (amendmentPaginationRequestBean.getStatus() != null && !amendmentPaginationRequestBean.getStatus().isEmpty()) {
@@ -1372,14 +1514,33 @@ public class ApplicationAmendmentRequestDao {
.toList();
predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
}
- if(Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
- predicates.add(root.get("applicationEvaluationEntity").get("assignedApplicationsEntity").get("application").get("userId").in(userId));
- }
- else {
- predicates.add(root.get("applicationEvaluationEntity").get("assignedApplicationsEntity").get("userId").in(userId));
+ boolean isBeneficiaryOrConfidi = validator.checkIsBeneficiary() || validator.checkIsConfidi();
+ boolean isPreInstructor = validator.checkIsPreInstructor();
+ boolean isInstructorManagerWithPersonalRecords = validator.checkIsInstructorManager() &&
+ Boolean.TRUE.equals(amendmentPaginationRequestBean.getPersonalRecords());
+
+ if (isBeneficiaryOrConfidi) {
+ predicates.add(root.get(GepafinConstant.APPLICATION_USER_ID).in(userId));
+ } else if (isPreInstructor || isInstructorManagerWithPersonalRecords) {
+ predicates.add(root.get(GepafinConstant.ASSIGNED_USER_ID).in(userId));
}
return predicates;
}
+ public ApplicationAmendmentRequestViewResponse convertAmendmentEntityToApplicationAmendmentRequestViewResponse(ApplicationAmendmentRequestView applicationAmendmentRequestView){
+ ApplicationAmendmentRequestViewResponse applicationAmendmentRequestViewResponse=new ApplicationAmendmentRequestViewResponse();
+ applicationAmendmentRequestViewResponse.setId(applicationAmendmentRequestView.getId());
+ applicationAmendmentRequestViewResponse.setApplicationId(applicationAmendmentRequestView.getApplicationId());
+ applicationAmendmentRequestViewResponse.setProtocolNumber(applicationAmendmentRequestView.getProtocolNumber());
+ applicationAmendmentRequestViewResponse.setCallName(applicationAmendmentRequestView.getCallName());
+ applicationAmendmentRequestViewResponse.setCompanyName(applicationAmendmentRequestView.getCompanyName());
+ applicationAmendmentRequestViewResponse.setStartDate(applicationAmendmentRequestView.getStartDate());
+ applicationAmendmentRequestViewResponse.setExpirationDate(applicationAmendmentRequestView.getExpirationDate());
+ applicationAmendmentRequestViewResponse.setAssigendUserName(applicationAmendmentRequestView.getAssigendUserName());
+ applicationAmendmentRequestViewResponse.setStatus(applicationAmendmentRequestView.getStatus());
+ return applicationAmendmentRequestViewResponse;
+ }
+
+
}
diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java
index d6b66527..e95e1c8b 100644
--- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java
+++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java
@@ -132,8 +132,6 @@ public class ApplicationDao {
@Value("${rinaldo_email}")
private String rinaldoEmail;
- @Value("${carlo_email}")
- private String carloEmail;
@Value("${call.id}")
private String callId;
@@ -198,6 +196,9 @@ public class ApplicationDao {
@Autowired
private ApplicationEvaluationRepository applicationEvaluationRepository;
+ @Autowired
+ private ApplicationViewRepository applicationViewRepository;
+
@Autowired
private ApplicationFormViewRepository applicationFormViewRepository;
@@ -976,6 +977,13 @@ public class ApplicationDao {
applicationEntity.setStatus(status.getValue());
log.info("Status updated to DRAFT for applicationId: " + applicationId);
}
+ if (status.equals(ApplicationStatusTypeEnum.AWAITING) && Boolean.TRUE.equals(applicationEntity.getStatus().equals(ApplicationStatusTypeEnum.READY.getValue()))) {
+ ApplicationSignedDocumentEntity applicationSignedDocument = applicationSignedDocumentRepository.findByApplicationIdAndStatus(applicationId,
+ ApplicationSignedDocumentStatusEnum.ACTIVE.getValue());
+ deleteSignedDocumentFromS3(applicationSignedDocument);
+ applicationEntity.setStatus(status.getValue());
+ log.info("Status updated to AWAITING for applicationId: " + applicationId);
+ }
applicationEntity = applicationRepository.save(applicationEntity);
log.info("Application status updated successfully | applicationId: {}, newStatus: {}", applicationId, applicationEntity.getStatus());
@@ -1150,24 +1158,6 @@ public class ApplicationDao {
EmailLogRequest emailLogRequest=emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(),RecipientTypeEnum.PROPERTIES,null,userEntity.getEmail(),userEntity.getId(),applicationEntity.getId(),null,applicationEntity.getCall().getId());
-// mailUtil.sendByMailGun(subject, body, List.of(defaultSystemReceiverEmail), null);
-// mailUtil.sendByMailGun(subject, body, List.of(gepafinEmail), null);
-// mailUtil.sendByMailGun(subject, body, List.of(rinaldoEmail), null);
-// if(Boolean.TRUE.equals(hub.getUniqueUuid().equals(defaultHubUuid))) {
-// if (validator.isProductionProfileActivated()) {
-// emailLogRequest.setRecipientEmails(carloEmail);
-//// mailUtil.sendByMailGun(subject, body, List.of(carloEmail), null);
-// emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(carloEmail),emailLogRequest);
-// }
-// List listDefaultSystemReceiverEmail = Arrays.stream(defaultSystemReceiverEmail.split(","))
-// .map(String::trim)
-// .filter(email -> !email.isEmpty())
-// .toList();
-//
-// emailLogRequest.setRecipientEmails(defaultSystemReceiverEmail);
-// emailNotificationDao.sendMail(hub.getId(), subject, body, listDefaultSystemReceiverEmail, emailLogRequest);
-// }
-
List hubEmails = Arrays.stream(hub.getEmail().split(","))
.map(String::trim)
.filter(email -> !email.isEmpty())
@@ -1192,9 +1182,7 @@ public class ApplicationDao {
ApplicationSignedDocumentEntity oldApplicationSingedDocumentData = Utils.getClonedEntityForData(applicationSignedDocument);
if (applicationSignedDocument != null) {
- throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.APPLICATION_ALREADY_ASSIGNED));
- // applicationSignedDocument.setStatus(ApplicationSignedDocumentStatusEnum.INACTIVE.getValue());
- // applicationSignedDocumentRepository.save(applicationSignedDocument);
+ deleteSignedDocumentFromS3(applicationSignedDocument);
}
UploadFileOnAmazonS3Response uploadFileOnAmazonS3 = uploadFileOnAmazonS3ForUserSignedDocument(file, applicationEntity.getCall().getId(), applicationId);
applicationSignedDocument = new ApplicationSignedDocumentEntity();
@@ -1217,6 +1205,19 @@ public class ApplicationDao {
return convertApplicationSignedDocumentToApplicationSignedDocumentResponse(applicationSignedDocument);
}
+ public void deleteSignedDocumentFromS3(ApplicationSignedDocumentEntity applicationSignedDocumentEntity){
+ ApplicationSignedDocumentEntity oldApplicationSignedDocument = Utils.getClonedEntityForData(applicationSignedDocumentEntity);
+ String oldS3Path = applicationSignedDocumentEntity.getFilePath();
+ String newS3Path = s3ConfigBean.generateDocumentPathForOther(DocOtherSourceTypeEnum.DELETED_USER_SIGNED_DOCUMENT,applicationSignedDocumentEntity.getApplication().getCall().getId(),applicationSignedDocumentEntity.getApplication().getId(),0L);
+
+ UploadFileOnAmazonS3Response response = amazonS3Service.moveFile(applicationSignedDocumentEntity.getFileName(), oldS3Path, newS3Path);
+ applicationSignedDocumentEntity.setStatus(ApplicationSignedDocumentStatusEnum.INACTIVE.getValue());
+ applicationSignedDocumentEntity.setFileName(response.getFileName());
+ applicationSignedDocumentEntity.setFilePath(response.getFilePath());
+
+ applicationSignedDocumentRepository.save(applicationSignedDocumentEntity);
+ loggingUtil.addVersionHistory(VersionHistoryRequest.builder().request(request).actionType(VersionActionTypeEnum.SOFT_DELETE).oldData(oldApplicationSignedDocument).newData(applicationSignedDocumentEntity).build());
+ }
private void validateFileTypeForCall(MultipartFile file, ApplicationEntity applicationEntity) {
List validCallIds = Arrays.asList(callId.split(","));
@@ -1460,279 +1461,22 @@ public class ApplicationDao {
}
}
- public PageableResponseBean> getAllApplicationByPagination(UserEntity userEntity, Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean) {
- Integer pageNo = null;
- Integer pageLimit = null;
- UserWithCompanyEntity userWithCompany= userWithCompanyRepository.findByUserIdAndCompanyIdAndIsDeletedFalse(userEntity.getId(), companyId).orElse(null);
- Long userWithCompanyId = userWithCompany!=null?userWithCompany.getId():null;
- if (applicationPageableRequestBean.getGlobalFilters() != null) {
- pageNo = applicationPageableRequestBean.getGlobalFilters().getPage();
- pageLimit = applicationPageableRequestBean.getGlobalFilters().getLimit();
- }
- if (pageLimit == null || pageLimit <= 0) {
- pageLimit = GepafinConstant.DEFAULT_PAGE_LIMIT;
- }
- if (pageNo == null || pageNo <= 0) {
- pageNo = GepafinConstant.DEFAULT_PAGE;
- }
- Specification spec = search(callId,companyId, userWithCompanyId, applicationPageableRequestBean, userEntity);
- Page entityPage = applicationRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit));
- // Prepare the response
-
-
- List applicationResponses = entityPage.getContent().stream()
- .map(application -> {
- ApplicationResponse response = getApplicationResponse(application);
- return response;
- })
- .collect(Collectors.toList());
-
-
- PageableResponseBean> pageableResponseBean = new PageableResponseBean<>();
- pageableResponseBean.setBody(applicationResponses);
- pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing
- pageableResponseBean.setTotalPages(entityPage.getTotalPages());
- pageableResponseBean.setTotalRecords(entityPage.getTotalElements());
- pageableResponseBean.setPageSize(entityPage.getSize());
-
- return pageableResponseBean;
- }
-
- public Specification search(Long callId, Long companyId, Long userWithCompanyId, ApplicationPageableRequestBean applicationPageableRequestBean, UserEntity userEntity) {
- return (root, query, criteriaBuilder) -> {
-
- List predicates = getPredicates(applicationPageableRequestBean, criteriaBuilder, root, callId,companyId, userWithCompanyId, userEntity);
- SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
-
- if (applicationPageableRequestBean.getGlobalFilters() != null
- && applicationPageableRequestBean.getGlobalFilters().getSortBy() != null &&
- applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName() != null && Boolean.FALSE.equals(
- isEmpty(applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName()))) {
- sortBy.setColumnName(applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName());
- sortBy.setSortDesc(true);
- if (applicationPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc() != null) {
- sortBy.setSortDesc(applicationPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc());
- }
- }
-
- query.orderBy(criteriaBuilder.desc(root.get(sortBy.getColumnName())));
- if (Boolean.FALSE.equals(sortBy.getSortDesc())) {
- query.orderBy(criteriaBuilder.asc(root.get(sortBy.getColumnName())));
- }
- return query.where(criteriaBuilder.and(predicates.toArray(new Predicate[0]))).getRestriction();
- };
- }
-
-
- private List getPredicates(ApplicationPageableRequestBean applicationPageableRequestBean,
- CriteriaBuilder criteriaBuilder, Root root, Long callId,Long companyId, Long userWithCompanyId, UserEntity userEntity) {
-
- Integer year = null;
- String search = null;
- Integer daysRange = null;
- Map filters = new HashMap<>();
- if (applicationPageableRequestBean.getGlobalFilters() != null) {
- year = applicationPageableRequestBean.getGlobalFilters().getYear();
- search = applicationPageableRequestBean.getGlobalFilters().getSearch();
- daysRange = applicationPageableRequestBean.getDaysRange();
- }
- if (applicationPageableRequestBean.getFilters() != null) {
- filters = applicationPageableRequestBean.getFilters();
- }
- List predicates = new ArrayList<>();
-
-// Boolean isBeneficiary = validator.checkIsBeneficiary();
- if (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
- predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_ID), userEntity.getId()));
- }
- if (year != null && year > 0) {
- int filterYear = applicationPageableRequestBean.getGlobalFilters().getYear();
-
-// Create LocalDateTime boundaries for the start and end of the year
- LocalDateTime startOfYear = LocalDateTime.of(filterYear, 1, 1, 0, 0);
- LocalDateTime endOfYear = LocalDateTime.of(filterYear, 12, 31, 23, 59, 59);
-
-// Add the range comparison to filter records within the year
- predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear));
-
- }
- // Search in `title` and `message` (if search term is provided)
- if (search != null && !search.isEmpty()) {
- Predicate titlePredicate = criteriaBuilder.like(
- criteriaBuilder.upper(root.get(GepafinConstant.COMMENTS)),
- "%" + search.toUpperCase() + "%"
- );
-// Predicate protocolPredicate = criteriaBuilder.like(
-// criteriaBuilder.function(
-// "TO_CHAR",
-// String.class,
-// criteriaBuilder.function("CAST", String.class, root.get(GepafinConstant.PROTOCOL).get(GepafinConstant.PROTOCOL_NUMBER))
-// ),
-// "%" + search + "%"
-// );
-
- Predicate callNamePredicate =criteriaBuilder.like(
- criteriaBuilder.upper(root.get(GepafinConstant.CALL).get(GepafinConstant.NAME)), // Adjust field name
- "%" + search.toUpperCase() + "%"
- );
-
-// predicates.add(criteriaBuilder.or(protocolPredicate));
- predicates.add(criteriaBuilder.or(callNamePredicate));
- predicates.add(criteriaBuilder.or(titlePredicate));
- }
-
- // Filter by `status` (if status list is provided)
- if (applicationPageableRequestBean.getStatus() != null && !applicationPageableRequestBean.getStatus().isEmpty()) {
- List statusValues = applicationPageableRequestBean.getStatus().stream()
- .map(ApplicationStatusTypeEnum::name) // Convert enum to string
- .toList();
- predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
- }
-
- if (callId != null) {
- CallEntity call = callService.validateCall(callId);
- predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.CALL).get(GepafinConstant.ID), callId));
- }
-
- // Optional companyId filter
- if (userWithCompanyId != null) {
- predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_WITH_COMPANY).get(GepafinConstant.ID), userWithCompanyId));
- }
- if (companyId != null) {
- predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.COMPANY_ID), companyId));
- }
-
- if (daysRange != null && daysRange >= 0) {
- LocalDateTime today = LocalDateTime.now();
- LocalDateTime pastDate = today.minusDays(daysRange);
- predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), pastDate, today));
- }
- applyFilters(root, criteriaBuilder, predicates, filters);
-
- predicates.add(criteriaBuilder.isFalse(root.get(GepafinConstant.IS_DELETED)));
-
- predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.HUB_ID), userEntity.getHub().getId()));
-
-
- return predicates;
- }
- private void applyFilters(Root> root, CriteriaBuilder criteriaBuilder, List predicates, Map filters) {
- if (Boolean.FALSE.equals(filters.isEmpty())) {
- for (Map.Entry entry : filters.entrySet()) {
- String fieldName = entry.getKey();
- FilterCriteria filterCriteria = entry.getValue();
- Object value = filterCriteria.getValue();
- MatchModeEnum matchMode = filterCriteria.getMatchMode();
-
- if (value != null && matchMode != null) {
- Path> fieldPath = getFieldPath(root, fieldName);
- if (fieldPath != null) {
- applyStringFilter(fieldPath, criteriaBuilder, predicates, value, matchMode);
- applyNumberFilter(fieldPath, criteriaBuilder, predicates, value, matchMode);
- applyDateFilter(fieldPath, criteriaBuilder, predicates, value, matchMode,root);
- }
- }
- }
- }
- }
-
- private void applyStringFilter(Path> fieldPath, CriteriaBuilder criteriaBuilder, List predicates, Object value, MatchModeEnum matchMode) {
- if (value instanceof String) {
- String valueStr = (String) value;
- if (fieldPath.getJavaType().equals(String.class)) {
- MatchModeEnum mode = MatchModeEnum.fromObject(matchMode.getValue());
- switch (mode) {
- case CONTAINS ->
- predicates.add(criteriaBuilder.like(criteriaBuilder.lower(fieldPath.as(String.class)), "%" + valueStr.toLowerCase() + "%"));
- case EQUALS -> predicates.add(criteriaBuilder.equal(fieldPath, valueStr));
- case STARTSWITH ->
- predicates.add(criteriaBuilder.like(criteriaBuilder.lower(fieldPath.as(String.class)), valueStr.toLowerCase() + "%"));
- case ENDSWITH ->
- predicates.add(criteriaBuilder.like(criteriaBuilder.lower(fieldPath.as(String.class)), "%" + valueStr.toLowerCase()));
- }
- }
- }
- }
-
- private void applyNumberFilter(Path> fieldPath, CriteriaBuilder criteriaBuilder, List predicates, Object value, MatchModeEnum matchMode) {
- if (Number.class.isAssignableFrom(fieldPath.getJavaType())) {
- Number numberValue = null;
- if (value instanceof Number) {
- numberValue = (Number) value;
- }
- MatchModeEnum mode = MatchModeEnum.fromObject(matchMode.getValue());
- switch (mode) {
- case EQUALS -> predicates.add(criteriaBuilder.equal(fieldPath, numberValue));
- }
- }
- }
-
-
-
-
- private void applyDateFilter(Path> fieldPath, CriteriaBuilder criteriaBuilder, List predicates, Object value, MatchModeEnum matchMode, Root> root) {
- if (fieldPath.getJavaType().equals(LocalDateTime.class)) {
- // Convert input string: Replace 'T' with space
- String formattedValue = value.toString().replace("T", " ");
-
- // Handle timezones and UTC (`Z` or `+HH:mm`)
- if (formattedValue.contains("Z") || formattedValue.matches(".*[+-]\\d{2}:\\d{2}$")) {
- OffsetDateTime offsetDateTime = OffsetDateTime.parse(value.toString(), DateTimeFormatter.ISO_OFFSET_DATE_TIME);
- formattedValue = offsetDateTime.toLocalDateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
- }
-
- // Check if more than 3 decimal places exist
- if (formattedValue.contains(".")) {
- int dotIndex = formattedValue.indexOf(".");
- if (formattedValue.length() > dotIndex + 4) {
- formattedValue = formattedValue.substring(0, dotIndex + 4); // Keep only 3 decimals
- }
- } else {
- formattedValue += ".000"; // Ensure 3 decimals
- }
-
- // Define correct date-time format
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
-
- // Parse the formatted value into LocalDateTime
- LocalDateTime dateTimeValue = LocalDateTime.parse(formattedValue, formatter);
-
- // Extract only the date portion
- LocalDate dateValue = dateTimeValue.toLocalDate();
-
- // Convert database field to LocalDate for date-only comparison
- Expression dateField = criteriaBuilder.function("DATE", LocalDate.class, fieldPath);
-
- MatchModeEnum mode = MatchModeEnum.fromObject(matchMode.getValue());
-
- switch (mode) {
- case DATEIS -> predicates.add(criteriaBuilder.equal(dateField, dateValue));
- case DATEISNOT -> predicates.add(criteriaBuilder.notEqual(dateField, dateValue));
- case BEFORE -> predicates.add(criteriaBuilder.lessThan(fieldPath.as(Timestamp.class), Timestamp.valueOf(dateTimeValue)));
- case AFTER -> predicates.add(criteriaBuilder.greaterThan(fieldPath.as(Timestamp.class), Timestamp.valueOf(dateTimeValue)));
- }
- }
- }
-
-
-
-
- private Path> getFieldPath(Root> root, String fieldName) {
- try {
- return switch (fieldName) {
- case GepafinConstant.CALL_ID -> root.get(GepafinConstant.CALL).get(GepafinConstant.ID);
- case GepafinConstant.CALL_TITLE -> root.get(GepafinConstant.CALL).get(GepafinConstant.NAME);
- case GepafinConstant.CALL_END_DATE -> root.get(GepafinConstant.CALL).get(GepafinConstant.END_DATE);
- case GepafinConstant.CALL_END_TIME -> root.get(GepafinConstant.CALL).get(GepafinConstant.END_TIME);
- case GepafinConstant.MODIFIED_DATE -> root.get(GepafinConstant.CALL).get(GepafinConstant.UPDATED_DATE);
- case GepafinConstant.PROTOCOL_NUMBER-> root.get(GepafinConstant.PROTOCOL).get(GepafinConstant.PROTOCOL_NUMBER);
- default -> root.get(fieldName);
- };
- } catch (IllegalArgumentException e) {
- return null;
- }
- }
+// private Path> getFieldPath(Root> root, String fieldName) {
+// try {
+// return switch (fieldName) {
+//// case GepafinConstant.CALL_ID -> root.get(GepafinConstant.CALL).get(GepafinConstant.ID);
+//// case GepafinConstant.CALL_TITLE -> root.get(GepafinConstant.CALL).get(GepafinConstant.NAME);
+//// case GepafinConstant.CALL_END_DATE -> root.get(GepafinConstant.CALL).get(GepafinConstant.END_DATE);
+//// case GepafinConstant.CALL_END_TIME -> root.get(GepafinConstant.CALL).get(GepafinConstant.END_TIME);
+//// case GepafinConstant.MODIFIED_DATE -> root.get(GepafinConstant.CALL).get(GepafinConstant.UPDATED_DATE);
+//// case GepafinConstant.PROTOCOL_NUMBER-> root.get(GepafinConstant.PROTOCOL).get(GepafinConstant.PROTOCOL_NUMBER);
+// default -> root.get(fieldName);
+// };
+// } catch (IllegalArgumentException e) {
+// return null;
+// }
+// }
public void checkCallEndDate(CallEntity call) {
@@ -1890,6 +1634,195 @@ public class ApplicationDao {
}
return application;
}
+ public PageableResponseBean> getAllApplicationByPaginationByView(UserEntity userEntity, Long callId, Long companyId, ApplicationPageableRequestBean applicationPageableRequestBean) {
+ Integer pageNo = null;
+ Integer pageLimit = null;
+
+ UserWithCompanyEntity userWithCompany= userWithCompanyRepository.findByUserIdAndCompanyIdAndIsDeletedFalse(userEntity.getId(), companyId).orElse(null);
+ Long userWithCompanyId = userWithCompany!=null?userWithCompany.getId():null;
+ if (applicationPageableRequestBean.getGlobalFilters() != null) {
+ pageNo = applicationPageableRequestBean.getGlobalFilters().getPage();
+ pageLimit = applicationPageableRequestBean.getGlobalFilters().getLimit();
+ }
+ if (pageLimit == null || pageLimit <= 0) {
+ pageLimit = GepafinConstant.DEFAULT_PAGE_LIMIT;
+ }
+ if (pageNo == null || pageNo <= 0) {
+ pageNo = GepafinConstant.DEFAULT_PAGE;
+ }
+ Specification spec = searchByView(callId,companyId, userWithCompanyId, applicationPageableRequestBean, userEntity);
+ Page entityPage = applicationViewRepository.findAll(spec, PageRequest.of(pageNo - 1, pageLimit));
+ // Prepare the response
+
+
+ List applicationResponses = entityPage.getContent().stream()
+ .map(application -> {
+ ApplicationResponse response = getApplicationResponseByView(application);
+ return response;
+ })
+ .collect(Collectors.toList());
+
+
+ PageableResponseBean> pageableResponseBean = new PageableResponseBean<>();
+ pageableResponseBean.setBody(applicationResponses);
+ pageableResponseBean.setCurrentPage(entityPage.getNumber() + 1); // Page numbers typically start from 0, so add 1 for user-friendly indexing
+ pageableResponseBean.setTotalPages(entityPage.getTotalPages());
+ pageableResponseBean.setTotalRecords(entityPage.getTotalElements());
+ pageableResponseBean.setPageSize(entityPage.getSize());
+
+ return pageableResponseBean;
+ }
+
+ public Specification searchByView(Long callId, Long companyId, Long userWithCompanyId, ApplicationPageableRequestBean applicationPageableRequestBean, UserEntity userEntity) {
+ return (root, query, criteriaBuilder) -> {
+
+ List predicates = getPredicatesByView(applicationPageableRequestBean, criteriaBuilder, root, callId,companyId, userWithCompanyId, userEntity);
+ SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
+
+ if (applicationPageableRequestBean.getGlobalFilters() != null
+ && applicationPageableRequestBean.getGlobalFilters().getSortBy() != null &&
+ applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName() != null && Boolean.FALSE.equals(
+ isEmpty(applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName()))) {
+ sortBy.setColumnName(applicationPageableRequestBean.getGlobalFilters().getSortBy().getColumnName());
+ sortBy.setSortDesc(true);
+ if (applicationPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc() != null) {
+ sortBy.setSortDesc(applicationPageableRequestBean.getGlobalFilters().getSortBy().getSortDesc());
+ }
+ }
+
+ query.orderBy(criteriaBuilder.desc(root.get(sortBy.getColumnName())));
+ if (Boolean.FALSE.equals(sortBy.getSortDesc())) {
+ query.orderBy(criteriaBuilder.asc(root.get(sortBy.getColumnName())));
+ }
+ return query.where(criteriaBuilder.and(predicates.toArray(new Predicate[0]))).getRestriction();
+ };
+ }
+
+
+ private List getPredicatesByView(ApplicationPageableRequestBean applicationPageableRequestBean,
+ CriteriaBuilder criteriaBuilder, Root root, Long callId,Long companyId, Long userWithCompanyId, UserEntity userEntity) {
+
+ Integer year = null;
+ String search = null;
+ Integer daysRange = null;
+ Map filters = new HashMap<>();
+ if (applicationPageableRequestBean.getGlobalFilters() != null) {
+ year = applicationPageableRequestBean.getGlobalFilters().getYear();
+ search = applicationPageableRequestBean.getGlobalFilters().getSearch();
+ daysRange = applicationPageableRequestBean.getDaysRange();
+ }
+ if (applicationPageableRequestBean.getFilters() != null) {
+ filters = applicationPageableRequestBean.getFilters();
+ }
+ List predicates = new ArrayList<>();
+
+// Boolean isBeneficiary = validator.checkIsBeneficiary();
+ if (Boolean.TRUE.equals(validator.checkIsBeneficiary()) || Boolean.TRUE.equals(validator.checkIsConfidi())) {
+ predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_ID), userEntity.getId()));
+ }
+ if (year != null && year > 0) {
+ int filterYear = applicationPageableRequestBean.getGlobalFilters().getYear();
+
+// Create LocalDateTime boundaries for the start and end of the year
+ LocalDateTime startOfYear = LocalDateTime.of(filterYear, 1, 1, 0, 0);
+ LocalDateTime endOfYear = LocalDateTime.of(filterYear, 12, 31, 23, 59, 59);
+
+// Add the range comparison to filter records within the year
+ predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), startOfYear, endOfYear));
+
+ }
+ // Search in `title` and `message` (if search term is provided)
+ if (search != null && !search.isEmpty()) {
+ String searchPattern = "%" + search.toUpperCase() + "%";
+
+ Predicate titlePredicate = criteriaBuilder.like(
+ criteriaBuilder.upper(root.get(GepafinConstant.COMMENTS)),
+ searchPattern
+ );
+
+ Predicate callTitlePredicate = criteriaBuilder.like(
+ criteriaBuilder.upper(root.get(GepafinConstant.CALL_TITLE)),
+ searchPattern
+ );
+ Predicate callNamePredicate = criteriaBuilder.like(
+ criteriaBuilder.upper(root.get(GepafinConstant.CALL_NAME)),
+ searchPattern
+ );
+ Predicate companyName = criteriaBuilder.like(
+ criteriaBuilder.upper(root.get(GepafinConstant.COMPANY_NAME)),
+ searchPattern
+ );
+
+ // Combine them using a single `or()`
+ Predicate finalPredicate = criteriaBuilder.or(titlePredicate, callTitlePredicate,callNamePredicate,companyName);
+ predicates.add(finalPredicate);
+ }
+
+ // Filter by `status` (if status list is provided)
+ if (applicationPageableRequestBean.getStatus() != null && !applicationPageableRequestBean.getStatus().isEmpty()) {
+ List statusValues = applicationPageableRequestBean.getStatus().stream()
+ .map(ApplicationStatusTypeEnum::name) // Convert enum to string
+ .toList();
+ predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
+ }
+
+ if (callId != null) {
+ CallEntity call = callService.validateCall(callId);
+ predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.CALL_ID), callId));
+ }
+
+ // Optional companyId filter
+ if (userWithCompanyId != null) {
+ predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.USER_WITH_COMPANY_ID), userWithCompanyId));
+ }
+ if (companyId != null) {
+ predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.COMPANY_ID), companyId));
+ }
+
+ if (daysRange != null && daysRange >= 0) {
+ LocalDateTime today = LocalDateTime.now();
+ LocalDateTime pastDate = today.minusDays(daysRange);
+ predicates.add(criteriaBuilder.between(root.get(GepafinConstant.CREATED_DATE), pastDate, today));
+ }
+ Utils.applyFiltersByPagination(root, criteriaBuilder, predicates, filters);
+
+ predicates.add(criteriaBuilder.isFalse(root.get(GepafinConstant.IS_DELETED)));
+
+ predicates.add(criteriaBuilder.equal(root.get(GepafinConstant.HUB_ID), userEntity.getHub().getId()));
+
+
+ return predicates;
+ }
+
+ private ApplicationResponse getApplicationResponseByView(ApplicationView applicationView) {
+ ApplicationResponse responseBean = new ApplicationResponse();
+ List flowEdgesList = flowEdgesRepository.findByCallId(applicationView.getCallId());
+ Long totalFormSteps = flowFormDao.calculateTotalSteps(flowEdgesList);
+ Long completedSteps = Long.valueOf(flowFormDao.getCompletedStepsByView(applicationView.getId(), false));
+ Integer progress = calculateProgress(totalFormSteps, completedSteps);
+ responseBean.setId(applicationView.getId());
+ responseBean.setProgress(progress);
+ responseBean.setCallTitle(applicationView.getCallTitle());
+ responseBean.setCallEndDate(applicationView.getCallEndDate());
+ responseBean.setCallEndTime(applicationView.getCallEndTime());
+ responseBean.setModifiedDate(applicationView.getModifiedDate());
+ responseBean.setCallId(applicationView.getCallId());
+ responseBean.setSubmissionDate(applicationView.getSubmissionDate());
+ responseBean.setStatus(applicationView.getStatus());
+ responseBean.setEvaluationVersion(EvaluationVersionEnum.valueOf(applicationView.getEvaluationVersion()));
+ responseBean.setComments(applicationView.getComments());
+ responseBean.setCompanyId(applicationView.getCompanyId());
+ responseBean.setAssignedUserId(applicationView.getAssignedUserId());
+ responseBean.setAssignedUserName(applicationView.getAssignedUserName());
+ responseBean.setCompanyName(applicationView.getCompanyName());
+ responseBean.setProtocolNumber(applicationView.getProtocolNumber());
+ responseBean.setAmountAccepted(applicationView.getAmountAccepted());
+ responseBean.setAmountRequested(applicationView.getAmountRequested());
+ responseBean.setDateAccepted(applicationView.getDateAccepted());
+ responseBean.setDateRejected(applicationView.getDateRejected());
+ return responseBean;
+ }
+
public List getApplicationFormData(Long callId) {
List applicationFormViews=new ArrayList<>();
@@ -2199,4 +2132,6 @@ public class ApplicationDao {
tableDataByApp.put(appId, flattenedAll);
}
}
+
+
}
diff --git a/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java b/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java
index 46af8a26..9f135199 100644
--- a/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java
+++ b/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java
@@ -720,9 +720,11 @@ public class AppointmentDao {
// Build the appointment request body
AppointmentCreationRequest appointmentCreationRequest = buildAppointmentCreationRequest(applicationId, createAppointmentRequest, appointmentTemplateId,
templateRichiestaData);
+ log.info("AppointmentCreationRequest : {}", appointmentCreationRequest);
String appointmentRequestBody = Utils.convertObjectToJson(appointmentCreationRequest);
// Make API call to create the appointment
+ log.info("Context:{}, Authorization Token : {}, RequestBody : {}", context, authorizationToken, appointmentRequestBody);
ResponseEntity