Commit a86f4f49 by Nilu

adding role fit data to applicant report

parent 2d0e5d5e
......@@ -12,6 +12,7 @@ import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.utils.text.FormatUtils;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtils;
import org.jfree.chart.JFreeChart;
......@@ -39,7 +40,7 @@ public class RingChart
this.dataset = new DefaultPieDataset();
}
public RingChart(String title, String filename)
public RingChart(String filename)
{
this();
this.fileName = filename;
......@@ -67,7 +68,7 @@ public class RingChart
{
if(i == 0)
{
plot.setCenterText(String.valueOf(dataset.getValue(i)));
plot.setCenterText(FormatUtils.stringify(dataset.getValue(i), "PercentageWholeNumber", "0"));
}
plot.setSectionPaint(dataset.getKey(i), colors.get(i));
......
......@@ -18,7 +18,6 @@ import oneit.utils.DateDiff;
import oneit.utils.ObjectTransform;
import oneit.utils.StringUtils;
import oneit.utils.filter.*;
import performa.chart.RingChart;
import performa.utils.ExpressAnswerFilter;
......@@ -174,9 +173,4 @@ public class Candidate extends BaseCandidate
{
return isTrue(getConditionsAgreed());
}
public String getRingChart()
{
return new RingChart().addData("Completed", 20, RingChart.GREEN).addData("Incomplete", 80, RingChart.GREY).getChartImage();
}
}
\ No newline at end of file
package performa.orm;
import java.awt.Color;
import java.util.*;
import oneit.logging.*;
import oneit.objstore.*;
......@@ -13,6 +14,7 @@ import oneit.utils.filter.Filter;
import oneit.utils.math.NullArith;
import oneit.utils.math.Rounding;
import oneit.utils.parsers.FieldException;
import performa.chart.RingChart;
import performa.orm.types.*;
import performa.utils.*;
......@@ -602,4 +604,33 @@ public class JobApplication extends BaseJobApplication
return CollectionFilter.filter(getAssessmentCriteriaAnswersSet(), filter);
}
public String getCultureRingChart()
{
long score = getCultureFitScore();
Color color = score >= 70 ? RingChart.GREEN : (score >= 50 ? RingChart.AMBER : RingChart.RED);
return new RingChart(getID().toString() + "culture.jpeg").addData("Completed", score, color).addData("Incomplete", (100 - score), RingChart.GREY).getChartImage();
}
public String getRequirementRingChart()
{
long score = getRequirementFitScore();
Color color = hasFailedEssentialRequirements() ? RingChart.RED : (score >= 80 ? RingChart.GREEN : (score >= 60 ? RingChart.AMBER : RingChart.RED));
return new RingChart(getID().toString() + "requirement.jpeg").addData("Completed", score , color).addData("Incomplete", (100 - score), RingChart.GREY).getChartImage();
}
public String getRoleFitChart()
{
Tuple.T3<Double, ColorCode, Double> roleFitData = (getRoleFit() != null && getRoleFit().get(null) != null) ? (Tuple.T3<Double, ColorCode, Double>) getRoleFit().get(null) : null;
double score = roleFitData != null ? roleFitData.get2() : 0d;
Color color = roleFitData != null ? Utils.getColor(roleFitData.get1()) : RingChart.GREEN;
return new RingChart(getID().toString() + "rolefit.jpeg").addData("Completed", score , color).addData("Incomplete", (100 - score), RingChart.GREY).getChartImage();
}
}
\ No newline at end of file
package performa.utils;
import java.awt.Color;
import java.util.*;
import javax.activation.DataSource;
import javax.servlet.http.HttpServletRequest;
......@@ -23,6 +24,7 @@ import oneit.utils.filter.*;
import oneit.utils.parsers.FieldException;
import oneit.utils.transform.MapTransform;
import oneit.utils.transform.param.*;
import performa.chart.RingChart;
import performa.form.LinkedInOAuthLoginFP;
import performa.orm.*;
import performa.orm.types.*;
......@@ -644,4 +646,9 @@ public class Utils
return "th";
}
}
public static Color getColor(ColorCode colorCode)
{
return colorCode == ColorCode.RED ? RingChart.RED : (colorCode == ColorCode.AMBER ? RingChart.AMBER : RingChart.GREEN);
}
}
\ No newline at end of file
......@@ -4,8 +4,9 @@
<%@ include file="/setuprequest.jsp"%>
<%@ page import="oneit.servlets.process.*"%>
<%@ page import="oneit.objstore.*"%>
<%@ page import="performa.orm.*, performa.chart.*"%>
<%@ page import="oneit.objstore.*, oneit.utils.*"%>
<%@ page import="java.util.*"%>
<%@ page import="performa.orm.*, performa.orm.types.*, performa.chart.*, performa.utils.*"%>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction();
......@@ -70,12 +71,124 @@
<oneit:toString value="<%= candidate.getPhone() %>" mode="EscapeHTML" />
</div>
</div>
<div class="contact-row">
<!--Requirements-->
<%
if(job.getIncludeAssessmentCriteria() == Boolean.TRUE)
{
%>
<table width="100%" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td style="width:30%;">
<div>Requirements</div>
<div>
<img src="file:///<%= candidate.getRingChart() %>" alt="Pie Chart"/>
<img src="file:///<%= jobApplication.getRequirementRingChart() %>" alt="Ring Chart"/>
</div>
</td>
<td>
<table width="100%" cellspacing="0" cellpadding="0">
<%
Map<Importance, Long> requirementFitData = (Map<Importance, Long>)jobApplication.getRequirementFit();
for(Importance importance: Utils.getImportancesForAssessment())
{
Long rating = requirementFitData.get(importance);
%>
<tr>
<span class="appli-label"><oneit:toString value="<%= importance %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></span>
<span class="appli-progress-bar">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>;"></div>
</div>
</span>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
<%
}
%>
<!--Role Fit-->
<table width="100%" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td style="width:30%;">
<div>Role Fit</div>
<div>
<img src="file:///<%= jobApplication.getRoleFitChart() %>" alt="Ring Chart"/>
</div>
</td>
<td>
<table width="100%" cellspacing="0" cellpadding="0">
<%
Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit();
Map<FactorClass, Map<FactorLevelLink, Map>> factorClassDtls = (Map<FactorClass, Map<FactorLevelLink, Map>>) jobApplication.getFactorScoreDetails();
for(FactorClass factorClass : factorClassDtls.keySet())
{
Double rating = roleScoreMap.get(factorClass).get2();
%>
<tr>
<span class="appli-label"><oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></span>
<span class="appli-progress-bar">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>;"></div>
</div>
</span>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
<!--Culture Fit Data-->
<table width="100%" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td style="width:30%;">
<div>Culture Fit</div>
<div>
<img src="file:///<%= jobApplication.getCultureRingChart() %>" alt="Ring Chart"/>
</div>
</td>
<td>
<table width="100%" cellspacing="0" cellpadding="0">
<%
Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>> cultureFitData = (Map<CultureClass, Tuple.T2<Long, Set<Tuple.T3>>>) jobApplication.getCultureFit();
for(CultureClass cClass: cultureFitData.keySet())
{
if(cClass == null || cultureFitData.get(cClass) == null)
{
continue;
}
Long rating = cultureFitData.get(cClass).get0();
%>
<tr>
<span class="appli-label"><oneit:toString value="<%= cClass %>" mode="EscapeHTML"/></span>
<span class="appli-percen gray"><oneit:toString value="<%= rating %>" mode="PercentageWholeNumber" /></span>
<span class="appli-progress-bar">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= rating %>" aria-valuemin="0" aria-valuemax="100" style="width:<%= rating %>;"></div>
</div>
</span>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
</div>
......
......@@ -20,6 +20,14 @@
.appli-name{color: #1A2531; text-align: left; font-size: 26px; font-weight: 300; font-family: "Usual-Light";}
.appli-applied{color: #7d7f82; text-align: left; font-size: 12px; margin-top: 6px;}
.appli-label{font-size: 12px;text-align: left; color: #4E5258;}
.appli-percen{font-size: 24px; color: #667281;}
span.appli-progress-bar {display: inline-block; width: 60%;}
.progress {margin-bottom: 0; border-radius: 0;height: 24px;background: #e9ecef;box-shadow: none;}
.progress-bar{background: #667281;}
@page
{
size: A4 portrait;
......
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