Updated code
This commit is contained in:
@@ -243,11 +243,11 @@ public class FlowFormDao {
|
|||||||
.map(FlowEdgesEntity::getSourceId)
|
.map(FlowEdgesEntity::getSourceId)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
List<FormEntity> previousForms = formRepository.findByIdIn(previousFormIds);
|
List<ApplicationFormEntity> applicationFormEntities=applicationFormRepository.findByFormIdInAndApplicationId(previousFormIds,applicationEntity.getId());
|
||||||
|
|
||||||
previousForms.sort(Comparator.comparing(FormEntity::getCreatedDate).reversed());
|
applicationFormEntities.sort(Comparator.comparing(ApplicationFormEntity::getCreatedDate).reversed());
|
||||||
|
|
||||||
return previousForms.isEmpty() ? null : previousForms.get(0).getId();
|
return applicationFormEntities.isEmpty() ? null : applicationFormEntities.get(0).getForm().getId();
|
||||||
}
|
}
|
||||||
public NextOrPreviousFormResponse getnextOrPreviousForm(ApplicationEntity applicationEntity, Long formId,
|
public NextOrPreviousFormResponse getnextOrPreviousForm(ApplicationEntity applicationEntity, Long formId,
|
||||||
FormActionEnum action) {
|
FormActionEnum action) {
|
||||||
|
|||||||
@@ -221,8 +221,10 @@ public class FormDao {
|
|||||||
.validateCustom(value, fieldValidatorBean.getCustom(), fieldId); // Add the custom validation here
|
.validateCustom(value, fieldValidatorBean.getCustom(), fieldId); // Add the custom validation here
|
||||||
if (fieldValidatorBean.getCustom() != null && fieldValidatorBean.getCustom().equals(GepafinConstant.IS_PIVA)) {
|
if (fieldValidatorBean.getCustom() != null && fieldValidatorBean.getCustom().equals(GepafinConstant.IS_PIVA)) {
|
||||||
String error = validateVatNumber(value, fieldValidatorBean.getCustom(), fieldId);
|
String error = validateVatNumber(value, fieldValidatorBean.getCustom(), fieldId);
|
||||||
|
if(error != null) {
|
||||||
validator.addError(error);
|
validator.addError(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
validator.validate();
|
validator.validate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ public interface ApplicationFormRepository extends JpaRepository<ApplicationForm
|
|||||||
|
|
||||||
public List<ApplicationFormEntity> findByApplicationIdOrderByCreatedDateAsc(Long applicationId);
|
public List<ApplicationFormEntity> findByApplicationIdOrderByCreatedDateAsc(Long applicationId);
|
||||||
|
|
||||||
|
public List<ApplicationFormEntity> findByFormIdInAndApplicationId(List<Long> formIds,Long applicationId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user