Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Sign in
Toggle navigation
Open sidebar
Kamal Agrawal
StateStreetProject-dev
Commits
d760aa11
Commit
d760aa11
authored
Jun 09, 2021
by
manishatyagi
Browse files
Add api code to generate Tenure wise assessment infographic report
parent
2d8b9fa3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
226 additions
and
10 deletions
+226
-10
src/main/java/com/statestreet/controller/ReportController.java
...ain/java/com/statestreet/controller/ReportController.java
+11
-0
src/main/java/com/statestreet/dao/QuestionSetRepositoryCustom.java
...java/com/statestreet/dao/QuestionSetRepositoryCustom.java
+2
-0
src/main/java/com/statestreet/dao/QuestionSetRepositoryImpl.java
...n/java/com/statestreet/dao/QuestionSetRepositoryImpl.java
+34
-8
src/main/java/com/statestreet/dao/QuizResultRepositoryCustom.java
.../java/com/statestreet/dao/QuizResultRepositoryCustom.java
+2
-0
src/main/java/com/statestreet/dao/QuizResultRepositoryImpl.java
...in/java/com/statestreet/dao/QuizResultRepositoryImpl.java
+37
-0
src/main/java/com/statestreet/model/PendingUserCount.java
src/main/java/com/statestreet/model/PendingUserCount.java
+1
-0
src/main/java/com/statestreet/service/LobServiceImpl.java
src/main/java/com/statestreet/service/LobServiceImpl.java
+2
-2
src/main/java/com/statestreet/service/ReportService.java
src/main/java/com/statestreet/service/ReportService.java
+3
-0
src/main/java/com/statestreet/service/ReportServiceImpl.java
src/main/java/com/statestreet/service/ReportServiceImpl.java
+131
-0
src/main/java/com/statestreet/utils/CommonUtils.java
src/main/java/com/statestreet/utils/CommonUtils.java
+3
-0
No files found.
src/main/java/com/statestreet/controller/ReportController.java
View file @
d760aa11
...
...
@@ -186,6 +186,17 @@ public class ReportController {
return
reportService
.
getGenderAssessInfographicReport
(
startDate
,
endDate
,
assessmentId
,
subLobId
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/api/admin/getTenureAssessmentInfographicReport"
)
public
ResponseEntity
<
List
<
UserAssessmentInfographicReport
>>
getTenureAssessmentInfographicReport
(
@RequestParam
(
value
=
"startDate"
,
required
=
true
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
true
)
String
endDate
,
@RequestParam
(
value
=
"assessmentId"
,
required
=
true
)
long
assessmentId
,
@RequestParam
(
value
=
"subLobId"
)
long
subLobId
)
throws
Exception
{
log
.
debug
(
"Inside ReportController called method getTenureAssessmentInfographicReport with parameter,"
+
"startDate={},endDate={},assessmentId={},subLobId={}"
,
startDate
,
endDate
,
assessmentId
,
subLobId
);
return
reportService
.
getTenureAssessmentInfographicReport
(
startDate
,
endDate
,
assessmentId
,
subLobId
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/api/admin/getCategoryAssessmentInfographicReport"
)
public
ResponseEntity
<
List
<
DBObject
>>
getCategoryAssessmentInfographicReport
(
@RequestParam
(
value
=
"startDate"
,
required
=
true
)
String
startDate
,
...
...
src/main/java/com/statestreet/dao/QuestionSetRepositoryCustom.java
View file @
d760aa11
...
...
@@ -42,6 +42,8 @@ public interface QuestionSetRepositoryCustom {
public
List
<
BotQuizResult
>
getUserQuestionList
(
String
userId
)
throws
Exception
;
List
<
PendingUserCount
>
getUnattemptedUsers
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
,
List
<
String
>
userId
,
String
criteria
)
throws
Exception
;
List
<
PendingUserCount
>
getPendingUsers
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
,
List
<
String
>
userId
,
Date
currentDate
)
throws
Exception
;
List
<
DBObject
>
getUnattemptedQuestionSetCount
(
long
assessmentId
,
List
<
String
>
userIdList
)
throws
Exception
;
}
src/main/java/com/statestreet/dao/QuestionSetRepositoryImpl.java
View file @
d760aa11
...
...
@@ -12,8 +12,6 @@ import org.springframework.data.mongodb.core.MongoOperations;
import
org.springframework.data.mongodb.core.aggregation.Aggregation
;
import
org.springframework.data.mongodb.core.aggregation.AggregationOperation
;
import
org.springframework.data.mongodb.core.aggregation.AggregationResults
;
import
org.springframework.data.mongodb.core.aggregation.ConditionalOperators
;
import
org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
...
...
@@ -259,7 +257,38 @@ public class QuestionSetRepositoryImpl implements QuestionSetRepositoryCustom{
AggregationOperation
sort
=
Aggregation
.
sort
(
Sort
.
Direction
.
ASC
,
"criteria"
);
Aggregation
agg
=
Aggregation
.
newAggregation
(
match
,
project
,
group
,
lookup
,
unwind
,
project1
,
group1
,
project2
,
sort
);
AggregationResults
<
PendingUserCount
>
result
=
template
.
aggregate
(
agg
,
COLLECTION
,
PendingUserCount
.
class
);
log
.
debug
(
"Response returned from QuestionSetRepositoryImpl -- getUserQuestionList , result={}"
,
result
.
getMappedResults
().
size
());
log
.
debug
(
"Response returned from QuestionSetRepositoryImpl -- getUnattemptedUsers , result={}"
,
result
.
getMappedResults
().
size
());
return
result
.
getMappedResults
();
}
@Override
public
List
<
PendingUserCount
>
getPendingUsers
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
,
List
<
String
>
userId
,
Date
currentDate
)
throws
Exception
{
// TODO Auto-generated method stub
log
.
debug
(
"Inside QuestionSetRepositoryImpl called getPendingUsers method with parameter, "
+
"startDate={},endDate={},assessmentId={},subLobId={},currentDate={}"
,
startDate
,
endDate
,
assessmentId
,
subLobId
,
currentDate
);
AggregationOperation
match
=
Aggregation
.
match
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"isActive"
).
is
(
true
),
Criteria
.
where
(
"isAttempted"
).
is
(
false
),
Criteria
.
where
(
"subLob._id"
).
is
(
subLobId
),
Criteria
.
where
(
"assessmentId"
).
is
(
assessmentId
),
Criteria
.
where
(
"userId"
).
nin
(
userId
)));
AggregationOperation
project
=
Aggregation
.
project
(
"userId"
);
AggregationOperation
group
=
Aggregation
.
group
(
"userId"
).
addToSet
(
currentDate
).
as
(
"currentDate"
);
AggregationOperation
unwind
=
Aggregation
.
unwind
(
"currentDate"
);
AggregationOperation
lookup
=
Aggregation
.
lookup
(
"User_Master"
,
"_id"
,
"_id"
,
"userList"
);
AggregationOperation
unwind1
=
Aggregation
.
unwind
(
"userList"
);
AggregationOperation
project1
=
Aggregation
.
project
(
"userId"
,
"currentDate"
).
and
(
"userList.joiningDateSSBJV"
).
as
(
"criteria"
);
AggregationOperation
group1
=
Aggregation
.
group
(
"criteria"
,
"currentDate"
).
count
().
as
(
"pendingCount"
);
AggregationOperation
project2
=
Aggregation
.
project
(
"pendingCount"
)
.
andExpression
(
"(currentDate - criteria)/(1000*60*60*24*30)"
).
as
(
"duration"
).
and
(
"_id"
).
as
(
"criteria"
);
AggregationOperation
sort
=
Aggregation
.
sort
(
Sort
.
Direction
.
ASC
,
"criteria"
);
//Aggregation agg = Aggregation.newAggregation(match,project,group);
Aggregation
agg
=
Aggregation
.
newAggregation
(
match
,
project
,
group
,
unwind
,
lookup
,
unwind1
,
project1
,
group1
,
project2
,
sort
);
AggregationResults
<
PendingUserCount
>
result
=
template
.
aggregate
(
agg
,
COLLECTION
,
PendingUserCount
.
class
);
log
.
debug
(
"Response returned from QuestionSetRepositoryImpl -- getPendingUsers , result={}"
,
result
.
getMappedResults
().
size
());
return
result
.
getMappedResults
();
}
...
...
@@ -279,10 +308,7 @@ public class QuestionSetRepositoryImpl implements QuestionSetRepositoryCustom{
Aggregation
agg
=
Aggregation
.
newAggregation
(
match
,
project
,
group
,
group1
);
AggregationResults
<
DBObject
>
result
=
template
.
aggregate
(
agg
,
COLLECTION
,
DBObject
.
class
);
log
.
debug
(
"Response returned from QuestionSetRepositoryImpl -- getUnattemptedQuestionSetUsers , result={}"
,
result
.
getMappedResults
());
if
(
result
.
getMappedResults
().
size
()!=
0
)
return
result
.
getMappedResults
();
else
return
null
;
return
result
.
getMappedResults
();
}
}
src/main/java/com/statestreet/dao/QuizResultRepositoryCustom.java
View file @
d760aa11
...
...
@@ -72,6 +72,8 @@ public interface QuizResultRepositoryCustom {
List
<
DBObject
>
getCriteriaWiseAssessInfographicReport
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
,
String
criteria
)
throws
Exception
;
List
<
DBObject
>
getTenureWiseAssessInfographicReport
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
,
Date
currentDate
)
throws
Exception
;
List
<
DBObject
>
getCategoryAssessmentInfographicReport
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
;
List
<
DBObject
>
getUserAssessmentReport
(
Date
stDate
,
Date
enDate
,
String
userId
)
throws
Exception
;
...
...
src/main/java/com/statestreet/dao/QuizResultRepositoryImpl.java
View file @
d760aa11
...
...
@@ -782,6 +782,43 @@ AggregationOperation match = Aggregation.match(new Criteria().andOperator(Crite
return
result
.
getMappedResults
();
}
@Override
public
List
<
DBObject
>
getTenureWiseAssessInfographicReport
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
,
Date
currentDate
)
throws
Exception
{
// TODO Auto-generated method stub
log
.
debug
(
"Inside QuizResultRepositoryImpl called getTenureWiseAssessInfographicReport method, with parameter"
+
" startDate={},endDate={},assessmentId={},subLobId={},currentDate={}"
,
startDate
,
endDate
,
assessmentId
,
subLobId
,
currentDate
);
AggregationOperation
matchQ
=
Aggregation
.
match
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"quizDate"
)
.
gte
(
startDate
).
lte
(
endDate
),
Criteria
.
where
(
"questionSet.subLob._id"
).
is
(
subLobId
)
,
Criteria
.
where
(
"questionSet.assessmentId"
).
is
(
assessmentId
)));
Cond
passQuiz
=
ConditionalOperators
.
when
(
Criteria
.
where
(
"quizOutcome"
).
is
(
CommonUtils
.
Quiz_Status
.
Pass
.
name
())).
then
(
1
).
otherwise
(
0
);
Cond
failQuiz
=
ConditionalOperators
.
when
(
Criteria
.
where
(
"quizOutcome"
).
is
(
CommonUtils
.
Quiz_Status
.
Fail
.
name
())).
then
(
1
).
otherwise
(
0
);
Cond
evalPendingQuiz
=
ConditionalOperators
.
when
(
Criteria
.
where
(
"quizOutcome"
).
is
(
CommonUtils
.
Quiz_Status
.
Pending
.
name
())).
then
(
1
).
otherwise
(
0
);
AggregationOperation
projectQ
=
Aggregation
.
project
(
"_id"
).
and
(
"questionSet.userId"
).
as
(
"userId"
)
.
and
(
passQuiz
).
as
(
"pass"
).
and
(
failQuiz
).
as
(
"fail"
).
and
(
evalPendingQuiz
).
as
(
"evalPending"
);
AggregationOperation
sort
=
Aggregation
.
sort
(
Sort
.
Direction
.
ASC
,
"_id"
);
AggregationOperation
groupQ
=
Aggregation
.
group
(
"userId"
).
last
(
"pass"
).
as
(
"pass"
).
last
(
"fail"
).
as
(
"fail"
)
.
last
(
"evalPending"
).
as
(
"evalPending"
).
addToSet
(
currentDate
).
as
(
"currentDate"
);
AggregationOperation
unwind
=
Aggregation
.
unwind
(
"currentDate"
);
AggregationOperation
lookup
=
Aggregation
.
lookup
(
"User_Master"
,
"_id"
,
"_id"
,
"userList"
);
AggregationOperation
unwind1
=
Aggregation
.
unwind
(
"userList"
);
AggregationOperation
project
=
Aggregation
.
project
(
"pass"
,
"fail"
,
"evalPending"
,
"currentDate"
)
.
and
(
"userList.joiningDateSSBJV"
).
as
(
"criteria"
).
and
(
"_id"
).
as
(
"userId"
);
AggregationOperation
group
=
Aggregation
.
group
(
"criteria"
,
"currentDate"
).
sum
(
"pass"
).
as
(
"pass"
).
sum
(
"fail"
).
as
(
"fail"
)
.
sum
(
"evalPending"
).
as
(
"evalPending"
).
push
(
"userId"
).
as
(
"userId"
);
AggregationOperation
project2
=
Aggregation
.
project
(
"pass"
,
"fail"
,
"evalPending"
,
"userId"
,
"criteria"
)
.
andExpression
(
"(currentDate - criteria)/(1000*60*60*24*30)"
).
as
(
"duration"
);
AggregationOperation
project1
=
Aggregation
.
project
(
"criteria"
,
"pass"
,
"fail"
,
"evalPending"
,
"userId"
,
"duration"
)
.
andExpression
(
"add(pass,fail,evalPending)"
).
as
(
"total"
);
AggregationOperation
sort1
=
Aggregation
.
sort
(
Sort
.
Direction
.
ASC
,
"criteria"
);
Aggregation
agg
=
Aggregation
.
newAggregation
(
matchQ
,
projectQ
,
sort
,
groupQ
,
unwind
,
lookup
,
unwind1
,
project
,
group
,
project2
,
project1
,
sort1
);
AggregationResults
<
DBObject
>
result
=
template
.
aggregate
(
agg
,
COLLECTION
,
DBObject
.
class
);
log
.
debug
(
"Response returned from QuizResultRepositoryImpl--getTenureWiseAssessInfographicReport method,result={}"
,
result
.
getMappedResults
().
size
());
return
result
.
getMappedResults
();
}
@Override
public
List
<
DBObject
>
getCategoryAssessmentInfographicReport
(
Date
startDate
,
Date
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
{
...
...
src/main/java/com/statestreet/model/PendingUserCount.java
View file @
d760aa11
...
...
@@ -10,5 +10,6 @@ import lombok.NoArgsConstructor;
public
class
PendingUserCount
{
private
long
pendingCount
;
private
double
duration
;
private
String
criteria
;
}
src/main/java/com/statestreet/service/LobServiceImpl.java
View file @
d760aa11
...
...
@@ -247,10 +247,10 @@ public class LobServiceImpl implements LobService{
}
if
(
userList
.
isEmpty
())
{
log
.
debug
(
"Response returned from LobServiceImpl -- getLobByUser method, userList={}"
,
userList
);
return
new
ResponseEntity
<
List
<
UserMaster
>>(
HttpStatus
.
OK
);
return
new
ResponseEntity
<
List
<
UserMaster
>>(
HttpStatus
.
NO_CONTENT
);
}
log
.
debug
(
"Response returned from LobServiceImpl -- getLobByUser method, userList={}"
,
userList
);
return
new
ResponseEntity
<
List
<
UserMaster
>>(
HttpStatus
.
BAD_REQUEST
);
return
new
ResponseEntity
<
List
<
UserMaster
>>(
HttpStatus
.
FOUND
);
}
}
src/main/java/com/statestreet/service/ReportService.java
View file @
d760aa11
...
...
@@ -59,6 +59,9 @@ public interface ReportService {
public
ResponseEntity
<
List
<
UserAssessmentInfographicReport
>>
getGenderAssessInfographicReport
(
String
startDate
,
String
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
;
ResponseEntity
<
List
<
UserAssessmentInfographicReport
>>
getTenureAssessmentInfographicReport
(
String
startDate
,
String
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
;
public
ResponseEntity
<
List
<
DBObject
>>
getCategoryAssessmentInfographicReport
(
String
startDate
,
String
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
;
...
...
src/main/java/com/statestreet/service/ReportServiceImpl.java
View file @
d760aa11
...
...
@@ -610,6 +610,137 @@ public class ReportServiceImpl implements ReportService{
}
}
@Override
public
ResponseEntity
<
List
<
UserAssessmentInfographicReport
>>
getTenureAssessmentInfographicReport
(
String
startDate
,
String
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
{
// TODO Auto-generated method stub
log
.
debug
(
"Inside ReportServiceImpl called method getTenureAssessmentInfographicReport with parameter,"
+
"startDate={},endDate={},assessmentId={},subLobId={}"
,
startDate
,
endDate
,
assessmentId
,
subLobId
);
DATE_FORMAT
.
setTimeZone
(
CommonUtils
.
TIME_ZONE
);
Date
stDate
=
DATE_FORMAT
.
parse
(
startDate
);
Date
enDate
=
DATE_FORMAT
.
parse
(
endDate
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
enDate
);
cal
.
add
(
Calendar
.
DATE
,
1
);
enDate
=
DATE_FORMAT
.
parse
(
DATE_FORMAT
.
format
(
cal
.
getTime
()));
Date
currentDate
=
DATE_FORMAT
.
parse
(
DATE_FORMAT
.
format
(
new
Date
()));
List
<
UserAssessmentInfographicReport
>
report
=
new
ArrayList
<
UserAssessmentInfographicReport
>();
UserAssessmentInfographicReport
objReport
;
List
<
DBObject
>
result
=
quizResultRepo
.
getTenureWiseAssessInfographicReport
(
stDate
,
enDate
,
assessmentId
,
subLobId
,
currentDate
);
List
<
String
>
userIdList
=
new
ArrayList
<
String
>();
if
(
result
.
size
()>
0
)
{
String
[]
userArray
=
result
.
stream
().
map
(
dbObject
->
dbObject
.
get
(
"userId"
)).
map
(
Object:
:
toString
).
toArray
(
String
[]::
new
);
for
(
String
user:
userArray
)
{
user
=
user
.
substring
(
1
,
user
.
length
()-
1
);
userIdList
.
add
(
user
);
}
}
List
<
PendingUserCount
>
pendingResult
=
quesSetRepo
.
getPendingUsers
(
stDate
,
enDate
,
assessmentId
,
subLobId
,
userIdList
,
currentDate
);
List
<
PendingUserCount
>
pendingResultTransform
=
pendingResult
.
stream
().
collect
(
Collectors
.
groupingBy
(
obj
->
obj
.
getDuration
()))
.
entrySet
().
stream
()
.
map
(
e
->
e
.
getValue
().
stream
()
.
reduce
((
f1
,
f2
)
->
new
PendingUserCount
(
f1
.
getPendingCount
()+
f2
.
getPendingCount
(),
f1
.
getDuration
(),
f1
.
getCriteria
())))
.
map
(
f
->
f
.
get
())
.
collect
(
Collectors
.
toList
());
Map
<
Double
,
Long
>
pendingMap
=
pendingResultTransform
.
stream
().
collect
(
Collectors
.
toMap
(
PendingUserCount
::
getDuration
,
PendingUserCount
::
getPendingCount
));
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++)
{
DBObject
obj
=
result
.
get
(
i
);
double
duration
=
Double
.
parseDouble
(
obj
.
get
(
"duration"
).
toString
());
String
tenure
=
getTenureRange
(
duration
);
if
(
pendingMap
.
containsKey
(
duration
))
{
long
pendingCount
=
pendingMap
.
get
(
duration
);
long
total
=
Long
.
parseLong
(
obj
.
get
(
"total"
).
toString
())+
pendingCount
;
objReport
=
new
UserAssessmentInfographicReport
(
tenure
,
Long
.
parseLong
(
obj
.
get
(
"pass"
).
toString
()),
Long
.
parseLong
(
obj
.
get
(
"fail"
).
toString
()),
Long
.
parseLong
(
obj
.
get
(
"evalPending"
).
toString
()),
pendingCount
,
total
);
report
.
add
(
objReport
);
pendingMap
.
remove
(
duration
);
}
else
{
objReport
=
new
UserAssessmentInfographicReport
(
tenure
,
Long
.
parseLong
(
obj
.
get
(
"pass"
).
toString
()),
Long
.
parseLong
(
obj
.
get
(
"fail"
).
toString
()),
Long
.
parseLong
(
obj
.
get
(
"evalPending"
).
toString
()),
0
,
Long
.
parseLong
(
obj
.
get
(
"total"
).
toString
()));
report
.
add
(
objReport
);
}
}
if
(
pendingMap
.
size
()>
0
)
{
pendingMap
.
forEach
((
key
,
value
)->
{
String
tenure
=
getTenureRange
(
key
);
UserAssessmentInfographicReport
tempObj
=
new
UserAssessmentInfographicReport
(
tenure
,
0
,
0
,
0
,
value
,
value
);
report
.
add
(
tempObj
);
});
}
if
(
report
.
size
()>
0
)
{
List
<
UserAssessmentInfographicReport
>
transform
=
report
.
stream
().
collect
(
Collectors
.
groupingBy
(
obj
->
obj
.
getCriteria
()))
.
entrySet
().
stream
()
.
map
(
e
->
e
.
getValue
().
stream
()
.
reduce
((
f1
,
f2
)
->
new
UserAssessmentInfographicReport
(
f1
.
getCriteria
(),
f1
.
getPassCount
()+
f2
.
getPassCount
(),
f1
.
getFailCount
()
+
f2
.
getFailCount
(),
f1
.
getEvalPendingCount
()
+
f2
.
getEvalPendingCount
()
,
f1
.
getPendingCount
()
+
f2
.
getPendingCount
(),
f1
.
getTotal
()
+
f2
.
getTotal
())))
.
map
(
f
->
f
.
get
())
.
collect
(
Collectors
.
toList
());
List
<
String
>
allTenure
=
Arrays
.
asList
(
CommonUtils
.
Tenure
);
allTenure
.
forEach
((
str
)->{
if
(!
transform
.
stream
().
anyMatch
(
o
->
o
.
getCriteria
().
equals
(
str
)))
{
UserAssessmentInfographicReport
tempObj
=
new
UserAssessmentInfographicReport
(
str
,
0
,
0
,
0
,
0
,
0
);
transform
.
add
(
tempObj
);
}
});
log
.
debug
(
"Response returned from ReportServiceImpl --getTenureAssessmentInfographicReport method, No of record={}"
,
report
.
size
());
return
new
ResponseEntity
<
List
<
UserAssessmentInfographicReport
>>
(
transform
,
HttpStatus
.
OK
);
}
else
{
log
.
debug
(
"Response returned from ReportServiceImpl --getTenureAssessmentInfographicReport method -- No record found"
);
return
new
ResponseEntity
<
List
<
UserAssessmentInfographicReport
>>
(
HttpStatus
.
NO_CONTENT
);
}
}
private
String
getTenureRange
(
double
duration
)
{
String
tenure
=
""
;
if
(
duration
>
0
&&
duration
<=
6
)
{
tenure
=
CommonUtils
.
Tenure
[
0
];
}
else
if
(
duration
>
6
&&
duration
<=
12
)
{
tenure
=
CommonUtils
.
Tenure
[
1
];
}
else
if
(
duration
>
12
&&
duration
<=
18
)
{
tenure
=
CommonUtils
.
Tenure
[
2
];
}
else
if
(
duration
>
18
&&
duration
<=
24
)
{
tenure
=
CommonUtils
.
Tenure
[
3
];
}
else
if
(
duration
>
24
&&
duration
<=
30
)
{
tenure
=
CommonUtils
.
Tenure
[
4
];
}
else
if
(
duration
>
30
&&
duration
<=
36
)
{
tenure
=
CommonUtils
.
Tenure
[
5
];
}
else
if
(
duration
>
36
&&
duration
<=
42
)
{
tenure
=
CommonUtils
.
Tenure
[
6
];
}
else
{
tenure
=
CommonUtils
.
Tenure
[
7
];
}
return
tenure
;
}
@Override
public
ResponseEntity
<
List
<
DBObject
>>
getCategoryAssessmentInfographicReport
(
String
startDate
,
String
endDate
,
long
assessmentId
,
long
subLobId
)
throws
Exception
{
...
...
src/main/java/com/statestreet/utils/CommonUtils.java
View file @
d760aa11
package
com.statestreet.utils
;
import
java.text.SimpleDateFormat
;
import
java.util.List
;
import
java.util.TimeZone
;
public
class
CommonUtils
{
...
...
@@ -48,6 +49,8 @@ public class CommonUtils {
MALE
,
FEMALE
,
OTHER
}
public
static
String
[]
Tenure
=
new
String
[]
{
"0 to 6"
,
"6 to 12"
,
"12 to 18"
,
"18 to 24"
,
"24 to 30"
,
"30 to 36"
,
"36 to 42"
,
"More than 42"
};
public
static
enum
Training_Batch_Status
{
Not_Started_Yet
,
Active_In_Progress
,
Completed
,
Active_Over_Due
,
Deactivate
}
...
...
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