Skip to content

Commit

Permalink
Merge pull request #40 from zucisystems-dev/bugs/episode_of_coverage_004
Browse files Browse the repository at this point in the history
changed blank and null check in episode of coverage
  • Loading branch information
Sanjeeya-Velayutham-ZS0029 authored Jun 1, 2023
2 parents 04e0287 + d88f6f8 commit 37df916
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,32 @@ public Map<String,List<Integer>> SplitByEocId(Jdbi jdbi, String sorItem) {


for (var eocGroupingEocIdRequestInfo : eocIdRequestInfo) {
List<Integer> paperList = new ArrayList<>();
Integer startNoInt = (Integer) Optional.ofNullable(eocGroupingEocIdRequestInfo.get("start_no")).orElse(0);
String answerString = Optional.ofNullable(eocGroupingEocIdRequestInfo.get("answer")).map(String::valueOf).orElse("");
int totalPageInt = Integer.parseInt(episodeOfCoverage.getTotalPages());
int endPoint = 0;
if(!answerString.isEmpty() && !answerString.isBlank()){
List<Integer> paperList = new ArrayList<>();

try {
endPoint = breakPointsList.get(breakPointsList.indexOf(startNoInt) + 1);
} catch (Exception e) {
endPoint = totalPageInt + 1;
}
if (breakPointsList.indexOf(startNoInt) == 0 ) {
startNoInt = 1;
}
Integer startNoInt = (Integer) Optional.ofNullable(eocGroupingEocIdRequestInfo.get("start_no")).orElse(0);

int totalPageInt = Integer.parseInt(episodeOfCoverage.getTotalPages());
int endPoint = 0;

for (int i = startNoInt; i < endPoint; i++) {
paperList.add(i);
try {
endPoint = breakPointsList.get(breakPointsList.indexOf(startNoInt) + 1);
} catch (Exception e) {
endPoint = totalPageInt + 1;
}
if (breakPointsList.indexOf(startNoInt) == 0 ) {
startNoInt = 1;
}

for (int i = startNoInt; i < endPoint; i++) {
paperList.add(i);
}
//thic code will save the result as a map with string as key and list as value
answerString =answerString.replaceAll("[-/#%;?\\\\]","_");
eocObjectMap.put(answerString, paperList);
}
//thic code will save the result as a map with string as key and list as value
answerString =answerString.replaceAll("[-/#%;?\\\\]","_");
eocObjectMap.put(answerString, paperList);

}
}
}
Expand Down

0 comments on commit 37df916

Please sign in to comment.