Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
Grievance
Commits
3a8bc627
Commit
3a8bc627
authored
1 year ago
by
shishir suman
Browse files
Options
Download
Patches
Plain Diff
new API for ticket statistics
parent
bc0fde1e
UPHRH_quartz_scheduler
UAT
UPHRH_7903_mobile_otp
1 merge request
!48
Uphrh 7903 mobile otp
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/org/upsmf/grievance/controller/TicketController.java
+3
-2
...java/org/upsmf/grievance/controller/TicketController.java
src/main/java/org/upsmf/grievance/service/DashboardService.java
+2
-1
...in/java/org/upsmf/grievance/service/DashboardService.java
src/main/java/org/upsmf/grievance/service/impl/DashboardServiceImpl.java
+10
-2
...rg/upsmf/grievance/service/impl/DashboardServiceImpl.java
with
15 additions
and
5 deletions
+15
-5
src/main/java/org/upsmf/grievance/controller/TicketController.java
+
3
−
2
View file @
3a8bc627
package
org.upsmf.grievance.controller
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
...
...
@@ -79,9 +80,9 @@ public class TicketController {
}
@PostMapping
(
"/statistic"
)
public
ResponseEntity
upload
(
@Request
Param
(
"userId"
)
Long
user
Id
)
{
public
ResponseEntity
upload
(
@Request
Body
JsonNode
user
Data
)
{
try
{
TicketStatistics
ticketStatisticsByUser
=
dashboardService
.
getTicketStatisticsByUser
(
user
Id
);
TicketStatistics
ticketStatisticsByUser
=
dashboardService
.
getTicketStatisticsByUser
(
user
Data
);
Response
response
=
new
Response
(
HttpStatus
.
OK
.
value
(),
ticketStatisticsByUser
);
return
new
ResponseEntity
<
Response
>(
response
,
HttpStatus
.
OK
);
}
catch
(
Exception
e
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/upsmf/grievance/service/DashboardService.java
+
2
−
1
View file @
3a8bc627
package
org.upsmf.grievance.service
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
org.upsmf.grievance.dto.SearchRequest
;
import
org.upsmf.grievance.model.TicketStatistics
;
import
org.upsmf.grievance.model.es.Feedback
;
...
...
@@ -13,5 +14,5 @@ public interface DashboardService {
public
List
<
Feedback
>
getFeedbackByTicketId
(
String
ticketId
);
public
TicketStatistics
getTicketStatisticsByUser
(
Long
userId
);
public
TicketStatistics
getTicketStatisticsByUser
(
JsonNode
data
);
}
This diff is collapsed.
Click to expand it.
src/main/java/org/upsmf/grievance/service/impl/DashboardServiceImpl.java
+
10
−
2
View file @
3a8bc627
package
org.upsmf.grievance.service.impl
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -631,11 +632,17 @@ public class DashboardServiceImpl implements DashboardService {
/**
* Method to give ticket statistical data for logged in user
* @param user
Id
* @param user
Data
* @return
*/
@Override
public
TicketStatistics
getTicketStatisticsByUser
(
Long
userId
)
{
public
TicketStatistics
getTicketStatisticsByUser
(
JsonNode
userData
)
{
Long
userId
=
null
;
log
.
info
(
"Json node data - {}"
,
userData
);
if
(
userData
!=
null
&&
userData
.
has
(
"userId"
))
{
userId
=
userData
.
get
(
"userId"
).
asLong
();
}
log
.
info
(
"assigned userID - {}"
,
userId
);
// validate payload
Long
escalatedToMeCount
=
null
;
Long
nudgedTicketCount
=
null
;
...
...
@@ -669,6 +676,7 @@ public class DashboardServiceImpl implements DashboardService {
.
junkTicketCount
(
junkTicketCount
)
.
priorityTicketCount
(
priorityTicketCount
)
.
build
();
log
.
info
(
"statistic data - {}"
,
ticketStatistics
);
return
ticketStatistics
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets