Resolved conflicts
This commit is contained in:
@@ -200,7 +200,7 @@ public class FieldValidator {
|
||||
|
||||
|
||||
public FieldValidator validateCustomTableValidation(String value, String customRule, String fieldId, ContentResponseBean contentResponseBean) {
|
||||
if (customRule == null || value == null) {
|
||||
if (customRule == null ) {
|
||||
return this; // No custom rule to validate
|
||||
}
|
||||
|
||||
@@ -226,6 +226,7 @@ public class FieldValidator {
|
||||
.findFirst() // Get the first matching result
|
||||
.orElse(null); // Default to null if no match
|
||||
|
||||
|
||||
if (tableType!=null){
|
||||
try {
|
||||
Object object = PdfUtils.extractRows(value);;
|
||||
@@ -291,6 +292,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) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user