RED-8670: add idp fields and llm tracking
This commit is contained in:
parent
b5c469c30c
commit
da9924d1e6
@ -316,6 +316,7 @@ public class DossierTemplateController implements DossierTemplateResource {
|
|||||||
.removeWatermark(dossierTemplate.isRemoveWatermark())
|
.removeWatermark(dossierTemplate.isRemoveWatermark())
|
||||||
.idpByDefault(dossierTemplate.isIdpByDefault())
|
.idpByDefault(dossierTemplate.isIdpByDefault())
|
||||||
.rotationCorrectionByDefault(dossierTemplate.isRotationCorrectionByDefault())
|
.rotationCorrectionByDefault(dossierTemplate.isRotationCorrectionByDefault())
|
||||||
|
.fontStyleDetection(dossierTemplate.isFontStyleDetection())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -89,6 +89,9 @@ public class DossierTemplateEntity {
|
|||||||
@Column(name = "idp_by_default")
|
@Column(name = "idp_by_default")
|
||||||
private boolean idpByDefault;
|
private boolean idpByDefault;
|
||||||
|
|
||||||
|
@Column(name = "font_style_detection")
|
||||||
|
private boolean fontStyleDetection;
|
||||||
|
|
||||||
@Column(name = "remove_watermark")
|
@Column(name = "remove_watermark")
|
||||||
private boolean removeWatermark;
|
private boolean removeWatermark;
|
||||||
|
|
||||||
@ -134,6 +137,7 @@ public class DossierTemplateEntity {
|
|||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private LayoutParsingType layoutParsingType;
|
private LayoutParsingType layoutParsingType;
|
||||||
|
|
||||||
|
|
||||||
public static DossierTemplateEntity copyDossierTemplateEntityWithoutChildEntities(DossierTemplateEntity dossierTemplateEntity) {
|
public static DossierTemplateEntity copyDossierTemplateEntityWithoutChildEntities(DossierTemplateEntity dossierTemplateEntity) {
|
||||||
|
|
||||||
DossierTemplateEntity dossierTemplateCopy = new DossierTemplateEntity();
|
DossierTemplateEntity dossierTemplateCopy = new DossierTemplateEntity();
|
||||||
@ -156,6 +160,7 @@ public class DossierTemplateEntity {
|
|||||||
dossierTemplateCopy.layoutParsingType = dossierTemplateEntity.layoutParsingType;
|
dossierTemplateCopy.layoutParsingType = dossierTemplateEntity.layoutParsingType;
|
||||||
dossierTemplateCopy.rotationCorrectionByDefault = dossierTemplateEntity.rotationCorrectionByDefault;
|
dossierTemplateCopy.rotationCorrectionByDefault = dossierTemplateEntity.rotationCorrectionByDefault;
|
||||||
dossierTemplateCopy.idpByDefault = dossierTemplateEntity.idpByDefault;
|
dossierTemplateCopy.idpByDefault = dossierTemplateEntity.idpByDefault;
|
||||||
|
dossierTemplateCopy.fontStyleDetection = dossierTemplateEntity.fontStyleDetection;
|
||||||
return dossierTemplateCopy;
|
return dossierTemplateCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -770,7 +770,9 @@ public class FileStatusService {
|
|||||||
DossierTemplateEntity dt = dossierTemplatePersistenceService.getDossierTemplate(dossierPersistenceService.getDossierTemplateId(dossierId));
|
DossierTemplateEntity dt = dossierTemplatePersistenceService.getDossierTemplate(dossierPersistenceService.getDossierTemplateId(dossierId));
|
||||||
Set<AzureOcrFeature> features = new HashSet<>();
|
Set<AzureOcrFeature> features = new HashSet<>();
|
||||||
|
|
||||||
features.add(AzureOcrFeature.FONT_STYLE_DETECTION);
|
if (dt.isFontStyleDetection()) {
|
||||||
|
features.add(AzureOcrFeature.FONT_STYLE_DETECTION);
|
||||||
|
}
|
||||||
|
|
||||||
if (dt.isRemoveWatermark()) {
|
if (dt.isRemoveWatermark()) {
|
||||||
features.add(AzureOcrFeature.REMOVE_WATERMARKS);
|
features.add(AzureOcrFeature.REMOVE_WATERMARKS);
|
||||||
|
|||||||
@ -603,9 +603,9 @@ public class FileStatusPersistenceService {
|
|||||||
public int getNumberOfAssignedFiles(String userId) {
|
public int getNumberOfAssignedFiles(String userId) {
|
||||||
|
|
||||||
List<FileEntity> files = fileRepository.findFilesByAssignee(userId);
|
List<FileEntity> files = fileRepository.findFilesByAssignee(userId);
|
||||||
return files.stream()
|
return Math.toIntExact(files.stream()
|
||||||
.filter(fileEntity -> fileEntity.getHardDeletedTime() == null)
|
.filter(fileEntity -> fileEntity.getHardDeletedTime() == null)
|
||||||
.collect(Collectors.toList()).size();
|
.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,11 @@ databaseChangeLog:
|
|||||||
name: rotation_correction_by_default
|
name: rotation_correction_by_default
|
||||||
type: boolean
|
type: boolean
|
||||||
remarks: "Indicates if rotation correction is enabled by default"
|
remarks: "Indicates if rotation correction is enabled by default"
|
||||||
|
- column:
|
||||||
|
name: font_style_detection
|
||||||
|
type: boolean
|
||||||
|
defaultValueBoolean: true
|
||||||
|
remarks: "Indicates if bold detection is enabled in OCR"
|
||||||
|
|
||||||
- update:
|
- update:
|
||||||
tableName: dossier_template
|
tableName: dossier_template
|
||||||
@ -44,3 +49,7 @@ databaseChangeLog:
|
|||||||
tableName: dossier_template
|
tableName: dossier_template
|
||||||
columnName: rotation_correction_by_default
|
columnName: rotation_correction_by_default
|
||||||
columnDataType: boolean
|
columnDataType: boolean
|
||||||
|
- addNotNullConstraint:
|
||||||
|
tableName: dossier_template
|
||||||
|
columnName: font_style_detection
|
||||||
|
columnDataType: boolean
|
||||||
|
|||||||
@ -74,6 +74,9 @@ public class DossierTemplateModel {
|
|||||||
@Schema(description = "Flag that specifies if IDP is performed instead of OCR for all dossiers of this template")
|
@Schema(description = "Flag that specifies if IDP is performed instead of OCR for all dossiers of this template")
|
||||||
private boolean idpByDefault;
|
private boolean idpByDefault;
|
||||||
|
|
||||||
|
@Schema(description = "Flag that specifies if font style detection is performed during OCR")
|
||||||
|
private boolean fontStyleDetection;
|
||||||
|
|
||||||
@Schema(description = "Flag that specifies the watermark removal in documents will be performed before the OCR processing")
|
@Schema(description = "Flag that specifies the watermark removal in documents will be performed before the OCR processing")
|
||||||
private boolean removeWatermark;
|
private boolean removeWatermark;
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,8 @@ public class CreateOrUpdateDossierTemplateRequest {
|
|||||||
|
|
||||||
private boolean rotationCorrectionByDefault;
|
private boolean rotationCorrectionByDefault;
|
||||||
|
|
||||||
|
private boolean fontStyleDetection;
|
||||||
|
|
||||||
private boolean removeWatermark;
|
private boolean removeWatermark;
|
||||||
|
|
||||||
private LayoutParsingType layoutParsingType;
|
private LayoutParsingType layoutParsingType;
|
||||||
|
|||||||
@ -39,6 +39,7 @@ public class DossierTemplate {
|
|||||||
private boolean rotationCorrectionByDefault;
|
private boolean rotationCorrectionByDefault;
|
||||||
private boolean idpByDefault;
|
private boolean idpByDefault;
|
||||||
private boolean removeWatermark;
|
private boolean removeWatermark;
|
||||||
|
private boolean fontStyleDetection;
|
||||||
private LayoutParsingType layoutParsingType;
|
private LayoutParsingType layoutParsingType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user