Browse Source

implemented public section like pgr complaint

master
AJITHKUMAR12 3 months ago
parent
commit
3d5290ab39
  1. 790
      src/main/java/com/gcc/greencommitte/controller/Apicontroller.java
  2. 2
      src/main/resources/application.properties
  3. 438
      src/main/resources/templates/modules/home.html
  4. 187
      src/main/resources/templates/modules/public/form.html
  5. 13
      src/test/java/com/gcc/greencommitte/GreencommitteApplicationTests.java

790
src/main/java/com/gcc/greencommitte/controller/Apicontroller.java

@ -1,11 +1,17 @@
package com.gcc.greencommitte.controller;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@ -17,6 +23,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Base64;
//import org.springframework.http.MediaType;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
@ -28,362 +38,470 @@ import com.gcc.greencommitte.service.Greencommitteeservice;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
@RestController
@RequestMapping("/greencommittee/api")
public class Apicontroller {
@Autowired
private AppConfig appConfig;
@Autowired
private AppConfig appConfig;
@Autowired
private Greencommitteeservice gcservice;
@GetMapping(value = "/sendOTP")
public String sendOtp(HttpServletRequest request, @RequestParam String mobileNo) {
public String sendOtp(HttpServletRequest request, @RequestParam String mobileNo) {
// Generate OTP logic as before
String MobileNo = mobileNo;
Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
// Generate OTP logic as before
String MobileNo = mobileNo;
Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
String key = "pfTEYN6H";
String key = "pfTEYN6H";
String entityId = "1401572690000011081";
String templateId = "1407175765770900925";
String appName="Green Committe";
String appName = "Green Committe";
String generatedMessage = "Welcome to GCC! Your OTP for " + appName + " is " + otp + ".";
String urlString = appConfig.getGetOtpUrl() + "from=GCCCRP" + "&key=" + key + "&sender=GCCCRP" + "&to=" + MobileNo + "&body="
+ generatedMessage + "&entityid=" + entityId + "&templateid=" + templateId;
String generatedMessage = "Welcome to GCC! Your OTP for " + appName + " is " + otp + ".";
String urlString = appConfig.getGetOtpUrl() + "from=GCCCRP" + "&key=" + key + "&sender=GCCCRP" + "&to="
+ MobileNo + "&body="
+ generatedMessage + "&entityid=" + entityId + "&templateid=" + templateId;
System.out.println("\n urlString---: " + urlString);
System.out.println("\n urlString---: " + urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage = Response;
System.out.println("\n bodyMessage" + bodyMessage);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage = Response;
System.out.println("\n bodyMessage" + bodyMessage);
System.out.println("OTP sent successfully!");
System.out.println("OTP sent successfully!");
} catch (Exception e) {
System.out.print("ERROR---: " + e);
bodyMessage = "Error";
}
} catch (Exception e) {
System.out.print("ERROR---: " + e);
bodyMessage = "Error";
}
HttpSession session = request.getSession();
session.setAttribute("otp", otp);
session.setAttribute("mobileNo", mobileNo);
return bodyMessage;
}
HttpSession session = request.getSession();
session.setAttribute("otp", otp);
session.setAttribute("mobileNo", mobileNo);
return bodyMessage;
}
@GetMapping(value = "/verifyOTP")
public String verifyOtp(HttpServletRequest request, @RequestParam String otp) {
HttpSession session = request.getSession();
try {
Integer session_otp = (Integer) session.getAttribute("otp");
//System.out.println("session_otp---:" + session_otp);
Integer entered_otp = Integer.parseInt(otp);
if (session_otp != null && session_otp.equals(entered_otp)) {
System.out.println("Entered OTP Correct");
session.setAttribute("verifiedotp", "success");
return "Success";
} else {
System.out.println("Incorrect OTP. Please enter correct OTPs.");
session.setAttribute("verifiedotp", "error");
return "Error";
}
} catch (NumberFormatException e) {
System.out.println("Invalid OTP format: " + otp);
return "Error";
} catch (Exception e) {
System.out.println("Error verifying OTP: " + e.getMessage());
return "Error";
}
}
@GetMapping("/getcompnatureforpublic")
public ResponseEntity<?> getCompNatureForPublic(){
try {
List<Map<String, Object>> list = gcservice.getCompNatureForPublic();
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("data", list);
return ResponseEntity.ok(response);
} catch (Exception ex) {
ex.printStackTrace();
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@GetMapping("/getcompnaturefordept")
public ResponseEntity<?> getCompNatureForDept(){
try {
List<Map<String, Object>> list = gcservice.getCompNatureForDept();
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("data", list);
return ResponseEntity.ok(response);
} catch (Exception ex) {
ex.printStackTrace();
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@GetMapping("/getAllDepts")
public ResponseEntity<?> getAllDepts(){
try {
List<Map<String, Object>> list = gcservice.getAllDepts();
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("data", list);
return ResponseEntity.ok(response);
} catch (Exception ex) {
ex.printStackTrace();
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@PostMapping("/savepublicform")
public ResponseEntity<?> savepublicform(
@RequestParam String p_name,
@RequestParam String ph_no,
@RequestParam String gender,
@RequestParam String address,
@RequestParam String latitude,
@RequestParam String longitude,
@RequestParam String zone,
@RequestParam String ward,
@RequestParam String remarks,
@RequestParam MultipartFile c1image,
@RequestParam MultipartFile c2image,
@RequestParam String comp_details,
@RequestParam String source) throws JsonMappingException, JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> compList = mapper.readValue(comp_details,
new TypeReference<List<Map<String, Object>>>() {
});
int totalTreeCount = compList.stream()
.mapToInt(item -> Integer.parseInt(item.get("count").toString()))
.sum();
String c1imagePath=null;
String c2imagePath=null;
c1imagePath=gcservice.fileUpload(c1image, "comp_image1");
c2imagePath=gcservice.fileUpload(c2image, "comp_image1");
//System.out.println("======="+latitude+","+longitude);
String saveStatus = gcservice.savepublicform(p_name,ph_no,gender,address,latitude,longitude,zone,ward,remarks,c1imagePath,c2imagePath,compList,totalTreeCount,source);
if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Failed to save the details"
));
}
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Details saved successfully",
"ref_id", saveStatus
));
}
@PostMapping("/savedeptform")
public ResponseEntity<?> savedeptform(
@RequestParam String dept_id,
@RequestParam (required = false) String dept_name,
@RequestParam String ph_no,
@RequestParam String designation,
@RequestParam String govt_type,
@RequestParam String address,
@RequestParam String latitude,
@RequestParam String longitude,
@RequestParam String zone,
@RequestParam String ward,
@RequestParam String remarks,
@RequestParam MultipartFile c1image,
@RequestParam MultipartFile c2image,
@RequestParam String comp_details,
@RequestParam String source) throws JsonMappingException, JsonProcessingException{
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> compList = mapper.readValue(comp_details,
new TypeReference<List<Map<String, Object>>>() {
});
int totalTreeCount = compList.stream()
.mapToInt(item -> Integer.parseInt(item.get("count").toString()))
.sum();
String c1imagePath=null;
String c2imagePath=null;
c1imagePath=gcservice.fileUpload(c1image, "comp_image1");
c2imagePath=gcservice.fileUpload(c2image, "comp_image1");
// System.out.println("======="+latitude+","+longitude);
String saveStatus = gcservice.savedeptform(dept_id,dept_name,ph_no,designation,govt_type,address,latitude,longitude,zone,ward,remarks,c1imagePath,c2imagePath,compList,totalTreeCount,source);
if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Failed to save the details"
));
}
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Details saved successfully",
"ref_id", saveStatus
));
}
@GetMapping(value = "/sendOTPforwithdraw")
public String sendOtpforwithdraw(HttpServletRequest request, @RequestParam String mobileNo) {
List<?> CompDetailsList = gcservice.findByMobileNo(mobileNo);
System.out.println("CompDetailsList="+CompDetailsList);
if (CompDetailsList == null || CompDetailsList.isEmpty()) {
// If the mobile number is not registered, return an error message
return "Error: This number is not registered.";
}
// Generate OTP logic as before
String MobileNo = mobileNo;
Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
String key = "pfTEYN6H";
String entityId = "1401572690000011081";
String templateId = "1407175765770900925";
String appName="Green Committe";
String generatedMessage = "Welcome to GCC! Your OTP for " + appName + " is " + otp + ".";
String urlString = appConfig.getGetOtpUrl() + "from=GCCCRP" + "&key=" + key + "&sender=GCCCRP" + "&to=" + MobileNo + "&body="
+ generatedMessage + "&entityid=" + entityId + "&templateid=" + templateId;
System.out.println("\n urlString---: " + urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage = Response;
System.out.println("\n bodyMessage" + bodyMessage);
System.out.println("OTP sent successfully!");
} catch (Exception e) {
System.out.print("ERROR---: " + e);
bodyMessage = "Error";
}
HttpSession session = request.getSession();
session.setAttribute("otp", otp);
session.setAttribute("mobileNo", mobileNo);
return bodyMessage;
}
// @GetMapping("/checkwithdraw")
// public List<Map<String, Object>> checkWithdrawByMobileNumber(@RequestParam String mobile_num){
//
// return gcservice.checkwithdraw(mobile_num);
// }
@GetMapping("/checkwithdraw")
public List<Map<String, Object>> checkWithdrawByMobileNumber(@RequestParam String mobile_num) {
List<String> refnums = gcservice.getrefnums(mobile_num);
System.out.println("refnums="+refnums);
Map<String, Object> wrapper = new HashMap<>();
List<Map<String, Object>> finalList = new ArrayList<>();
if (refnums.isEmpty()) {
wrapper.put("message", "Empty List");
wrapper.put("status", "Success");
return Collections.singletonList(wrapper);
}
for (String ref : refnums) {
System.out.println("ref="+ref);
Map<String, Object> data = gcservice.getfulldetailsdata(ref);
if (data != null && !data.isEmpty()) {
finalList.add(data);
}
}
wrapper.put("data", finalList);
wrapper.put("message", "Complaint List");
wrapper.put("status", "Success");
return Collections.singletonList(wrapper);
}
@PostMapping("/withdraw")
public ResponseEntity<?> withdraw(@RequestParam String id,@RequestParam String remarks)
{
String saveStatus=gcservice.withdraw(id,remarks);
if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Failed to withdraw the Complaint"
));
}
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Application withdrawn successfully",
"ref_id", saveStatus
));
}
public String verifyOtp(HttpServletRequest request, @RequestParam String otp) {
HttpSession session = request.getSession();
try {
Integer session_otp = (Integer) session.getAttribute("otp");
// System.out.println("session_otp---:" + session_otp);
Integer entered_otp = Integer.parseInt(otp);
if (session_otp != null && session_otp.equals(entered_otp)) {
System.out.println("Entered OTP Correct");
session.setAttribute("verifiedotp", "success");
return "Success";
} else {
System.out.println("Incorrect OTP. Please enter correct OTPs.");
session.setAttribute("verifiedotp", "error");
return "Error";
}
} catch (NumberFormatException e) {
System.out.println("Invalid OTP format: " + otp);
return "Error";
} catch (Exception e) {
System.out.println("Error verifying OTP: " + e.getMessage());
return "Error";
}
}
@GetMapping("/getcompnatureforpublic")
public ResponseEntity<?> getCompNatureForPublic() {
try {
List<Map<String, Object>> list = gcservice.getCompNatureForPublic();
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("data", list);
return ResponseEntity.ok(response);
} catch (Exception ex) {
ex.printStackTrace();
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@GetMapping("/getcompnaturefordept")
public ResponseEntity<?> getCompNatureForDept() {
try {
List<Map<String, Object>> list = gcservice.getCompNatureForDept();
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("data", list);
return ResponseEntity.ok(response);
} catch (Exception ex) {
ex.printStackTrace();
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@GetMapping("/getAllDepts")
public ResponseEntity<?> getAllDepts() {
try {
List<Map<String, Object>> list = gcservice.getAllDepts();
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("data", list);
return ResponseEntity.ok(response);
} catch (Exception ex) {
ex.printStackTrace();
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", ex.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@PostMapping("/savepublicform")
public ResponseEntity<?> savepublicform(
@RequestParam String p_name,
@RequestParam String ph_no,
@RequestParam String gender,
@RequestParam String address,
@RequestParam String latitude,
@RequestParam String longitude,
@RequestParam String zone,
@RequestParam String ward,
@RequestParam String remarks,
@RequestParam MultipartFile c1image,
@RequestParam MultipartFile c2image,
@RequestParam String comp_details,
@RequestParam String source) throws JsonMappingException, JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> compList = mapper.readValue(comp_details,
new TypeReference<List<Map<String, Object>>>() {
});
int totalTreeCount = compList.stream()
.mapToInt(item -> Integer.parseInt(item.get("count").toString()))
.sum();
String c1imagePath = null;
String c2imagePath = null;
c1imagePath = gcservice.fileUpload(c1image, "comp_image1");
c2imagePath = gcservice.fileUpload(c2image, "comp_image1");
// System.out.println("======="+latitude+","+longitude);
String saveStatus = gcservice.savepublicform(p_name, ph_no, gender, address, latitude, longitude, zone, ward,
remarks, c1imagePath, c2imagePath, compList, totalTreeCount, source);
if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Failed to save the details"));
}
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Details saved successfully",
"ref_id", saveStatus));
}
@PostMapping("/savepruningform")
public ResponseEntity<?> registerComplaint(
@RequestParam(value = "p_name", required = false) String complainantName,
@RequestParam(value = "address", required = false) String complainantAddr,
@RequestParam(value = "ph_no", required = false) String mobileNo,
@RequestParam(value = "Email", required = false) String email,
@RequestParam(value = "ComplaintType", required = false) String complaintType,
@RequestParam(value = "ComplaintTitle", required = false) String complaintTitle,
@RequestParam(value = "remarks", required = false) String complaintDetails,
@RequestParam(value = "StreetId", required = false) String streetId,
@RequestParam(value = "c1image", required = false) MultipartFile compImage,
@RequestParam(value = "latitude", required = false) String latitude,
@RequestParam(value = "longitude", required = false) String longtitude,
@RequestParam(value = "Landmark", required = false) String landmark,
@RequestParam(value = "gender", required = false) String gender) {
complaintType = "454";
complaintTitle = "Tree Pruning";
System.out.println("========== Incoming Request ==========");
System.out.println("Complainant Name : " + complainantName);
System.out.println("Address : " + complainantAddr);
System.out.println("Mobile No : " + mobileNo);
System.out.println("Email : " + email);
System.out.println("Complaint Type : " + complaintType);
System.out.println("Complaint Title : " + complaintTitle);
System.out.println("Complaint Details: " + complaintDetails);
System.out.println("Street ID : " + streetId);
System.out.println("Latitude : " + latitude);
System.out.println("Longitude : " + longtitude);
System.out.println("Landmark : " + landmark);
System.out.println("Gender : " + gender);
String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice";
try {
URL url = new URL(externalUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
// 1) Convert MultipartFile to Base64 string
String compImageBase64 = "";
if (compImage != null && !compImage.isEmpty()) {
byte[] bytes = compImage.getBytes();
compImageBase64 = Base64.getEncoder().encodeToString(bytes);
}
System.out.println("compImage.." + compImage);
String params = "serviceId=RegComplaint" +
"&ComplainantName=" + URLEncoder.encode(complainantName != null ? complainantName : "", "UTF-8") +
"&ComplainantAddr=" + URLEncoder.encode(complainantAddr != null ? complainantAddr : "", "UTF-8") +
"&MobileNo=" + URLEncoder.encode(mobileNo != null ? mobileNo : "", "UTF-8") +
"&Email=" + URLEncoder.encode(email != null ? email : "", "UTF-8") +
"&ComplaintType=" + URLEncoder.encode(complaintType != null ? complaintType : "", "UTF-8") +
"&ComplaintTitle=" + URLEncoder.encode(complaintTitle != null ? complaintTitle : "", "UTF-8") +
"&ComplaintDetails=" + URLEncoder.encode(complaintDetails != null ? complaintDetails : "", "UTF-8")
+
"&StreetId=" + URLEncoder.encode(streetId != null ? streetId : "", "UTF-8") +
"&Comp_Image=" + URLEncoder.encode(compImageBase64, "UTF-8") +
"&latitude=" + URLEncoder.encode(latitude != null ? latitude : "", "UTF-8") +
"&longtitude=" + URLEncoder.encode(longtitude != null ? longtitude : "", "UTF-8") +
"&Landmark=" + URLEncoder.encode(landmark != null ? landmark : "", "UTF-8") +
"&gender=" + URLEncoder.encode(gender != null ? gender : "", "UTF-8") +
"&compmode=1";
/*
* System.out.println("========================================");
* System.out.println("External URL : " + externalUrl);
*
* System.out.println("========================================");
*/
try (OutputStream os = conn.getOutputStream()) {
byte[] input = params.getBytes("UTF-8");
os.write(input, 0, input.length);
}
int responseCode = conn.getResponseCode();
System.out.println("responseCode" + responseCode);
BufferedReader reader;
if (responseCode == HttpURLConnection.HTTP_OK) {
reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
} else {
reader = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
}
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
System.out.println("response" + response);
}
reader.close();
// ✅ Parse and return only the complaint number
ObjectMapper mapper = new ObjectMapper();
Map<String, String> responseMap = mapper.readValue(response.toString(), Map.class);
System.out.println("responseMap" + responseMap);
String complaintNo = responseMap.getOrDefault("Complaint Number", "N/A");
System.out.println("complaintNo====" + complaintNo);
return ResponseEntity.ok(
Map.of(
"status", true,
"complaintNumber", complaintNo));
/*
* return ResponseEntity.ok()
* .contentType(MediaType.APPLICATION_JSON).body(Map.of("complaintNumber",
* complaintNo));
*/
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(Map.of("error", "An error occurred while processing the request."));
}
}
@PostMapping("/savedeptform")
public ResponseEntity<?> savedeptform(
@RequestParam String dept_id,
@RequestParam(required = false) String dept_name,
@RequestParam String ph_no,
@RequestParam String designation,
@RequestParam String govt_type,
@RequestParam String address,
@RequestParam String latitude,
@RequestParam String longitude,
@RequestParam String zone,
@RequestParam String ward,
@RequestParam String remarks,
@RequestParam MultipartFile c1image,
@RequestParam MultipartFile c2image,
@RequestParam String comp_details,
@RequestParam String source) throws JsonMappingException, JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> compList = mapper.readValue(comp_details,
new TypeReference<List<Map<String, Object>>>() {
});
int totalTreeCount = compList.stream()
.mapToInt(item -> Integer.parseInt(item.get("count").toString()))
.sum();
String c1imagePath = null;
String c2imagePath = null;
c1imagePath = gcservice.fileUpload(c1image, "comp_image1");
c2imagePath = gcservice.fileUpload(c2image, "comp_image1");
// System.out.println("======="+latitude+","+longitude);
String saveStatus = gcservice.savedeptform(dept_id, dept_name, ph_no, designation, govt_type, address, latitude,
longitude, zone, ward, remarks, c1imagePath, c2imagePath, compList, totalTreeCount, source);
if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Failed to save the details"));
}
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Details saved successfully",
"ref_id", saveStatus));
}
@GetMapping(value = "/sendOTPforwithdraw")
public String sendOtpforwithdraw(HttpServletRequest request, @RequestParam String mobileNo) {
List<?> CompDetailsList = gcservice.findByMobileNo(mobileNo);
System.out.println("CompDetailsList=" + CompDetailsList);
if (CompDetailsList == null || CompDetailsList.isEmpty()) {
// If the mobile number is not registered, return an error message
return "Error: This number is not registered.";
}
// Generate OTP logic as before
String MobileNo = mobileNo;
Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
String key = "pfTEYN6H";
String entityId = "1401572690000011081";
String templateId = "1407175765770900925";
String appName = "Green Committe";
String generatedMessage = "Welcome to GCC! Your OTP for " + appName + " is " + otp + ".";
String urlString = appConfig.getGetOtpUrl() + "from=GCCCRP" + "&key=" + key + "&sender=GCCCRP" + "&to="
+ MobileNo + "&body="
+ generatedMessage + "&entityid=" + entityId + "&templateid=" + templateId;
System.out.println("\n urlString---: " + urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage = Response;
System.out.println("\n bodyMessage" + bodyMessage);
System.out.println("OTP sent successfully!");
} catch (Exception e) {
System.out.print("ERROR---: " + e);
bodyMessage = "Error";
}
HttpSession session = request.getSession();
session.setAttribute("otp", otp);
session.setAttribute("mobileNo", mobileNo);
return bodyMessage;
}
// @GetMapping("/checkwithdraw")
// public List<Map<String, Object>> checkWithdrawByMobileNumber(@RequestParam
// String mobile_num){
//
// return gcservice.checkwithdraw(mobile_num);
// }
@GetMapping("/checkwithdraw")
public List<Map<String, Object>> checkWithdrawByMobileNumber(@RequestParam String mobile_num) {
List<String> refnums = gcservice.getrefnums(mobile_num);
System.out.println("refnums=" + refnums);
Map<String, Object> wrapper = new HashMap<>();
List<Map<String, Object>> finalList = new ArrayList<>();
if (refnums.isEmpty()) {
wrapper.put("message", "Empty List");
wrapper.put("status", "Success");
return Collections.singletonList(wrapper);
}
for (String ref : refnums) {
System.out.println("ref=" + ref);
Map<String, Object> data = gcservice.getfulldetailsdata(ref);
if (data != null && !data.isEmpty()) {
finalList.add(data);
}
}
wrapper.put("data", finalList);
wrapper.put("message", "Complaint List");
wrapper.put("status", "Success");
return Collections.singletonList(wrapper);
}
@PostMapping("/withdraw")
public ResponseEntity<?> withdraw(@RequestParam String id, @RequestParam String remarks) {
String saveStatus = gcservice.withdraw(id, remarks);
if (saveStatus == null || saveStatus.equals("error")) {
return ResponseEntity.ok(Map.of(
"status", false,
"message", "failed",
"description", "Failed to withdraw the Complaint"));
}
return ResponseEntity.ok(Map.of(
"status", true,
"message", "success",
"description", "Application withdrawn successfully",
"ref_id", saveStatus));
}
}

2
src/main/resources/application.properties

@ -1,3 +1,3 @@
spring.application.name=greencommitte
spring.profiles.active=dev
spring.profiles.active=prod

438
src/main/resources/templates/modules/home.html

@ -1,159 +1,161 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>GCC Green Committee</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base th:href="${baseURL}"/>
<link rel="icon" th:href="@{images/favicon.ico}" type="image/x-icon" />
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800" rel="stylesheet">
<link rel="stylesheet" type="text/css" th:href="@{assets/node_modules/bootstrap/dist/css/bootstrap.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{assets/node_modules/select2/dist/css/select2.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{assets/node_modules/sweetalert2/sweetalert2.min.css}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<style>
/* Header Styling */
.header {
background-color: #1d495a;
padding: 10px 20px;
color: white;
font-family: Arial, sans-serif;
}
.header .logo img {
height: 50px;
}
.header .center-text {
text-align: center;
font-size: 24px;
}
.header .menu-btn {
background-color: transparent;
border: none;
font-size: 24px;
color: white;
}
.header .menu-btn:hover {
color: #ccc;
}
/* Menu Dropdown */
.menu-dropdown {
position: absolute;
top: 60px;
right: 20px;
background-color: #1d495a;
padding: 10px;
display: none;
flex-direction: column;
z-index: 1000; /* Add z-index to bring the menu above other elements */
}
.menu-dropdown a {
color: white;
margin-bottom: 5px;
text-decoration: none;
}
.menu-dropdown a:hover {
text-decoration: underline;
}
/* Mobile Specific Styling */
@media (max-width: 768px) {
.header {
display: flex;
justify-content: space-between;
align-items: center;
}
.center-text {
font-size: 18px !important;
flex-grow: 1;
text-align: center;
}
.menu-dropdown {
right: 0;
left: 0;
z-index: 1000; /* Add z-index to bring the menu above other elements */
}
}
.enhanced-btn {
padding: 12px;
font-size: 16px;
border-radius: 6px;
transition: 0.3s ease;
}
.enhanced-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.card {
border-radius: 12px;
}
.card-h{
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}
</style>
<meta charset="utf-8">
<title>GCC Green Committee</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base th:href="${baseURL}" />
<link rel="icon" th:href="@{images/favicon.ico}" type="image/x-icon" />
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800" rel="stylesheet">
<link rel="stylesheet" type="text/css" th:href="@{assets/node_modules/bootstrap/dist/css/bootstrap.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{assets/node_modules/select2/dist/css/select2.min.css}">
<link rel="stylesheet" type="text/css" th:href="@{assets/node_modules/sweetalert2/sweetalert2.min.css}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<style>
/* Header Styling */
.header {
background-color: #1d495a;
padding: 10px 20px;
color: white;
font-family: Arial, sans-serif;
}
.header .logo img {
height: 50px;
}
.header .center-text {
text-align: center;
font-size: 24px;
}
.header .menu-btn {
background-color: transparent;
border: none;
font-size: 24px;
color: white;
}
.header .menu-btn:hover {
color: #ccc;
}
/* Menu Dropdown */
.menu-dropdown {
position: absolute;
top: 60px;
right: 20px;
background-color: #1d495a;
padding: 10px;
display: none;
flex-direction: column;
z-index: 1000;
/* Add z-index to bring the menu above other elements */
}
.menu-dropdown a {
color: white;
margin-bottom: 5px;
text-decoration: none;
}
.menu-dropdown a:hover {
text-decoration: underline;
}
/* Mobile Specific Styling */
@media (max-width: 768px) {
.header {
display: flex;
justify-content: space-between;
align-items: center;
}
.center-text {
font-size: 18px !important;
flex-grow: 1;
text-align: center;
}
.menu-dropdown {
right: 0;
left: 0;
z-index: 1000;
/* Add z-index to bring the menu above other elements */
}
}
.enhanced-btn {
padding: 12px;
font-size: 16px;
border-radius: 6px;
transition: 0.3s ease;
}
.enhanced-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.card {
border-radius: 12px;
}
.card-h {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}
</style>
</head>
<body style="background-color: #ebf1fa;">
<!-- Header Start-->
<header>
<div class="header d-flex justify-content-between align-items-center">
<!-- Left: Logo -->
<div class="logo">
<img src="https://gccservices.in/gcc/assets/images/logo.png" alt="Logo">
</div>
<!-- Center: Text -->
<div class="center-text">
GREATER CHENNAI CORPORATION
</div>
<!-- Right: Button for Menu -->
<div class="menu">
<button class="menu-btn" onclick="toggleMenu()">
&#9776; <!-- Unicode for hamburger menu icon -->
</button>
</div>
</div>
<!-- Dropdown Menu -->
<div class="menu-dropdown" id="menuDropdown">
<a href="https://chennaicorporation.gov.in/gcc/">Home</a>
<a href="https://chennaicorporation.gov.in/gcc/about-GCC/">About GCC</a>
<a href="https://chennaicorporation.gov.in/gcc/who-is-who/index_data.jsp">Who's Who</a>
<a href="https://chennaicorporation.gov.in/gcc/council/about-council/">Council</a>
<a href="https://chennaicorporation.gov.in/gcc/tender/">Tender</a>
<a href="https://chennaicorporation.gov.in/gcc/department/">Departments</a>
<a href="https://chennaicorporation.gov.in/gcc/online-services/">Online Services</a>
<a href="https://gccservices.in/gcc/login">Official Login</a>
</div>
</header>
<!-- Header End-->
<main class="container mt-4">
<!-- <div class="card mb-4">
<!-- Header Start-->
<header>
<div class="header d-flex justify-content-between align-items-center">
<!-- Left: Logo -->
<div class="logo">
<img src="https://gccservices.in/gcc/assets/images/logo.png" alt="Logo">
</div>
<!-- Center: Text -->
<div class="center-text">
GREATER CHENNAI CORPORATION
</div>
<!-- Right: Button for Menu -->
<div class="menu">
<button class="menu-btn" onclick="toggleMenu()">
&#9776; <!-- Unicode for hamburger menu icon -->
</button>
</div>
</div>
<!-- Dropdown Menu -->
<div class="menu-dropdown" id="menuDropdown">
<a href="https://chennaicorporation.gov.in/gcc/">Home</a>
<a href="https://chennaicorporation.gov.in/gcc/about-GCC/">About GCC</a>
<a href="https://chennaicorporation.gov.in/gcc/who-is-who/index_data.jsp">Who's Who</a>
<a href="https://chennaicorporation.gov.in/gcc/council/about-council/">Council</a>
<a href="https://chennaicorporation.gov.in/gcc/tender/">Tender</a>
<a href="https://chennaicorporation.gov.in/gcc/department/">Departments</a>
<a href="https://chennaicorporation.gov.in/gcc/online-services/">Online Services</a>
<a href="https://gccservices.in/gcc/login">Official Login</a>
</div>
</header>
<!-- Header End-->
<main class="container mt-4">
<!-- <div class="card mb-4">
<div class="card-header text-center">
<h4> GREEN COMMITTEE </h4>
</div>
@ -170,82 +172,98 @@
</div> -->
<div class="card shadow-lg border-0">
<div class="card-h text-center text-white py-4" style="background-color: #1d495a;">
<h4 class="mb-0">Green Committee Application Forms</h4>
</div>
<div class="card shadow-lg border-0">
<div class="card-h text-center text-white py-4" style="background-color: #1d495a;">
<h4 class="mb-0">Green Committee Application Forms</h4>
</div>
<div class="card-body py-5">
<!-- Public Form -->
<div class="row align-items-center mb-4">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
For Citizen Form (Public)
</div>
<div class="col-md-7">
<button type="button" class="btn btn-success btn-block enhanced-btn" onclick="gotopublic()">
<i class="fa fa-users mr-2"></i> Click Here to fill citizen form
</button>
<div class="card-body py-5">
<!-- Public Form -->
<div class="row align-items-center mb-4">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
For Citizen Form (Public)
</div>
<div class="col-md-7">
<button type="button" class="btn btn-success btn-block enhanced-btn" onclick="gotopublic()">
<i class="fa fa-users mr-2"></i> Click Here to fill citizen form
</button>
</div>
</div>
</div>
<!-- Department Form -->
<div class="row align-items-center mb-4">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
For Department Form
</div>
<div class="col-md-7">
<button type="button" class="btn btn-primary btn-block enhanced-btn" onclick="gotodept()">
<i class="fa fa-building mr-2"></i> Click Here to fill department form
</button>
<!-- Department Form -->
<div class="row align-items-center mb-4">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
For Department Form
</div>
<div class="col-md-7">
<button type="button" class="btn btn-primary btn-block enhanced-btn" onclick="gotodept()">
<i class="fa fa-building mr-2"></i> Click Here to fill department form
</button>
</div>
</div>
</div>
<!-- Withdraw Applications -->
<div class="row align-items-center">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
Check Status
</div>
<div class="col-md-7">
<button type="button" class="btn btn-warning btn-block enhanced-btn" onclick="gotowithraw()">
<i class="fa fa-check-circle mr-2"></i> Click Here to check status
</button>
<!-- Withdraw Applications -->
<div class="row align-items-center mb-4">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
Check Status
</div>
<div class="col-md-7">
<button type="button" class="btn btn-warning btn-block enhanced-btn" onclick="gotowithraw()">
<i class="fa fa-check-circle mr-2"></i> Click Here to check status
</button>
</div>
</div>
<div class="row align-items-center mb-4">
<div class="col-md-5 pb-2 text-center text-md-right font-weight-bold">
Check Pruning Status
</div>
<div class="col-md-7">
<button type="button" class="btn btn-warning btn-block enhanced-btn" onclick="getpruning()">
<i class="fa fa-check-circle mr-2"></i>
Click Here to check pruning status
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</main>
<script type="text/javascript" th:src="@{assets/node_modules/jquery/dist/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/bootstrap/dist/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/select2/dist/js/select2.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/sweetalert2/sweetalert2.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/jquery/dist/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/bootstrap/dist/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/select2/dist/js/select2.min.js}"></script>
<script type="text/javascript" th:src="@{assets/node_modules/sweetalert2/sweetalert2.min.js}"></script>
<script type="text/javascript">
function toggleMenu() {
var dropdown = document.getElementById("menuDropdown");
if (dropdown.style.display === "flex") {
dropdown.style.display = "none";
} else {
dropdown.style.display = "flex";
}
}
function gotopublic() {
window.location.href = '/greencommittee/publicform';
}
<script type="text/javascript">
function toggleMenu() {
var dropdown = document.getElementById("menuDropdown");
if (dropdown.style.display === "flex") {
dropdown.style.display = "none";
} else {
dropdown.style.display = "flex";
}
}
function gotopublic() {
window.location.href = '/greencommittee/publicform';
}
function gotodept() {
window.location.href = '/greencommittee/deptform';
}
function gotowithraw(){
window.location.href = '/greencommittee/withdrawpage';
}
</script>
function gotodept() {
window.location.href = '/greencommittee/deptform';
}
function gotowithraw() {
window.location.href = '/greencommittee/withdrawpage';
}
function getpruning() {
window.location.href = "https://erp.chennaicorporation.gov.in/pgr/";
}
</script>
</body>
</html>

187
src/main/resources/templates/modules/public/form.html

@ -384,12 +384,12 @@
<input type="radio" name="gender" value="F" class="ms-3 ml-3"> Female
<input type="radio" name="gender" value="T" class="ms-3 ml-3"> Transgender
</div>
<div class="col-md-8">
<!--<div class="col-md-8">
<label class="form-label">Tree Land Location (Also click the street in Map)<span
class="text-danger">*</span></label>
<textarea class="form-control" id="address" name="address" maxlength="255"
placeholder="Type Tree Address Here" required></textarea>
</div>
</div>-->
</div>
<!-- <div class="row mb-3">
@ -425,14 +425,20 @@
<label for="longitude">Longitude<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="longitude" name="longitude" readonly>
</div>
<div class="col-md-3">
<div class="col-md-6">
<label for="streetName">Street<span class="text-danger">*</span></label>
<select id="streetName" name="streetName" class="form-control" required>
<option value="">Select Street</option>
</select>
</div>
<!-- <div class="col-md-3">
<label for="zone">Zone<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="zone" name="zone" required readonly>
</div>
<div class="col-md-3">
<label for="ward">Ward<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="ward" name="ward" required readonly>
</div>
</div>-->
</div>
@ -457,6 +463,21 @@
</div>
</div>-->
<div class="row mb-3">
<input type="hidden" id="streetId" name="streetId">
<!-- <div class="col-md-3">
<label for="streetId">Street Id</label>
<input type="text" class="form-control" id="streetId" readonly>
</div>-->
<div class="col-md-3">
<label for="zone">Zone<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="zone" name="zone" readonly>
</div>
<div class="col-md-3">
<label for="ward">Ward<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="ward" name="ward" readonly>
</div>
<!-- Left Side -->
<div class="col-md-4">
@ -489,7 +510,7 @@
</div>
<!-- Right Side -->
<div class="col-md-8">
<!--<div class="col-md-8">
<div class="alert alert-info mb-0 py-2">
<strong>Instructions:</strong><br>
@ -505,7 +526,7 @@
Click here to raise the complaint
</a>
</div>
</div>
</div>-->
</div>
@ -727,6 +748,22 @@
let id = $(this).val();
let name = $("#complaintDropdown option:selected").data("name");
if (name && name.toLowerCase() === "pruning") {
// Hide second image
$("#c2image").closest(".col-md-6").hide();
// Remove required validation
$("#c2image").prop("required", false).val("");
} else {
// Show second image
$("#c2image").closest(".col-md-6").show();
// Existing workflow
$("#c2image").prop("required", true);
}
if (!id) {
return;
@ -929,10 +966,10 @@
//const url = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/
//FeatureServer/2/query?where=&objectIds=&time=&geometry={encodedGeometry}&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1&units=esriSRUnit_Meter&outFields=zone,ward&returnGeometry=false&f=geojson`;
const url = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/FeatureServer/2/query?` +
const url = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/GCCDepts/EDPMobile2025/FeatureServer/0/query?` +
`where=&objectIds=&time=&geometry=${encodedGeometry}` +
`&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=1` +
`&units=esriSRUnit_Meter&relationParam=&outFields=zone,ward` +
`&geometryType=esriGeometryPoint&inSR=4326&defaultSR=4326&spatialRel=esriSpatialRelIntersects&distance=25` +
`&units=esriSRUnit_Meter&relationParam=&outFields=region%2Cnew_zone%2C+new_ward%2Croad_id%2C+road_name%2Cgis_id%2Ctype` +
`&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=` +
`&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=` +
`&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=` +
@ -940,6 +977,7 @@
`&timeReferenceUnknownClient=false&maxRecordCountFactor=&sqlFormat=none&resultType=&featureEncoding=esriDefault` +
`&datumTransformation=&f=geojson`;
//console.log(url);
fetch(url)
@ -951,13 +989,14 @@
})
.then(data => {
//console.log("GIS API Response:", data);
console.log("GIS API Response:", data);
const features = data.features;
if (features.length > 0) {
const props = features[0].properties;
const zone = props.zone;
const ward = props.ward;
const zone = props.new_zone;
const ward = props.new_ward;
console.log("Zone:", zone, "Ward:", ward);
// 👉 You can update form fields or DOM elements here
@ -972,7 +1011,73 @@
.catch(error => {
console.error("Error fetching zone/ward:", error);
});
const streetSelect = document.getElementById("streetName");
streetSelect.innerHTML = "";
const defaultOption = document.createElement("option");
defaultOption.value = "";
defaultOption.text = "-- Select Street --";
streetSelect.appendChild(defaultOption);
document.getElementById("streetId").value = "";
// Timeout mechanism: 1 seconds
const timeout = new Promise((_, reject) =>
setTimeout(() => reject(new Error("Request timed out")), 1000)
);
// Actual fetch
const fetchRequest = fetch(url).then(res => res.json());
Promise.race([fetchRequest, timeout])
.then(data => {
const features = data.features;
if (!features || features.length === 0) {
Swal.fire({
icon: 'warning',
title: 'No Street Found',
text: 'Please select the nearby street.',
});
return;
}
streetsList = features.map(f => f.properties); //Save for use in dropdown
streetsList.forEach((props, index) => {
const option = document.createElement("option");
option.value = index;
option.text = props.road_name;
streetSelect.appendChild(option);
});
})
.catch(err => {
console.error("Error fetching street:", err);
Swal.fire("Failed to load street data", '', 'error');
});
}
document.getElementById("streetName").addEventListener("change", function () {
const selectedIndex = this.value;
console.log("heck")
console.log(selectedIndex);
if (selectedIndex !== "") {
const selectedStreet = streetsList[selectedIndex];
console.log(selectedStreet);
document.getElementById("streetId").value = selectedStreet.road_id;
console.log("Selected street:", selectedStreet);
} else {
document.getElementById("streetId").value = "";
}
});
}
$('#publicform').submit(function (e) {
@ -1071,6 +1176,13 @@
}
const name = $('#pname').val();
const streetName = $('#streetName option:selected').text();
const street_id = $('#streetId').val();
console.log("cfefefef");
console.log(streetName);
console.log("Streetid");
console.log(street_id);
// const streetName = $('#streetName').val();
const c1image = $('#c1image')[0];
@ -1142,21 +1254,35 @@
formData.append("p_name", name);
formData.append("source", "1");
formData.append("address", streetName)
formData.append("c1image", c1image);
formData.append("c2image", c2image);
formData.append("comp_details", JSON.stringify(compDetailsList));
let complaintName = $("#complaintDropdown option:selected").data("name");
let apiUrl = "/greencommittee/api/savepublicform";
if (complaintName &&
complaintName.trim().toLowerCase() === "pruning") {
apiUrl = "/greencommittee/api/savepruningform";
formData.append("StreetId", street_id);
// Only one image for pruning
formData.delete("c2image");
}
console.log(formData);
$.ajax({
url: "/greencommittee/api/savepublicform",
url: apiUrl,
method: "POST",
data: formData,
processData: false,
contentType: false,
success: function (response) {
$('#pageLoader').hide();
if (response.status) {
/*if (response.status) {
Swal.fire({
icon: 'success',
allowOutsideClick: false,
@ -1167,7 +1293,38 @@
window.location.href = "/greencommittee/home";
});
} else {
}*/
if (response.status) {
if (complaintName &&
complaintName.trim().toLowerCase() === "pruning") {
Swal.fire({
icon: 'success',
allowOutsideClick: false,
allowEscapeKey: false,
title: 'Complaint Registered Successfully',
html: 'Complaint Number: <b>' + response.complaintNumber + '</b>'
}).then(() => {
window.location.href = "/greencommittee/home";
});
} else {
Swal.fire({
icon: 'success',
allowOutsideClick: false,
allowEscapeKey: false,
title: 'Details are Saved Successfully',
html: 'Reference ID: <b>' + response.ref_id + '</b>'
}).then(() => {
window.location.href = "/greencommittee/home";
});
}
}
else {
$('#pageLoader').hide();
Swal.fire({
icon: 'error',

13
src/test/java/com/gcc/greencommitte/GreencommitteApplicationTests.java

@ -1,13 +0,0 @@
package com.gcc.greencommitte;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class GreencommitteApplicationTests {
@Test
void contextLoads() {
}
}
Loading…
Cancel
Save