diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 8f96f52..0000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -wrapperVersion=3.3.2 -distributionType=only-script -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip diff --git a/pom.xml b/pom.xml index d8d2664..28fdeeb 100644 --- a/pom.xml +++ b/pom.xml @@ -51,8 +51,18 @@ spring-boot-starter-test test - + + + com.example + erp + 0.0.1-SNAPSHOT + + + in.gov.chennaicorporation + gccoffice + 0.0.1 + diff --git a/src/main/java/com/gcc/publicgrievance/Service/ComplaintService.java b/src/main/java/com/gcc/publicgrievance/Service/ComplaintService.java index 6d9791c..3ce0e43 100644 --- a/src/main/java/com/gcc/publicgrievance/Service/ComplaintService.java +++ b/src/main/java/com/gcc/publicgrievance/Service/ComplaintService.java @@ -10,11 +10,19 @@ import java.util.Random; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; + +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; @Service public class ComplaintService { + + private final JdbcTemplate jdbcTemplate; + + public ComplaintService(JdbcTemplate jdbcTemplate) { + this.jdbcTemplate = jdbcTemplate; + } private final String baseUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; @@ -45,12 +53,15 @@ public class ComplaintService { } } - public List> fetchComplaintDetailsByMobile(String mobileNo) { + public List> fetchComplaintDetailsByMobile(String mobileNo, String fromDate, String toDate, String year) { RestTemplate restTemplate = new RestTemplate(); String url = baseUrl - + "?serviceId=getComplaintListWithImg&From_date=01/01/2024&To_date=20/08/2024&jsonResp=Yes&UserType=Public&MobileNo=" - + mobileNo + "&PageIndex=null&Status=null&repYear=2024"; - String response = restTemplate.getForObject(url, String.class); + + "?serviceId=getComplaintListWithImg&From_date=" + fromDate + + "&To_date=" + toDate + + "&jsonResp=Yes&UserType=Public&MobileNo=" + mobileNo + + "&PageIndex=null&Status=null&repYear=" + year; + + String response = restTemplate.getForObject(url, String.class); try { ObjectMapper objectMapper = new ObjectMapper(); @@ -63,5 +74,31 @@ public class ComplaintService { } + private final ObjectMapper objectMapper = new ObjectMapper(); + + public String getComplaintCategories() { + String sql = "SELECT category_id, category_name, label_name " + + "FROM category WHERE is_active = 1 and is_delete = 0"; + try { + List> result = jdbcTemplate.queryForList(sql); + return objectMapper.writeValueAsString(result); + } catch (Exception e) { + e.printStackTrace(); + return "[]"; + } + } + + public String getComplaintSubTypes(String categoryId) { + String sql = "SELECT subcategory_id, subcategory_name, category_id " + + "FROM subcategory WHERE is_active = 1 and is_delete = 0 " + + "AND category_id = ?"; + try { + List> result = jdbcTemplate.queryForList(sql, categoryId); + return objectMapper.writeValueAsString(result); + } catch (Exception e) { + e.printStackTrace(); + return "[]"; + } + } } diff --git a/src/main/java/com/gcc/publicgrievance/config/AppConfigur.java b/src/main/java/com/gcc/publicgrievance/config/AppConfigur.java new file mode 100644 index 0000000..1ac6ae0 --- /dev/null +++ b/src/main/java/com/gcc/publicgrievance/config/AppConfigur.java @@ -0,0 +1,47 @@ +package com.gcc.publicgrievance.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "app") +public class AppConfigur { + + private String title; + private String baseUrl; + private String getOtpUrl; + private String erpUrl; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getBaseUrl() { + return baseUrl; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } + + public String getGetOtpUrl() { + return getOtpUrl; + } + + public void setGetOtpUrl(String getOtpUrl) { + this.getOtpUrl = getOtpUrl; + } + + public String getErpUrl() { + return erpUrl; + } + + public void setErpUrl(String erpUrl) { + this.erpUrl = erpUrl; + } + +} \ No newline at end of file diff --git a/src/main/java/com/gcc/publicgrievance/configuration/AppConfig.java b/src/main/java/com/gcc/publicgrievance/configuration/AppConfig.java index 91ab2d8..d4f7bf1 100644 --- a/src/main/java/com/gcc/publicgrievance/configuration/AppConfig.java +++ b/src/main/java/com/gcc/publicgrievance/configuration/AppConfig.java @@ -1,15 +1,15 @@ -package com.gcc.publicgrievance.configuration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.client.RestTemplate; - -@Configuration -public class AppConfig { - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } - -} + package com.gcc.publicgrievance.configuration; + + import org.springframework.context.annotation.Bean; + import org.springframework.context.annotation.Configuration; + import org.springframework.web.client.RestTemplate; + + @Configuration public class AppConfig { + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } + + } diff --git a/src/main/java/com/gcc/publicgrievance/configuration/DataSourceConfig.java b/src/main/java/com/gcc/publicgrievance/configuration/DataSourceConfig.java new file mode 100644 index 0000000..1568d7a --- /dev/null +++ b/src/main/java/com/gcc/publicgrievance/configuration/DataSourceConfig.java @@ -0,0 +1,73 @@ +package com.gcc.publicgrievance.configuration; + +import java.util.Properties; + +import org.hibernate.jpa.HibernatePersistenceProvider; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.jdbc.datasource.DriverManagerDataSource; +import org.springframework.orm.jpa.JpaTransactionManager; +import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.annotation.EnableTransactionManagement; +import org.springframework.web.client.RestTemplate; + +import javax.sql.DataSource; + +@Configuration +@EnableTransactionManagement +public class DataSourceConfig { + + private static String host = "localhost"; + //private static String dbpassword = "gccroot"; + private static String dbpassword = "password"; + + @Configuration + @EnableTransactionManagement + @EnableJpaRepositories( + entityManagerFactoryRef = "appEntityManagerFactory", + transactionManagerRef = "appTransactionManager", + basePackages = {"com.gcc.publicgrievance"} + ) + + public static class MysqlAppDataSourceConfig { + @Primary + @Bean(name = "mysqlAppDataSource") + public DataSource mysqlAppDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://"+host+"/gcc_rest_services"); + dataSource.setUsername("root"); + dataSource.setPassword(dbpassword); + return dataSource; + } + + @Primary + @Bean(name="appEntityManagerFactory") + public LocalContainerEntityManagerFactoryBean entityManagerFactory( + @Qualifier("mysqlAppDataSource") DataSource dataSource) { + LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); + entityManagerFactoryBean.setDataSource(dataSource); + entityManagerFactoryBean.setPackagesToScan("com.gcc.publicgrievance"); + entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class); + Properties properties = new Properties(); + properties.setProperty("hibernate.hbm2ddl.auto", "update"); + entityManagerFactoryBean.setJpaProperties(properties); + + return entityManagerFactoryBean; + } + + @Primary + @Bean(name = "appTransactionManager") + public PlatformTransactionManager transactionManager(@Qualifier("appEntityManagerFactory") jakarta.persistence.EntityManagerFactory entityManagerFactory) { + return new JpaTransactionManager(entityManagerFactory); + } + } + + + + +} diff --git a/src/main/java/com/gcc/publicgrievance/configuration/SecurityConfig.java b/src/main/java/com/gcc/publicgrievance/configuration/SecurityConfig.java new file mode 100644 index 0000000..b0693f1 --- /dev/null +++ b/src/main/java/com/gcc/publicgrievance/configuration/SecurityConfig.java @@ -0,0 +1,24 @@ +package com.gcc.publicgrievance.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +public class SecurityConfig { + + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http + .csrf(csrf -> csrf.disable()) + .authorizeHttpRequests(auth -> auth + .requestMatchers("/pgr/api/**").permitAll() + .anyRequest().permitAll() + ) + .formLogin(form -> form.disable()) + .httpBasic(httpBasic -> httpBasic.disable()); + + return http.build(); + } +} diff --git a/src/main/java/com/gcc/publicgrievance/configuration/UserSessionInterceptor.java b/src/main/java/com/gcc/publicgrievance/configuration/UserSessionInterceptor.java new file mode 100644 index 0000000..a4c857e --- /dev/null +++ b/src/main/java/com/gcc/publicgrievance/configuration/UserSessionInterceptor.java @@ -0,0 +1,33 @@ +package com.gcc.publicgrievance.configuration; + +import java.util.Arrays; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; + +import com.gcc.publicgrievance.config.AppConfigur; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +@Component +public class UserSessionInterceptor implements HandlerInterceptor { + + + + @Autowired + private AppConfigur appConfig; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + // Get the current request URL + String requestUrl = request.getRequestURI(); + request.setAttribute("baseURL", appConfig.getBaseUrl()); + + return true; // Allow the request to proceed + } + + +} diff --git a/src/main/java/com/gcc/publicgrievance/controller/APIController.java b/src/main/java/com/gcc/publicgrievance/controller/APIController.java new file mode 100644 index 0000000..22f9ec4 --- /dev/null +++ b/src/main/java/com/gcc/publicgrievance/controller/APIController.java @@ -0,0 +1,123 @@ +package com.gcc.publicgrievance.controller; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Random; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.multipart.MultipartFile; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; // Import Jackson's ObjectMapper +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.gcc.publicgrievance.config.AppConfigur; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; + +@RequestMapping("/pgr/api") +@RestController +public class APIController { + + @Autowired + private AppConfigur appConfig; + + @GetMapping(value = "/sendOTP") + public String sendOtp(HttpServletRequest request, + @RequestParam String mobileNo, + @RequestParam(defaultValue = "5") int otpLength, + @RequestParam(defaultValue = "false") boolean mobilenocheck) { + + String bodyMessage = ""; + + try { + // Validate Mobile Number + if (mobileNo.length() != 10) { + throw new IllegalArgumentException("Invalid Mobile Number. It must be 10 digits."); + } + + // New SMS API URL + String urlString = "https://gccservices.in/gccofficialapp/api/sendOTP?mobileNo=" + mobileNo + + "&otpLength=" + otpLength + "&mobilenocheck=" + mobilenocheck; + + System.out.println("\nurlString---: " + urlString); + + // Send the OTP using the new SMS API + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity response = restTemplate.exchange(urlString, HttpMethod.GET, null, String.class); + + // Log full response and status code + System.out.println("\nResponse Status Code: " + response.getStatusCode()); + System.out.println("\nResponse Body: " + response.getBody()); + + // Parse the response to extract the OTP from the API response + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode jsonResponse = objectMapper.readTree(response.getBody()); + String apiOtp = jsonResponse.get(0).get("OTP").asText(); // Extract OTP from the response + int statusCode = jsonResponse.get(0).get("status").asInt(); // Extract status code + String message = jsonResponse.get(0).get("message").asText(); // Extract message + + // Store the OTP in the session + HttpSession session = request.getSession(); + session.setAttribute("otp", apiOtp); // Use the OTP from the API response + + // Construct the bodyMessage with status, mobileNo, and OTP + bodyMessage = "[{\"Status\": " + statusCode + " , \"Mobile No\": " + mobileNo + " , \"OTP\": " + apiOtp + " , \"Message\": \"" + message + "\"}]"; + System.out.println("OTP sent successfully!"); + + } catch (IllegalArgumentException e) { + // Catch validation error for mobile number + System.out.println("ERROR---: " + e.getMessage()); + bodyMessage = "Error: " + e.getMessage(); + } catch (Exception e) { + // Catch general errors + System.out.println("ERROR---: " + e); + bodyMessage = "There was a problem sending OTP. Try again."; + } + + return bodyMessage; + } + + @GetMapping(value = "/verifyOTP") + public String verifyOtp(HttpServletRequest request, @RequestParam String otp) { + HttpSession session = request.getSession(); + try { + String sessionOtp = (String) session.getAttribute("otp"); // Get OTP from session + System.out.println("sessionOtp---:" + sessionOtp); + String enteredOtp = otp.trim(); // OTP entered by user + + if (sessionOtp != null && sessionOtp.equals(enteredOtp)) { + System.out.println("Entered OTP Correct"); + session.setAttribute("verifiedotp", "success"); + return "Success"; // OTP is correct + } else { + System.out.println("Incorrect OTP. Please enter correct OTP."); + session.setAttribute("verifiedotp", "error"); + return "Error"; // OTP mismatch + } + } catch (Exception e) { + System.out.println("Error verifying OTP: " + e.getMessage()); + return "Error"; // Handle any exceptions + } + } + + +} diff --git a/src/main/java/com/gcc/publicgrievance/controller/ComplaintController.java b/src/main/java/com/gcc/publicgrievance/controller/ComplaintController.java index 4c8eb02..f2bdeec 100644 --- a/src/main/java/com/gcc/publicgrievance/controller/ComplaintController.java +++ b/src/main/java/com/gcc/publicgrievance/controller/ComplaintController.java @@ -1,8 +1,13 @@ package com.gcc.publicgrievance.controller; -import java.util.List; -import java.util.Map; - +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; @@ -13,6 +18,8 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.UriUtils; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.util.LinkedMultiValueMap; @@ -26,21 +33,30 @@ import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; + import org.springframework.http.*; -import java.util.Base64; -import java.util.HashMap; import com.gcc.publicgrievance.Service.ComplaintService; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + import org.springframework.web.multipart.MultipartFile; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import javax.imageio.ImageIO; +import javax.management.modelmbean.RequiredModelMBean; + import java.util.Base64; +import java.util.stream.Collectors; -@CrossOrigin +//@CrossOrigin @RestController +@RequestMapping("/pgr/api") public class ComplaintController { private final RestTemplate restTemplate; @@ -52,77 +68,181 @@ public class ComplaintController { @Autowired private ComplaintService complaintService; - @GetMapping("/api/getComplaintCategories") + @GetMapping("/getComplaintCategories") public @ResponseBody String getComplaintCategories() { return complaintService.fetchComplaintCategories(); } + - @GetMapping("/api/getComplaintSubTypes") + @GetMapping("/getComplaintSubTypes") public @ResponseBody String getComplaintSubTypes(@RequestParam String groupId) { return complaintService.fetchComplaintSubTypes(groupId); } - - @GetMapping("/api/getComplaintDetailsbyId") + + @GetMapping("/ComplaintCategories") + public @ResponseBody String ComplaintCategories() { + return complaintService.getComplaintCategories(); + } + + @GetMapping("/ComplaintSubTypes") + public @ResponseBody String ComplaintSubTypes(@RequestParam String categoryId) { + return complaintService.getComplaintSubTypes(categoryId); + } + + @GetMapping("/getComplaintDetailsbyId") public List> getComplaintDetailsById(@RequestParam String complaintid) { return complaintService.fetchComplaintDetailsById(complaintid); } - @GetMapping("/api/getComplaintDetailsByMobile") - public List> getComplaintDetailsByMobile(@RequestParam String mobileNo) { - return complaintService.fetchComplaintDetailsByMobile(mobileNo); + @GetMapping("/getComplaintDetailsByMobile") + public List> getComplaintDetailsByMobile(@RequestParam String mobileNo, + @RequestParam String fromDate, + @RequestParam String toDate, + @RequestParam String year) { + List> result = complaintService.fetchComplaintDetailsByMobile(mobileNo, fromDate, toDate, year); + + // If the result is empty, return a response with "No data found" message + if (result == null || result.isEmpty()) { + // Create a response map to indicate no data found + Map noDataResponse = new HashMap<>(); + noDataResponse.put("message", "No data found"); + noDataResponse.put("status", "404"); + + // Return the no data response in a list + return Collections.singletonList(noDataResponse); + } + + return result; } - @PostMapping("/register") - public ResponseEntity registerComplaint( - @RequestParam(value = "ComplainantName", required = false) String complainantName, - @RequestParam(value = "ComplainantAddr", required = false) String complainantAddr, - @RequestParam(value = "MobileNo", 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 = "ComplaintDetails", required = false) String complaintDetails, - @RequestParam(value = "StreetId", required = false) String streetId, - @RequestParam(value = "Comp_Image", required = false) String compImage, - @RequestParam(value = "latitude", required = false) String latitude, - @RequestParam(value = "longtitude", required = false) String longtitude, - @RequestParam(value = "Landmark", required = false) String landmark, - @RequestParam(value = "gender", required = false) String gender) { - - String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; +@PostMapping("/register") +public ResponseEntity registerComplaint( + @RequestParam(value = "ComplainantName", required = false) String complainantName, + @RequestParam(value = "ComplainantAddr", required = false) String complainantAddr, + @RequestParam(value = "MobileNo", 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 = "ComplaintDetails", required = false) String complaintDetails, + @RequestParam(value = "StreetId", required = false) String streetId, + @RequestParam(value = "Comp_Image", required = false) MultipartFile compImage, + @RequestParam(value = "latitude", required = false) String latitude, + @RequestParam(value = "longtitude", required = false) String longtitude, + @RequestParam(value = "Landmark", required = false) String landmark, + @RequestParam(value = "gender", required = false) String 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=2"; + + try (OutputStream os = conn.getOutputStream()) { + byte[] input = params.getBytes("UTF-8"); + os.write(input, 0, input.length); + } + + int responseCode = conn.getResponseCode(); + 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); + } + reader.close(); + + // ✅ Parse and return only the complaint number + ObjectMapper mapper = new ObjectMapper(); + Map responseMap = mapper.readValue(response.toString(), Map.class); + + String complaintNo = responseMap.getOrDefault("Complaint Number", "N/A"); + System.out.println("complaintNo===="+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("/updateComplaint") + public ResponseEntity updateComplaint(@RequestParam("ComplaintId") String complaintId, + @RequestParam(value = "Message", required = false) String message, + @RequestParam(value = "Status") String status, + @RequestPart(value = "Comp_Image", required = false) MultipartFile compImage) { + + String userType = "Public"; + + System.out.println("message:-" + message + "\n UserType:-" + userType + "\n Status:-" + status); + System.out.println(compImage == null); + String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/newmobileservice"; try { - // Create the URL object - URL url = new URL(externalUrl); + String base64Image = null; + if (compImage != null && !compImage.isEmpty()) { + base64Image = compressAndEncodeToBase64(compImage); + System.out.println("imageee" + base64Image); + } - // Create the HttpURLConnection object + // Construct the POST body with parameters + String params = "serviceId=UpdateComplaint" + "&ComplaintId=" + + URLEncoder.encode(complaintId != null ? complaintId : "", "UTF-8") + "&Message=" + + URLEncoder.encode(message != null ? message : "", "UTF-8") + "&UserType=" + + URLEncoder.encode(userType, "UTF-8") + "&Status=" + + URLEncoder.encode(status != null ? status : "", "UTF-8") + "&Comp_Image=" + + URLEncoder.encode(compImage != null ? base64Image : "", "UTF-8") + + "&Token=718333469976265947044293"; + // Open connection and send POST request + 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); + conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - // Create the parameters string, handling null values - 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(compImage != null ? compImage : "", "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"); - - // Write parameters to request body - try (OutputStream os = conn.getOutputStream()) { - byte[] input = params.getBytes("UTF-8"); - os.write(input, 0, input.length); - } + // Send parameters + OutputStream os = conn.getOutputStream(); + os.write(params.getBytes()); + os.flush(); + os.close(); - // Read the response + // Handle the response int responseCode = conn.getResponseCode(); BufferedReader reader; if (responseCode == HttpURLConnection.HTTP_OK) { @@ -138,7 +258,6 @@ public class ComplaintController { } reader.close(); - // Return the response from the external API return ResponseEntity.status(responseCode).body(response.toString()); } catch (IOException e) { @@ -148,179 +267,6 @@ public class ComplaintController { } } -// @PostMapping("/updateComplaint") -// public ResponseEntity updateComplaint(@RequestParam("ComplaintId") String complaintId, -// @RequestParam(value = "Message", required = false) String message, -// @RequestParam(value = "UserType", required = false) String userType, -// @RequestParam(value = "Status", required = false) String status, -// @RequestParam(value = "Comp_Image", required = false) String compImage) { -// -// // Print for debugging -// System.out.println("ComplaintId: " + complaintId); -// System.out.println("Message: " + message); -// System.out.println("Status: " + status); -// -// // External API URL -// String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; -// -// // Create the request body as MultiValueMap for form-encoded data -// MultiValueMap requestBody = new LinkedMultiValueMap<>(); -// requestBody.add("serviceId", "UpdateComplaint"); -// requestBody.add("ComplaintId", complaintId != null ? complaintId : ""); -// requestBody.add("Message", message != null ? message : ""); -// requestBody.add("UserType", userType != null ? userType : ""); -// requestBody.add("Status", status != null ? status : ""); -// requestBody.add("Comp_Image", compImage != null ? compImage : ""); -// requestBody.add("Token", "718333469976265947044293"); -//// MultiValueMap requestBody = new LinkedMultiValueMap<>(); -//// requestBody.add("serviceId", "UpdateComplaint"); -//// requestBody.add("ComplaintId", "2024-516FGB"); -//// requestBody.add("Message","test"); -//// requestBody.add("UserType", "Public"); -//// requestBody.add("Status","8"); -//// requestBody.add("Comp_Image","null"); -//// requestBody.add("Token", "718333469976265947044293"); -// System.out.println(requestBody); -// -// // Set headers to indicate form data -// HttpHeaders headers = new HttpHeaders(); -// headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); -// -// // Build the request entity with headers and body -// HttpEntity> entity = new HttpEntity<>(requestBody, headers); -// -// try { -// // Make the POST request using RestTemplate -// ResponseEntity response = restTemplate.exchange(externalUrl, // External API endpoint -// HttpMethod.GET, // HTTP Method -// entity, // The request entity containing body and headers -// String.class // Expected response type -// ); -// System.out.println(response.getBody()); -// -// // Return the response from the external API -// return new ResponseEntity<>(response.getBody(), response.getStatusCode()); -// -// } catch (Exception e) { -// e.printStackTrace(); -// return ResponseEntity.status(500).body("An error occurred while processing the request."); -// } -// } - - /* - * @PostMapping("/updateComplaint") public ResponseEntity - * updateComplaint(@RequestParam("ComplaintId") String complaintId, - * - * @RequestParam(value = "Message", required = false) String message, - * - * @RequestParam(value = "Status") String status, - * - * @RequestParam(value = "Comp_Image", required = false) String compImage) { - * String userType = "Public"; - * System.out.println("message:-"+message+"\n UserType:-"+userType+"\n Status:-" - * +status); String externalUrl = - * "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; - * - * try { // Create the URL object URL url = new URL(externalUrl); - * - * // Create the HttpURLConnection object HttpURLConnection conn = - * (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); - * conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - * conn.setDoOutput(true); - * - * // Create the parameters string, handling null values String params = - * "serviceId=UpdateComplaint" + "&ComplaintId=" + URLEncoder.encode(complaintId - * != null ? complaintId : "", "UTF-8") + "&Message=" + - * URLEncoder.encode(message != null ? message : "", "UTF-8") + "&UserType=" + - * URLEncoder.encode(userType , "UTF-8") + "&Status=" + URLEncoder.encode(status - * != null ? status : "", "UTF-8") + "&Comp_Image=" + - * URLEncoder.encode(compImage != null ? compImage : "", "UTF-8") + - * "&Token=718333469976265947044293"; System.out.println(params); // Write - * parameters to request body try (OutputStream os = conn.getOutputStream()) { - * byte[] input = params.getBytes("UTF-8"); os.write(input, 0, input.length); } - * - * // Read the response int responseCode = conn.getResponseCode(); - * 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); } reader.close(); - * System.out.println(response.toString()); // Return the response from the - * external API return - * ResponseEntity.status(responseCode).body(response.toString()); - * - * } catch (IOException e) { e.printStackTrace(); return - * ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) - * .body("An error occurred while processing the request."); } } - */ - @PostMapping("/updateComplaint") - public ResponseEntity updateComplaint( - @RequestParam("ComplaintId") String complaintId, - @RequestParam(value = "Message", required = false) String message, - @RequestParam(value = "Status") String status, - @RequestPart(value = "Comp_Image", required = false) MultipartFile compImage) { - - String userType = "Public"; - System.out.println("message:-" + message + "\n UserType:-" + userType + "\n Status:-" + status); - - String externalUrl = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice"; - - try { - // Convert and compress the image to base64 if provided - String base64Image = null; - if (compImage != null && !compImage.isEmpty()) { - base64Image = compressAndEncodeToBase64(compImage); - } - - // Construct the POST body with parameters - String params = "serviceId=UpdateComplaint" + - "&ComplaintId=" + URLEncoder.encode(complaintId != null ? complaintId : "", "UTF-8") + - "&Message=" + URLEncoder.encode(message != null ? message : "", "UTF-8") + - "&UserType=" + URLEncoder.encode(userType, "UTF-8") + - "&Status=" + URLEncoder.encode(status != null ? status : "", "UTF-8") + - "&Token=718333469976265947044293"; - - // Open connection and send POST request - URL url = new URL(externalUrl); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setRequestMethod("POST"); - conn.setDoOutput(true); - conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - - // Send parameters - OutputStream os = conn.getOutputStream(); - os.write(params.getBytes()); - os.flush(); - os.close(); - - // Handle the response - int responseCode = conn.getResponseCode(); - 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); - } - reader.close(); - - return ResponseEntity.status(responseCode).body(response.toString()); - - } catch (IOException e) { - e.printStackTrace(); - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) - .body("An error occurred while processing the request."); - } - } - - private String compressAndEncodeToBase64(MultipartFile file) throws IOException { // Convert MultipartFile to BufferedImage BufferedImage originalImage = ImageIO.read(file.getInputStream()); @@ -343,5 +289,486 @@ public class ComplaintController { // Convert the compressed image to base64 return Base64.getEncoder().encodeToString(compressedBytes); } + @GetMapping("/getdetails") + public ResponseEntity getComplaintMatch( + @RequestParam("mobileNo") String mobileNo, + @RequestParam("complaintId") String complaintId, + @RequestParam("streetName") String streetName + ) { + try { + // 1. Map complaintId to complaint title + Map complaintIdToTitle = new HashMap<>(); + complaintIdToTitle.put("97", "Removal of Garbage"); + complaintIdToTitle.put("98", "Overflowing of Garbage Bin"); + complaintIdToTitle.put("99", "Removal of Debris"); + complaintIdToTitle.put("100", "Absenteeism of Sweepers"); + complaintIdToTitle.put("101", "Absenteeism of Door to door garbage Collector"); + complaintIdToTitle.put("102", "Improper Sweeping"); + complaintIdToTitle.put("103", "Provison of Garbage Bin"); + complaintIdToTitle.put("104", "Broken Bin"); + complaintIdToTitle.put("105", "Shifting of Garbage Bin"); + complaintIdToTitle.put("106", "Cleaning of Water Table"); + complaintIdToTitle.put("107", "Nuisance by Garbage Tractor/Truck"); + complaintIdToTitle.put("108", "Burning of Garbage"); + complaintIdToTitle.put("109", "Garbage Lorry without Net"); + complaintIdToTitle.put("110", "Spilling of Garbage from Lorry"); + complaintIdToTitle.put("111", "Burning of Garbage at Dumping Ground"); + complaintIdToTitle.put("112", "Pot hole fill up / Repairs to the damaged surface"); + complaintIdToTitle.put("113", "Relaying of Road"); + complaintIdToTitle.put("114", "Formation of New Road"); + complaintIdToTitle.put("115", "Repairs to existing Footpath"); + complaintIdToTitle.put("116", "Request to provide Footpath"); + complaintIdToTitle.put("117", "Removal of Shops in the Footpath"); + complaintIdToTitle.put("118", "Mosquito Menace"); + complaintIdToTitle.put("119", "Street Dogs"); + complaintIdToTitle.put("120", "Stray Cattle"); + complaintIdToTitle.put("121", "Stray Pigs"); + complaintIdToTitle.put("122", "Death of Stray Animals"); + complaintIdToTitle.put("123", "Public Health / Dengue / Malaria / Gastro Enteritis"); + complaintIdToTitle.put("124", "Transfer Station Smell"); + complaintIdToTitle.put("125", "Flies Menace from Dumping Ground"); + complaintIdToTitle.put("126", "Open Defecation"); + complaintIdToTitle.put("127", "Illegal Draining of Sewage to SWD / Open Site"); + complaintIdToTitle.put("128", "Complaints regarding unhygenic Restaurants"); + complaintIdToTitle.put("129", "Complaints regarding quality of food in hotels"); + complaintIdToTitle.put("130", "Road Side Eateries"); + complaintIdToTitle.put("131", "Slaughter House related complaints"); + complaintIdToTitle.put("132", "Unauthorized Sale of Meat and Meat products"); + complaintIdToTitle.put("133", "Illegal Slaughtering"); + complaintIdToTitle.put("134", "Unhygenic and Improper Transport of Meat and Livestock"); + complaintIdToTitle.put("135", "Biomedical waste / Health hazard waste removal"); + complaintIdToTitle.put("136", "Complaints regarding Corporation Hospitals"); + complaintIdToTitle.put("137", "Complaints regarding CDH"); + complaintIdToTitle.put("138", "Stagnation of Water"); + complaintIdToTitle.put("139", "Obstruction of Water Flow"); + complaintIdToTitle.put("140", "Desilting of Drain"); + complaintIdToTitle.put("141", "Desilting of Canal"); + complaintIdToTitle.put("142", "Repairs to Storm Water Drain"); + complaintIdToTitle.put("143", "Covering Manholes of Storm Water Drain"); + complaintIdToTitle.put("144", "New Drain Construction"); + complaintIdToTitle.put("145", "Disposal of Removed Silt on the Road"); + complaintIdToTitle.put("146", "Non burning of Street lights"); + complaintIdToTitle.put("147", "Electric shock due to street light"); + complaintIdToTitle.put("148", "Damage to the Electric pole"); + complaintIdToTitle.put("149", "New Street lights"); + complaintIdToTitle.put("150", "Shifting of Street light pole"); + complaintIdToTitle.put("151", "Overhead cable wires running in a haphazard manner"); + complaintIdToTitle.put("152", "Removal of Fallen Trees"); + complaintIdToTitle.put("153", "Complaints regarding Park"); + complaintIdToTitle.put("154", "Complaints regarding Playground"); + complaintIdToTitle.put("155", "Complaints regarding Centre Median"); + complaintIdToTitle.put("156", "Complaints regarding Traffic Island"); + complaintIdToTitle.put("157", "Unauthorized Tree Cutting"); + complaintIdToTitle.put("158", "Obstruction of Trees"); + complaintIdToTitle.put("159", "Complaints regarding Public Toilets"); + complaintIdToTitle.put("160", "Complaints regarding Free Usage of Public Toilets"); + complaintIdToTitle.put("161", "Complaints regarding Cleanliness of Toilets in Theatre"); + complaintIdToTitle.put("162", "Complaints regarding Cleanliness of Toilets in Shopping Complex"); + complaintIdToTitle.put("163", "Building Plan Sanction"); + complaintIdToTitle.put("164", "Violation of DCR/Building By laws"); + complaintIdToTitle.put("165", "Unauthorized / Illegal Construction"); + complaintIdToTitle.put("166", "Complaints related to Property Tax"); + complaintIdToTitle.put("167", "Complaints related to Professional Tax"); + complaintIdToTitle.put("168", "Complaints related to Trade Licence"); + complaintIdToTitle.put("174", "Name Error (Spelling Related)"); + complaintIdToTitle.put("175", "Change of Address in Electoral Roll"); + complaintIdToTitle.put("176", "Issue of Voter ID"); + complaintIdToTitle.put("177", "Inclusion, Deletion, Correction in Voter List"); + complaintIdToTitle.put("178", "Complaints regarding Voter List"); + complaintIdToTitle.put("179", "Name not found in the Electoral Roll"); + complaintIdToTitle.put("180", "Issue of Birth and Death Certificate"); + complaintIdToTitle.put("181", "Encroachment on the Public Property"); + complaintIdToTitle.put("182", " Complaints related to Schools"); + complaintIdToTitle.put("183", "Sanction of Financial Assistance under Moovalaur Thirumana Thittam"); + complaintIdToTitle.put("184", "Complaints related to issue of all types of Registration Certificate"); + complaintIdToTitle.put("185", "Slow Progress of Work"); + complaintIdToTitle.put("186", "Poor Quality of Work"); + complaintIdToTitle.put("187", "Unauthorized Advertisement Boards"); + complaintIdToTitle.put("188", "Complaints regarding Bridges / Flyovers / Subways"); + complaintIdToTitle.put("189", "Complaints related Shopping Complex"); + complaintIdToTitle.put("190", "Complaints regarding Community Hall"); + complaintIdToTitle.put("191", "Complaints regarding Burial Ground"); + complaintIdToTitle.put("192", "Complaints regarding any other CoC building"); + complaintIdToTitle.put("193", "Parking Issue"); + complaintIdToTitle.put("195", "Complaints Regarding Plastics"); + complaintIdToTitle.put("196", "No electricity in public toilet"); + complaintIdToTitle.put("197", "No water supply in public toilet"); + complaintIdToTitle.put("198", "Public toilet blockage"); + complaintIdToTitle.put("199", "Public toilet cleaning"); + complaintIdToTitle.put("200", "Burning of street light in daytime"); + complaintIdToTitle.put("201", "Illegal Parking on foot path"); + complaintIdToTitle.put("202", "Complaints regarding non availability of Doctors"); + complaintIdToTitle.put("203", "Complaints regarding non availability of medicines"); + complaintIdToTitle.put("204", "Complaints regarding laboratory issues"); + complaintIdToTitle.put("205", "Issues regarding amma baby care kits (After Delivery)"); + complaintIdToTitle.put("206", "Issues regarding Amma nutrition kit for pregnant woman"); + complaintIdToTitle.put("207", "Issues regarding Muthulakshmi Reddy Maternity Benefit Scheme (MRMBS)"); + complaintIdToTitle.put("208", "Issues regarding janani suraksha yojana scheme (JSY)"); + complaintIdToTitle.put("209", "Travel pass related complaints"); + complaintIdToTitle.put("210", "Food related complaints"); + complaintIdToTitle.put("212", "Covid Health Related Queries"); + complaintIdToTitle.put("213", "Hospital and Covid care centre(CCC) Related Queries"); + complaintIdToTitle.put("214", "Medical Emergencies"); + complaintIdToTitle.put("215", "Essentials and Medicines"); + complaintIdToTitle.put("216", "PSYCHO-SOCIO support"); + complaintIdToTitle.put("218", "Quarantine and isolation Related Queries"); + complaintIdToTitle.put("219", "General Health Queries"); + complaintIdToTitle.put("220", "Disinfection request"); + complaintIdToTitle.put("221", "Non Covid Health Related Queries"); + complaintIdToTitle.put("222", "Milling/Scraping of Road before Relaying of Road"); + complaintIdToTitle.put("226", "Food Requirement"); + complaintIdToTitle.put("227", "Relief Center Requirement"); + complaintIdToTitle.put("228", "Covid19 Ambulance Service"); + complaintIdToTitle.put("229", "Air Quality"); + complaintIdToTitle.put("230", "Online Payment Issue"); + complaintIdToTitle.put("231", "General Revision Objection"); + complaintIdToTitle.put("232", "Water Mixed with Sewarage"); + complaintIdToTitle.put("233", "Sewerage Overflow"); + complaintIdToTitle.put("234", "Drinking water supply"); + complaintIdToTitle.put("235", "Electricity Shock"); + complaintIdToTitle.put("236", "Electricity Unavailability"); + complaintIdToTitle.put("237", "Insufficient Barricading"); + complaintIdToTitle.put("238", "Fallen poles/towers/hoardings/other infra"); + complaintIdToTitle.put("239", "Fallen EB cables"); + complaintIdToTitle.put("240", "Project information not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("241", "Project information not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("242", "Project information not provided (MC Road)"); + complaintIdToTitle.put("243", "Project information not provided (Washermenpet Metro)"); + complaintIdToTitle.put("244", "Project information not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("245", "Project information not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("246", "Advance information on consultation not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("247", "Advance information on consultation not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("248", "Advance information on consultation not provided (MC Road)"); + complaintIdToTitle.put("249", "Advance information on consultation not provided (Washermenpet Metro)"); + complaintIdToTitle.put("250", "Advance information on consultation not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("251", "Advance information on consultation not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("252", "Location and area of consultation not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("253", "Location and area of consultation not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("254", "Location and area of consultation not provided (MC Road)"); + complaintIdToTitle.put("255", "Location and area of consultation not provided (Washermenpet Metro)"); + complaintIdToTitle.put("256", "Location and area of consultation not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("257", "Location and area of consultation not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("258", "Information on detailed work plan not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("259", "Information on detailed work plan not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("260", "Information on detailed work plan not provided (MC Road)"); + complaintIdToTitle.put("261", "Information on detailed work plan not provided (Washermenpet Metro)"); + complaintIdToTitle.put("262", "Information on detailed work plan not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("263", "Information on detailed work plan not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("264", "Others (Thiruvotriyur High Road)"); + complaintIdToTitle.put("265", "Others (Arunachaleshwar Road)"); + complaintIdToTitle.put("266", "Others (MC Road)"); + complaintIdToTitle.put("267", "Others (Washermenpet Metro)"); + complaintIdToTitle.put("268", "Others (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("269", "Others (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("270", "No information in advance provided on the date and time of civil works (Thiruvotriyur High Road)"); + complaintIdToTitle.put("271", "No information in advance provided on the date and time of civil works (Arunachaleshwar Road)"); + complaintIdToTitle.put("272", "No information in advance provided on the date and time of civil works (MC Road)"); + complaintIdToTitle.put("273", "No information in advance provided on the date and time of civil works (Washermenpet Metro)"); + complaintIdToTitle.put("274", "No information in advance provided on the date and time of civil works (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("275", "No information in advance provided on the date and time of civil works (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("276", "No information provided on the nature and schedule of civil work (Thiruvotriyur High Road)"); + complaintIdToTitle.put("277", "No information provided on the nature and schedule of civil work (Arunachaleshwar Road)"); + complaintIdToTitle.put("278", "No information provided on the nature and schedule of civil work (MC Road)"); + complaintIdToTitle.put("279", "No information provided on the nature and schedule of civil work (Washermenpet Metro)"); + complaintIdToTitle.put("280", "No information provided on the nature and schedule of civil work (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("281", "No information provided on the nature and schedule of civil work (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("282", "No consultation carried out with the people affected by the civil works (Thiruvotriyur High Road)"); + complaintIdToTitle.put("283", "No consultation carried out with the people affected by the civil works (Arunachaleshwar Road)"); + complaintIdToTitle.put("284", "No consultation carried out with the people affected by the civil works (MC Road)"); + complaintIdToTitle.put("285", "No consultation carried out with the people affected by the civil works (Washermenpet Metro)"); + complaintIdToTitle.put("286", "No consultation carried out with the people affected by the civil works (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("287", "No consultation carried out with the people affected by the civil works (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("288", "No arrangement made for temporary displacement (Thiruvotriyur High Road)"); + complaintIdToTitle.put("289", "No arrangement made for temporary displacement (Arunachaleshwar Road)"); + complaintIdToTitle.put("290", "No arrangement made for temporary displacement (MC Road)"); + complaintIdToTitle.put("291", "No arrangement made for temporary displacement (Washermenpet Metro)"); + complaintIdToTitle.put("292", "No arrangement made for temporary displacement (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("293", "No arrangement made for temporary displacement (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("294", "No display board on the project installed at work site (Thiruvotriyur High Road)"); + complaintIdToTitle.put("295", "No display board on the project installed at work site (Arunachaleshwar Road)"); + complaintIdToTitle.put("296", "No display board on the project installed at work site (MC Road)"); + complaintIdToTitle.put("297", "No display board on the project installed at work site (Washermenpet Metro)"); + complaintIdToTitle.put("298", "No display board on the project installed at work site (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("299", "No display board on the project installed at work site (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("300", "Temporary access to structures not provided and or not adequate (Thiruvotriyur High Road)"); + complaintIdToTitle.put("301", "Temporary access to structures not provided and or not adequate (Arunachaleshwar Road)"); + complaintIdToTitle.put("302", "Temporary access to structures not provided and or not adequate (MC Road)"); + complaintIdToTitle.put("303", "Temporary access to structures not provided and or not adequate (Washermenpet Metro)"); + complaintIdToTitle.put("304", "Temporary access to structures not provided and or not adequate (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("305", "Temporary access to structures not provided and or not adequate (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("306", "No safety measures taken at worksite (Thiruvotriyur High Road)"); + complaintIdToTitle.put("307", "No safety measures taken at worksite (Arunachaleshwar Road)"); + complaintIdToTitle.put("308", "No safety measures taken at worksite (MC Road)"); + complaintIdToTitle.put("309", "No safety measures taken at worksite (Washermenpet Metro)"); + complaintIdToTitle.put("310", "No safety measures taken at worksite (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("311", "No safety measures taken at worksite (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("312", "Water supply disrupted and alternate arrangement not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("313", "Water supply disrupted and alternate arrangement not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("314", "Water supply disrupted and alternate arrangement not provided (MC Road)"); + complaintIdToTitle.put("315", "Water supply disrupted and alternate arrangement not provided (Washermenpet Metro)"); + complaintIdToTitle.put("316", "Water supply disrupted and alternate arrangement not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("317", "Water supply disrupted and alternate arrangement not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("318", "Electricity supply disrupted and alternate arrangement not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("319", "Electricity supply disrupted and alternate arrangement not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("320", "Electricity supply disrupted and alternate arrangement not provided (MC Road)"); + complaintIdToTitle.put("321", "Electricity supply disrupted and alternate arrangement not provided (Washermenpet Metro)"); + complaintIdToTitle.put("322", "Electricity supply disrupted and alternate arrangement not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("323", "Electricity supply disrupted and alternate arrangement not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("324", "Disposal of debris not appropriately managed (Thiruvotriyur High Road)"); + complaintIdToTitle.put("325", "Disposal of debris not appropriately managed (Arunachaleshwar Road)"); + complaintIdToTitle.put("326", "Disposal of debris not appropriately managed (MC Road)"); + complaintIdToTitle.put("327", "Disposal of debris not appropriately managed (Washermenpet Metro)"); + complaintIdToTitle.put("328", "Disposal of debris not appropriately managed (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("329", "Disposal of debris not appropriately managed (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("330", " Temporary arrangement for parking not provided (Thiruvotriyur High Road)"); + complaintIdToTitle.put("331", " Temporary arrangement for parking not provided (Arunachaleshwar Road)"); + complaintIdToTitle.put("332", " Temporary arrangement for parking not provided (MC Road)"); + complaintIdToTitle.put("333", " Temporary arrangement for parking not provided (Washermenpet Metro)"); + complaintIdToTitle.put("334", " Temporary arrangement for parking not provided (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("335", " Temporary arrangement for parking not provided (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("336", "GRM and helpline numbers not displayed at worksite (Thiruvotriyur High Road)"); + complaintIdToTitle.put("337", "GRM and helpline numbers not displayed at worksite (Arunachaleshwar Road)"); + complaintIdToTitle.put("338", "GRM and helpline numbers not displayed at worksite (MC Road)"); + complaintIdToTitle.put("339", "GRM and helpline numbers not displayed at worksite (Washermenpet Metro)"); + complaintIdToTitle.put("340", "GRM and helpline numbers not displayed at worksite (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("341", "GRM and helpline numbers not displayed at worksite (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("342", "Drinking water/ other basic needs for Labour not available at worksite (Thiruvotriyur High Road)"); + complaintIdToTitle.put("343", "Drinking water/ other basic needs for Labour not available at worksite (Arunachaleshwar Road)"); + complaintIdToTitle.put("344", "Drinking water/ other basic needs for Labour not available at worksite (MC Road)"); + complaintIdToTitle.put("345", "Drinking water/ other basic needs for Labour not available at worksite (Washermenpet Metro)"); + complaintIdToTitle.put("346", "Drinking water/ other basic needs for Labour not available at worksite (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("347", "Drinking water/ other basic needs for Labour not available at worksite (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("348", "Noise levels are very high (Thiruvotriyur High Road)"); + complaintIdToTitle.put("349", "Noise levels are very high (Arunachaleshwar Road)"); + complaintIdToTitle.put("350", "Noise levels are very high (MC Road)"); + complaintIdToTitle.put("351", "Noise levels are very high (Washermenpet Metro)"); + complaintIdToTitle.put("352", "Noise levels are very high (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("353", "Noise levels are very high (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("354", " Sprinkling of water at worksite not carried out (Thiruvotriyur High Road)"); + complaintIdToTitle.put("355", " Sprinkling of water at worksite not carried out (Arunachaleshwar Road)"); + complaintIdToTitle.put("356", " Sprinkling of water at worksite not carried out (MC Road)"); + complaintIdToTitle.put("357", " Sprinkling of water at worksite not carried out (Washermenpet Metro)"); + complaintIdToTitle.put("358", " Sprinkling of water at worksite not carried out (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("359", " Sprinkling of water at worksite not carried out (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("360", "The worksite is not barricaded; (Thiruvotriyur High Road)"); + complaintIdToTitle.put("361", "The worksite is not barricaded; (Arunachaleshwar Road)"); + complaintIdToTitle.put("362", "The worksite is not barricaded; (MC Road)"); + complaintIdToTitle.put("363", "The worksite is not barricaded; (Washermenpet Metro)"); + complaintIdToTitle.put("364", "The worksite is not barricaded; (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("365", "The worksite is not barricaded; (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("366", " No information on number of labour working at the site (Thiruvotriyur High Road)"); + complaintIdToTitle.put("367", " No information on number of labour working at the site (Arunachaleshwar Road)"); + complaintIdToTitle.put("368", " No information on number of labour working at the site (MC Road)"); + complaintIdToTitle.put("369", " No information on number of labour working at the site (Washermenpet Metro)"); + complaintIdToTitle.put("370", " No information on number of labour working at the site (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("371", " No information on number of labour working at the site (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("372", "Labourer not using the safety equipment (Thiruvotriyur High Road)"); + complaintIdToTitle.put("373", "Labourer not using the safety equipment (Arunachaleshwar Road)"); + complaintIdToTitle.put("374", "Labourer not using the safety equipment (MC Road)"); + complaintIdToTitle.put("375", "Labourer not using the safety equipment (Washermenpet Metro)"); + complaintIdToTitle.put("376", "Labourer not using the safety equipment (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("377", "Labourer not using the safety equipment (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("378", "Sewerage pipe is damaged (Thiruvotriyur High Road)"); + complaintIdToTitle.put("379", "Sewerage pipe is damaged (Arunachaleshwar Road)"); + complaintIdToTitle.put("380", "Sewerage pipe is damaged (MC Road)"); + complaintIdToTitle.put("381", "Sewerage pipe is damaged (Washermenpet Metro)"); + complaintIdToTitle.put("382", "Sewerage pipe is damaged (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("383", "Sewerage pipe is damaged (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("384", "Others (Thiruvotriyur High Road)"); + complaintIdToTitle.put("385", "Others (Arunachaleshwar Road)"); + complaintIdToTitle.put("386", "Others (MC Road)"); + complaintIdToTitle.put("387", "Others (Washermenpet Metro)"); + complaintIdToTitle.put("388", "Others (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("389", "Others (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("390", "Insufficient Barricading (Thiruvotriyur High Road)"); + complaintIdToTitle.put("391", "Insufficient Barricading (Arunachaleshwar Road)"); + complaintIdToTitle.put("392", "Insufficient Barricading (MC Road)"); + complaintIdToTitle.put("393", "Insufficient Barricading (Washermenpet Metro)"); + complaintIdToTitle.put("394", "Insufficient Barricading (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("395", "Insufficient Barricading (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("396", "Non Removal of Debris (Thiruvotriyur High Road)"); + complaintIdToTitle.put("397", "Non Removal of Debris (Arunachaleshwar Road)"); + complaintIdToTitle.put("398", "Non Removal of Debris (MC Road)"); + complaintIdToTitle.put("399", "Non Removal of Debris (Washermenpet Metro)"); + complaintIdToTitle.put("400", "Non Removal of Debris (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("401", "Non Removal of Debris (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("402", "Potholes fill up (Thiruvotriyur High Road)"); + complaintIdToTitle.put("403", "Potholes fill up (Arunachaleshwar Road)"); + complaintIdToTitle.put("404", "Potholes fill up (MC Road)"); + complaintIdToTitle.put("405", "Potholes fill up (Washermenpet Metro)"); + complaintIdToTitle.put("406", "Potholes fill up (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("407", "Potholes fill up (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("408", "Damage to utilities (TNEB, CMWSSB, BSNL) (Thiruvotriyur High Road)"); + complaintIdToTitle.put("409", "Damage to utilities (TNEB, CMWSSB, BSNL) (Arunachaleshwar Road)"); + complaintIdToTitle.put("410", "Damage to utilities (TNEB, CMWSSB, BSNL) (MC Road)"); + complaintIdToTitle.put("411", "Damage to utilities (TNEB, CMWSSB, BSNL) (Washermenpet Metro)"); + complaintIdToTitle.put("412", "Damage to utilities (TNEB, CMWSSB, BSNL) (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("413", "Damage to utilities (TNEB, CMWSSB, BSNL) (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("414", "Encroaching Public Space (Thiruvotriyur High Road)"); + complaintIdToTitle.put("415", "Encroaching Public Space (Arunachaleshwar Road)"); + complaintIdToTitle.put("416", "Encroaching Public Space (MC Road)"); + complaintIdToTitle.put("417", "Encroaching Public Space (Washermenpet Metro)"); + complaintIdToTitle.put("418", "Encroaching Public Space (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("419", "Encroaching Public Space (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("420", "Need Pathway ramp (Thiruvotriyur High Road)"); + complaintIdToTitle.put("421", "Need Pathway ramp (Arunachaleshwar Road)"); + complaintIdToTitle.put("422", "Need Pathway ramp (MC Road)"); + complaintIdToTitle.put("423", "Need Pathway ramp (Washermenpet Metro)"); + complaintIdToTitle.put("424", "Need Pathway ramp (Khadar Nawas Khan Road)"); + complaintIdToTitle.put("425", "Need Pathway ramp (Race Course road + Guindy MMI)"); + complaintIdToTitle.put("426", "Cleanliness in Parks"); + complaintIdToTitle.put("427", "Greenary in Parks"); + complaintIdToTitle.put("428", "Play Equipment"); + complaintIdToTitle.put("429", "Opening and closing hours"); + complaintIdToTitle.put("430", "Toilets in parks"); + complaintIdToTitle.put("431", "Non functional lights/ no lights in parks"); + complaintIdToTitle.put("432", "Safety in parks/playgrounds"); + complaintIdToTitle.put("433", "Women related safety issues in parks"); + complaintIdToTitle.put("434", "Availability or cleanliness of dustbins in public toilets"); + complaintIdToTitle.put("435", "Cleanliness/ water supply in toilets"); + complaintIdToTitle.put("436", "Broken sinks, toilets or urinals and doors"); + complaintIdToTitle.put("437", "Request for new toilet"); + complaintIdToTitle.put("438", "Illegal activities in toilet"); + complaintIdToTitle.put("439", "Toilets not in use/ closed"); + complaintIdToTitle.put("440", "Inadequate lighting in and around the toilet"); + complaintIdToTitle.put("441", "Safety in public toilets"); + complaintIdToTitle.put("442", "Cleanliness in footpath"); + complaintIdToTitle.put("443", "Electrical wires/obstruction on footpath"); + complaintIdToTitle.put("444", "Unsafe dark spots/ corners"); + complaintIdToTitle.put("445", "Public defecation/urination"); + complaintIdToTitle.put("446", "Women related safety issues "); + complaintIdToTitle.put("447", "Inadequate light in a particular location or spot/ dark spots"); + + String expectedType; + if (complaintIdToTitle.containsKey(complaintId)) { + expectedType = complaintIdToTitle.get(complaintId).trim().toLowerCase(); + } else { + // Fallback: Use sub-type text directly if not found in map (i.e. for "Others") + expectedType = complaintId.trim().toLowerCase(); + } + + // 2. Date range: last 7 days + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); + LocalDate today = LocalDate.now(); + String endDate = today.format(formatter); + String startDate = today.minusDays(7).format(formatter); + int repYear = today.getYear(); + + // 3. Construct external URL + String externalUrl = String.format( + "https://erp.chennaicorporation.gov.in/pgr/newmobileservice?serviceId=getComplaintListWithImg" + + "&From_date=%s&To_date=%s&jsonResp=Yes&UserType=Public&Token=&PageIndex=null&Status=null&repYear=%d&MobileNo=%s", + startDate, endDate, repYear, mobileNo + ); + + System.out.println("External API URL: " + externalUrl); + + // 4. Fetch and parse response + RestTemplate restTemplate = new RestTemplate(); + String json = restTemplate.getForObject(externalUrl, String.class); + ObjectMapper mapper = new ObjectMapper(); + JsonNode rootArray = mapper.readTree(json); + + boolean found = false; + + if (rootArray.isArray() && rootArray.size() > 0) { + JsonNode complaintList = rootArray.get(0).path("ComplaintListHistory"); + + if (complaintList.isArray()) { + for (JsonNode item : complaintList) { + String type = item.path("complainttype").asText("").trim().toLowerCase(); + String street = item.path("Street").asText("").trim().toLowerCase(); + + System.out.println("Complaint type in data: " + type); + System.out.println("Expected complaint type: " + expectedType); + System.out.println("Street in data: " + street); + System.out.println("Given street name: " + streetName.trim().toLowerCase()); + + if (type.equals(expectedType) && + street.equals(streetName.trim().toLowerCase())) { + found = true; + break; + } + } + } + } + + // 5. Return response + Map response = new HashMap<>(); + response.put("duplicate", found); + return ResponseEntity.ok(response); + + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(Collections.singletonMap("error", "Failed to process the request")); + } + } + + /* + * private static final Logger log = + * LoggerFactory.getLogger(ComplaintController.class); + * + * + * @GetMapping("/getStreets") public ResponseEntity getStreets( + * + * @RequestParam double lat, + * + * @RequestParam double lon ) throws Exception { // 1) raw ESRI geometry JSON + * String geomJson = String.format("{\"x\":%f,\"y\":%f}", lon, lat); + * + * // 2) build & encode the full query URL in one go String url = + * UriComponentsBuilder .fromHttpUrl("https://gisgcc.chennaicorporation.gov.in" + * + "/server/rest/services/GCCDepts/EDPMobile2025/FeatureServer/0/query") + * .queryParam("where", "") .queryParam("geometry", geomJson) // <<< raw JSON + * here .queryParam("geometryType", "esriGeometryPoint") .queryParam("inSR", + * "4326") .queryParam("spatialRel", "esriSpatialRelIntersects") + * .queryParam("distance", "25") .queryParam("units", "esriSRUnit_Meter") + * .queryParam("outFields", + * "region,new_zone,new_ward,road_id,road_name,gis_id,type") + * .queryParam("returnGeometry", "false") .queryParam("f", "geojson") .build() + * .encode() // <<< encode once .toUriString(); + * + * log.info("Calling ESRI: {}", url); + * + * // 3) fetch the raw JSON String rawJson = restTemplate.getForObject(url, + * String.class); log.info("ESRI raw response: {}", rawJson); + * + * // 4) detect ESRI-level errors JsonNode root = new + * ObjectMapper().readTree(rawJson); if (root.has("error")) { String msg = + * root.path("error").path("message").asText(); return ResponseEntity + * .status(HttpStatus.BAD_GATEWAY) .body(Map.of("message", + * "ESRI service error: " + msg)); } + * + * // 5) now safe to bind only the “features” array FeatureCollection fc = new + * ObjectMapper() .readerFor(FeatureCollection.class) .readValue(root); + * + * List feats = Optional.ofNullable(fc.getFeatures()) + * .orElse(List.of()); + * + * if (feats.isEmpty()) { return ResponseEntity.noContent().build(); } + * + * // 6) extract unique road names List streets = feats.stream() .map(f + * -> f.getProperties().getRoadName()) .filter(Objects::nonNull) .distinct() + * .toList(); + * + * return ResponseEntity.ok(Map.of("streets", streets)); } + * + * @JsonIgnoreProperties(ignoreUnknown = true) public static class + * FeatureCollection { private List features; public List + * getFeatures() { return features; } public void setFeatures(List + * features) { this.features = features; } } + * + * @JsonIgnoreProperties(ignoreUnknown = true) public static class Feature { + * private Properties properties; public Properties getProperties() { return + * properties; } public void setProperties(Properties properties) { + * this.properties = properties; } } + * + * @JsonIgnoreProperties(ignoreUnknown = true) public static class Properties { + * + * @JsonProperty("road_name") private String roadName; public String + * getRoadName() { return roadName; } public void setRoadName(String roadName) { + * this.roadName = roadName; } } + */ } diff --git a/src/main/java/com/gcc/publicgrievance/controller/UserController.java b/src/main/java/com/gcc/publicgrievance/controller/UserController.java index 3b3f5ac..ac99ec9 100644 --- a/src/main/java/com/gcc/publicgrievance/controller/UserController.java +++ b/src/main/java/com/gcc/publicgrievance/controller/UserController.java @@ -3,11 +3,13 @@ package com.gcc.publicgrievance.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; @Controller +@RequestMapping("/pgr") public class UserController { - @GetMapping({"/", "/home"}) + @GetMapping({"/","", "/home"}) public String home(Model model) { return "User/home"; } @@ -23,9 +25,17 @@ public class UserController { public String checklistofficer(Model model) { return "checklistofficer/checklistofficer"; } - @GetMapping("/checklistuser") - public String checklistuser(Model model) { - return "checklistuser/checklistuser"; + @GetMapping("/checkofficerhome") + public String checkofficerhome(Model model) { + return "officer/checkofficerhome"; + } + @GetMapping("/staffcomplaint") + public String staffcomplaint(Model model) { + return "staff/staffcomplaint"; + } + @GetMapping("/staffhome") + public String staffhome(Model model) { + return "staff/staffhome"; } } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties new file mode 100644 index 0000000..e140473 --- /dev/null +++ b/src/main/resources/application-dev.properties @@ -0,0 +1,20 @@ +spring.application.name=publicgrievance +# Sets the session timeout to 60 seconds +#server.servlet.session.timeout=60s + +# Sets the async request timeout to 5000 milliseconds (5 seconds) +#spring.mvc.async.request-timeout=5000ms + +server.port=8072 +#server.port=8061 + +app.baseUrl=http://localhost:8072 + +#For development +#assets.baseUrl=/ + + +app.getOtpUrl=https://tmegov.onex-aura.com/api/sms? + +app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/newmobileservice? +app.title=GREATER CHENNAI CORPORATION - PGR diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties new file mode 100644 index 0000000..076dfff --- /dev/null +++ b/src/main/resources/application-prod.properties @@ -0,0 +1,24 @@ +spring.application.name=publicgrievance +# Sets the session timeout to 60 seconds +#server.servlet.session.timeout=60s + +# Sets the async request timeout to 5000 milliseconds (5 seconds) +#spring.mvc.async.request-timeout=5000ms + +server.port=8072 +#server.port=8061 + +app.baseUrl=https://gccservices.chennaicorporation.gov.in/pgr/ + +#For Production +#assets.baseUrl=/pgr + + +app.getOtpUrl=https://tmegov.onex-aura.com/api/sms? + +app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/newmobileservice? +app.title=GREATER CHENNAI CORPORATION - PGR + +# Disable DataSource auto-configuration since no database is being used +spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 15cded8..09cb954 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,8 +1 @@ -spring.application.name=publicgrievance -# Sets the session timeout to 60 seconds -server.servlet.session.timeout=60s - -# Sets the async request timeout to 5000 milliseconds (5 seconds) -spring.mvc.async.request-timeout=5000ms - - +spring.profiles.active= prod \ No newline at end of file diff --git a/src/main/resources/static/images/message.png b/src/main/resources/static/images/message.png new file mode 100644 index 0000000..8a51f0f Binary files /dev/null and b/src/main/resources/static/images/message.png differ diff --git a/src/main/resources/static/images/otp.png b/src/main/resources/static/images/otp.png new file mode 100644 index 0000000..f403650 Binary files /dev/null and b/src/main/resources/static/images/otp.png differ diff --git a/src/main/resources/static/images/output-onlinepngtools.png b/src/main/resources/static/images/output-onlinepngtools.png new file mode 100644 index 0000000..1fa210e Binary files /dev/null and b/src/main/resources/static/images/output-onlinepngtools.png differ diff --git a/src/main/resources/static/js/screenreader.js b/src/main/resources/static/js/screenreader.js index 3489b7f..ef6bc17 100644 --- a/src/main/resources/static/js/screenreader.js +++ b/src/main/resources/static/js/screenreader.js @@ -1,33 +1,44 @@ -// screenReader.js +// speech.js -let isReading = false; -let speechSynthesisUtterance; +let isSpeechEnabled = false; // Start with speech disabled -function readScreenContent() { - const content = document.body.innerText; - speechSynthesisUtterance = new SpeechSynthesisUtterance(content); - window.speechSynthesis.speak(speechSynthesisUtterance); - isReading = true; +// Function to handle the speech synthesis +function speakText(text) { + if (isSpeechEnabled) { + const speech = new SpeechSynthesisUtterance(text); + speech.lang = 'en-US'; // Set language as needed + window.speechSynthesis.speak(speech); + } } -function stopReading() { - if (speechSynthesisUtterance) { - window.speechSynthesis.cancel(); - isReading = false; - } +// Function to add event listeners to all relevant elements for speech +function addSpeechListeners() { + const elementsToRead = document.querySelectorAll('label, button, input, h1, h2, h3, h4,h5,h6, p, .card-footer'); // Add any additional selectors as needed + elementsToRead.forEach(function(element) { + element.addEventListener('mouseover', function() { + // Check if it's an input field and read the placeholder if it exists + if (element.tagName.toLowerCase() === 'input') { + const placeholder = element.getAttribute('placeholder'); + if (placeholder) { + speakText(placeholder.trim()); + } + } else { + speakText(element.textContent.trim()); // Speak the element's text when hovered + } + }); + }); } -function toggleScreenReader(buttonId) { - const button = document.getElementById(buttonId); - if (button) { - button.addEventListener('click', function() { - if (isReading) { - stopReading(); - button.innerText = "Read Screen"; // Update button text when stopped - } else { - readScreenContent(); - button.innerText = "Stop Reading"; // Update button text when reading - } - }); - } -} +document.addEventListener('DOMContentLoaded', function() { + addSpeechListeners(); // Add speech listeners when the document is loaded + + // Add event listener to the toggle button + const toggleButton = document.getElementById('toggleSpeech'); + toggleButton.addEventListener('click', function() { + isSpeechEnabled = !isSpeechEnabled; // Toggle the speech feature + + // Update button text based on the state, preserving the image + const buttonText = isSpeechEnabled ? 'Turn Off Speech' : 'Turn On Speech'; + toggleButton.innerHTML = `Accessibility Icon ${buttonText}`; + }); +}); \ No newline at end of file diff --git a/src/main/resources/templates/User/home.html b/src/main/resources/templates/User/home.html index e82d8a4..fd4716f 100644 --- a/src/main/resources/templates/User/home.html +++ b/src/main/resources/templates/User/home.html @@ -230,22 +230,26 @@ -
+
- +
+ + Back +
+
- -
+ +
- register + register
Register Your
Complaints

Register Complaints
Via Internet

@@ -261,7 +265,7 @@
- Phone + Phone
Register Complaint via Phone

Call 1913 to register your complaint.

@@ -276,7 +280,7 @@
- Paper + Paper
Complaint via Paper Form

Send your Grievance to
The Commissioner,
Greater Chennai @@ -292,7 +296,7 @@

- Status + Status
Check Your Complaint Status
@@ -313,7 +317,7 @@
@@ -332,6 +336,12 @@
+
+
+
+
+
+
@@ -405,8 +415,7 @@ - - +
@@ -428,7 +437,7 @@ $('#check-now-btn').click(function () { var complaintNumber = $('#complaint-number').val(); if (complaintNumber) { - window.location.href = 'checklistofficer?complaintno=' + encodeURIComponent(complaintNumber); + window.location.href = '/pgr/checklistofficer?complaintno=' + encodeURIComponent(complaintNumber); } else { alert('Please enter a complaint number.'); } @@ -461,7 +470,39 @@ } } + // ✅ Mobile number validation as user types + $('#complaint-mobile').on('input', function () { + let value = this.value; + + // Allow only digits + value = value.replace(/[^0-9]/g, ''); + + // Prevent starting with 0 + if (value.startsWith('0')) { + value = ''; + //showSnackbar("Mobile number cannot start with 0."); + } + + // Limit to 10 digits + if (value.length > 10) { + value = value.slice(0, 10); + } + + this.value = value; + + // Check for all repeating digits + if (/^(\d)\1{9}$/.test(value)) { + $(this).addClass('is-invalid'); + showSnackbar("Mobile number cannot be all repeating digits."); + } else { + $(this).removeClass('is-invalid'); + } + }); + $(document).ready(function () { + + + // Trigger modal and load complaint list based on mobile number $('#check-mobile-btn').on('click', function () { const mobileNumber = $('#complaint-mobile').val(); // Get the entered mobile number @@ -470,10 +511,16 @@ alert("Please enter a mobile number."); return; } + + if (mobileNumber.length !== 10 || !/^\d{10}$/.test(mobileNumber) || mobileNumber.startsWith('0') || /^(\d)\1{9}$/.test(mobileNumber)) { + alert("Enter a valid 10-digit mobile number."); + return; + } + $('#loader').show(); // AJAX request to fetch complaint details by mobile number $.ajax({ - url: '/api/getComplaintDetailsByMobile', // Replace with your correct API path + url: '/pgr/api/getComplaintDetailsByMobile', method: 'GET', data: {mobileNo: mobileNumber}, success: function (response) { @@ -490,7 +537,7 @@ complaintList.forEach(function (complaint) { const complaintId = complaint.complaintid || 'N/A'; // Fallback to N/A if complaintid is null const complaintType = complaint.complainttype || 'N/A'; - + const newRow = ` ${complaintId} @@ -528,7 +575,7 @@ var complaintId = $(this).data('complaintid'); if (complaintId) { // Redirect to the complaint details page using complaintId - window.location.href = 'checklistofficer?complaintno=' + encodeURIComponent(complaintId); + window.location.href = '/pgr/checklistofficer?complaintno=' + encodeURIComponent(complaintId); } else { alert('Complaint ID not found.'); } @@ -538,6 +585,7 @@ }); + \ No newline at end of file diff --git a/src/main/resources/templates/User/kin.html b/src/main/resources/templates/User/kin.html new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/templates/User/registercomplaints.html b/src/main/resources/templates/User/registercomplaints.html index c5d7697..6d4d1ae 100644 --- a/src/main/resources/templates/User/registercomplaints.html +++ b/src/main/resources/templates/User/registercomplaints.html @@ -4,6 +4,8 @@ Main Page + + @@ -11,7 +13,7 @@ - + + + /* otp*/ + + .otp-input-box { + display: flex; + justify-content: center; + gap: 10px; + /* Adjust spacing between the inputs */ + } + + .otp-input { + width: 50px; + /* Width for a square input */ + height: 50px; + /* Height for a square input */ + font-size: 24px; + /* Make the digits larger */ + text-align: center; + /* Center the digit inside the box */ + border: 1px solid #ccc; + /* Optional: add a border */ + border-radius: 5px; + /* Optional: rounded corners */ + outline: none; + /* Remove default focus outline */ + transition: border-color 0.3s ease; + } + + .otp-input:focus { + border-color: #007bff; + /* Change border color on focus */ + } + + /* otp*/ + + + /*send otp styles*/ + .input-group .form-control { + border-right: 0; + /* Remove right border of the input to blend with the button */ + } + + .input-group-append .btn { + border-left: 0; + /* Remove left border of the button */ + } +
+
-
@@ -391,30 +479,72 @@ style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">
+ - -
+
1. Complaining Person's Details:
-
+ + + +
+
+
+ Yes + No +
+
+ + + + + + +
+
+
+ + Yes + + No +
+
+ + + + +
+
- +
@@ -427,16 +557,16 @@
- -
- - -
+ + + +
+
@@ -444,162 +574,143 @@
- - +
-
+ +
+ +
+
- +
- - + + + +
+ - +
- - + + +
- - + + +
+ - +
+
- + +
+ -
-
-
3. Complaint Type:
- - -
-
- Pothole -

Pothole

-
-
- garbage -

Garbage

-
-
- broken-bin -

Broken-Bin

-
-
- StreetLight -

StreetLight

-
-
- public-toilet -

Public Toilet

-
-
- mosquito -

Mosquito Menace

-
-
- waterstag -

WaterStagnation

-
-
- sewage -

Storm Water Drains

-
-
- dog -

Street Dog

-
- - -
- Others -

Others

-
-
- - -
-
-
- - -
-
- - -
- -
-
-
- - -
-
- - -
- -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
-
- - - - -
+
+
+
3. Complaint Type and Sub-Type
+ + +
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + +
+
+ + + +

Upload Photo Less Than 1MB.

+
+
+
+
+
+ + +
+
+
+ + + +
@@ -666,30 +777,125 @@
+ + + + + + + + + diff --git a/src/main/resources/templates/checklistofficer/checklistofficer.html b/src/main/resources/templates/checklistofficer/checklistofficer.html index af4d125..b85fa13 100644 --- a/src/main/resources/templates/checklistofficer/checklistofficer.html +++ b/src/main/resources/templates/checklistofficer/checklistofficer.html @@ -84,6 +84,9 @@ + + +

Check Complaint Status

@@ -97,27 +100,19 @@
- Complainant ID: +
- Complainant Mobile Number: +
- Complainant Name: +
- +
@@ -128,23 +123,23 @@
- Complainant Street: +
- Complainant Zone: +
- Complainant Ward: +
- Complainant Area: +
- Complainant Locality: +
@@ -156,7 +151,7 @@
- Complainant Type: +
@@ -169,7 +164,7 @@
-->
- Complainant Description: +
@@ -184,17 +179,17 @@
- Complaint Closed Date: +
- Official Name: +
- Status: +
@@ -219,23 +214,20 @@
- Change Complaint Status: +
- Details of Complaint: +
@@ -249,6 +241,12 @@ + + + +
@@ -276,7 +274,7 @@ $('#loader').show(); $.ajax({ - url: '/api/getComplaintDetailsbyId', // Replace with your actual API endpoint + url: '/pgr/api/getComplaintDetailsbyId', // Replace with your actual API endpoint type: 'GET', data: {complaintid: complaintNo}, success: function (response) { @@ -312,6 +310,40 @@ document.getElementById("commentDate").value = complaintDetails.complaintcloseddate || ''; document.getElementById("commentuser").value = complaintDetails.Officialname || ''; + let complaintCurrentStatus = complaintDetails.complaintcurrentstatus || ''; + + // Get the dropdown element + let complaintStatusDropdown = document.getElementById("complaintStatus"); + + // Function to add options to the select element + function addOption(text, value) { + let option = document.createElement("option"); + option.text = text; + option.value = value; + complaintStatusDropdown.add(option); + } + + // Check the current status and add the respective options + if (complaintCurrentStatus === 'REGISTERED') { + addOption('REGISTERED', '2'); + addOption('WITHDRAWN', '8'); + } else if (complaintCurrentStatus === 'WITHDRAWN') { + addOption('WITHDRAWN', '8'); + addOption('REOPENED', '9'); + } + else if (complaintCurrentStatus === 'CLOSE') { + addOption('CLOSE', '10'); + addOption('REOPENED', '9'); + } + else if (complaintCurrentStatus === 'REOPENED') { + addOption('REOPENED', '9'); + addOption('WITHDRAWN', '8'); + } + else if (complaintCurrentStatus === 'FINAL_CLOSURE') { + addOption('FINAL_CLOSURE', '11'); + addOption('REOPENED', '9'); + } + document.getElementById("statusshow").value = complaintDetails.complaintcurrentstatus || ''; // Handle nested Comments array @@ -329,15 +361,64 @@ return txt.value; } + // Convert image URL to Base64 + function convertImageToBase64(url, callback) { + var xhr = new XMLHttpRequest(); + xhr.onload = function () { + var reader = new FileReader(); + reader.onloadend = function () { + callback(reader.result); + }; + reader.readAsDataURL(xhr.response); + }; + xhr.open('GET', url); + xhr.responseType = 'blob'; + xhr.send(); + } + + // Compress the Base64 image using canvas + function compressImage(base64Str, callback, quality = 0.7, maxWidth = 800) { + var img = new Image(); + img.onload = function () { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + + var width = img.width; + var height = img.height; + + // Adjust the image size for compression + if (width > maxWidth) { + height *= maxWidth / width; + width = maxWidth; + } + + canvas.width = width; + canvas.height = height; + + // Draw the image onto the canvas + ctx.drawImage(img, 0, 0, width, height); + + // Convert the canvas back to Base64 with the specified quality (compression) + var compressedBase64 = canvas.toDataURL('image/jpeg', quality); + callback(compressedBase64); + }; + img.src = base64Str; + } + // Handle last comment var userImageHtml = ''; if (Array.isArray(lastComment.userimages) && lastComment.userimages.length > 0) { var imageUrl = lastComment.userimages[0].Comp_Image; if (imageUrl && imageUrl !== 'null') { - userImageHtml = ` -
- User Image -
`; + convertImageToBase64(imageUrl, function (base64Image) { + compressImage(base64Image, function (compressedImage) { + userImageHtml = ` +
+ User Image +
`; + commentsContainer.append(lastCommentHtml); + }); + }); } } @@ -361,13 +442,13 @@

`; + // Add the comment section with the compressed Base64 image commentsContainer.append(lastCommentHtml); // Add dropdown button for other comments if (comments.length > 1) { var dropdownHtml = ` - + diff --git a/src/main/resources/templates/fragments/footer.html b/src/main/resources/templates/fragments/footer.html index 3e6355a..5b08c52 100644 --- a/src/main/resources/templates/fragments/footer.html +++ b/src/main/resources/templates/fragments/footer.html @@ -42,10 +42,11 @@ diff --git a/src/main/resources/templates/fragments/header.html b/src/main/resources/templates/fragments/header.html index 2808c64..75d5b12 100644 --- a/src/main/resources/templates/fragments/header.html +++ b/src/main/resources/templates/fragments/header.html @@ -3,43 +3,59 @@ Header Fragment +
+ .header .logos-right img { + height: 60px; + margin-left: 10px; + } + + #toggleSpeech { + background-color: white; + color: black; + margin: 3px; + } + + #toggleSpeech img { + height: 30px; + /* Set height for the image */ + margin-right: 8px; + /* Add some space between the image and text */ + } +
- Greater Chennai Corporation Logo + Greater Chennai Corporation Logo +
@@ -47,52 +63,11 @@
- Tamil Nadu Logo - bonton Logo + Tamil Nadu Logo +
-
- -
+ \ No newline at end of file diff --git a/src/main/resources/templates/officer/checkofficerhome.html b/src/main/resources/templates/officer/checkofficerhome.html new file mode 100644 index 0000000..0753e09 --- /dev/null +++ b/src/main/resources/templates/officer/checkofficerhome.html @@ -0,0 +1,258 @@ + + + + + + Main Page + + + + + + + + + + + + +
+ + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/officer/checkofficerstatus.html b/src/main/resources/templates/officer/checkofficerstatus.html new file mode 100644 index 0000000..a626730 --- /dev/null +++ b/src/main/resources/templates/officer/checkofficerstatus.html @@ -0,0 +1,528 @@ + + + + + + CheckList User + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+
+

Check Complaint Status

+
+
+ +
+
+
1. Complaining Person's Details +
+
+
+
+ Complainant ID: + +
+
+ Complainant Mobile Number: + +
+
+ Complainant Name: + +
+ + +
+
+
+ +
+
2. Complaint Location Details +
+
+
+
+ Complainant Street: + +
+
+ Complainant Zone: + +
+
+ Complainant Ward: + +
+
+ Complainant Area: + +
+
+ Complainant Locality: + +
+
+
+
+ +
+
3. Complaint Type
+
+
+
+ Complainant Type: + +
+ + +
+ Complainant Description: + +
+
+
+
+
+ +
+
Complaint Action
+
+
+ + +
+ Complaint Closed Date: + + +
+
+ Official Name: + +
+ +
+ Status: + +
+
+ + +
+
+ + +
+
Complaint Action History
+
+
+
+
+ + + +
+
Update Complaint
+
+
+
+ Change Complaint Status: + +
+ + +
+
+
+ Details of Complaint: + +
+
+
+ +
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/staff/staffcheckstatus.html b/src/main/resources/templates/staff/staffcheckstatus.html new file mode 100644 index 0000000..4ef0476 --- /dev/null +++ b/src/main/resources/templates/staff/staffcheckstatus.html @@ -0,0 +1,614 @@ + + + + + + CheckList User + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+
+

Check Complaint Status

+
+
+ +
+
+
1. Complaining Person's Details +
+
+
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+
+ +
+
2. Complaint Location Details +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
3. Complaint Type
+
+
+
+ + +
+ + +
+ + +
+
+
+
+
+ +
+
Complaint Action
+
+
+ + +
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
Complaint Action History
+
+
+
+
+ + + +
+
Update Complaint
+
+
+
+ + +
+ + +
+
+
+ + +
+
+
+ +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/staff/staffcomplaint.html b/src/main/resources/templates/staff/staffcomplaint.html new file mode 100644 index 0000000..bf7b4b8 --- /dev/null +++ b/src/main/resources/templates/staff/staffcomplaint.html @@ -0,0 +1,1538 @@ + + + + + + Main Page + + + + + + + + + + + + +
+ +
+ + +
+ +
+
+ + +

Registration of Complaint

+
+
+ + +
+

Instructions:

+

Please fill your complaint details below and click the ‘Submit’ button at the bottom. You will be given a + Complaint Number upon submitting the complaint that you can use to track the complaint.

+
+
+
+
+
+ + + +
+
+
1. Complaining Person's Details:
+
+
+ +
+ +
+
+
+
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ +
+
+ +
+
+
2. Complaint Location Details:
+
+ + + + + + +
+
+
+ +
+
+
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ +
+
+
3. Complaint Type:
+ + +
+
+ Pothole +

Pothole

+
+
+ garbage +

Garbage

+
+
+ broken-bin +

Broken-Bin

+
+
+ StreetLight +

StreetLight

+
+
+ public-toilet +

Public Toilet

+
+
+ mosquito +

Mosquito Menace

+
+
+ waterstag +

WaterStagnation

+
+
+ sewage +

Storm Water Drains

+
+
+ dog +

Street Dog

+
+ + +
+ Others +

Others

+
+
+ + +
+
+
+ + +
+
+ + +
+ +
+
+
+ + +
+
+ + + +

Upload Photo Less Than 1mb*.

+
+
+ +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + + +

Upload Photo Less Than 1mb*.

+
+
+
+
+
+ + +
+
+
+ + + + +
+
+ + +
+
+
4. Complaint Details:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name: Complaint Location:
Mobile Number: Email Address:
Complaint Type: Complaint Title:
Description: Street Id:
Landmark: Latitude:
Longitude: Gender:
Image / Video: + +
+ + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/staff/staffhome.html b/src/main/resources/templates/staff/staffhome.html new file mode 100644 index 0000000..74657f3 --- /dev/null +++ b/src/main/resources/templates/staff/staffhome.html @@ -0,0 +1,543 @@ + + + + + + Main Page + + + + + + + + + + + + +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/com/gcc/publicgrievance/PublicgrievanceApplicationTests.java b/src/test/java/com/gcc/publicgrievance/PublicgrievanceApplicationTests.java deleted file mode 100644 index b5965c2..0000000 --- a/src/test/java/com/gcc/publicgrievance/PublicgrievanceApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.gcc.publicgrievance; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class PublicgrievanceApplicationTests { - - @Test - void contextLoads() { - } - -}