18 changed files with 1690 additions and 1070 deletions
-
67gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/QaqcAgentsService.java
-
9gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java
-
154gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
-
215gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/flagpole/controller/FlagPoleApiController.java
-
133gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/flagpole/service/FlagpoleSMSService.java
-
1195gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/flagpole/service/RdoService.java
-
45gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/flagpole/service/WhatsappServiceFlagPole.java
-
41gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/flagpole/util/MessageUtility.java
-
4gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java
-
3gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java
-
9gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java
-
4gcc_officer_portal/src/main/resources/application.properties
-
4gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/socialmediacomplaints.html
-
29gcc_officer_portal/src/main/resources/templates/modules/flagpole/approvedandrejectedlist.html
-
315gcc_officer_portal/src/main/resources/templates/modules/flagpole/requestlist.html
-
1gcc_officer_portal/src/main/resources/templates/modules/m_petition/complaint_list.html
-
1gcc_officer_portal/src/main/resources/templates/modules/m_petition/petition_list.html
-
3gcc_officer_portal/src/main/resources/templates/modules/nulm/salary-approve.html
@ -0,0 +1,133 @@ |
|||
package in.gov.chennaicorporation.gccoffice.flagpole.service; |
|||
|
|||
import java.net.URLEncoder; |
|||
import java.nio.charset.StandardCharsets; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig; |
|||
import in.gov.chennaicorporation.gccoffice.flagpole.util.MessageUtility; |
|||
|
|||
@Service |
|||
public class FlagpoleSMSService { |
|||
|
|||
@Autowired |
|||
private AppConfig appConfig; |
|||
|
|||
@Autowired |
|||
private MessageUtility messageUtility; |
|||
|
|||
private final String key = "pfTEYN6H"; |
|||
|
|||
public String sendBookingSuccesssms(String mobileNo, String requestId) { |
|||
|
|||
String message = "Your Flag Pole permission request has been submitted successfully. " |
|||
+ "Request ID: " + requestId |
|||
+ ". You will be notified once the status is updated. By GCC"; |
|||
|
|||
// Encode message and fix colon issue (gateway not decoding %3A) |
|||
String encodedMsg = URLEncoder.encode(message, StandardCharsets.UTF_8) |
|||
.replace("%3A", ":"); |
|||
|
|||
String urlString = appConfig.getOtpUrl() |
|||
+ "from=GCCCRP" |
|||
+ "&key=" + key |
|||
+ "&sender=GCCCRP" |
|||
+ "&to=" + mobileNo |
|||
+ "&body=" + encodedMsg |
|||
+ "&entityid=1401572690000011081" |
|||
+ "&templateid=1407176959297472163"; |
|||
|
|||
System.out.println("SMS URL:- " + urlString); |
|||
|
|||
String response = messageUtility.sendSMS(urlString); |
|||
System.out.println("SMS RESPONSE:- " + response); |
|||
|
|||
return response; |
|||
} |
|||
|
|||
public String userrequestApprovedsms(String mobileNo, String requestId) { |
|||
|
|||
String message = "Your Flag Pole permission request has been approved. " |
|||
+ "Request ID: " + requestId |
|||
+ ". Please proceed as per the permitted guidelines. By GCC"; |
|||
|
|||
// Encode message and fix colon issue (gateway not decoding %3A) |
|||
String encodedMsg = URLEncoder.encode(message, StandardCharsets.UTF_8) |
|||
.replace("%3A", ":"); |
|||
|
|||
String urlString = appConfig.getOtpUrl() |
|||
+ "from=GCCCRP" |
|||
+ "&key=" + key |
|||
+ "&sender=GCCCRP" |
|||
+ "&to=" + mobileNo |
|||
+ "&body=" + encodedMsg |
|||
+ "&entityid=1401572690000011081" |
|||
+ "&templateid=1407176959304753543"; |
|||
|
|||
System.out.println("SMS URL:- " + urlString); |
|||
|
|||
String response = messageUtility.sendSMS(urlString); |
|||
System.out.println("SMS RESPONSE:- " + response); |
|||
|
|||
return response; |
|||
} |
|||
|
|||
// public String userrequestRejectedsms(String mobileNo, String requestId) { |
|||
|
|||
// String message = "Your Flag Pole permission request has been rejected. " |
|||
// + "Request ID: " + requestId + ". " |
|||
// + "Review the details in the portal |
|||
// https://gccservices.in/flagpolesregistration/status\n" |
|||
// + "By GCC"; |
|||
|
|||
// // ONLY encode. Do NOT replace %3A |
|||
// String encodedMsg = URLEncoder.encode(message, StandardCharsets.UTF_8); |
|||
|
|||
// String urlString = appConfig.getOtpUrl() |
|||
// + "from=GCCCRP" |
|||
// + "&key=" + key |
|||
// + "&sender=GCCCRP" |
|||
// + "&to=" + mobileNo |
|||
// + "&body=" + encodedMsg |
|||
// + "&entityid=1401572690000011081" |
|||
// + "&templateid=1407176959315374790"; |
|||
|
|||
// System.out.println("SMS URL:- " + urlString); |
|||
|
|||
// String response = messageUtility.sendSMS(urlString); |
|||
// System.out.println("SMS RESPONSE:- " + response); |
|||
|
|||
// return response; |
|||
// } |
|||
|
|||
public String userrequestRejectedsms(String mobileNo, String requestId) { |
|||
|
|||
System.out.println("Rejected Mob Num SMSSSSSSS = " + mobileNo); |
|||
String url = "https://gccservices.in/flagpolesregistration/status"; |
|||
String message = "Your Flag Pole permission request has been rejected. Request ID: " + requestId |
|||
+ ". Review the details in the portal " + url + "\r\nBy GCC"; |
|||
|
|||
String encodedMsg = URLEncoder.encode(message, StandardCharsets.UTF_8); |
|||
|
|||
System.out.println("encodedMsg:- " + encodedMsg); |
|||
|
|||
String urlString = appConfig.getOtpUrl() |
|||
+ "from=GCCCRP" |
|||
+ "&key=" + key |
|||
// + "&sender=GCCCRP" |
|||
+ "&to=" + mobileNo |
|||
+ "&body=" + encodedMsg |
|||
+ "&entityid=1401572690000011081" |
|||
+ "&templateid=1407176959315374790"; |
|||
|
|||
System.out.println("SMS URL:- " + urlString); |
|||
|
|||
String response = messageUtility.sendSMS(urlString); |
|||
System.out.println("SMS RESPONSE:- " + response); |
|||
|
|||
return response; |
|||
} |
|||
|
|||
} |
|||
1195
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/flagpole/service/RdoService.java
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,28 +1,31 @@ |
|||
package in.gov.chennaicorporation.gccoffice.flagpole.service; |
|||
// package in.gov.chennaicorporation.gccoffice.flagpole.service; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
// import org.springframework.beans.factory.annotation.Autowired; |
|||
// import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class WhatsappServiceFlagPole { |
|||
// @Service |
|||
// public class WhatsappServiceFlagPole { |
|||
|
|||
@Autowired |
|||
private SmsServiceFlagPole smsService; |
|||
// @Autowired |
|||
// private SMSService smsService; |
|||
|
|||
// c & d waste template after user register |
|||
public void sendOfficerApprovedWhatsappMessage(String refId, String mobileNumber) { |
|||
try { |
|||
// // c & d waste template after user register |
|||
// public void sendOfficerApprovedWhatsappMessage(String refId, String |
|||
// mobileNumber) { |
|||
// try { |
|||
|
|||
String apiUrl = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=" |
|||
+ mobileNumber |
|||
+ "&v=1.1&format=json&msg_type=IMAGE&method=SENDMEDIAMESSAGE&caption=Welcome+to+Greater+Chennai+Corporation%2C+%0A%0AYour+Registered+ID+is+%2A${registerId}%2A+.%0AYour+C%26D+waste+registration+has+been+approved+successfully.+%0A%0AFor+downloading+your+ID+card%2C+kindly+click+on+the+button+below+%F0%9F%91%87&media_url=https%3A%2F%2Fres.cloudinary.com%2Fdpub5muar%2Fimage%2Fupload%2Fv1729597847%2Fq2ihjs99puhhwkjzajyo.png&isTemplate=true&buttonUrlParam=userdetail%3Fregister_id%3D" |
|||
+ refId; |
|||
// String apiUrl = |
|||
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=" |
|||
// + mobileNumber |
|||
// + |
|||
// "&v=1.1&format=json&msg_type=IMAGE&method=SENDMEDIAMESSAGE&caption=Welcome+to+Greater+Chennai+Corporation%2C+%0A%0AYour+Registered+ID+is+%2A${registerId}%2A+.%0AYour+C%26D+waste+registration+has+been+approved+successfully.+%0A%0AFor+downloading+your+ID+card%2C+kindly+click+on+the+button+below+%F0%9F%91%87&media_url=https%3A%2F%2Fres.cloudinary.com%2Fdpub5muar%2Fimage%2Fupload%2Fv1729597847%2Fq2ihjs99puhhwkjzajyo.png&isTemplate=true&buttonUrlParam=userdetail%3Fregister_id%3D" |
|||
// + refId; |
|||
|
|||
System.out.println("WhatsApp API URL: " + apiUrl); // Optional debug |
|||
smsService.sendMsg(apiUrl); |
|||
// System.out.println("WhatsApp API URL: " + apiUrl); // Optional debug |
|||
// smsService.sendMsg(apiUrl); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
// } catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
// } |
|||
// } |
|||
// } |
|||
@ -0,0 +1,41 @@ |
|||
package in.gov.chennaicorporation.gccoffice.flagpole.util; |
|||
|
|||
import java.net.HttpURLConnection; |
|||
import java.net.URL; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
@Service |
|||
public class MessageUtility { |
|||
|
|||
public String sendMsg(String msgUrl) { |
|||
System.out.println("Whatsapp URL :-" + msgUrl); |
|||
|
|||
String response = ""; |
|||
try { |
|||
HttpURLConnection connection = null; |
|||
|
|||
URL url = new URL(msgUrl); |
|||
connection = (HttpURLConnection) url.openConnection(); |
|||
connection.setRequestMethod("GET"); |
|||
|
|||
int responseCode = connection.getResponseCode(); |
|||
response = responseCode + ""; |
|||
System.out.println("Response Code: " + responseCode); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
return response; |
|||
} |
|||
|
|||
public String sendSMS(String SMS_Url) { |
|||
// System.out.println("SMS URL:- " + SMS_Url); |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
String response = restTemplate.getForObject(SMS_Url, String.class); |
|||
return response; |
|||
} |
|||
|
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue