Commit fbad2534 by Harsh Shah

Role Fit graph should display relative values

parent 3d2437ea
......@@ -117,6 +117,27 @@ public class Job extends BaseJob
setRankingCompleted(true);
}
public JobApplication getTopper()
{
try
{
calculateRoleFitForRanking();
}
catch(FieldException ex)
{
return null;
}
List<JobApplication> sortedApplications = ObjstoreUtils.sort(getSubmittedApplications(),
new ObjectTransform[]{JobApplicationRoleFitTransform.INSTANCE},
new Comparator[]{CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR)});
if(sortedApplications.size() > 0)
{
return sortedApplications.get(0);
}
return null;
}
public Boolean jobDetailsCompleted()
{
return getJobTitle() != null && getJobDescription() != null;
......
......@@ -320,6 +320,16 @@ public class JobApplication extends BaseJobApplication
return getRequirementFit() != null ? (Long) getRequirementFit().get(null) : 0;
}
//This will return relative percentage considering topper as 100%
public Double getRoleFitPercentage()
{
JobApplication jobTopper = getJob() != null ? getJob().getTopper() : null;
Double myScore = getRoleFitScore();
Double topScore = jobTopper.getRoleFitScore();
return NullArith.round(NullArith.divide(NullArith.multiply(myScore, 100), topScore), 2);
}
public List<AppProcessOption> getValidProcessOptions()
{
List<AppProcessOption> options = new ArrayList<>();
......
......@@ -29,7 +29,7 @@
for(JobApplication jobApplication : applications)
{
String roleFit = FormatUtils.stringify(jobApplication.getRoleFitScore(), "PercentageWholeNumber", "0");
String roleFit = FormatUtils.stringify(jobApplication.getRoleFitPercentage(), "PercentageTwoDP", "0");
String culture = FormatUtils.stringify(jobApplication.getCultureFitScore(), "PercentageWholeNumber", "0");
String criteria = FormatUtils.stringify(jobApplication.getRequirementFitScore(), "PercentageWholeNumber", "0");
String appID = "app-id-" + jobApplication.getID().toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment