Commit 4e8c0ddd by Yashvant Kantival

NGPA To NGPL - CR For MDB And MPB

parent 94f2160e
...@@ -68,18 +68,25 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService { ...@@ -68,18 +68,25 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService {
return basicJSONOperation1; return basicJSONOperation1;
} }
public double calculateMonthlyPerformanceBonus ( Double WFYC ) throws JSONException { public double calculateMonthlyPerformanceBonus ( Double WFYC , boolean isYear1 ) throws JSONException {
basicDoubleOperation = 0; basicDoubleOperation = 0;
// basicStringOperation = ; // basicStringOperation = ;
basicJSONArrayOperation = leaderCalcConfig.getValue("fyc"); basicJSONArrayOperation = leaderCalcConfig.getValue("fyc");
if(!isYear1) {
WFYC = (double) Math.round( WFYC / 12 ); WFYC = (double) Math.round( WFYC / 12 );
}
for ( i = 0; i < basicJSONArrayOperation.length(); i++ ) { for ( i = 0; i < basicJSONArrayOperation.length(); i++ ) {
if (WFYC >= basicJSONArrayOperation.getJSONObject(i).getDouble("minval") && WFYC <= basicJSONArrayOperation.getJSONObject(i).getDouble("maxval")) { if (WFYC >= basicJSONArrayOperation.getJSONObject(i).getDouble("minval") && WFYC <= basicJSONArrayOperation.getJSONObject(i).getDouble("maxval")) {
basicDoubleOperation = Math.round( ( WFYC * basicJSONArrayOperation.getJSONObject(i).getDouble("per") ) / 100 ); basicDoubleOperation = Math.round( ( WFYC * basicJSONArrayOperation.getJSONObject(i).getDouble("per") ) / 100 );
} }
} }
if(!isYear1) {
return Math.round( basicDoubleOperation * 12 ); return Math.round( basicDoubleOperation * 12 );
} }
else {
return Math.round( basicDoubleOperation * metricsTable[1][0] );
}
}
public void preparengpaToLeaderCareerPathTable(JSONObject requestJSON) throws JSONException { public void preparengpaToLeaderCareerPathTable(JSONObject requestJSON) throws JSONException {
// Preparing Leader Career Path Table // Preparing Leader Career Path Table
...@@ -142,11 +149,18 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService { ...@@ -142,11 +149,18 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService {
// basicStringOperation = "[{\"180000\":25000,\"360000\":25000,\"720000\":25000,\"1440000\":25000,\"MPB\":2},{\"180000\":25000,\"360000\":50000,\"720000\":50000,\"1440000\":50000,\"MPB\":3},{\"180000\":25000,\"360000\":50000,\"720000\":75000,\"1440000\":75000,\"MPB\":4},{\"180000\":25000,\"360000\":50000,\"720000\":75000,\"1440000\":100000,\"MPB\":5}]"; // basicStringOperation = "[{\"180000\":25000,\"360000\":25000,\"720000\":25000,\"1440000\":25000,\"MPB\":2},{\"180000\":25000,\"360000\":50000,\"720000\":50000,\"1440000\":50000,\"MPB\":3},{\"180000\":25000,\"360000\":50000,\"720000\":75000,\"1440000\":75000,\"MPB\":4},{\"180000\":25000,\"360000\":50000,\"720000\":75000,\"1440000\":100000,\"MPB\":5}]";
basicJSONArrayOperation = leaderCalcConfig.getValue("mdb"); basicJSONArrayOperation = leaderCalcConfig.getValue("mdb");
for( i=0;i<basicJSONArrayOperation.length();i++ ) { for( i=0;i<basicJSONArrayOperation.length();i++ ) {
if ( basicJSONArrayOperation.getJSONObject(i).getDouble("MDB") == 4 ) { if( i == 1 ) {
basicDoubleOperation = 2;
}
else {
basicDoubleOperation = 4;
}
if ( basicJSONArrayOperation.getJSONObject(i).getDouble("MPB") == basicDoubleOperation ) {
basicJSONOperation1 = basicJSONArrayOperation.getJSONObject(i); basicJSONOperation1 = basicJSONArrayOperation.getJSONObject(i);
break; break;
} }
} }
metricsTable[1][7] = Math.round( metricsTable[1][7] / metricsTable[1][0] );
for( i=0;i<4;i++ ) { for( i=0;i<4;i++ ) {
if( metricsTable[i][7] > 180000 && metricsTable[i][7] < 360000 ) { if( metricsTable[i][7] > 180000 && metricsTable[i][7] < 360000 ) {
MonthlyDevelopmentBonus_Year1_NGPL[i] = basicJSONOperation1.getDouble("monthly_ep_18"); MonthlyDevelopmentBonus_Year1_NGPL[i] = basicJSONOperation1.getDouble("monthly_ep_18");
...@@ -179,15 +193,14 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService { ...@@ -179,15 +193,14 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService {
earningsTable[1][0] = Math.round( ( metricsTable[1][6] * fycPersantage ) / 100 ); earningsTable[1][0] = Math.round( ( metricsTable[1][6] * fycPersantage ) / 100 );
basicJSONOperation1 = new JSONObject(); basicJSONOperation1 = new JSONObject();
basicJSONOperation1 = calculateFYCCreditAndWFYC("BA",earningsTable[1][0]); basicJSONOperation1 = calculateFYCCreditAndWFYC("BA", earningsTable[1][0] / metricsTable[1][0] );
earningsTable[1][7] = basicJSONOperation1.getDouble("DT"); earningsTable[1][7] = basicJSONOperation1.getDouble("DT");
earningsTable[1][8] = basicJSONOperation1.getDouble("WFYC"); earningsTable[1][8] = basicJSONOperation1.getDouble("WFYC");
earningsTable[1][1] = 0; earningsTable[1][1] = 0;
earningsTable[1][2] = 0; earningsTable[1][2] = 0;
earningsTable[1][3] = ( earningsTable[1][8] != 0 ? calculateMonthlyPerformanceBonus(earningsTable[1][8]) : 0 ); earningsTable[1][3] = ( earningsTable[1][8] != 0 ? calculateMonthlyPerformanceBonus(earningsTable[1][8], true) : 0 );
earningsTable[1][4] = Math.round( MonthlyDevelopmentBonus_Year1_NGPL[1] * ( 12 - metricsTable[1][0] ) ); earningsTable[1][4] = Math.round( MonthlyDevelopmentBonus_Year1_NGPL[1] * metricsTable[1][0] );
earningsTable[1][5] = earningsTable[1][3] + earningsTable[1][4]; earningsTable[1][5] = earningsTable[1][3] + earningsTable[1][4];
earningsTable[1][6] = 0; earningsTable[1][6] = 0;
...@@ -215,8 +228,8 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService { ...@@ -215,8 +228,8 @@ public class NGPAtoNGPLCalcServiceImpl implements NGPAtoNGPLCalcService {
earningsTable[3][1] = 0; earningsTable[3][1] = 0;
earningsTable[3][2] = 0; earningsTable[3][2] = 0;
earningsTable[3][3] = ( earningsTable[3][8] != 0 ? calculateMonthlyPerformanceBonus(earningsTable[3][8]) : 0 ); earningsTable[3][3] = ( earningsTable[3][8] != 0 ? calculateMonthlyPerformanceBonus(earningsTable[3][8], false) : 0 );
earningsTable[3][4] = Math.round( ngpaToLeaderCareerPathTable[2][1] * MonthlyDevelopmentBonus_Year1_NGPL[3] * 12 ); earningsTable[3][4] = Math.round( MonthlyDevelopmentBonus_Year1_NGPL[3] * 12 );
earningsTable[3][5] = earningsTable[3][3] + earningsTable[3][4]; earningsTable[3][5] = earningsTable[3][3] + earningsTable[3][4];
earningsTable[3][6] = Math.round( earningsTable[3][5] / 12 ); earningsTable[3][6] = Math.round( earningsTable[3][5] / 12 );
......
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