use of org.hisp.dhis.scheduling.parameters.DataIntegrityJobParameters in project dhis2-core by dhis2.
the class DataIntegrityController method runDataIntegrityAsync.
private WebMessage runDataIntegrityAsync(Collection<String> checks, User currentUser, String description, DataIntegrityReportType type) {
DataIntegrityJobParameters params = new DataIntegrityJobParameters();
params.setChecks(toUniformCheckNames(checks));
params.setType(type);
JobConfiguration config = new JobConfiguration(description, JobType.DATA_INTEGRITY, null, params, true, true);
config.setUserUid(currentUser.getUid());
config.setAutoFields();
if (!schedulingManager.executeNow(config)) {
return conflict("Data integrity check is already running");
}
return jobConfigurationReport(config);
}
use of org.hisp.dhis.scheduling.parameters.DataIntegrityJobParameters in project dhis2-core by dhis2.
the class DataIntegrityJob method execute.
@Override
public void execute(JobConfiguration config, JobProgress progress) {
DataIntegrityJobParameters parameters = (DataIntegrityJobParameters) config.getJobParameters();
Set<String> checks = parameters == null ? Set.of() : parameters.getChecks();
DataIntegrityReportType type = parameters == null ? null : parameters.getType();
if (type == null || type == DataIntegrityReportType.REPORT) {
runReport(config, progress, checks);
} else if (type == DataIntegrityReportType.SUMMARY) {
dataIntegrityService.runSummaryChecks(checks, progress);
} else {
dataIntegrityService.runDetailsChecks(checks, progress);
}
}
Aggregations