Resolved conflicts

This commit is contained in:
nisha
2025-01-20 21:17:31 +05:30
11 changed files with 79 additions and 8 deletions

View File

@@ -388,5 +388,6 @@ public class GepafinConstant {
public static final String APPLICATION_PER_STATUS="applicationPerStatus"; public static final String APPLICATION_PER_STATUS="applicationPerStatus";
public static final String NON_EMPTY_TABLES="nonEmptyTables"; public static final String NON_EMPTY_TABLES="nonEmptyTables";
public static final String VALIDATION_IN_TABLE = "validation.table.message"; public static final String VALIDATION_IN_TABLE = "validation.table.message";
public static final String CALL_EXPIRED="call.expired";
} }

View File

@@ -49,7 +49,9 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
@@ -186,6 +188,7 @@ public class ApplicationDao {
// callService.validatePublishedCall(formEntity.getCall().getId()); // callService.validatePublishedCall(formEntity.getCall().getId());
validateFormFields(applicationRequestBean,formEntity); validateFormFields(applicationRequestBean,formEntity);
ApplicationEntity applicationEntity = validateApplication(applicationId); ApplicationEntity applicationEntity = validateApplication(applicationId);
checkCallEndDate(applicationEntity.getCall());
validator.validateUserWithCompany(request, applicationEntity.getCompanyId()); validator.validateUserWithCompany(request, applicationEntity.getCompanyId());
if(Boolean.FALSE.equals(applicationEntity.getStatus().equals(ApplicationStatusTypeEnum.DRAFT.getValue()))) { if(Boolean.FALSE.equals(applicationEntity.getStatus().equals(ApplicationStatusTypeEnum.DRAFT.getValue()))) {
throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.APPLICATION_NOT_IN_DRAFT_STATUS)); throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.APPLICATION_NOT_IN_DRAFT_STATUS));
@@ -405,6 +408,7 @@ public class ApplicationDao {
responseBean.setProgress(progress); responseBean.setProgress(progress);
responseBean.setCallTitle(applicationEntity.getCall().getName()); responseBean.setCallTitle(applicationEntity.getCall().getName());
responseBean.setCallEndDate(applicationEntity.getCall().getEndDate()); responseBean.setCallEndDate(applicationEntity.getCall().getEndDate());
responseBean.setCallEndTime(applicationEntity.getCall().getEndTime());
responseBean.setModifiedDate(applicationEntity.getCall().getUpdatedDate()); responseBean.setModifiedDate(applicationEntity.getCall().getUpdatedDate());
responseBean.setCallId(applicationEntity.getCall().getId()); responseBean.setCallId(applicationEntity.getCall().getId());
responseBean.setSubmissionDate(applicationEntity.getSubmissionDate()); responseBean.setSubmissionDate(applicationEntity.getSubmissionDate());
@@ -872,7 +876,7 @@ public class ApplicationDao {
ApplicationRequest applicationRequest, Long callId, UserEntity userEntity) { ApplicationRequest applicationRequest, Long callId, UserEntity userEntity) {
CallEntity call = callService.validateCall(callId); CallEntity call = callService.validateCall(callId);
UserWithCompanyEntity userWithCompanyEntity=companyService.getUserWithCompany(userEntity.getId(),companyEntity.getId()); UserWithCompanyEntity userWithCompanyEntity=companyService.getUserWithCompany(userEntity.getId(),companyEntity.getId());
checkCallEndDate(call);
// call = callService.validatePublishedCall(call.getId()); // call = callService.validatePublishedCall(call.getId());
// checkIfApplicationExists(call, userWithCompanyEntity, userEntity); // checkIfApplicationExists(call, userWithCompanyEntity, userEntity);
ApplicationEntity applicationEntity = createApplicationEntity(userEntity, call, userWithCompanyEntity); ApplicationEntity applicationEntity = createApplicationEntity(userEntity, call, userWithCompanyEntity);
@@ -890,7 +894,7 @@ public class ApplicationDao {
public ApplicationResponse updateApplicationStatus(HttpServletRequest request, Long applicationId, ApplicationStatusTypeEnum status) { public ApplicationResponse updateApplicationStatus(HttpServletRequest request, Long applicationId, ApplicationStatusTypeEnum status) {
ApplicationEntity applicationEntity = validateApplication(applicationId); ApplicationEntity applicationEntity = validateApplication(applicationId);
checkCallEndDate(applicationEntity.getCall());
//cloned entity for old application data //cloned entity for old application data
ApplicationEntity oldApplicationEntity = Utils.getClonedEntityForData(applicationEntity); ApplicationEntity oldApplicationEntity = Utils.getClonedEntityForData(applicationEntity);
@@ -1119,7 +1123,7 @@ public class ApplicationDao {
public ApplicationSignedDocumentResponse uploadSignedDocument(HttpServletRequest request, Long applicationId, public ApplicationSignedDocumentResponse uploadSignedDocument(HttpServletRequest request, Long applicationId,
MultipartFile file) { MultipartFile file) {
ApplicationEntity applicationEntity = validateApplication(applicationId); ApplicationEntity applicationEntity = validateApplication(applicationId);
checkCallEndDate(applicationEntity.getCall());
//cloned entity for old data //cloned entity for old data
ApplicationEntity oldApplicationData = Utils.getClonedEntityForData(applicationEntity); ApplicationEntity oldApplicationData = Utils.getClonedEntityForData(applicationEntity);
@@ -1252,6 +1256,7 @@ public class ApplicationDao {
ApplicationEntity applicationEntity = validateApplication(applicationId); ApplicationEntity applicationEntity = validateApplication(applicationId);
ApplicationEntity oldApplicationEntity = Utils.getClonedEntityForData(applicationEntity); ApplicationEntity oldApplicationEntity = Utils.getClonedEntityForData(applicationEntity);
checkCallEndDate(applicationEntity.getCall());
UserEntity userEntity = userService.validateUser(applicationEntity.getUserId()); UserEntity userEntity = userService.validateUser(applicationEntity.getUserId());
validator.validateUserWithCompany(request, applicationEntity.getCompanyId()); validator.validateUserWithCompany(request, applicationEntity.getCompanyId());
@@ -1516,4 +1521,21 @@ public class ApplicationDao {
return predicates; return predicates;
} }
public void checkCallEndDate(CallEntity call) {
LocalDateTime now = DateTimeUtil.DateServerToUTC(LocalDateTime.now());
LocalDateTime callEndDateTime = LocalDateTime.of(
call.getEndDate().toLocalDate(),
call.getEndTime()
);
if (now.isAfter(callEndDateTime)) {
throw new CustomValidationException(
Status.BAD_REQUEST,
Translator.toLocale(GepafinConstant.CALL_EXPIRED)
);
}
}
} }

View File

@@ -113,12 +113,21 @@ public class ApplicationEvaluationDao {
@Autowired @Autowired
private ApplicationAmendmentRequestDao applicationAmendmentRequestDao; private ApplicationAmendmentRequestDao applicationAmendmentRequestDao;
@Autowired
private HubService hubService;
private ApplicationEvaluationEntity convertToEntity(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) { private ApplicationEvaluationEntity convertToEntity(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) {
ApplicationEvaluationEntity entity = new ApplicationEvaluationEntity(); ApplicationEvaluationEntity entity = new ApplicationEvaluationEntity();
AssignedApplicationsEntity assignedApplications = assignedApplicationsService.validateAssignedApplication(assignedApplciationId); AssignedApplicationsEntity assignedApplications = assignedApplicationsService.validateAssignedApplication(assignedApplciationId);
ApplicationEntity application = applicationService.validateApplication(assignedApplications.getApplication().getId()); ApplicationEntity application = applicationService.validateApplication(assignedApplications.getApplication().getId());
Long hubId = application.getHubId();
HubEntity hub = hubService.valdateHub(hubId);
Long initialDays = (hub != null) ? hub.getEvaluationExpirationDays() : 0L;
entity.setApplicationId(application.getId()); entity.setApplicationId(application.getId());
entity.setAssignedApplicationsEntity(assignedApplications); entity.setAssignedApplicationsEntity(assignedApplications);
entity.setUserId(user.getId()); entity.setUserId(user.getId());
@@ -128,7 +137,7 @@ public class ApplicationEvaluationDao {
entity.setNote(req.getNote()); entity.setNote(req.getNote());
entity.setMotivation(req.getMotivation()); entity.setMotivation(req.getMotivation());
entity.setIsDeleted(false); entity.setIsDeleted(false);
entity.setInitialDays(30L); entity.setInitialDays(initialDays);
entity.setRemainingDays(30L); entity.setRemainingDays(30L);
entity.setSuspendedDays(0L); entity.setSuspendedDays(0L);
entity.setStartDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now())); entity.setStartDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));

View File

@@ -296,6 +296,8 @@ public class FlowFormDao {
applicationDao.processForm(formEntity, applicationEntity)); applicationDao.processForm(formEntity, applicationEntity));
nextOrPreviousFormResponse.setCallId(applicationEntity.getCall().getId()); nextOrPreviousFormResponse.setCallId(applicationEntity.getCall().getId());
nextOrPreviousFormResponse.setCallTitle(applicationEntity.getCall().getName()); nextOrPreviousFormResponse.setCallTitle(applicationEntity.getCall().getName());
nextOrPreviousFormResponse.setCallEndDate(applicationEntity.getCall().getEndDate());
nextOrPreviousFormResponse.setCallEndTime(applicationEntity.getCall().getEndTime());
nextOrPreviousFormResponse.setCompanyId(applicationEntity.getCompanyId()); nextOrPreviousFormResponse.setCompanyId(applicationEntity.getCompanyId());
nextOrPreviousFormResponse.setCompanyName(company.getCompanyName()); nextOrPreviousFormResponse.setCompanyName(company.getCompanyName());

View File

@@ -63,4 +63,7 @@ public class HubEntity extends BaseEntity{
@Column(name = "AREA_CODE") @Column(name = "AREA_CODE")
private String areaCode; private String areaCode;
@Column(name = "EVALUATION_EXPIRATION_DAYS")
private Long evaluationExpirationDays;
} }

View File

@@ -5,6 +5,7 @@ import net.gepafin.tendermanagement.model.response.ApplicationFormFieldResponseB
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List; import java.util.List;
@Data @Data
@@ -18,6 +19,8 @@ public class ApplicationResponse{
private LocalDateTime callEndDate; private LocalDateTime callEndDate;
private LocalTime callEndTime;
private LocalDateTime modifiedDate; private LocalDateTime modifiedDate;
private Integer progress; private Integer progress;

View File

@@ -5,6 +5,7 @@ import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime;
@Data @Data
public class NextOrPreviousFormResponse { public class NextOrPreviousFormResponse {
@@ -21,6 +22,10 @@ public class NextOrPreviousFormResponse {
private Long currentStep; private Long currentStep;
private LocalDateTime callEndDate;
private LocalTime callEndTime;
private Long companyId; private Long companyId;
private String companyName; private String companyName;

View File

@@ -153,11 +153,17 @@ public class AmazonS3ServiceImpl implements AmazonS3Service {
} }
} }
private String decodeS3Key(String key) {
return URLDecoder.decode(key, StandardCharsets.UTF_8);
}
@Override @Override
public UploadFileOnAmazonS3Response moveFile(String fileName, String oldPath, String newPath) { public UploadFileOnAmazonS3Response moveFile(String fileName, String oldPath, String newPath) {
try { try {
log.info("Original Paths - oldPath: {}, newPath: {}", oldPath, newPath);
oldPath = decodeS3Key(cleanOldPath(oldPath));
newPath = cleanNewPath(oldPath, newPath); newPath = cleanNewPath(oldPath, newPath);
oldPath = cleanOldPath(oldPath);
log.info("Moving file from {} to {} in bucket {}", oldPath, newPath, bucketName); log.info("Moving file from {} to {} in bucket {}", oldPath, newPath, bucketName);
CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, oldPath, bucketName, newPath); CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, oldPath, bucketName, newPath);

View File

@@ -2229,4 +2229,23 @@
<column name="date_rejected" type="TIMESTAMP WITHOUT TIME ZONE"></column> <column name="date_rejected" type="TIMESTAMP WITHOUT TIME ZONE"></column>
</addColumn> </addColumn>
</changeSet> </changeSet>
<changeSet id="16-01-2025_RK_173515" author="Rajesh Khore">
<addColumn tableName="hub">
<column name="evaluation_expiration_days" type="INTEGER"/>
</addColumn>
</changeSet>
<changeSet id="16-01-2025_RK_173616" author="Rajesh Khore">
<update tableName="hub">
<column name="evaluation_expiration_days" valueNumeric="999"/>
<where>unique_uuid = 't7jh5wfg9QXylNaTZkPoE'</where>
</update>
<update tableName="hub">
<column name="evaluation_expiration_days" valueNumeric="30"/>
<where>unique_uuid = 'p4lk3bcx1RStqTaIVVbXs'</where>
</update>
</changeSet>
</databaseChangeLog> </databaseChangeLog>

View File

@@ -351,3 +351,4 @@ user.with.company.not.found = User with company not found for user or company.
user.action.fetched.successfully = User action details fetched successfully. user.action.fetched.successfully = User action details fetched successfully.
action.context.labels.fetched.successfully = Action Context Labels Fetched Successfully. action.context.labels.fetched.successfully = Action Context Labels Fetched Successfully.
amount.accepted.required=Amount accepted is required while approving the application. amount.accepted.required=Amount accepted is required while approving the application.
call.expired=Call has been expired.

View File

@@ -304,7 +304,6 @@ beneficiary.call.duplicate = Una chiamata preferita con questo ID di chiamata e
user.must.be.associated.with.company.to.create.application=Devi essere associato a un'azienda per poter presentare domanda per questa applicazione. user.must.be.associated.with.company.to.create.application=Devi essere associato a un'azienda per poter presentare domanda per questa applicazione.
company.id.required.for.preferred.call=ID azienda obbligatorio quando si richiedono solo chiamate preferite. company.id.required.for.preferred.call=ID azienda obbligatorio quando si richiedono solo chiamate preferite.
response.days.not.null=I giorni di risposta non devono essere nulli e maggiori di zero. response.days.not.null=I giorni di risposta non devono essere nulli e maggiori di zero.
application.cannot.approved.or.rejected=La domanda non pu<70> essere approvata o rifiutata perch<63> l'emendamento <20> attivo.
valid.vatnumber.message=Il numero di partita IVA <20> valido. valid.vatnumber.message=Il numero di partita IVA <20> valido.
application.cannot.approved.or.rejected=La domanda non pu? essere approvata o rifiutata perch? l'emendamento ? attivo. application.cannot.approved.or.rejected=La domanda non pu? essere approvata o rifiutata perch? l'emendamento ? attivo.
@@ -343,3 +342,4 @@ user.action.fetched.successfully = Dettagli sull'azione dell'utente recuperati c
action.context.labels.fetched.successfully = Etichette del contesto dell'azione recuperate correttamente. action.context.labels.fetched.successfully = Etichette del contesto dell'azione recuperate correttamente.
amount.accepted.required=L'importo accettato <20> obbligatorio durante l'approvazione della domanda. amount.accepted.required=L'importo accettato <20> obbligatorio durante l'approvazione della domanda.
validation.table.message=I dati per il campo {0} non sono presenti. validation.table.message=I dati per il campo {0} non sono presenti.
call.expired=La chiamata <20> scaduta.