query static reference
This commit is contained in:
parent
a1c95f35fd
commit
ea3b1a762d
|
@ -117,23 +117,25 @@ public class ExternalFetcherServiceImpl implements ExternalFetcherService {
|
||||||
if (this.conventionService.isListNullOrEmpty(item.getOptions())) continue;
|
if (this.conventionService.isListNullOrEmpty(item.getOptions())) continue;
|
||||||
Map<String, String> result = new HashMap<>();
|
Map<String, String> result = new HashMap<>();
|
||||||
Map<String, Object> rawData = new HashMap<>();
|
Map<String, Object> rawData = new HashMap<>();
|
||||||
|
|
||||||
for (Object object: item.getOptions()) {
|
for (Object object: item.getOptions()) {
|
||||||
StaticOptionEntity staticOption = (StaticOptionEntity) object;
|
StaticOptionEntity staticOption = (StaticOptionEntity) object;
|
||||||
if (this.conventionService.isNullOrEmpty(externalReferenceCriteria.getLike())){
|
|
||||||
rawData.put(staticOption.getCode(), staticOption.getValue());
|
rawData.put(staticOption.getCode(), staticOption.getValue());
|
||||||
result.put(staticOption.getCode(), staticOption.getValue());
|
result.put(staticOption.getCode(), staticOption.getValue());
|
||||||
result.put(ReferenceEntity.KnownFields.SourceLabel, staticSource.getLabel());
|
result.put(ReferenceEntity.KnownFields.SourceLabel, staticSource.getLabel());
|
||||||
result.put(ReferenceEntity.KnownFields.Key, staticSource.getKey());
|
result.put(ReferenceEntity.KnownFields.Key, staticSource.getKey());
|
||||||
}else if (!this.conventionService.isNullOrEmpty(externalReferenceCriteria.getLike()) && externalReferenceCriteria.getLike().toUpperCase().contains(staticOption.getValue().toUpperCase())){
|
|
||||||
rawData.put(staticOption.getCode(), staticOption.getValue());
|
|
||||||
result.put(staticOption.getCode(), staticOption.getValue());
|
|
||||||
result.put(ReferenceEntity.KnownFields.SourceLabel, staticSource.getLabel());
|
|
||||||
result.put(ReferenceEntity.KnownFields.Key, staticSource.getKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!rawData.isEmpty()) externalDataResult.getRawData().add(rawData);
|
if (!this.conventionService.isNullOrEmpty(externalReferenceCriteria.getLike())) {
|
||||||
if (!result.isEmpty()) externalDataResult.getResults().add(result);
|
if ( (result.get(ReferenceEntity.KnownFields.ReferenceId) != null && result.get(ReferenceEntity.KnownFields.ReferenceId).toUpperCase().contains(externalReferenceCriteria.getLike().toUpperCase()))
|
||||||
|
|| (result.get(ReferenceEntity.KnownFields.Label) != null && result.get(ReferenceEntity.KnownFields.Label).toUpperCase().contains(externalReferenceCriteria.getLike().toUpperCase()))
|
||||||
|
|| (result.get(ReferenceEntity.KnownFields.Description) != null && result.get(ReferenceEntity.KnownFields.Description).toUpperCase().contains(externalReferenceCriteria.getLike().toUpperCase()))) {
|
||||||
|
if (!rawData.isEmpty()) externalDataResult.getRawData().add(rawData);
|
||||||
|
if (!result.isEmpty()) externalDataResult.getResults().add(result);
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
if (!rawData.isEmpty()) externalDataResult.getRawData().add(rawData);
|
||||||
|
if (!result.isEmpty()) externalDataResult.getResults().add(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return externalDataResult;
|
return externalDataResult;
|
||||||
|
|
Loading…
Reference in New Issue