@Override protected void importMatching(ReportTable object, ReportTable match) { match.setName(object.getName()); match.setRegression(object.isRegression()); match.setDoIndicators(match.isDoIndicators()); match.setDoPeriods(match.isDoPeriods()); match.setDoUnits(match.isDoUnits()); match.getRelatives().setLastMonth(object.getRelatives().isLastMonth()); match.getRelatives().setMonthsThisYear(object.getRelatives().isMonthsThisYear()); match.getRelatives().setQuartersThisYear(object.getRelatives().isQuartersThisYear()); match.getRelatives().setThisYear(object.getRelatives().isThisYear()); match.getRelatives().setMonthsLastYear(object.getRelatives().isMonthsLastYear()); match.getRelatives().setQuartersLastYear(object.getRelatives().isQuartersLastYear()); match.getRelatives().setLastYear(object.getRelatives().isLastYear()); match .getReportParams() .setParamReportingMonth(object.getReportParams().isParamReportingMonth()); match .getReportParams() .setParamParentOrganisationUnit(object.getReportParams().isParamParentOrganisationUnit()); match .getReportParams() .setParamOrganisationUnit(object.getReportParams().isParamOrganisationUnit()); reportTableService.saveReportTable(match); }
@Override protected boolean isIdentical(ReportTable object, ReportTable existing) { if (!object.getName().equals(existing.getName())) { return false; } if (object.isRegression() != existing.isRegression()) { return false; } if (object.isDoIndicators() != existing.isDoIndicators()) { return false; } if (object.isDoPeriods() != existing.isDoPeriods()) { return false; } if (object.isDoUnits() != existing.isDoUnits()) { return false; } return true; }
@Override protected ReportTable getMatching(ReportTable object) { List<ReportTable> reportTableByName = reportTableService.getReportTableByName(object.getName()); return reportTableByName.isEmpty() ? null : reportTableByName.get(0); }