コード例 #1
0
 private void populateColleagueEvalState(
     String evalSeasonDataId,
     UserModel currentUser,
     Set<UserModel> rateesOfColleague,
     Model model) {
   List<ColleagueEvalState> states =
       personalEvalDataLoader.getColleagueEvalStates(
           evalSeasonDataId,
           currentUser.getId(),
           rateesOfColleague.stream().map(x -> x.getId()).collect(Collectors.toSet()));
   model.addAttribute("colleagueEvalStates", states);
 }
コード例 #2
0
  @RequestMapping("/main/evalseasons/{seasonId}")
  public String main(
      @PathVariable("seasonId") String evalSeasonId,
      Model model,
      @AuthenticationPrincipal UserModel currentUser)
      throws IOException {
    EvalSeasonData evalSeasonData = evalSeasonDataLoader.load(evalSeasonId);
    model.addAttribute("evalSeason", evalSeasonData);

    EvalSeasonMappingModel evalSeasonMappingModel = evalSeasonData.getMappingModel();

    EvalSeasonUserRole evalUserRole = new EvalSeasonUserRole();

    if (evalSeasonMappingModel.containsRatee(currentUser.getId())) {
      evalUserRole.addRateeRole();
      populateUserPersonalEvalState(evalSeasonData.getId(), currentUser, model);
    }
    if (evalSeasonMappingModel.containsFirstRater(currentUser.getId())) {
      evalUserRole.addFirstRaterRole();
      populateFirstRatersRateePersonalEvalState(
          evalSeasonId, evalSeasonMappingModel.getRateesOfFirstRater(currentUser.getId()), model);
    }
    if (evalSeasonData.isColleagueEvalutionStarted()
        && evalSeasonMappingModel.containsColleaguRater(currentUser.getId())) {
      evalUserRole.addColleagueRaterRole();
      populateColleagueEvalState(
          evalSeasonData.getId(),
          currentUser,
          evalSeasonMappingModel.getRateesOfColleague(currentUser.getId()),
          model);
    }
    if (evalSeasonMappingModel.containsSecondRater(currentUser.getId())) {
      evalUserRole.addSecondRaterRole();
      populateSecondRaterRateePersonalEvalState(
          evalSeasonId, evalSeasonMappingModel.getRateesOfSecondRater(currentUser.getId()), model);
    }

    model.addAttribute("evalUserRole", evalUserRole);
    return "main/evalseason/evalseasonMain";
  }
コード例 #3
0
 private void populateUserPersonalEvalState(
     String evalSeasonId, UserModel currentUser, Model model) {
   PersonalEvalState personalEval =
       personalEvalDataLoader.getPersonalEvalStateOf(evalSeasonId, currentUser.getId());
   model.addAttribute("myPersonalEval", personalEval);
 }