Done ticket GEPAFINBE-180

This commit is contained in:
rajesh
2025-03-06 20:00:34 +05:30
parent 6cdd99ae8a
commit 3664c2382e
4 changed files with 28 additions and 11 deletions

View File

@@ -378,6 +378,9 @@ public class ApplicationEvaluationDao {
case "fileupload":
mapFileFieldDetails(mappedField, formFieldId, applicationForm.getId(), applicationId);
break;
case "fileselect":
mapFileFieldDetails(mappedField, formFieldId, applicationForm.getId(), applicationId);
break;
case "checkboxes":
populateOptionFieldsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId, contentBean);
break;
@@ -516,7 +519,7 @@ public class ApplicationEvaluationDao {
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
contentResponseBeans.forEach(contentResponseBean -> {
// Check if this is a file upload field that matches the current field response
if ("fileupload".equals(contentResponseBean.getName()) && contentResponseBean.getId().equals(fieldResponse.getId())) {
if (("fileupload".equals(contentResponseBean.getName()) || GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) && contentResponseBean.getId().equals(fieldResponse.getId())) {
String label = null;
// Set the label if available
if (contentResponseBean.getSettings() != null) {
@@ -1252,7 +1255,9 @@ public class ApplicationEvaluationDao {
case "fileupload":
populateFileDetailsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId);
break;
case "fileselect":
populateFileDetailsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId);
break;
case "checkboxes":
populateOptionFieldsAsFieldValue(mappedField, formFieldId, applicationForm, applicationId, contentResponseBean);
break;
@@ -1402,7 +1407,7 @@ public class ApplicationEvaluationDao {
// List<ContentResponseBean> contentResponseBeans = Utils.convertJsonStringToList(formEntity.getContent(), ContentResponseBean.class);
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
contentResponseBeans.forEach(contentResponseBean -> {
if ("fileupload".equals(contentResponseBean.getName()) && contentResponseBean.getId().equals(fieldResponse.getId())) {
if (("fileupload".equals(contentResponseBean.getName()) || GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) && contentResponseBean.getId().equals(fieldResponse.getId())) {
String label = null;
if (contentResponseBean.getSettings() != null) {
for (SettingResponseBean setting : contentResponseBean.getSettings()) {
@@ -1564,9 +1569,10 @@ public class ApplicationEvaluationDao {
mappedField.setFieldName(contentResponseBean.getName());
boolean isCheckbox = "checkboxes".equals(contentResponseBean.getName());
boolean isFileUpload = "fileupload".equals(contentResponseBean.getName());
boolean isFileSelect = GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName());
boolean isParagraph = "paragraph".equals(contentResponseBean.getName());
boolean isTable = "table".equals(contentResponseBean.getName());
if (isFileUpload) {
if (isFileUpload || isFileSelect ) {
handleFileUpload(applicationId, criteriaFormField, mappedField);
} else if (isCheckbox) {
handleCheckbox(applicationId, criteriaFormField, contentResponseBean, mappedField);
@@ -1773,7 +1779,7 @@ public class ApplicationEvaluationDao {
List<ContentResponseBean> contentResponseBeans = formDao.convertFormEntityToFormResponseBean(formEntity).getContent();
for (ContentResponseBean contentResponseBean : contentResponseBeans) {
if ("fileupload".equals(contentResponseBean.getName())) {
if ("fileupload".equals(contentResponseBean.getName()) || GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) {
String fieldId = contentResponseBean.getId();
Long applicationFormId = applicationForm.getId();
@@ -2103,7 +2109,8 @@ public class ApplicationEvaluationDao {
List<ContentResponseBean> contentResponseBeans=evaluationFormDao.convertEvaluationFormEntityToEvaluationFormResponseBean(evaluationFormEntity).getContent();
for (ContentResponseBean contentResponseBean:contentResponseBeans){
if(Boolean.TRUE.equals(contentResponseBean.getName().equals("fileupload"))) {
if(Boolean.TRUE.equals(contentResponseBean.getName().equals("fileupload")) ||
Boolean.TRUE.equals(contentResponseBean.getName().equals(GepafinConstant.FILE_SELECT))){
if (contentResponseBean.getId().equals(applicationFormFieldRequestBean.getFieldId())) {
Object fieldValueObject = applicationFormFieldRequestBean.getFieldValue();
if (fieldValueObject instanceof String) {
@@ -2128,7 +2135,8 @@ public class ApplicationEvaluationDao {
for (ApplicationEvaluationFormFieldEntity applicationEvaluationFormFieldEntity : evaluationFormFieldEntities) {
Optional<ContentResponseBean> fileUploadContent = contentResponseBeans.stream()
.filter(contentResponseBean -> "fileupload".equals(contentResponseBean.getName()) &&
.filter(contentResponseBean -> ("fileupload".equals(contentResponseBean.getName()) ||
GepafinConstant.FILE_SELECT.equals(contentResponseBean.getName())) &&
contentResponseBean.getId().equals(applicationEvaluationFormFieldEntity.getFieldId()))
.findFirst();