Ejemplo n.º 1
0
  @Override
  public void updateCandidatesCount(List<String> staffIds, String rewardId) {
    List<Candidate> candList = candidateDao.findCandidatesByRewardIdandStaffIds(rewardId, staffIds);
    for (Candidate cand : candList) {
      cand.setNominatecount(cand.getNominatecount() + 1);
      candidateDao.update(cand);
    }
    //		int xxx=candidateDao.updateCandidatesNominateCount(rewardId, staffIds);
    //		System.out.println(xxx);

  }
Ejemplo n.º 2
0
 @Override
 public void AddCandidateToReward(SysUser caller, String rewardId, CandidateRule candidateRule) {
   Reward reward = rewardDao.findById(Reward.class, rewardId);
   Date now = DateUtil.getTime();
   Set<Staff> staffs =
       candidateRuleLogic.getQualifiedStaffsFromCandidateRuleId(candidateRule.getId());
   for (Staff staff : staffs) {
     if (staff.isDeleted() != 1) {
       Candidate candidate = new Candidate();
       candidate.setReward(reward);
       candidate.setStaff(staff);
       candidate.setCreatedAt(now);
       candidate.setCreatedBy(caller);
       candidate.setLastModifiedAt(now);
       candidate.setLastModifiedBy(caller);
       candidateDao.save(candidate);
     }
   }
 }
Ejemplo n.º 3
0
 @Override
 public List<Candidate> getCandidatesFromRewardAndQueryVo(
     String rewardId, WinnersRecordQueryVo queryVo) {
   return candidateDao.findCandidatesByRewardIdAndQueryVo(rewardId, queryVo);
 }
Ejemplo n.º 4
0
 @Override
 public List<Candidate> getCandidatesFromReward(String rewardId) {
   return candidateDao.findCandidatesByRewardId(rewardId);
 }