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-service
Commits
6f3aca8a
Commit
6f3aca8a
authored
1 year ago
by
lakshmikommalapati
Browse files
Options
Download
Patches
Plain Diff
create new send mail method to send requestedmail
parent
5252d3b8
github/fork/rahulbowade/feature_ticket_creation
feature_ticket_creation
1 merge request
!8
Grievance raise ticket
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/main/java/org/upsmf/grievance/dao/impl/TicketDaoImpl.java
+20
-2
...main/java/org/upsmf/grievance/dao/impl/TicketDaoImpl.java
src/main/java/org/upsmf/grievance/model/GrievanceRaise.java
+0
-7
src/main/java/org/upsmf/grievance/model/GrievanceRaise.java
src/main/java/org/upsmf/grievance/service/impl/GrievanceRaiseServiceImpl.java
+6
-2
...smf/grievance/service/impl/GrievanceRaiseServiceImpl.java
src/main/java/org/upsmf/grievance/util/JsonKey.java
+2
-0
src/main/java/org/upsmf/grievance/util/JsonKey.java
with
28 additions
and
11 deletions
+28
-11
src/main/java/org/upsmf/grievance/dao/impl/TicketDaoImpl.java
+
20
−
2
View file @
6f3aca8a
...
...
@@ -11,6 +11,7 @@ import java.sql.SQLException;
import
java.sql.Timestamp
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
...
...
@@ -286,7 +287,7 @@ public class TicketDaoImpl implements TicketDao {
ticket
.
setOperation
(
"save"
);
ticket
.
setStatus
(
value
);
if
(
ticket
.
getSourceId
().
equals
(
3L
))
{
sendTicketEmail
(
ticket
);
sendTicketEmail
(
ticket
,
ticket
.
getRequesterEmail
()
);
ticketsRequestInterceptor
.
addData
(
ticket
);
}
if
(!
value1
)
{
...
...
@@ -410,7 +411,7 @@ public class TicketDaoImpl implements TicketDao {
return
RandomStringUtils
.
random
(
length
,
randomText
);
}
private
void
sendTicketEmail
(
Ticket
ticket
)
{
/*
private void sendTicketEmail(Ticket ticket) {
try {
User user = superAdminDao.userDetailsByUserId(ticket.getRequestedBy());
user.setOrgId(MasterDataManager.getUserOrgMap().get(ticket.getRequestedBy()));
...
...
@@ -426,6 +427,23 @@ public class TicketDaoImpl implements TicketDao {
} catch (ResourceNotFoundException e) {
LOGGER.error(String.format(ENCOUNTERED_AN_EXCEPTION_S, e.getMessage()));
}
}*/
private
void
sendTicketEmail
(
Ticket
ticket
,
String
recipientEmail
)
{
try
{
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"dd/MM/YYYY"
);
User
user
=
superAdminDao
.
userDetailsByUserId
(
ticket
.
getRequestedBy
());
user
.
setOrgId
(
MasterDataManager
.
getUserOrgMap
().
get
(
ticket
.
getRequestedBy
()));
Map
<
String
,
String
>
keyValue
=
new
HashMap
<>();
keyValue
.
put
(
JsonKey
.
FIRST_NAME
,
user
.
getName
());
keyValue
.
put
(
JsonKey
.
ID
,
ticket
.
getId
().
toString
());
keyValue
.
put
(
JsonKey
.
DATE
,
ticket
.
getCreatedTime
().
toLocalDateTime
().
format
(
dateTimeFormatter
));
String
[]
emails
=
recipientEmail
.
split
(
","
);
SendMail
.
sendMail
(
keyValue
,
emails
,
Constants
.
TICKETCREATION
,
"new-ticket-createdby-aurora.vm"
);
}
catch
(
ResourceNotFoundException
e
)
{
LOGGER
.
error
(
String
.
format
(
ENCOUNTERED_AN_EXCEPTION_S
,
e
.
getMessage
()));
}
}
private
void
mapTicketToHelpdesk
(
Ticket
ticket
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/upsmf/grievance/model/GrievanceRaise.java
+
0
−
7
View file @
6f3aca8a
...
...
@@ -29,12 +29,5 @@ public class GrievanceRaise {
private
List
<
String
>
filePath
;
private
String
appKey
;
private
Long
appId
;
private
String
appName
;
}
This diff is collapsed.
Click to expand it.
src/main/java/org/upsmf/grievance/service/impl/GrievanceRaiseServiceImpl.java
+
6
−
2
View file @
6f3aca8a
package
org.upsmf.grievance.service.impl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -30,10 +32,11 @@ public class GrievanceRaiseServiceImpl implements GrievanceRaiseService {
@Value
(
"${default_app_key}"
)
private
String
appKey
;
public
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
GrievanceRaiseServiceImpl
.
class
);
@Override
public
GrievanceTicket
addGrievance
(
GrievanceRaise
grievance
)
{
LOGGER
.
info
(
"Enter the addGrievanc method"
);
ticket
.
setUserName
(
grievance
.
getName
());
ticket
.
setHelpdeskId
(
grievance
.
getHelpdeskId
());
ticket
.
setSourceId
(
sourceId
);
...
...
@@ -44,11 +47,12 @@ public class GrievanceRaiseServiceImpl implements GrievanceRaiseService {
ticket
.
setRequesterUser
(
grievance
.
getName
());
ticket
.
setRequesterEmail
(
grievance
.
getEmailId
());
ticket
.
setRequesterPhoneNumber
(
grievance
.
getPhone
());
LOGGER
.
info
(
"added all values to ticket"
+
ticket
);
ticket
=
ticketService
.
addTicket
(
ticket
);
// checking response
GrievanceTicket
grievanceTicket
=
null
;
LOGGER
.
info
(
"after raise and sent a ticket to mail taking ticketid"
+
ticket
.
getId
()+
" date"
+
ticket
.
getCreatedTimeTS
());
if
(
ticket
!=
null
&&
ticket
.
getId
()>
0
){
grievanceTicket
=
GrievanceTicket
.
builder
().
ticketId
(
ticket
.
getId
())
.
date
(
ticket
.
getCreatedTime
().
toString
()).
build
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/upsmf/grievance/util/JsonKey.java
+
2
−
0
View file @
6f3aca8a
...
...
@@ -112,4 +112,6 @@ public class JsonKey {
public
static
final
String
NEWSTATUS
=
"newStatus"
;
public
static
final
String
ID
=
"id"
;
public
static
final
String
HELPDESKID
=
"helpdeskId"
;
public
static
final
String
DATE
=
"date"
;
}
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