Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
business-java
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Proteus
business-java
Commits
e6b63d04
Commit
e6b63d04
authored
Apr 21, 2020
by
CORP\sonam.kamble
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes done for notification sending.
parent
fa2ebfe2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
webitm-dashboard/ibase/dashboard/crm/ejb/Appointment.java
webitm-dashboard/ibase/dashboard/crm/ejb/Appointment.java
+34
-5
No files found.
webitm-dashboard/ibase/dashboard/crm/ejb/Appointment.java
View file @
e6b63d04
...
@@ -20,6 +20,8 @@ import ibase.utility.E12GenericUtility;
...
@@ -20,6 +20,8 @@ import ibase.utility.E12GenericUtility;
import
ibase.utility.EMail
;
import
ibase.utility.EMail
;
import
ibase.utility.UserInfoBean
;
import
ibase.utility.UserInfoBean
;
import
ibase.webitm.ejb.DBAccessEJB
;
import
ibase.webitm.ejb.DBAccessEJB
;
import
ibase.webitm.notification.ejb.PublishPushNotificationEJB
;
import
ibase.webitm.notification.ejb.PublishPushNotificationRemote
;
public
class
Appointment
public
class
Appointment
{
{
...
@@ -955,9 +957,17 @@ public class Appointment
...
@@ -955,9 +957,17 @@ public class Appointment
mobNo
=
E12GenericUtility
.
checkNull
(
jsonData
.
getString
(
"mobile_no"
));
mobNo
=
E12GenericUtility
.
checkNull
(
jsonData
.
getString
(
"mobile_no"
));
address
=
E12GenericUtility
.
checkNull
(
jsonData
.
getString
(
"addr1"
));
address
=
E12GenericUtility
.
checkNull
(
jsonData
.
getString
(
"addr1"
));
city
=
jsonData
.
getString
(
"city"
);
city
=
jsonData
.
getString
(
"city"
);
try
{
dateOfBirth
=
output
.
parse
(
dob
);
dateOfBirth
=
output
.
parse
(
dob
);
dtOfBirth
=
Timestamp
.
valueOf
(
String
.
valueOf
(
this
.
genericUtility
.
getValidDateString
(
dob
,
this
.
genericUtility
.
getApplDateFormat
(),
this
.
genericUtility
.
getDBDateFormat
()))
+
" 00:00:00.00"
);
dtOfBirth
=
Timestamp
.
valueOf
(
String
.
valueOf
(
this
.
genericUtility
.
getValidDateString
(
dob
,
this
.
genericUtility
.
getApplDateFormat
(),
this
.
genericUtility
.
getDBDateFormat
()))
+
" 00:00:00.00"
);
}
catch
(
Exception
e
)
{
errString
=
genericUtility
.
getErrorString
(
"dateOfBirth"
,
"VTBIRTH"
,
mobNo
);
jsonObject
=
this
.
convertXmlToJsonInError
(
errString
);
return
jsonObject
.
toString
();
}
/*
/*
* if (emailId.length() == 0) { errString =
* if (emailId.length() == 0) { errString =
* genericUtility.getErrorString("email_id", "VTEMAILBK", mobNo); jsonObject =
* genericUtility.getErrorString("email_id", "VTEMAILBK", mobNo); jsonObject =
...
@@ -1366,7 +1376,7 @@ public class Appointment
...
@@ -1366,7 +1376,7 @@ public class Appointment
{
{
System
.
out
.
println
(
"Appointment.getMailFormatDetails()"
);
System
.
out
.
println
(
"Appointment.getMailFormatDetails()"
);
String
lineNo
=
""
,
apptId
=
""
,
visitPlace
=
""
,
String
lineNo
=
""
,
apptId
=
""
,
visitPlace
=
""
,
docName
=
""
,
apptDate
=
""
,
emailId
=
""
;
docName
=
""
,
apptDate
=
""
,
emailId
=
""
,
patientCode
=
""
;
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
PreparedStatement
psmt
=
null
;
PreparedStatement
psmt
=
null
;
ResultSet
rs
=
null
;
ResultSet
rs
=
null
;
...
@@ -1375,11 +1385,12 @@ public class Appointment
...
@@ -1375,11 +1385,12 @@ public class Appointment
final
List
<
String
>
visiPlaceArr
=
new
ArrayList
<
String
>();
final
List
<
String
>
visiPlaceArr
=
new
ArrayList
<
String
>();
final
List
<
String
>
docNameArr
=
new
ArrayList
<
String
>();
final
List
<
String
>
docNameArr
=
new
ArrayList
<
String
>();
final
List
<
String
>
emailIdArr
=
new
ArrayList
<
String
>();
final
List
<
String
>
emailIdArr
=
new
ArrayList
<
String
>();
final
List
<
String
>
patCodeArr
=
new
ArrayList
<
String
>();
try
try
{
{
builder
.
append
(
"SELECT APPT.APPOINT_ID, TO_CHAR(APPT.APPOINT_DATE, 'DD-MON-YY') APPOINT_DATE , SVH.VISIT_PLACE, PAT.EMAIL_ID ,"
);
builder
.
append
(
"SELECT APPT.APPOINT_ID, TO_CHAR(APPT.APPOINT_DATE, 'DD-MON-YY') APPOINT_DATE , SVH.VISIT_PLACE, PAT.EMAIL_ID ,"
);
builder
.
append
(
"SC.FIRST_NAME || ' ' || SC.MIDDLE_NAME || ' ' || SC.LAST_NAME AS DOC_NAME "
);
builder
.
append
(
"SC.FIRST_NAME || ' ' || SC.MIDDLE_NAME || ' ' || SC.LAST_NAME AS DOC_NAME
, APPT.PATIENT_CODE
"
);
builder
.
append
(
"FROM APPOINTMENT APPT, STRG_CUSTOMER SC, STRG_VISIT_HOURS SVH, PATIENT PAT "
);
builder
.
append
(
"FROM APPOINTMENT APPT, STRG_CUSTOMER SC, STRG_VISIT_HOURS SVH, PATIENT PAT "
);
builder
.
append
(
"WHERE APPT.DOCTOR_CODE = SC.SC_CODE AND APPT.PATIENT_CODE = PAT.PATIENT_CODE "
);
builder
.
append
(
"WHERE APPT.DOCTOR_CODE = SC.SC_CODE AND APPT.PATIENT_CODE = PAT.PATIENT_CODE "
);
builder
.
append
(
"AND APPT.VISIT_REF_NO = SVH.LINE_NO AND APPT.DOCTOR_CODE = SVH.SC_CODE AND DOCTOR_CODE = ? "
);
builder
.
append
(
"AND APPT.VISIT_REF_NO = SVH.LINE_NO AND APPT.DOCTOR_CODE = SVH.SC_CODE AND DOCTOR_CODE = ? "
);
...
@@ -1402,12 +1413,14 @@ public class Appointment
...
@@ -1402,12 +1413,14 @@ public class Appointment
docName
=
rs
.
getString
(
"doc_name"
);
docName
=
rs
.
getString
(
"doc_name"
);
apptDate
=
rs
.
getString
(
"appoint_date"
);
apptDate
=
rs
.
getString
(
"appoint_date"
);
emailId
=
rs
.
getString
(
"email_id"
);
emailId
=
rs
.
getString
(
"email_id"
);
patientCode
=
rs
.
getString
(
"patient_code"
);
apptIdArr
.
add
(
apptId
);
apptIdArr
.
add
(
apptId
);
visiPlaceArr
.
add
(
visitPlace
);
visiPlaceArr
.
add
(
visitPlace
);
docNameArr
.
add
(
docName
);
docNameArr
.
add
(
docName
);
apptDateArr
.
add
(
apptDate
);
apptDateArr
.
add
(
apptDate
);
emailIdArr
.
add
(
emailId
);
emailIdArr
.
add
(
emailId
);
patCodeArr
.
add
(
patientCode
);
}
}
}
}
}
}
...
@@ -1425,12 +1438,14 @@ public class Appointment
...
@@ -1425,12 +1438,14 @@ public class Appointment
docName
=
rs
.
getString
(
"doc_name"
);
docName
=
rs
.
getString
(
"doc_name"
);
apptDate
=
rs
.
getString
(
"appoint_date"
);
apptDate
=
rs
.
getString
(
"appoint_date"
);
emailId
=
rs
.
getString
(
"email_id"
);
emailId
=
rs
.
getString
(
"email_id"
);
patientCode
=
rs
.
getString
(
"patient_code"
);
apptIdArr
.
add
(
apptId
);
apptIdArr
.
add
(
apptId
);
visiPlaceArr
.
add
(
visitPlace
);
visiPlaceArr
.
add
(
visitPlace
);
docNameArr
.
add
(
docName
);
docNameArr
.
add
(
docName
);
apptDateArr
.
add
(
apptDate
);
apptDateArr
.
add
(
apptDate
);
emailIdArr
.
add
(
emailId
);
emailIdArr
.
add
(
emailId
);
patCodeArr
.
add
(
patientCode
);
}
}
}
}
...
@@ -1439,7 +1454,7 @@ public class Appointment
...
@@ -1439,7 +1454,7 @@ public class Appointment
public
void
run
()
public
void
run
()
{
{
System
.
out
.
println
(
"apptDateArr L "
+
apptDateArr
);
System
.
out
.
println
(
"apptDateArr L "
+
apptDateArr
);
sendMail
(
apptIdArr
,
docNameArr
,
apptDateArr
,
visiPlaceArr
,
emailIdArr
,
userInfo
);
sendMail
(
apptIdArr
,
docNameArr
,
apptDateArr
,
visiPlaceArr
,
emailIdArr
,
patCodeArr
,
userInfo
);
};
};
}.
start
();
}.
start
();
...
@@ -1451,15 +1466,18 @@ public class Appointment
...
@@ -1451,15 +1466,18 @@ public class Appointment
}
}
public
void
sendMail
(
List
<
String
>
refId
,
List
<
String
>
docName
,
List
<
String
>
apptDate
,
public
void
sendMail
(
List
<
String
>
refId
,
List
<
String
>
docName
,
List
<
String
>
apptDate
,
List
<
String
>
visitPlace
,
List
<
String
>
emailId
,
UserInfoBean
userInfo
)
List
<
String
>
visitPlace
,
List
<
String
>
emailId
,
List
<
String
>
patCodeArr
,
UserInfoBean
userInfo
)
{
{
EMail
email
=
new
EMail
();
EMail
email
=
new
EMail
();
ArrayList
<
String
>
userIdList
=
null
;
try
try
{
{
if
(
refId
!=
null
)
if
(
refId
!=
null
)
{
{
for
(
int
i
=
0
;
i
<
refId
.
size
();
i
++)
for
(
int
i
=
0
;
i
<
refId
.
size
();
i
++)
{
{
userIdList
=
new
ArrayList
<
String
>();
userIdList
.
add
(
patCodeArr
.
get
(
i
));
String
patientMailDomStr
=
"<ROOT><TRANS_INFO><OBJ_NAME>APPOINTMENT</OBJ_NAME>"
+
String
patientMailDomStr
=
"<ROOT><TRANS_INFO><OBJ_NAME>APPOINTMENT</OBJ_NAME>"
+
"<REF_SER>APPT</REF_SER><REF_ID>"
+
refId
.
get
(
i
)+
"</REF_ID>"
+
"<REF_SER>APPT</REF_SER><REF_ID>"
+
refId
.
get
(
i
)+
"</REF_ID>"
+
"<LINE_NO></LINE_NO><XSL_FILE_NAME></XSL_FILE_NAME></TRANS_INFO>"
+
"<LINE_NO></LINE_NO><XSL_FILE_NAME></XSL_FILE_NAME></TRANS_INFO>"
+
...
@@ -1475,6 +1493,17 @@ public class Appointment
...
@@ -1475,6 +1493,17 @@ public class Appointment
//Changed by pankaj T. on 10-04-2020 for Configure SMTP mail server against ENTERPRISE
//Changed by pankaj T. on 10-04-2020 for Configure SMTP mail server against ENTERPRISE
//email.sendMail(patientMailDomStr, "ITM", conn);
//email.sendMail(patientMailDomStr, "ITM", conn);
email
.
sendMail
(
patientMailDomStr
,
"ITM"
,
userInfo
);
email
.
sendMail
(
patientMailDomStr
,
"ITM"
,
userInfo
);
try
{
String
postMessage
=
"Your appotment with Dr. "
+
docName
.
get
(
i
)+
" scheduled on Date "
+
apptDate
.
get
(
i
)+
","
+
visitPlace
.
get
(
i
)+
" has been cancelled."
;
String
refSer
=
"APPT-D"
;
PublishPushNotificationEJB
publishPushNotificationEJB
=
new
PublishPushNotificationEJB
();
publishPushNotificationEJB
.
invockPushNotification
(
postMessage
,
""
,
PublishPushNotificationRemote
.
OPEN_TARGET_TRANSACTION
,
refId
.
get
(
i
),
userIdList
,
""
,
refId
.
get
(
i
),
refSer
,
userInfo
.
getLoginCode
(),
0
,
userInfo
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Exception Appointment.sendMail() while sending Notification...."
+
e
);
}
}
}
}
}
}
}
...
...
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