Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/environment/common_test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ cron-scheduler-registration=0 34 19 * * ? *
start-everwelldatasync-scheduler=false
cron-scheduler-everwelldatasync=0 0/5 * * * ? *
##-----------------------------------------------#NHM data dashboard schedular----------------------------------------------------------------
# run at everyday 11:59PM
# run at everyday 12:01AM
start-nhmdashboard-scheduler=true
cron-scheduler-nhmdashboard=0 59 23 * * ? *
cron-scheduler-nhmdashboard=0 1 * * * ? *

##-------------------------------------------------### Redis IP--------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public class FeedbackDetails {
private String instiName;

@Transient
@Expose
private String instituteName = "";

@Column(name = "DesignationID")
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/iemr/common/data/institute/Institute.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ public class Institute
protected Institute()
{
}

public String getInstituteName() {
return institutionName;
}

public Institute(Integer institutionID, String institutionName)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.iemr.common.model.sms;

public class SmsAPIRequestModel {
import java.io.Serializable;

import lombok.Data;

@Data
public class SmsAPIRequestModel implements Serializable{

private String customerId;
private StringBuffer destinationAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public List<AgentSummaryReport> callAgentSummaryReportCTI_API() throws IEMRExcep
String fromDate = null;

LocalDateTime date = null;
date = LocalDateTime.now();
date = LocalDateTime.now().minusDays(1);
String[] dateArr = date.toString().split("T");
endDate = dateArr[0].concat(" 23:59:59");
fromDate = dateArr[0].concat(" 00:00:01");
Expand Down Expand Up @@ -251,7 +251,7 @@ public List<DetailedCallReport> callDetailedCallReportCTI_API() throws IEMRExcep
String fromDate = null;

LocalDateTime date = null;
date = LocalDateTime.now();
date = LocalDateTime.now().minusDays(1);
String[] dateArr = date.toString().split("T");
endDate = dateArr[0].concat(" 23:59:59");
fromDate = dateArr[0].concat(" 00:00:01");
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/com/iemr/common/service/sms/SMSServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -937,13 +938,16 @@ public void publishSMS() {

// for fetching dltTemplateId
String dltTemplateId = smsTemplateRepository.findDLTTemplateID(sms.getSmsTemplateID());
if(dltTemplateId == null)
throw new Exception("No dltTemplateId template ID mapped");

SmsAPIRequestModel smsAPICredentials104 = new SmsAPIRequestModel(senderName, phoneNo,
sms.getSms(), sourceAddress, dltTemplateId, smsMessageType, smsEntityID);
sms.getSms(), sourceAddress, smsMessageType, dltTemplateId, smsEntityID);

MultiValueMap<String, String> headersLogin = new LinkedMultiValueMap<String, String>();
headersLogin.add("Content-Type", "application/json");
headersLogin.add("AUTHORIZATION", senderName + ":" + senderPassword);
String auth=senderName + ":" + senderPassword;
headersLogin.add("Authorization", "Basic "+Base64.getEncoder().encodeToString(auth.getBytes()));
// smsPublishURL = smsPublishURL.replace("SMS_TEXT",
// URLEncoder.encode(sms.getSms(), "UTF-8"))

Expand All @@ -958,7 +962,10 @@ public void publishSMS() {
if (responseLogin.getStatusCodeValue() == 200 & responseLogin.hasBody()) {
String smsResponse = responseLogin.getBody();
JSONObject obj = new JSONObject(smsResponse);
String messageRequestId = obj.getString("MessageRequestId");
String messageRequestId = null;
if(obj !=null)
messageRequestId = obj.getString("messageRequestId");
// String messageRequestId = obj.getString("MessageRequestId");
// logger.info("SMS Sent successfully by calling API " + smsPublishURL);
sms.setTransactionError(null);
sms.setTransactionID(messageRequestId);
Expand Down