Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IncomeCalculator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
neel
IncomeCalculator
Commits
7d475aea
Commit
7d475aea
authored
Apr 28, 2020
by
neel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling try catch and commenting changes
parent
ae788edd
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
55 deletions
+63
-55
src/main/java/com/iRecruit/modules/auth/controller/FycMappingController.java
+3
-1
src/main/java/com/iRecruit/modules/auth/controller/L1slabsMappingController.java
+2
-0
src/main/java/com/iRecruit/modules/auth/controller/L2slabsMappingController.java
+4
-0
src/main/java/com/iRecruit/modules/auth/controller/MDBMappingController.java
+3
-0
src/main/java/com/iRecruit/modules/auth/controller/MpbMappingController.java
+3
-0
src/main/java/com/iRecruit/modules/auth/service/impl/LeaderCalcServiceImpl.java
+48
-54
No files found.
src/main/java/com/iRecruit/modules/auth/controller/FycMappingController.java
View file @
7d475aea
...
@@ -46,6 +46,8 @@ public class FycMappingController {
...
@@ -46,6 +46,8 @@ public class FycMappingController {
@PostMapping
(
"/fycmapping/get"
)
@PostMapping
(
"/fycmapping/get"
)
@ApiOperation
(
"Get all fyc mapping list"
)
@ApiOperation
(
"Get all fyc mapping list"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get fyc"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get fyc"
)
//Neel – 20-Apr-2020 – Tata - Fyc mapping – Added function for fetch all data of fyc from table
public
ResponseEntity
<?>
getAllFycMappings
(){
public
ResponseEntity
<?>
getAllFycMappings
(){
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"Fyc List"
,
fycMappingService
.
findAll
().
stream
().
map
(
FycMapping
->
new
fycDto
(
FycMapping
))),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"Fyc List"
,
fycMappingService
.
findAll
().
stream
().
map
(
FycMapping
->
new
fycDto
(
FycMapping
))),
HttpStatus
.
OK
);
}
}
...
@@ -74,7 +76,7 @@ public class FycMappingController {
...
@@ -74,7 +76,7 @@ public class FycMappingController {
@PostMapping
(
"/fycmapping/update"
)
@PostMapping
(
"/fycmapping/update"
)
@ApiOperation
(
"update fycmapping"
)
@ApiOperation
(
"update fycmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create fycmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create fycmapping"
)
public
ResponseEntity
<?>
updateFycmapping
(
@RequestBody
fycDto
fycMapping
)
{
public
ResponseEntity
<?>
updateFycmapping
(
@RequestBody
fycDto
fycMapping
)
{
//Neel – 20-Apr-2020 – Tata - Fyc mapping – Added function for Store data of fyc from table
System
.
out
.
println
(
"in fyc contrroler"
);
System
.
out
.
println
(
"in fyc contrroler"
);
System
.
out
.
println
(
"in fycmapping"
);
System
.
out
.
println
(
"in fycmapping"
);
FycMapping
fycupdate
=
null
;
FycMapping
fycupdate
=
null
;
...
...
src/main/java/com/iRecruit/modules/auth/controller/L1slabsMappingController.java
View file @
7d475aea
...
@@ -45,12 +45,14 @@ public class L1slabsMappingController {
...
@@ -45,12 +45,14 @@ public class L1slabsMappingController {
@PostMapping
(
"/l1salbsmapping/get"
)
@PostMapping
(
"/l1salbsmapping/get"
)
@ApiOperation
(
"Get all l1slabs mapping list"
)
@ApiOperation
(
"Get all l1slabs mapping list"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get l1slabs"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get l1slabs"
)
//Neel – 20-Apr-2020 – Tata - l1 slabs mapping – Added function for fetch all data of l1 slabs from table
public
ResponseEntity
<?>
getAllL1slabsMappings
(
){
public
ResponseEntity
<?>
getAllL1slabsMappings
(
){
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"l1 slabs List"
,
l1slabsMappingService
.
findAll
().
stream
().
map
(
L1slabsMapping
->
new
L1slabsDto
(
L1slabsMapping
))),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"l1 slabs List"
,
l1slabsMappingService
.
findAll
().
stream
().
map
(
L1slabsMapping
->
new
L1slabsDto
(
L1slabsMapping
))),
HttpStatus
.
OK
);
}
}
@PostMapping
(
"/l1salbsmapping/create"
)
@PostMapping
(
"/l1salbsmapping/create"
)
@ApiOperation
(
"Create l1salbsmapping"
)
@ApiOperation
(
"Create l1salbsmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create l1salbsmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create l1salbsmapping"
)
//Neel – 20-Apr-2020 – Tata - l1 slabs mapping – Added function for store all data of l1 slabs table
public
ResponseEntity
<?>
createL1slabsmapping
(
@RequestBody
L1slabsDto
l1slabsmapping
)
{
public
ResponseEntity
<?>
createL1slabsmapping
(
@RequestBody
L1slabsDto
l1slabsmapping
)
{
System
.
out
.
println
(
"in l1salbsmapping contrroler"
);
System
.
out
.
println
(
"in l1salbsmapping contrroler"
);
System
.
out
.
println
(
"in l1salbsmapping"
);
System
.
out
.
println
(
"in l1salbsmapping"
);
...
...
src/main/java/com/iRecruit/modules/auth/controller/L2slabsMappingController.java
View file @
7d475aea
...
@@ -45,6 +45,8 @@ public class L2slabsMappingController {
...
@@ -45,6 +45,8 @@ public class L2slabsMappingController {
@PostMapping
(
"/l2salbsmapping/get"
)
@PostMapping
(
"/l2salbsmapping/get"
)
@ApiOperation
(
"Get all l2slabs mapping list"
)
@ApiOperation
(
"Get all l2slabs mapping list"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get l2slabs"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get l2slabs"
)
//Neel – 20-Apr-2020 – Tata - l2 slabs mapping – Added function for fetch all data of l2 slabs from table
public
ResponseEntity
<?>
getAllL1slabsMappings
(
){
public
ResponseEntity
<?>
getAllL1slabsMappings
(
){
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"l2 slabs List"
,
l2slabsMappingService
.
findAll
().
stream
().
map
(
L2slabsMapping
->
new
L2slabsDto
(
L2slabsMapping
))),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"l2 slabs List"
,
l2slabsMappingService
.
findAll
().
stream
().
map
(
L2slabsMapping
->
new
L2slabsDto
(
L2slabsMapping
))),
HttpStatus
.
OK
);
}
}
...
@@ -52,6 +54,8 @@ public class L2slabsMappingController {
...
@@ -52,6 +54,8 @@ public class L2slabsMappingController {
@PostMapping
(
"/l2salbsmapping/create"
)
@PostMapping
(
"/l2salbsmapping/create"
)
@ApiOperation
(
"Create l2salbsmapping"
)
@ApiOperation
(
"Create l2salbsmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create l2salbsmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create l2salbsmapping"
)
//Neel – 20-Apr-2020 – Tata - l2 slabs mapping – Added function for store all data of l1 slabs table
public
ResponseEntity
<?>
createL1slabsmapping
(
@RequestBody
L2slabsDto
l2slabsmapping
)
{
public
ResponseEntity
<?>
createL1slabsmapping
(
@RequestBody
L2slabsDto
l2slabsmapping
)
{
System
.
out
.
println
(
"in l2salbsmapping contrroler"
);
System
.
out
.
println
(
"in l2salbsmapping contrroler"
);
System
.
out
.
println
(
"in l2salbsmapping"
);
System
.
out
.
println
(
"in l2salbsmapping"
);
...
...
src/main/java/com/iRecruit/modules/auth/controller/MDBMappingController.java
View file @
7d475aea
...
@@ -51,6 +51,8 @@ public class MDBMappingController {
...
@@ -51,6 +51,8 @@ public class MDBMappingController {
@PostMapping
(
"/mdbmapping/get"
)
@PostMapping
(
"/mdbmapping/get"
)
@ApiOperation
(
"Get all mdb mapping list"
)
@ApiOperation
(
"Get all mdb mapping list"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get mdb"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get mdb"
)
//Neel – 20-Apr-2020 – Tata - mdb mapping – Added function for fetch all data of mdb mapping table
public
ResponseEntity
<?>
getAllMDBMappings
(
){
public
ResponseEntity
<?>
getAllMDBMappings
(
){
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"MDB List"
,
mdbMappingService
.
findAll
().
stream
().
map
(
MDBMapping
->
new
MDBDto
(
MDBMapping
))),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"MDB List"
,
mdbMappingService
.
findAll
().
stream
().
map
(
MDBMapping
->
new
MDBDto
(
MDBMapping
))),
HttpStatus
.
OK
);
}
}
...
@@ -58,6 +60,7 @@ public class MDBMappingController {
...
@@ -58,6 +60,7 @@ public class MDBMappingController {
@PostMapping
(
"/mdbmapping/create"
)
@PostMapping
(
"/mdbmapping/create"
)
@ApiOperation
(
"Create mdbmapping"
)
@ApiOperation
(
"Create mdbmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create mdbmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create mdbmapping"
)
//Neel – 20-Apr-2020 – Tata - mdb mapping – Added function for storing all data of mdb mapping table
public
ResponseEntity
<?>
createmdbsmapping
(
@RequestBody
MDBDto
mdbmapping
)
{
public
ResponseEntity
<?>
createmdbsmapping
(
@RequestBody
MDBDto
mdbmapping
)
{
System
.
out
.
println
(
"in mdb contrroler"
);
System
.
out
.
println
(
"in mdb contrroler"
);
System
.
out
.
println
(
"in mdbmapping"
);
System
.
out
.
println
(
"in mdbmapping"
);
...
...
src/main/java/com/iRecruit/modules/auth/controller/MpbMappingController.java
View file @
7d475aea
...
@@ -45,12 +45,15 @@ public class MpbMappingController {
...
@@ -45,12 +45,15 @@ public class MpbMappingController {
@PostMapping
(
"/mpbmapping/get"
)
@PostMapping
(
"/mpbmapping/get"
)
@ApiOperation
(
"Get all mpb mapping list"
)
@ApiOperation
(
"Get all mpb mapping list"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get mpb"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Get mpb"
)
//Neel – 20-Apr-2020 – Tata - mpb mapping – Added function for storing all data of mpb mapping table
public
ResponseEntity
<?>
getAllMpbMappings
(
){
public
ResponseEntity
<?>
getAllMpbMappings
(
){
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"Mpb List"
,
mpbMappingService
.
findAll
().
stream
().
map
(
MpbMapping
->
new
mpbDto
(
MpbMapping
))),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
new
ApiResponse
(
HttpStatus
.
OK
.
value
(),
true
,
"Mpb List"
,
mpbMappingService
.
findAll
().
stream
().
map
(
MpbMapping
->
new
mpbDto
(
MpbMapping
))),
HttpStatus
.
OK
);
}
}
@PostMapping
(
"/mpbmapping/create"
)
@PostMapping
(
"/mpbmapping/create"
)
@ApiOperation
(
"Create mpbmapping"
)
@ApiOperation
(
"Create mpbmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create mpbmapping"
)
@AuditLogs
(
isRequest
=
true
,
isResponse
=
true
,
service
=
"Create mpbmapping"
)
//Neel – 20-Apr-2020 – Tata - mdb mapping – Added function for storing all data of mdb mapping table
public
ResponseEntity
<?>
createMpbmapping
(
@RequestBody
mpbDto
mpbMapping
)
{
public
ResponseEntity
<?>
createMpbmapping
(
@RequestBody
mpbDto
mpbMapping
)
{
System
.
out
.
println
(
"in mpb contrroler"
);
System
.
out
.
println
(
"in mpb contrroler"
);
System
.
out
.
println
(
"in mpbmapping"
);
System
.
out
.
println
(
"in mpbmapping"
);
...
...
src/main/java/com/iRecruit/modules/auth/service/impl/LeaderCalcServiceImpl.java
View file @
7d475aea
...
@@ -3,6 +3,7 @@ package com.iRecruit.modules.auth.service.impl;
...
@@ -3,6 +3,7 @@ package com.iRecruit.modules.auth.service.impl;
import
java.util.List
;
import
java.util.List
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -24,9 +25,10 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -24,9 +25,10 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
LeaderCalcConfig
leaderCalcConfig
;
LeaderCalcConfig
leaderCalcConfig
;
public
JSONObject
calculate
(
String
data
)
{
public
JSONObject
calculate
(
String
data
)
{
JSONObject
Calc_JSON
=
null
;
try
{
JSONObject
InputData
=
new
JSONObject
(
data
);
JSONObject
InputData
=
new
JSONObject
(
data
);
JSONObject
Calc_JSON
=
InputData
.
getJSONObject
(
"CALC_JSON"
);
Calc_JSON
=
InputData
.
getJSONObject
(
"CALC_JSON"
);
String
leader_code
=
Calc_JSON
.
getString
(
"LEADER_CODE"
);
String
leader_code
=
Calc_JSON
.
getString
(
"LEADER_CODE"
);
String
leader_designation
=
Calc_JSON
.
getString
(
"LEADER_DESIGNATION"
);
String
leader_designation
=
Calc_JSON
.
getString
(
"LEADER_DESIGNATION"
);
...
@@ -35,10 +37,7 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -35,10 +37,7 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
double
ELIGIBLE_PREMIUM
=
Calc_JSON
.
getDouble
(
"ELIGIBLE_PREMIUM"
);
double
ELIGIBLE_PREMIUM
=
Calc_JSON
.
getDouble
(
"ELIGIBLE_PREMIUM"
);
double
COMMISION_RATE
=
Calc_JSON
.
getDouble
(
"COMMISION_RATE"
);
double
COMMISION_RATE
=
Calc_JSON
.
getDouble
(
"COMMISION_RATE"
);
// Neel – 20-Apr-2020 – Tata - Leader calculation – NGPA inputs table start
//Neel – 20-Apr-2020 – Tata - Leader calculation – NGPA inputs table start
JSONObject
NGPA_Inputs_DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
)
JSONObject
NGPA_Inputs_DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
)
.
getJSONObject
(
"NGPA_INPUTS"
);
.
getJSONObject
(
"NGPA_INPUTS"
);
...
@@ -47,9 +46,12 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -47,9 +46,12 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
JSONObject
NGPA_Inputs_L2
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L2"
)
JSONObject
NGPA_Inputs_L2
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L2"
)
.
getJSONObject
(
"NGPA_INPUTS"
);
.
getJSONObject
(
"NGPA_INPUTS"
);
JSONObject
BAU_Inputs_DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
).
getJSONObject
(
"BAU_INPUTS"
);
JSONObject
BAU_Inputs_DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
)
JSONObject
BAU_Inputs_L1
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L1"
).
getJSONObject
(
"BAU_INPUTS"
);
.
getJSONObject
(
"BAU_INPUTS"
);
JSONObject
BAU_Inputs_L2
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L2"
).
getJSONObject
(
"BAU_INPUTS"
);
JSONObject
BAU_Inputs_L1
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L1"
)
.
getJSONObject
(
"BAU_INPUTS"
);
JSONObject
BAU_Inputs_L2
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L2"
)
.
getJSONObject
(
"BAU_INPUTS"
);
JSONObject
BAU_Inputs2_DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
)
JSONObject
BAU_Inputs2_DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
)
.
getJSONObject
(
"BAU_INPUTS_2"
);
.
getJSONObject
(
"BAU_INPUTS_2"
);
...
@@ -115,12 +117,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -115,12 +117,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
NGPA_Inputs_TOTAL
.
put
(
"TOTAL_NOP_NGPA"
,
NGPA_Inputs_TOTAL
.
put
(
"TOTAL_NOP_NGPA"
,
Double
.
valueOf
(
TOTAL_NGPA_WNBP_TOTAL
)
/
Double
.
valueOf
(
TOTAL_CASE_SIZE_PER_NOP
));
Double
.
valueOf
(
TOTAL_NGPA_WNBP_TOTAL
)
/
Double
.
valueOf
(
TOTAL_CASE_SIZE_PER_NOP
));
// Neel – 20-Apr-2020 – Tata - Leader calculation – NGPA inputs table end
// Neel – 20-Apr-2020 – Tata - Leader calculation – BAU inputs table start
//Neel – 20-Apr-2020 – Tata - Leader calculation – NGPA inputs table end
//Neel – 20-Apr-2020 – Tata - Leader calculation – BAU inputs table start
double
Active_Agent_BAU_Dt
=
BAU_Inputs_DT
.
getDouble
(
"ACTIVE_AGENT_BAU_DT"
);
double
Active_Agent_BAU_Dt
=
BAU_Inputs_DT
.
getDouble
(
"ACTIVE_AGENT_BAU_DT"
);
double
NOP_NGPA_BAU_Dt
=
BAU_Inputs_DT
.
getDouble
(
"NOP_AGENT_BAU_DT"
);
double
NOP_NGPA_BAU_Dt
=
BAU_Inputs_DT
.
getDouble
(
"NOP_AGENT_BAU_DT"
);
...
@@ -149,7 +148,8 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -149,7 +148,8 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
double
TOTAL_BAU_WNBP_L1
=
BAU_Inputs_L1
.
getDouble
(
"TOTAL_BAU_WNBP_L1"
);
double
TOTAL_BAU_WNBP_L1
=
BAU_Inputs_L1
.
getDouble
(
"TOTAL_BAU_WNBP_L1"
);
double
TOTAL_BAU_WNBP_L2
=
BAU_Inputs_L2
.
getDouble
(
"TOTAL_BAU_WNBP_L2"
);
double
TOTAL_BAU_WNBP_L2
=
BAU_Inputs_L2
.
getDouble
(
"TOTAL_BAU_WNBP_L2"
);
BAU_Inputs_TOTAL
.
put
(
"TOTAL_BAU_WNBP_TOATL"
,
Addition
(
TOTAL_BAU_WNBP_DT
,
TOTAL_BAU_WNBP_L1
,
TOTAL_BAU_WNBP_L2
));
BAU_Inputs_TOTAL
.
put
(
"TOTAL_BAU_WNBP_TOATL"
,
Addition
(
TOTAL_BAU_WNBP_DT
,
TOTAL_BAU_WNBP_L1
,
TOTAL_BAU_WNBP_L2
));
BAU_Inputs_TOTAL
.
put
(
"TOTAL_CASE_SIZE_PER_NOP_BAU"
,
Average
(
Double
.
valueOf
(
CASE_SIZE_PER_NOP_BAU_Dt
),
BAU_Inputs_TOTAL
.
put
(
"TOTAL_CASE_SIZE_PER_NOP_BAU"
,
Average
(
Double
.
valueOf
(
CASE_SIZE_PER_NOP_BAU_Dt
),
Double
.
valueOf
(
CASE_SIZE_PER_NOP_BAU_L1
),
Double
.
valueOf
(
CASE_SIZE_PER_NOP_BAU_L2
)));
Double
.
valueOf
(
CASE_SIZE_PER_NOP_BAU_L1
),
Double
.
valueOf
(
CASE_SIZE_PER_NOP_BAU_L2
)));
...
@@ -159,11 +159,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -159,11 +159,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
BAU_Inputs_TOTAL
.
put
(
"TOTAL_NOP_AGENT_BAU"
,
BAU_Inputs_TOTAL
.
put
(
"TOTAL_NOP_AGENT_BAU"
,
Double
.
valueOf
(
TOTAL_BAU_WNBP_TOATL
)
/
Double
.
valueOf
(
TOTAL_CASE_SIZE_PER_NOP_BAU
));
Double
.
valueOf
(
TOTAL_BAU_WNBP_TOATL
)
/
Double
.
valueOf
(
TOTAL_CASE_SIZE_PER_NOP_BAU
));
//Neel – 20-Apr-2020 – Tata - Leader calculation – BAU inputs table end
// Neel – 20-Apr-2020 – Tata - Leader calculation – BAU inputs table end
// Neel – 20-Apr-2020 – Tata - Leader calculation – BAU2 inputs table start
//Neel – 20-Apr-2020 – Tata - Leader calculation – BAU2 inputs table start
double
ACTIVE_AGENT_LP_DT
=
BAU_Inputs2_DT
.
getDouble
(
"ACTIVE_AGENT_LP_DT"
);
double
ACTIVE_AGENT_LP_DT
=
BAU_Inputs2_DT
.
getDouble
(
"ACTIVE_AGENT_LP_DT"
);
double
WNBP_LP_DT
=
BAU_Inputs2_DT
.
getDouble
(
"WNBP_LP_DT"
);
double
WNBP_LP_DT
=
BAU_Inputs2_DT
.
getDouble
(
"WNBP_LP_DT"
);
...
@@ -188,14 +186,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -188,14 +186,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
Addition
(
ACTIVE_AGENT_LP_DT
,
ACTIVE_AGENT_LP_L1
,
ACTIVE_AGENT_LP_L2
));
Addition
(
ACTIVE_AGENT_LP_DT
,
ACTIVE_AGENT_LP_L1
,
ACTIVE_AGENT_LP_L2
));
BAU_Inputs_2_TOTAL
.
put
(
"TOTAL_PA"
,
Addition
(
PA_DT
,
PA_L1
,
PA_L2
));
BAU_Inputs_2_TOTAL
.
put
(
"TOTAL_PA"
,
Addition
(
PA_DT
,
PA_L1
,
PA_L2
));
// Neel – 20-Apr-2020 – Tata - Leader calculation – BAU2 inputs table ends
// Neel – 20-Apr-2020 – Tata - Leader calculation – earning table starts
//Neel – 20-Apr-2020 – Tata - Leader calculation – BAU2 inputs table ends
//Neel – 20-Apr-2020 – Tata - Leader calculation – earning table starts
JSONObject
DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
);
JSONObject
DT
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"DT"
);
JSONObject
L1
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L1"
);
JSONObject
L1
=
InputData
.
getJSONObject
(
"CALC_JSON"
).
getJSONObject
(
"L1"
);
...
@@ -218,9 +211,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -218,9 +211,9 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
EARNING_L2
=
L2
.
getJSONObject
(
"EARNING_L2"
);
EARNING_L2
=
L2
.
getJSONObject
(
"EARNING_L2"
);
EARNING_TOTAL
=
TOTAL
.
getJSONObject
(
"EARNING_TOTAL"
);
EARNING_TOTAL
=
TOTAL
.
getJSONObject
(
"EARNING_TOTAL"
);
EARNING_DT
.
put
(
"AGENT_FYC_25_DT"
,
calc
(
Total_NGPA_WNBP_Dt
,
TOTAL_BAU_WNBP_DT
,
COMMISION_RATE
));
EARNING_DT
.
put
(
"AGENT_FYC_25_DT"
,
calc
(
Total_NGPA_WNBP_Dt
,
TOTAL_BAU_WNBP_DT
,
COMMISION_RATE
));
EARNING_L1
.
put
(
"AGENT_FYC_25_L1"
,
calc
(
Total_NGPA_WNBP_L1
,
TOTAL_BAU_WNBP_L1
,
COMMISION_RATE
));
EARNING_L1
.
put
(
"AGENT_FYC_25_L1"
,
calc
(
Total_NGPA_WNBP_L1
,
TOTAL_BAU_WNBP_L1
,
COMMISION_RATE
));
EARNING_L2
.
put
(
"AGENT_FYC_25_L2"
,
calc
(
Total_NGPA_WNBP_L2
,
TOTAL_BAU_WNBP_L2
,
COMMISION_RATE
));
EARNING_L2
.
put
(
"AGENT_FYC_25_L2"
,
calc
(
Total_NGPA_WNBP_L2
,
TOTAL_BAU_WNBP_L2
,
COMMISION_RATE
));
double
AGENT_FYC_25_DT
=
EARNING_DT
.
getDouble
(
"AGENT_FYC_25_DT"
);
double
AGENT_FYC_25_DT
=
EARNING_DT
.
getDouble
(
"AGENT_FYC_25_DT"
);
double
AGENT_FYC_25_L1
=
EARNING_L1
.
getDouble
(
"AGENT_FYC_25_L1"
);
double
AGENT_FYC_25_L1
=
EARNING_L1
.
getDouble
(
"AGENT_FYC_25_L1"
);
...
@@ -310,7 +303,8 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -310,7 +303,8 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
}
}
EARNING_TOTAL
.
put
(
"TOTAL_MONTHLY_PERFORMANCE_BONUS"
,
Multiplication
((
val
*
percentage
)
/
100
,
TOTAL_WFYC
,
1
));
EARNING_TOTAL
.
put
(
"TOTAL_MONTHLY_PERFORMANCE_BONUS"
,
Multiplication
((
val
*
percentage
)
/
100
,
TOTAL_WFYC
,
1
));
double
TOTAL_MONTHLY_PERFORMANCE_BONUS
=
EARNING_TOTAL
.
getDouble
(
"TOTAL_MONTHLY_PERFORMANCE_BONUS"
);
double
TOTAL_MONTHLY_PERFORMANCE_BONUS
=
EARNING_TOTAL
.
getDouble
(
"TOTAL_MONTHLY_PERFORMANCE_BONUS"
);
...
@@ -351,22 +345,22 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -351,22 +345,22 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
double
PA_DEVELOPMENT_L1
=
EARNING_L1
.
getDouble
(
"PA_DEVELOPMENT_L1"
);
double
PA_DEVELOPMENT_L1
=
EARNING_L1
.
getDouble
(
"PA_DEVELOPMENT_L1"
);
double
PA_DEVELOPMENT_L2
=
EARNING_L2
.
getDouble
(
"PA_DEVELOPMENT_L2"
);
double
PA_DEVELOPMENT_L2
=
EARNING_L2
.
getDouble
(
"PA_DEVELOPMENT_L2"
);
EARNING_TOTAL
.
put
(
"TOTAL_PA_DEVELOPMENT"
,
Addition
(
PA_DEVELOPMENT_DT
,
PA_DEVELOPMENT_L1
,
PA_DEVELOPMENT_L2
));
EARNING_TOTAL
.
put
(
"TOTAL_PA_DEVELOPMENT"
,
Addition
(
PA_DEVELOPMENT_DT
,
PA_DEVELOPMENT_L1
,
PA_DEVELOPMENT_L2
));
// MDB mappings
//MDB mappings
JSONArray
mdb2array
=
leaderCalcConfig
.
getValue
(
"mdb"
);
JSONArray
mdb2array
=
leaderCalcConfig
.
getValue
(
"mdb"
);
System
.
out
.
println
(
"mdb2array"
);
System
.
out
.
println
(
"mdb2array"
);
System
.
out
.
println
(
mdb2array
);
System
.
out
.
println
(
mdb2array
);
NGPA_Dt
=
2
;
NGPA_Dt
=
2
;
TOTAL_NGPA_EP_125_DT
=
1250000
;
TOTAL_NGPA_EP_125_DT
=
1250000
;
double
monthly_ep_18
=
0
;
double
monthly_ep_18
=
0
;
double
monthly_ep_36
=
0
;
double
monthly_ep_36
=
0
;
double
monthly_ep_72
=
0
;
double
monthly_ep_72
=
0
;
double
monthly_ep_144
=
0
;
double
monthly_ep_144
=
0
;
for
(
int
i
=
0
;
i
<
mdb2array
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
mdb2array
.
length
();
i
++)
{
...
@@ -397,34 +391,27 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -397,34 +391,27 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
if
(
TOTAL_NGPA_EP_125_DT
<
180000
)
{
if
(
TOTAL_NGPA_EP_125_DT
<
180000
)
{
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
0
);
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
0
);
}
else
if
(
TOTAL_NGPA_EP_125_DT
>
180000
&&
TOTAL_NGPA_EP_125_DT
<
360000
)
{
}
else
if
(
TOTAL_NGPA_EP_125_DT
>
180000
&&
TOTAL_NGPA_EP_125_DT
<
360000
)
{
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_18
);
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_18
);
}
}
else
if
(
TOTAL_NGPA_EP_125_DT
>
360000
&&
TOTAL_NGPA_EP_125_DT
<
720000
)
{
else
if
(
TOTAL_NGPA_EP_125_DT
>
360000
&&
TOTAL_NGPA_EP_125_DT
<
720000
)
{
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_36
);
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_36
);
}
}
else
if
(
TOTAL_NGPA_EP_125_DT
>
720000
&&
TOTAL_NGPA_EP_125_DT
<
1400000
)
{
else
if
(
TOTAL_NGPA_EP_125_DT
>
720000
&&
TOTAL_NGPA_EP_125_DT
<
1400000
)
{
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_72
);
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_72
);
}
}
else
{
else
{
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_144
);
EARNING_DT
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
,
monthly_ep_144
);
}
}
// System.out.println("neel");
// System.out.println("neel");
System
.
out
.
println
(
EARNING_DT
.
getDouble
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
));
System
.
out
.
println
(
EARNING_DT
.
getDouble
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
));
double
MONTHLY_DEVELOPMENT_BONUS_DT
=
EARNING_DT
.
getDouble
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
);
double
MONTHLY_DEVELOPMENT_BONUS_DT
=
EARNING_DT
.
getDouble
(
"MONTHLY_DEVELOPMENT_BONUS_DT"
);
EARNING_L1
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_L1"
,
0
);
EARNING_L1
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_L1"
,
0
);
EARNING_L2
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_L2"
,
0
);
EARNING_L2
.
put
(
"MONTHLY_DEVELOPMENT_BONUS_L2"
,
0
);
EARNING_TOTAL
.
put
(
"TOTAL_MONTHLY_DEVELOPMENT_BONUS"
,
MONTHLY_DEVELOPMENT_BONUS_DT
);
EARNING_TOTAL
.
put
(
"TOTAL_MONTHLY_DEVELOPMENT_BONUS"
,
MONTHLY_DEVELOPMENT_BONUS_DT
);
JSONArray
l1array
=
leaderCalcConfig
.
getValue
(
"l1slabs"
);
JSONArray
l1array
=
leaderCalcConfig
.
getValue
(
"l1slabs"
);
double
multiplier
=
0
;
double
multiplier
=
0
;
...
@@ -453,8 +440,6 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -453,8 +440,6 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
}
}
EARNING_L1
.
put
(
"ACTIVATION_L1"
,
(
Active_Agent_BAU_L1
*
multiplier
)
+
(
ACTIVE_AGENT_LP_L1
*
500
));
EARNING_L1
.
put
(
"ACTIVATION_L1"
,
(
Active_Agent_BAU_L1
*
multiplier
)
+
(
ACTIVE_AGENT_LP_L1
*
500
));
JSONArray
L2Slabsarray
=
leaderCalcConfig
.
getValue
(
"l2slabs"
);
JSONArray
L2Slabsarray
=
leaderCalcConfig
.
getValue
(
"l2slabs"
);
System
.
out
.
println
(
"L2Slabsarray"
);
System
.
out
.
println
(
"L2Slabsarray"
);
System
.
out
.
println
(
L2Slabsarray
);
System
.
out
.
println
(
L2Slabsarray
);
...
@@ -535,15 +520,24 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
...
@@ -535,15 +520,24 @@ public class LeaderCalcServiceImpl implements LeaderCalcService {
EARNING_TOTAL
.
put
(
"TOTAL_ANNUALISED_EARNING"
,
(
TOTAL_EARNING_TOTAL
*
12
));
EARNING_TOTAL
.
put
(
"TOTAL_ANNUALISED_EARNING"
,
(
TOTAL_EARNING_TOTAL
*
12
));
// Neel – 20-Apr-2020 – Tata - Leader calculation – earning table ends
System
.
out
.
println
(
Calc_JSON
);
return
Calc_JSON
;
}
//Neel – 20-Apr-2020 – Tata - Leader calculation – earning table ends
System
.
out
.
println
(
Calc_JSON
);
catch
(
Exception
e
)
{
Calc_JSON
=
new
JSONObject
();
Calc_JSON
.
put
(
"Error_Code"
,
"500"
);
Calc_JSON
.
put
(
"Error_Message"
,
"Technical Error caught while calculating"
);
return
Calc_JSON
;
return
Calc_JSON
;
}
}
}
private
double
Multiplication
(
double
Str1
,
double
Str2
,
double
Str3
)
{
private
double
Multiplication
(
double
Str1
,
double
Str2
,
double
Str3
)
{
double
result
=
Str1
*
Str2
*
Str3
;
double
result
=
Str1
*
Str2
*
Str3
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment