Fixed table validation issue
This commit is contained in:
@@ -251,6 +251,22 @@ public class FieldValidator {
|
|||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
boolean hasAtLeastOneNonEmptyPredefinedFalse = fieldValueList.stream()
|
||||||
|
.anyMatch(field -> stateFieldMap.entrySet().stream()
|
||||||
|
.filter(entry -> Boolean.FALSE.equals(entry.getValue())) // Check only predefined: false fields
|
||||||
|
.anyMatch(entry -> {
|
||||||
|
Object fieldValue = field.get(entry.getKey());
|
||||||
|
return fieldValue != null && !StringUtils.isEmpty(fieldValue.toString());
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!hasAtLeastOneNonEmptyPredefinedFalse) {
|
||||||
|
errors.add(MessageFormat.format(
|
||||||
|
Translator.toLocale(GepafinConstant.VALIDATION_IN_TABLE),
|
||||||
|
fieldId));
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user