diff --git a/src/main/java/trap/report/ReportHelper.java b/src/main/java/trap/report/ReportHelper.java index be5cb81..2311348 100644 --- a/src/main/java/trap/report/ReportHelper.java +++ b/src/main/java/trap/report/ReportHelper.java @@ -35,13 +35,13 @@ @Service public class ReportHelper { - private static final String SINGLES = "singles"; - private static final String DOUBLES = "doubles"; - private static final String HANDICAP = "handicap"; - private static final String SKEET = "skeet"; - private static final String CLAYS = "clays"; - private static final String FIVESTAND = "fivestand"; - private static final String DOUBLESKEET = "doublesskeet"; + public static final String SINGLES = "singles"; + public static final String DOUBLES = "doubles"; + public static final String HANDICAP = "handicap"; + public static final String SKEET = "skeet"; + public static final String CLAYS = "clays"; + public static final String FIVESTAND = "fivestand"; + public static final String DOUBLESKEET = "doublesskeet"; private static final String ROOKIE = "Rookie"; private static final String VARSITY = "Varsity"; private static final String INTERMEDIATE_ENTRY = "Intermediate Entry"; @@ -56,7 +56,7 @@ public class ReportHelper { Logger logger = LoggerFactory.getLogger(ReportHelper.class); public void generateExcelFile() throws Exception { - downloadHelper.downloadFiles(trapTypes); +// downloadHelper.downloadFiles(trapTypes); var workbook = getWorkbook(); @@ -346,8 +346,8 @@ private HashMap> calculateTeamScores(List Integer.compare(b.getTotal(), a.getTotal())); diff --git a/src/main/java/trap/report/TrapHelper.java b/src/main/java/trap/report/TrapHelper.java index 91708e8..96f646d 100644 --- a/src/main/java/trap/report/TrapHelper.java +++ b/src/main/java/trap/report/TrapHelper.java @@ -12,9 +12,17 @@ import java.util.Map; import java.util.Set; +import static trap.report.ReportHelper.CLAYS; +import static trap.report.ReportHelper.DOUBLES; +import static trap.report.ReportHelper.DOUBLESKEET; +import static trap.report.ReportHelper.FIVESTAND; +import static trap.report.ReportHelper.HANDICAP; +import static trap.report.ReportHelper.SINGLES; +import static trap.report.ReportHelper.SKEET; + public class TrapHelper { private static final Map eventCounts = determineEventsToCount(); - public static final Map roundCounts = determineRoundsToCount(); + protected static final Map roundCounts = determineRoundsToCount(); public Map> calculatePlayerRoundTotals(List roundScores) { Map> playerRoundTotals = new HashMap<>(); @@ -134,19 +142,19 @@ public Map calculatePlayerFinalTotal(Map validRounds = Set.of("clays", "doubles", "doublesskeet", "fivestand"); + Set validRounds = Set.of(CLAYS, DOUBLES, DOUBLESKEET, FIVESTAND); return validRounds.contains(roundType); } private static Map determineEventsToCount() { var eventCounts = new HashMap(); - eventCounts.put("singles", 4); - eventCounts.put("doubles", 4); - eventCounts.put("handicap", 4); - eventCounts.put("skeet", 4); - eventCounts.put("clays", 3); - eventCounts.put("fivestand", 4); - eventCounts.put("doublesskeet", 4); + eventCounts.put(SINGLES, 4); + eventCounts.put(DOUBLES, 4); + eventCounts.put(HANDICAP, 4); + eventCounts.put(SKEET, 4); + eventCounts.put(CLAYS, 3); + eventCounts.put(FIVESTAND, 4); + eventCounts.put(DOUBLESKEET, 4); return eventCounts; } @@ -160,14 +168,14 @@ public static String trimString(String s) { private static Map determineRoundsToCount() { var roundCounts = new HashMap(); - roundCounts.put("singles", 5); - roundCounts.put("doubles", 5); - roundCounts.put("handicap", 5); - - roundCounts.put("skeet", 3); - roundCounts.put("clays", 3); - roundCounts.put("fivestand", 3); - roundCounts.put("doublesskeet", 3); + roundCounts.put(SINGLES, 5); + roundCounts.put(DOUBLES, 5); + roundCounts.put(HANDICAP, 5); + + roundCounts.put(SKEET, 3); + roundCounts.put(CLAYS, 3); + roundCounts.put(FIVESTAND, 3); + roundCounts.put(DOUBLESKEET, 3); return roundCounts; }