Browse Source

URL Changed Based on Domain and nginx

For domain access, we utilize Nginx, which functions as both a web server and a reverse proxy. It directs base URL requests to the localhost server URL and facilitates access to files outside the web server based on the specified path (such as for uploading files).
main
Balaji 3 years ago
parent
commit
7c2f7e70bc
  1. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/JacksonConfiguration.java
  2. 16
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java
  3. 56
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java
  4. 73
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/FileController.java
  5. 7
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java
  6. 35
      src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java
  7. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/APIController.java
  8. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/MainController.java
  9. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/MainController.java
  10. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/PGRCommon.java
  11. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserRepository.java
  12. 38
      src/main/java/in/gov/chennaicorporation/gccoffice/service/Base64Util.java
  13. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/service/CustomUserDetailsService.java
  14. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/service/LoginUserInfo.java
  15. BIN
      src/main/resources/.DS_Store
  16. 16
      src/main/resources/application.properties
  17. BIN
      src/main/resources/static/.DS_Store
  18. BIN
      src/main/resources/static/assets/.DS_Store
  19. BIN
      src/main/resources/static/assets/dist/.DS_Store
  20. 4
      src/main/resources/static/assets/dist/css/theme.css
  21. BIN
      src/main/resources/static/assets/images/.DS_Store
  22. BIN
      src/main/resources/templates/.DS_Store
  23. 2
      src/main/resources/templates/fragments/modules/base/footer.html
  24. 28
      src/main/resources/templates/fragments/modules/base/header.html
  25. 2
      src/main/resources/templates/fragments/modules/base/menu.html
  26. 163
      src/main/resources/templates/index.html
  27. 2
      src/main/resources/templates/modules/admin/user-group-access.html
  28. 2
      src/main/resources/templates/modules/admin/user-list.html
  29. 6
      src/main/resources/templates/modules/mtm/index.html
  30. 6
      src/main/resources/templates/modules/mtm/officer/index.html
  31. 16
      src/main/resources/templates/modules/petregistration/accepted-list.html
  32. 2
      src/main/resources/templates/modules/petregistration/index.html
  33. 14
      src/main/resources/templates/modules/petregistration/license-issued.html
  34. 18
      src/main/resources/templates/modules/petregistration/rejected.html
  35. 18
      src/main/resources/templates/modules/petregistration/request-list.html
  36. 12
      src/main/resources/templates/modules/pgr/all-list.html
  37. 52
      src/main/resources/templates/modules/pgr/index.html
  38. 18
      src/main/resources/templates/modules/qrfeedback/index.html

5
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/JacksonConfiguration.java

@ -4,6 +4,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
@Configuration @Configuration
public class JacksonConfiguration { public class JacksonConfiguration {
@ -11,7 +12,9 @@ public class JacksonConfiguration {
@Bean @Bean
public ObjectMapper objectMapper() { public ObjectMapper objectMapper() {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); // Do not fail on empty beans during serialization
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); // Serialize dates as Strings
objectMapper.registerModule(new JavaTimeModule()); // Register JavaTimeModule for Java 8 Date/Time support
return objectMapper; return objectMapper;
} }
} }

16
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java

@ -31,7 +31,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
public void configure(WebSecurity web) throws Exception { public void configure(WebSecurity web) throws Exception {
web web
.ignoring() .ignoring()
.antMatchers("/static/**", "/assets/**", "/api/**","/images/**","/gcc/static/**", "/gcc/assets/**", "/gcc/api/**","/gcc/images/**");
.antMatchers("/static/**", "/assets/**", "/api/**","/images/**","/gcc/static/**", "/gcc/assets/**", "/gcc/api/**","/gcc/images/**","/gcc/files/**");
//.antMatchers("/gcc/static/**", "/gcc/assets/**", "/gcc/api/**","/gcc/images/**"); //.antMatchers("/gcc/static/**", "/gcc/assets/**", "/gcc/api/**","/gcc/images/**");
//.antMatchers("/assets/**", "/css/**", "/js/**", "/images/**", "/fonts/**"); // Add the paths to your static resources here //.antMatchers("/assets/**", "/css/**", "/js/**", "/images/**", "/fonts/**"); // Add the paths to your static resources here
} }
@ -52,7 +52,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/gcc/error").permitAll() .antMatchers("/gcc/error").permitAll()
.antMatchers("/gcc/login").permitAll() // Add the login URL .antMatchers("/gcc/login").permitAll() // Add the login URL
.antMatchers("/gcc/admin/**").hasRole("ADMIN") // Add the admin URLs .antMatchers("/gcc/admin/**").hasRole("ADMIN") // Add the admin URLs
.antMatchers("/gcc/**").hasAnyRole("USER", "ADMIN") // Add other URLs
.antMatchers("/gcc/**").hasAnyRole("ADMIN","USER") // Add other URLs
//.anyRequest().authenticated()
.and() .and()
.formLogin() .formLogin()
.loginPage("/gcc/login") // Customize the login page URL .loginPage("/gcc/login") // Customize the login page URL
@ -62,10 +63,21 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.logout() .logout()
.logoutUrl("/gcc/logout") // Include the logout URL .logoutUrl("/gcc/logout") // Include the logout URL
.logoutSuccessUrl("/gcc/login") // Include the success logout URL .logoutSuccessUrl("/gcc/login") // Include the success logout URL
.permitAll()
.and() .and()
.sessionManagement() .sessionManagement()
.sessionFixation() .sessionFixation()
.migrateSession(); // or .none(), .newSession() .migrateSession(); // or .none(), .newSession()
/*
// Print role values
http.authorizeRequests().anyRequest().authenticated().and().formLogin().successHandler((request, response, authentication) -> {
System.out.println("User Roles: ");
authentication.getAuthorities().forEach(authority -> System.out.println(authority.getAuthority()));
System.out.println();
response.sendRedirect("/gcc");
});
*/
} }

56
src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java

@ -1,5 +1,6 @@
package in.gov.chennaicorporation.gccoffice.controller; package in.gov.chennaicorporation.gccoffice.controller;
import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -88,6 +89,22 @@ public class APIController {
} }
// Encode to Base64
@GetMapping(value="/encodeBase64")
public static String encodeBase64(@RequestParam String string) {
String value=string;
byte[] encodedBytes = Base64.getEncoder().encode(value.getBytes());
return new String(encodedBytes);
}
// Decode from Base64
@GetMapping(value="/decodeBase64")
public static String decodeBase64(@RequestParam String string) {
String encodedValue=string;
byte[] decodedBytes = Base64.getDecoder().decode(encodedValue);
return new String(decodedBytes);
}
@GetMapping(value="/getAccessTree") @GetMapping(value="/getAccessTree")
public String getAccessTreeHTML(@RequestParam String groupId,@RequestParam String groupName) { public String getAccessTreeHTML(@RequestParam String groupId,@RequestParam String groupName) {
@ -228,6 +245,43 @@ public class APIController {
return ""; return "";
} }
@GetMapping(value="/getUserProfileBasic")
public String getUserProfileBasic(@RequestParam String userId) {
String userHtml ="";
String userProfileHtml ="";
String userProfileTimelineHtml ="";
getAppUserEntities = appUserRepository.showById(userId);
for (AppUserEntity appUserEntity : getAppUserEntities) {
userProfileHtml = ""
+ " "
+ " <div class='card mb-1'>"
+ " <div class='card-body'>"
+ " <div class='text-center'>"
+ " <img src='/assets/images/users/user.jpg' class='rounded' width='150'>\n"
+ " <h4 class='card-title mt-10'>"+appUserEntity.getUserid().getName()+"</h4>\n"
+ " <p class='text-muted'>Front End Developer</p>\n"
+ " </div>\n"
+ " </div>"
+ " <hr class='mb-0 mt-0'> \n"
+ " <div class='card-body'> \n"
+ " <small class='text-muted d-block'>Email address </small>\n"
+ " <h8>"+appUserEntity.getUserid().getEmail()+"</h8> \n"
+ " <small class='text-muted d-block pt-10'>Phone</small>\n"
+ " <h8>"+appUserEntity.getUserid().getPhone()+"</h8> \n"
+ " <small class='text-muted d-block pt-10'>Role</small>\n"
+ " <h8>"+appUserEntity.getRoles()+"</h8>\n"
+ " <small class='text-muted d-block pt-10'>Access Group</small>\n"
+ " <h8>"+appUserEntity.getUsergroup_id().getName()+"</h8>\n"
+ " </div>\n"
+ " </div>\n"
+ " ";
}
return userProfileHtml;
}
@GetMapping(value="/getUserProfile") @GetMapping(value="/getUserProfile")
public String getUserProfile(@RequestParam String userId) { public String getUserProfile(@RequestParam String userId) {
String userHtml =""; String userHtml ="";
@ -334,4 +388,6 @@ public class APIController {
//System.out.println(formattedTimestamp); //System.out.println(formattedTimestamp);
return formattedTimestamp.toUpperCase(); return formattedTimestamp.toUpperCase();
} }
} }

73
src/main/java/in/gov/chennaicorporation/gccoffice/controller/FileController.java

@ -0,0 +1,73 @@
package in.gov.chennaicorporation.gccoffice.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.HandlerMapping;
import java.nio.file.Path;
import java.nio.file.Paths;
import javax.servlet.http.HttpServletRequest;
@Controller
public class FileController {
@Value("${file.upload.directory}")
private String uploadDirectory;
@GetMapping("/gcc/files/{directoryPath}/**")
public ResponseEntity<Resource> serveFile(@PathVariable String directoryPath, HttpServletRequest request) {
String fullPath = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
System.out.println(fullPath.toString()+"\n"+directoryPath.length()+"\n directoryPath:"+directoryPath);
//String relativePath = fullPath.substring(directoryPath.length() + 1); // Adding 1 for the trailing '/'
String relativePath = fullPath.replace("/gcc/files", "");
String filePath = uploadDirectory + "/" + relativePath;
Path path = Paths.get(filePath).normalize();
System.out.println(path.toString());
Resource resource;
try {
resource = new UrlResource(path.toUri());
if (resource.exists() || resource.isReadable()) {
MediaType mediaType = MediaType.APPLICATION_OCTET_STREAM;
// Determine content type based on file extension
String fileName = resource.getFilename();
if (fileName != null) {
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
switch (fileExtension.toLowerCase()) {
case "jpg":
case "jpeg":
mediaType = MediaType.IMAGE_JPEG;
break;
case "png":
mediaType = MediaType.IMAGE_PNG;
break;
case "gif":
mediaType = MediaType.IMAGE_GIF;
break;
case "pdf":
mediaType = MediaType.APPLICATION_PDF;
break;
// Add more cases for other file types if needed
}
}
return ResponseEntity.ok()
.contentType(mediaType)
.header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + resource.getFilename() + "\"")
//.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
.body(resource);
} else {
return ResponseEntity.notFound().build();
}
} catch (Exception e) {
return ResponseEntity.notFound().build();
}
}
}

7
src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java

@ -20,10 +20,11 @@ public class MainController {
@GetMapping({"", "/", "/index"}) @GetMapping({"", "/", "/index"})
public String main(Model model) { public String main(Model model) {
String userId = LoginUserInfo.getLoginUserId();
if (userId != null && !userId.isEmpty()) {
System.out.println("String UserID: " + userId);
String LoginUserId = LoginUserInfo.getLoginUserId();
if (LoginUserId != null && !LoginUserId.isEmpty()) {
System.out.println("String UserID: " + LoginUserId);
} }
model.addAttribute("LoginUserId",LoginUserId);
return "index"; return "index";
} }

35
src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java

@ -100,7 +100,7 @@ public class AppInterceptor implements HandlerInterceptor {
private boolean hasModuleAccess(String moduleName) { private boolean hasModuleAccess(String moduleName) {
getAppModuleEntities = appModuleRepository.findByModulePath(moduleName); getAppModuleEntities = appModuleRepository.findByModulePath(moduleName);
System.out.println("DataTable Size for the url ("+moduleName+"): "+getAppModuleEntities.size());
//System.out.println("DataTable Size for the url ("+moduleName+"): "+getAppModuleEntities.size());
String moduleid = null; String moduleid = null;
@ -112,6 +112,7 @@ public class AppInterceptor implements HandlerInterceptor {
String userGroupId = LoginUserInfo.getUserGroupId(); String userGroupId = LoginUserInfo.getUserGroupId();
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid); System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid);
getAppModuleAccessEntities = appModuleAccessRepository.findByAll(userGroupId,moduleid); getAppModuleAccessEntities = appModuleAccessRepository.findByAll(userGroupId,moduleid);
//System.out.println("After Check in(hasModuleAccess):"+getAppModuleAccessEntities.size());
if(getAppModuleAccessEntities.size()>0) { if(getAppModuleAccessEntities.size()>0) {
return true; return true;
} }
@ -125,7 +126,7 @@ public class AppInterceptor implements HandlerInterceptor {
if(!hasModuleAccess(moduleName)) {return false; } if(!hasModuleAccess(moduleName)) {return false; }
getMenuItemEntities = menuItemRepository.findByUrl(url); getMenuItemEntities = menuItemRepository.findByUrl(url);
System.out.println("DataTable Size for the url ("+url+"): "+getMenuItemEntities.size());
//System.out.println("DataTable Size for the url ("+url+"): "+getMenuItemEntities.size());
String moduleid = null; String moduleid = null;
String menuid = null; String menuid = null;
@ -137,7 +138,7 @@ public class AppInterceptor implements HandlerInterceptor {
} }
if(moduleid != null && menuid != null) { if(moduleid != null && menuid != null) {
String userGroupId = LoginUserInfo.getUserGroupId(); String userGroupId = LoginUserInfo.getUserGroupId();
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid);
//System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid);
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(userGroupId,moduleid,menuid); getMenuItemAccessEntities = menuItemAccessRepository.findByAll(userGroupId,moduleid,menuid);
if(getMenuItemAccessEntities.size()>0) { if(getMenuItemAccessEntities.size()>0) {
return true; return true;
@ -152,7 +153,7 @@ public class AppInterceptor implements HandlerInterceptor {
if(!hasModuleAccess(moduleName)) {return false; } if(!hasModuleAccess(moduleName)) {return false; }
getSubMenuItemEntities = subMenuItemRepository.findByUrl(url); getSubMenuItemEntities = subMenuItemRepository.findByUrl(url);
System.out.println("DataTable Size for the url ("+url+"): "+getSubMenuItemEntities.size());
//System.out.println("DataTable Size for the url ("+url+"): "+getSubMenuItemEntities.size());
String moduleid = null; String moduleid = null;
String menuid = null; String menuid = null;
@ -166,12 +167,12 @@ public class AppInterceptor implements HandlerInterceptor {
} }
if(moduleid != null && menuid != null && submenuid != null) { if(moduleid != null && menuid != null && submenuid != null) {
String userGroupId = LoginUserInfo.getUserGroupId(); String userGroupId = LoginUserInfo.getUserGroupId();
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid+"\n submenuid : "+submenuid);
//System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid+"\n submenuid : "+submenuid);
getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(userGroupId,moduleid,menuid,submenuid); getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(userGroupId,moduleid,menuid,submenuid);
if(getSubMenuItemAccessEntities.size()>0) { if(getSubMenuItemAccessEntities.size()>0) {
// Check Parent Menu Access (Menu Access) // Check Parent Menu Access (Menu Access)
if(moduleid != null && menuid != null) { if(moduleid != null && menuid != null) {
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid);
//System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid);
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(userGroupId,moduleid,menuid); getMenuItemAccessEntities = menuItemAccessRepository.findByAll(userGroupId,moduleid,menuid);
if(getMenuItemAccessEntities.size()>0) { if(getMenuItemAccessEntities.size()>0) {
return true; return true;
@ -186,9 +187,11 @@ public class AppInterceptor implements HandlerInterceptor {
private boolean hasAccess(String path) { private boolean hasAccess(String path) {
String userRole = LoginUserInfo.getUserRole(); String userRole = LoginUserInfo.getUserRole();
if (userRole != null && userRole.equals("ADMIN")) { if (userRole != null && userRole.equals("ADMIN")) {
return true; return true;
} }
/* /*
if(LoginUserInfo.getUserRole().equals("ADMIN")) { if(LoginUserInfo.getUserRole().equals("ADMIN")) {
return true; return true;
@ -196,7 +199,9 @@ public class AppInterceptor implements HandlerInterceptor {
*/ */
String url = removeLeadingSlash(path); String url = removeLeadingSlash(path);
System.out.println("Give URL : "+path+" After remove leading slash : "+url);
url = removeStartingString(url); // Remove parent App url "gcc"
//System.out.println("Give URL : "+path+" After remove leading slash : "+url);
// If default home page // If default home page
if(path.equals("/")) { if(path.equals("/")) {
@ -208,7 +213,7 @@ public class AppInterceptor implements HandlerInterceptor {
if(parts.length<=0) {return true;} if(parts.length<=0) {return true;}
System.out.println(parts.length);
//System.out.println("Part Length:"+ parts.length);
if(parts.length>1) { if(parts.length>1) {
int j=0; int j=0;
@ -219,8 +224,9 @@ public class AppInterceptor implements HandlerInterceptor {
String moduleName = ""; String moduleName = "";
String menuName = ""; String menuName = "";
String subMenuName = ""; String subMenuName = "";
if(parts.length==2) { // Check Only Module Access
moduleName = parts[1];
if(parts.length==1) { // Check Only Module Access
moduleName = parts[0];
return hasModuleAccess(moduleName); return hasModuleAccess(moduleName);
} }
else if(parts.length==2) { // Check Module & Menu Access else if(parts.length==2) { // Check Module & Menu Access
@ -237,7 +243,7 @@ public class AppInterceptor implements HandlerInterceptor {
} }
} }
return false;
return true;
} }
public static String removeLeadingSlash(String input) { public static String removeLeadingSlash(String input) {
@ -247,6 +253,13 @@ public class AppInterceptor implements HandlerInterceptor {
return input; return input;
} }
public static String removeStartingString(String input) {
if (input.startsWith("gcc")) {
return removeLeadingSlash(input.substring(3));
}
return input;
}
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String assetsBaseUrl = environment.getProperty("assets.base-url"); String assetsBaseUrl = environment.getProperty("assets.base-url");

2
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/APIController.java

@ -18,7 +18,7 @@ import org.springframework.web.util.UriComponentsBuilder;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig; import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
@RequestMapping("/api/petregistration")
@RequestMapping("/gcc/api/petregistration")
@RestController("petRegistrationRest") @RestController("petRegistrationRest")
public class APIController { public class APIController {
private final RestTemplate restTemplate; private final RestTemplate restTemplate;

2
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/MainController.java

@ -20,7 +20,7 @@ import in.gov.chennaicorporation.gccoffice.petregistration.data.PetCountInfo;
import in.gov.chennaicorporation.gccoffice.petregistration.data.RequestList; import in.gov.chennaicorporation.gccoffice.petregistration.data.RequestList;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/petregistration")
@RequestMapping("/gcc/petregistration")
@Controller("petregistration") @Controller("petregistration")
public class MainController { public class MainController {
private final RestTemplate restTemplate; private final RestTemplate restTemplate;

1
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/MainController.java

@ -9,6 +9,7 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.pgr.service.PGRCommon; import in.gov.chennaicorporation.gccoffice.pgr.service.PGRCommon;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;

1
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/PGRCommon.java

@ -170,6 +170,7 @@ public class PGRCommon {
+ " cs.statusname AS status, " + " cs.statusname AS status, "
+ " usr.user_name, " + " usr.user_name, "
+ " cd.complaintnumber, " + " cd.complaintnumber, "
+ " cd.ID_MODE AS \"MODE\", "
+ " COALESCE(ct.complainttypename, 'Unspecified') AS complainttypename, " + " COALESCE(ct.complainttypename, 'Unspecified') AS complainttypename, "
+ " cg.complaintgroupname " + " cg.complaintgroupname "
+ "FROM eggr_complaintdetails@erp cd " + "FROM eggr_complaintdetails@erp cd "

2
src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserRepository.java

@ -20,7 +20,7 @@ public interface AppUserRepository extends JpaRepository<AppUserEntity, Integer>
@Query(value = "SELECT * FROM `appusers`", nativeQuery = true) @Query(value = "SELECT * FROM `appusers`", nativeQuery = true)
List<AppUserEntity> showAll(); List<AppUserEntity> showAll();
@Query(value = "SELECT * FROM `appusers` WHERE (id=:userId AND `isdelete`=0)", nativeQuery = true)
@Query(value = "SELECT * FROM `appusers` WHERE (userid=:userId AND `isdelete`=0)", nativeQuery = true)
List<AppUserEntity> showById(String userId); List<AppUserEntity> showById(String userId);
AppUserEntity findByUsername(String username); AppUserEntity findByUsername(String username);

38
src/main/java/in/gov/chennaicorporation/gccoffice/service/Base64Util.java

@ -0,0 +1,38 @@
package in.gov.chennaicorporation.gccoffice.service;
import java.util.Base64;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class Base64Util {
// Encode to Base64
public static String encodeBase64(String value) {
if (value != null && !value.isEmpty()) {
byte[] encodedBytes = Base64.getEncoder().encode(value.getBytes());
return new String(encodedBytes);
}
else {
return "";
}
}
// Decode from Base64
public static String decodeBase64(String encodedValue) {
if (encodedValue != null && !encodedValue.isEmpty()) {
try {
byte[] decodedBytes = Base64.getDecoder().decode(encodedValue);
return new String(decodedBytes);
} catch (IllegalArgumentException e) {
// Handle the exception, e.g., log it or return an error message
System.err.println("Error decoding Base64 string: " + e.getMessage());
return "error"; // Or return an error message string
}
} else {
return "";
}
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/service/CustomUserDetailsService.java

@ -53,6 +53,7 @@ public class CustomUserDetailsService implements UserDetailsService {
userRole = "ROLE_" + userRole; userRole = "ROLE_" + userRole;
//System.out.println("User Role: "+userRole); //System.out.println("User Role: "+userRole);
} }
// Create a SimpleGrantedAuthority for the user role // Create a SimpleGrantedAuthority for the user role
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(userRole); SimpleGrantedAuthority authority = new SimpleGrantedAuthority(userRole);

2
src/main/java/in/gov/chennaicorporation/gccoffice/service/LoginUserInfo.java

@ -23,7 +23,9 @@ public class LoginUserInfo {
public static String getLoginUserId() { public static String getLoginUserId() {
UserDetails userDetails = LoginUserInfo.getCurrentUserDetails(); UserDetails userDetails = LoginUserInfo.getCurrentUserDetails();
if (userDetails instanceof CustomUserDetails) { if (userDetails instanceof CustomUserDetails) {
//System.out.println("User Details : "+userDetails.toString());
CustomUserDetails customUserDetails = (CustomUserDetails) userDetails; CustomUserDetails customUserDetails = (CustomUserDetails) userDetails;
Map<String, Object> additionalAttributes = customUserDetails.getAdditionalAttributes(); Map<String, Object> additionalAttributes = customUserDetails.getAdditionalAttributes();
if (additionalAttributes != null) { if (additionalAttributes != null) {

BIN
src/main/resources/.DS_Store

16
src/main/resources/application.properties

@ -40,14 +40,28 @@ server.servlet.session.tracking-modes=COOKIE
#logging.level.root=DEBUG #logging.level.root=DEBUG
file.upload.directory=${user.dir}/gccoffice_uploads
file.upload.directory=${user.dir}/gccoffice_uploads/
server.address=0.0.0.0 server.address=0.0.0.0
server.servlet.session.timeout=-1 server.servlet.session.timeout=-1
server.servlet.session.cookie.name= GCCONEPORTALSESSION server.servlet.session.cookie.name= GCCONEPORTALSESSION
server.servlet.session.cookie.max-age=-1 server.servlet.session.cookie.max-age=-1
server.servlet.session.cookie.http-only=true
server.servlet.session.cookie.secure=true
#server.servlet.session.timeout:5m #server.servlet.session.timeout:5m
#server.servlet.session.cookie.name: MYSESSIONID #server.servlet.session.cookie.name: MYSESSIONID
#server.servlet.session.cookie.max-age: 10m #server.servlet.session.cookie.max-age: 10m
#///////// For Mayor Petition //////////
mp_ackno_prefix=MP
mp_ackno = 10000000
mp_foldername = m_petition
mp_action_Foldername = m_action_file
#///////// For Councillor Petition //////////
cp_ackno_prefix=CP
cp_ackno = 10000000
cp_foldername = c_petition
cp_action_Foldername = c_action_file

BIN
src/main/resources/static/.DS_Store

BIN
src/main/resources/static/assets/.DS_Store

BIN
src/main/resources/static/assets/dist/.DS_Store

4
src/main/resources/static/assets/dist/css/theme.css

@ -5068,9 +5068,9 @@ body {
.wrapper .header-top .top-menu .nav-link i { .wrapper .header-top .top-menu .nav-link i {
font-size: 16px; } font-size: 16px; }
.wrapper .header-top .top-menu .nav-link .badge { .wrapper .header-top .top-menu .nav-link .badge {
right: -1px;
right: 0px;
position: absolute; position: absolute;
top: -4px;
top: 0px;
padding: 3px; padding: 3px;
width: 17px; width: 17px;
font-size: 11px; font-size: 11px;

BIN
src/main/resources/static/assets/images/.DS_Store

BIN
src/main/resources/templates/.DS_Store

2
src/main/resources/templates/fragments/modules/base/footer.html

@ -1,5 +1,5 @@
<footer class="footer"> <footer class="footer">
<form id="logout-form" th:action="@{/logout}" method="post" style="display: none;"></form>
<form id="logout-form" th:action="@{/gcc/logout}" method="post" style="display: none;"></form>
<div class="w-100 clearfix"> <div class="w-100 clearfix">
<span class="text-center text-sm-left d-md-inline-block">Copyright &copy; Greater Chennai Corporation | All rights reserved</span> <span class="text-center text-sm-left d-md-inline-block">Copyright &copy; Greater Chennai Corporation | All rights reserved</span>
<span class="float-none float-sm-right mt-1 mt-sm-0 text-center">Coded By BonTon Softwares Pvt Ltd</span> <span class="float-none float-sm-right mt-1 mt-sm-0 text-center">Coded By BonTon Softwares Pvt Ltd</span>

28
src/main/resources/templates/fragments/modules/base/header.html

@ -3,18 +3,21 @@
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<div class="top-menu d-flex align-items-center"> <div class="top-menu d-flex align-items-center">
<button type="button" class="btn-icon mobile-nav-toggle d-lg-none"><span></span></button> <button type="button" class="btn-icon mobile-nav-toggle d-lg-none"><span></span></button>
<div class="header-search">
<!-- <div class="header-search">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon search-close"><i class="ik ik-x"></i></span> <span class="input-group-addon search-close"><i class="ik ik-x"></i></span>
<input type="text" class="form-control"> <input type="text" class="form-control">
<span class="input-group-addon search-btn"><i class="ik ik-search"></i></span> <span class="input-group-addon search-btn"><i class="ik ik-search"></i></span>
</div> </div>
</div> </div>
-->
<button type="button" id="navbar-fullscreen" class="nav-link"><i class="ik ik-maximize"></i></button> <button type="button" id="navbar-fullscreen" class="nav-link"><i class="ik ik-maximize"></i></button>
</div> </div>
<div class="top-menu d-flex align-items-center"> <div class="top-menu d-flex align-items-center">
<div class="dropdown"> <div class="dropdown">
<a class="nav-link dropdown-toggle" href="#" id="notiDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="ik ik-bell"></i><span class="badge bg-danger">3</span></a>
<a class="nav-link dropdown-toggle" href="#" id="notiDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="ik ik-bell bell"></i><span class="badge bg-danger">3</span>
</a>
<div class="dropdown-menu dropdown-menu-right notification-dropdown" aria-labelledby="notiDropdown"> <div class="dropdown-menu dropdown-menu-right notification-dropdown" aria-labelledby="notiDropdown">
<h4 class="header">Notifications</h4> <h4 class="header">Notifications</h4>
<div class="notifications-wrap"> <div class="notifications-wrap">
@ -49,25 +52,6 @@
<div class="footer"><a href="javascript:void(0);">See all activity</a></div> <div class="footer"><a href="javascript:void(0);">See all activity</a></div>
</div> </div>
</div> </div>
<button type="button" class="nav-link ml-10 right-sidebar-toggle"><i class="ik ik-message-square"></i><span class="badge bg-success">3</span></button>
<div class="dropdown">
<a class="nav-link dropdown-toggle" href="#" id="menuDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="ik ik-plus"></i></a>
<div class="dropdown-menu dropdown-menu-right menu-grid" aria-labelledby="menuDropdown">
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Dashboard"><i class="ik ik-bar-chart-2"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Message"><i class="ik ik-mail"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Accounts"><i class="ik ik-users"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Sales"><i class="ik ik-shopping-cart"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Purchase"><i class="ik ik-briefcase"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Pages"><i class="ik ik-clipboard"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Chats"><i class="ik ik-message-square"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Contacts"><i class="ik ik-map-pin"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Blocks"><i class="ik ik-inbox"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Events"><i class="ik ik-calendar"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="Notifications"><i class="ik ik-bell"></i></a>
<a class="dropdown-item" href="#" data-toggle="tooltip" data-placement="top" title="More"><i class="ik ik-more-horizontal"></i></a>
</div>
</div>
<button type="button" class="nav-link ml-10" id="apps_modal_btn" data-toggle="modal" data-target="#appsModal"><i class="ik ik-grid"></i></button>
<div class="dropdown"> <div class="dropdown">
<a class="dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@ -78,7 +62,7 @@
<a class="dropdown-item" href="#"><i class="ik ik-settings dropdown-icon"></i> Settings</a> <a class="dropdown-item" href="#"><i class="ik ik-settings dropdown-icon"></i> Settings</a>
<a class="dropdown-item" href="#"><span class="float-right"><span class="badge badge-primary">6</span></span><i class="ik ik-mail dropdown-icon"></i> Inbox</a> <a class="dropdown-item" href="#"><span class="float-right"><span class="badge badge-primary">6</span></span><i class="ik ik-mail dropdown-icon"></i> Inbox</a>
<a class="dropdown-item" href="#"><i class="ik ik-navigation dropdown-icon"></i> Message</a> <a class="dropdown-item" href="#"><i class="ik ik-navigation dropdown-icon"></i> Message</a>
<a class="dropdown-item" th:href="@{/logout}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"><i class="ik ik-power dropdown-icon"></i> Logout</a>
<a class="dropdown-item" th:href="@{/gcc/logout}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"><i class="ik ik-power dropdown-icon"></i> Logout</a>
</div> </div>
</div> </div>

2
src/main/resources/templates/fragments/modules/base/menu.html

@ -7,7 +7,7 @@
</div> </div>
<span class="text"> GCC APP</span> <span class="text"> GCC APP</span>
</a> </a>
<button type="button" class="nav-toggle"><i data-toggle="expanded" class="ik ik-toggle-right toggle-icon"></i></button>
<!-- <button type="button" class="nav-toggle"><i data-toggle="expanded" class="ik ik-toggle-right toggle-icon"></i></button> -->
<button id="sidebarClose" class="nav-close"><i class="ik ik-x"></i></button> <button id="sidebarClose" class="nav-close"><i class="ik ik-x"></i></button>
</div> </div>

163
src/main/resources/templates/index.html

@ -24,8 +24,8 @@
<div class="page-header-title"> <div class="page-header-title">
<i class="ik ik-bar-chart-2 bg-blue"></i> <i class="ik ik-bar-chart-2 bg-blue"></i>
<div class="d-inline"> <div class="d-inline">
<h5>Main Module Name</h5>
<span>Any Discription needed pls add here :) </span>
<h5>Dashboard</h5>
<span>Main Dashboard of GCC App</span>
</div> </div>
</div> </div>
</div> </div>
@ -42,12 +42,50 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3>Page Title</h3>
<div class="col-lg-3 col-md-6 col-sm-12">
<div class="widget">
<div class="widget-header">
<h3 class="widget-title">My Details</h3>
<div class="widget-tools pull-right">
</div>
</div>
<div class="widget-body" style="" id="basicUserProfile">
The body of the widget
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="widget">
<div class="widget-header">
<h3 class="widget-title">தினம் ஒரு திருக்குறள்:</h3>
<div class="widget-tools pull-right text-right">
<img src="/gcc/files/app_uploads/icons/thiruvalluvar.jpeg" width="15%" class="rounded-circle">
</div>
</div> </div>
<div class="card-body">
<div class="widget-body">
<table>
<tr>
<td clas="text-center" width="20%"><img src="/gcc/files/app_uploads/icons/thiruvalluvar.jpeg" width="90%" class="rounded"></td>
<td>
<div class="mb-0" style="font-size:20px;">அகர முதல எழுத்தெல்லாம</div>
<div class="mb-0" style="font-size:20px;">ஆதி பகவன் முதற்றே உலக</div>
<div class="mb-0 text-right">( குறள் எண் : 6 ) | <a href="javascript:void(0);" class="link"> விளக்கம்</a>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12">
<div class="widget">
<div class="widget-header">
<h3 class="widget-title">Your Info</h3>
<div class="widget-tools pull-right"></div>
</div>
<div class="widget-body" id="">
</div> </div>
</div> </div>
@ -58,20 +96,10 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3>Datatable Test</h3>
<h3>User Profile</h3>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="col-sm-12"><table id="example" class="table table-striped table-bordered table-hover nowrap dataTable" role="grid" aria-describedby="simpletable_info">
<thead class="thead-dark">
<tr role="row"><th class="sorting_asc" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Name: activate to sort column descending" style="width: 178.258px;">Name</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Position: activate to sort column ascending" style="width: 268.727px;">Position</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 129.852px;">Office</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Age: activate to sort column ascending" style="width: 72.1875px;">Age</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="width: 135.57px;">Start date</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Salary: activate to sort column ascending" style="width: 96.4062px;">Salary</th></tr>
</theadclass="thead-dark">
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr><th rowspan="1" colspan="1">Name</th><th rowspan="1" colspan="1">Position</th><th rowspan="1" colspan="1">Office</th><th rowspan="1" colspan="1">Age</th><th rowspan="1" colspan="1">Start date</th><th rowspan="1" colspan="1">Salary</th></tr>
</tfoot>
</table></div>
<div class="col-sm-12" id="userProfile"></div>
</div> </div>
</div> </div>
</div> </div>
@ -88,5 +116,102 @@
<script th:replace="~{fragments/modules/base/script :: script}"></script> <script th:replace="~{fragments/modules/base/script :: script}"></script>
<script th:inline="javascript">
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
var createdBy = /*[[${LoginUserId}]]*/'';
//alert(createdBy);
// Loading Div id
const loading = $("#userProfile");
function call_loading(){
loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
}
function remove_loading(){
loading.html("");
}
/* Get Complaints Data */
function get_user_basic_data(){
var apiUrl = '/gcc/api/getUserProfileBasic?userId='+createdBy;
//alert(apiUrl);
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
/*dataType: 'json',*/
success: function(jsonResponse) {
// Resolve the Promise with the department list
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_user_basic_info(){
get_user_basic_data().then(function(userProfile) {
// Handle the userProfile
$("#basicUserProfile").html(userProfile);
}).catch(function(error) {
// Handle errors
if (error && error.message) {
console.error('Error fetching User Profile:', error.message);
} else {
console.error('An error occurred while fetching user profile:', error);
}
});
}
/* Get Complaints Data */
function get_user_data(){
var apiUrl = '/gcc/api/getUserProfile?userId='+createdBy;
//alert(apiUrl);
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
/*dataType: 'json',*/
success: function(jsonResponse) {
// Resolve the Promise with the department list
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_user_info(){
get_user_data().then(function(userProfile) {
// Handle the userProfile
$("#userProfile").html(userProfile);
}).catch(function(error) {
// Handle errors
if (error && error.message) {
console.error('Error fetching User Profile:', error.message);
} else {
console.error('An error occurred while fetching user profile:', error);
}
});
}
$(document).ready(function() {
call_loading();
get_user_info();
get_user_basic_info();
});
</script>
</body> </body>
</html> </html>

2
src/main/resources/templates/modules/admin/user-group-access.html

@ -238,7 +238,7 @@
var submitCheckedData = function(checkedData, groupId) { var submitCheckedData = function(checkedData, groupId) {
// Perform your AJAX request here using checkedData // Perform your AJAX request here using checkedData
// Replace the URL and other options with your actual API endpoint and data // Replace the URL and other options with your actual API endpoint and data
const apiUrl = "/api/saveGroupAccessData";
const apiUrl = "/gcc/api/saveGroupAccessData";
const selectedGroup = $('#search_groupid'); const selectedGroup = $('#search_groupid');
const selectedGroupName = selectedGroup.find('option:selected').text(); const selectedGroupName = selectedGroup.find('option:selected').text();

2
src/main/resources/templates/modules/admin/user-list.html

@ -202,7 +202,7 @@
} }
function getUserDetails(userid){ function getUserDetails(userid){
const apiUrl = "/api/getUserProfile";
const apiUrl = "/gcc/api/getUserProfile";
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,

6
src/main/resources/templates/modules/mtm/index.html

@ -128,9 +128,9 @@
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script> <script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script>
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="node_modules/amcharts3/amcharts/serial.js"></script>
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
<script> <script>
var chartData = []; var chartData = [];

6
src/main/resources/templates/modules/mtm/officer/index.html

@ -128,9 +128,9 @@
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script> <script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script>
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="node_modules/amcharts3/amcharts/serial.js"></script>
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
<script> <script>
var chartData = []; var chartData = [];

16
src/main/resources/templates/modules/petregistration/accepted-list.html

@ -371,7 +371,7 @@
function petimg(mobno,uniqueid){ function petimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetimg',
url: '/gcc/api/pet/getpetimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -391,7 +391,7 @@
function applicantimg(mobno,uniqueid){ function applicantimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getapplicantimg',
url: '/gcc/api/pet/getapplicantimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -410,7 +410,7 @@
function certificateimg(mobno,uniqueid){ function certificateimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getvacimg',
url: '/gcc/api/pet/getvacimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -429,7 +429,7 @@
function proofimg(mobno,uniqueid){ function proofimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getaddproofimg',
url: '/gcc/api/pet/getaddproofimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -459,7 +459,7 @@
if (result.isConfirmed) { if (result.isConfirmed) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/pet/accept',
url: '/gcc/api/pet/accept',
data: {'id':id}, data: {'id':id},
success: function(bodyMessage) { success: function(bodyMessage) {
if(bodyMessage=="success"){ if(bodyMessage=="success"){
@ -484,7 +484,7 @@
function reject(uniqueid){ function reject(uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetInfo',
url: '/gcc/api/pet/getpetInfo',
data: { data: {
'petid':uniqueid 'petid':uniqueid
}, },
@ -531,7 +531,7 @@
if (result.isConfirmed) { if (result.isConfirmed) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/pet/reject',
url: '/gcc/api/pet/reject',
data: {'id':id,'reason':reason}, data: {'id':id,'reason':reason},
success: function(bodyMessage) { success: function(bodyMessage) {
if(bodyMessage=="success"){ if(bodyMessage=="success"){
@ -562,7 +562,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetOwner',
url: '/gcc/api/pet/getpetOwner',
data: { data: {
'mobilenum':mobilenum, 'mobilenum':mobilenum,
}, },

2
src/main/resources/templates/modules/petregistration/index.html

@ -838,7 +838,7 @@
function getZoneDashboard() { function getZoneDashboard() {
var z = $('#zone').val(); var z = $('#zone').val();
if (z == 0) { if (z == 0) {
window.location.href = "/pet/dashboard";
window.location.href = "gcc/pet/dashboard";
} }
} }
</script> </script>

14
src/main/resources/templates/modules/petregistration/license-issued.html

@ -385,7 +385,7 @@
function petimg(mobno, uniqueid) { function petimg(mobno, uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetimg',
url: '/gcc/api/pet/getpetimg',
data: { data: {
'mobno': mobno, 'mobno': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -403,7 +403,7 @@
function certificateimg(mobno, uniqueid) { function certificateimg(mobno, uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getvacimg',
url: '/gcc/api/pet/getvacimg',
data: { data: {
'mobno': mobno, 'mobno': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -424,7 +424,7 @@
let own; let own;
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetOwner',
url: '/gcc/api/pet/getpetOwner',
data: { 'mobilenum': mobilenum }, data: { 'mobilenum': mobilenum },
success: function (bodyMessage) { success: function (bodyMessage) {
ownercall(bodyMessage); ownercall(bodyMessage);
@ -464,7 +464,7 @@
function licenceInfo(mobno, uniqueid) { function licenceInfo(mobno, uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getlicenseinfo',
url: '/gcc/api/pet/getlicenseinfo',
data: { data: {
'mobilenum': mobno, 'mobilenum': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -492,7 +492,7 @@
//window.open('/owners/getlicensebymobo/'+id+'/'+phone,'_blank'); //window.open('/owners/getlicensebymobo/'+id+'/'+phone,'_blank');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/owners/ /' + id + '/' + phone,
url: '/gcc/pet/owners/ /' + id + '/' + phone,
success: function (bodyMessage) { success: function (bodyMessage) {
$("#htmldatatxt").html(bodyMessage); $("#htmldatatxt").html(bodyMessage);
$('#getpetlic').modal({ $('#getpetlic').modal({
@ -521,12 +521,12 @@
var x = document.getElementById("fromdate").value; var x = document.getElementById("fromdate").value;
var y = document.getElementById("todate").value; var y = document.getElementById("todate").value;
var url = '/pet/licenseIssued?fromDate=' + x + '&toDate=' + y;
var url = '/gcc/pet/licenseIssued?fromDate=' + x + '&toDate=' + y;
window.location.href = url; window.location.href = url;
} }
function resetDate() { function resetDate() {
var url = '/pet/licenseIssued';
var url = '/gcc/pet/licenseIssued';
window.location.href = url; window.location.href = url;
} }

18
src/main/resources/templates/modules/petregistration/rejected.html

@ -385,7 +385,7 @@ $(document).ready(function() {
function petimg(mobno,uniqueid){ function petimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetimg',
url: '/gcc/api/pet/getpetimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -405,7 +405,7 @@ $(document).ready(function() {
function applicantimg(mobno,uniqueid){ function applicantimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getapplicantimg',
url: '/gcc/api/pet/getapplicantimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -424,7 +424,7 @@ $(document).ready(function() {
function certificateimg(mobno,uniqueid){ function certificateimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getvacimg',
url: '/gcc/api/pet/getvacimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -443,7 +443,7 @@ $(document).ready(function() {
function proofimg(mobno,uniqueid){ function proofimg(mobno,uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getaddproofimg',
url: '/gcc/api/pet/getaddproofimg',
data: { data: {
'mobno':mobno, 'mobno':mobno,
'uniqueid':uniqueid 'uniqueid':uniqueid
@ -473,7 +473,7 @@ $(document).ready(function() {
if (result.isConfirmed) { if (result.isConfirmed) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/accept',
url: '/gcc/api/accept',
data: {'id':id}, data: {'id':id},
success: function(bodyMessage) { success: function(bodyMessage) {
@ -499,7 +499,7 @@ $(document).ready(function() {
function reject(uniqueid){ function reject(uniqueid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetInfo',
url: '/gcc/api/pet/getpetInfo',
data: { data: {
'petid':uniqueid 'petid':uniqueid
}, },
@ -540,7 +540,7 @@ $(document).ready(function() {
let own; let own;
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetOwner',
url: '/gcc/api/pet/getpetOwner',
data: {'mobilenum':mobilenum }, data: {'mobilenum':mobilenum },
success: function(bodyMessage) { success: function(bodyMessage) {
ownercall(bodyMessage); ownercall(bodyMessage);
@ -594,12 +594,12 @@ $(document).ready(function() {
var x= document.getElementById("fromdate").value; var x= document.getElementById("fromdate").value;
var y= document.getElementById("todate").value; var y= document.getElementById("todate").value;
var url= '/pet/rejectedPets?fromDate='+x+'&toDate='+y;
var url= '/gcc/pet/rejectedPets?fromDate='+x+'&toDate='+y;
window.location.href=url; window.location.href=url;
} }
function resetDate(){ function resetDate(){
var url= '/pet/rejectedPets';
var url= '/gcc/pet/rejectedPets';
window.location.href=url; window.location.href=url;
} }
</script> </script>

18
src/main/resources/templates/modules/petregistration/request-list.html

@ -421,7 +421,7 @@
alert(mobno + " "+uniqueid); alert(mobno + " "+uniqueid);
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/petregistration/getpetimg',
url: '/gcc/api/petregistration/getpetimg',
data: { data: {
'mobno': mobno, 'mobno': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -442,7 +442,7 @@
function applicantimg(mobno, uniqueid) { function applicantimg(mobno, uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/petregistration/getapplicantimg',
url: '/gcc/api/petregistration/getapplicantimg',
data: { data: {
'mobno': mobno, 'mobno': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -461,7 +461,7 @@
function certificateimg(mobno, uniqueid) { function certificateimg(mobno, uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/petregistration/getvaccineimg',
url: '/gcc/api/petregistration/getvaccineimg',
data: { data: {
'mobno': mobno, 'mobno': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -480,7 +480,7 @@
function proofimg(mobno, uniqueid) { function proofimg(mobno, uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/petregistration/getaddressproofimg',
url: '/gcc/api/petregistration/getaddressproofimg',
data: { data: {
'mobno': mobno, 'mobno': mobno,
'uniqueid': uniqueid 'uniqueid': uniqueid
@ -510,7 +510,7 @@
if (result.isConfirmed) { if (result.isConfirmed) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/accept',
url: '/gcc/api/pet/accept',
data: { 'id': id, 'mobileNo': mobileNo }, data: { 'id': id, 'mobileNo': mobileNo },
success: function (bodyMessage) { success: function (bodyMessage) {
if (bodyMessage == "success") { if (bodyMessage == "success") {
@ -534,7 +534,7 @@
function reject(uniqueid) { function reject(uniqueid) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetInfo',
url: '/gcc/api/pet/getpetInfo',
data: { data: {
'petid': uniqueid 'petid': uniqueid
}, },
@ -616,7 +616,7 @@
let own; let own;
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/pet/getpetOwner',
url: '/gcc/api/pet/getpetOwner',
data: { 'mobilenum': mobilenum }, data: { 'mobilenum': mobilenum },
success: function (bodyMessage) { success: function (bodyMessage) {
ownercall(bodyMessage); ownercall(bodyMessage);
@ -673,12 +673,12 @@
var x = document.getElementById("fromdate").value; var x = document.getElementById("fromdate").value;
var y = document.getElementById("todate").value; var y = document.getElementById("todate").value;
var url = '/petregistration/requestlist?fromDate=' + x + '&toDate=' + y;
var url = '/gcc/pet/petregistration/requestlist?fromDate=' + x + '&toDate=' + y;
window.location.href = url; window.location.href = url;
} }
function resetDate() { function resetDate() {
var url = '/petregistration/requestlist';
var url = '/gcc/pet/petregistration/requestlist';
window.location.href = url; window.location.href = url;
} }
</script> </script>

12
src/main/resources/templates/modules/pgr/all-list.html

@ -64,6 +64,8 @@
<th class="text-center">Date</th> <th class="text-center">Date</th>
<th class="text-center">Time</th> <th class="text-center">Time</th>
<th class="text-center">Status</th> <th class="text-center">Status</th>
<th class="text-center">Department</th>
<th class="text-center">Mode</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -81,6 +83,8 @@
<th class="text-center">Date</th> <th class="text-center">Date</th>
<th class="text-center">Time</th> <th class="text-center">Time</th>
<th class="text-center">Status</th> <th class="text-center">Status</th>
<th class="text-center">Department</th>
<th class="text-center">Mode</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
@ -238,8 +242,8 @@
], ],
scrollY: '50vh', scrollY: '50vh',
fixedColumns: { fixedColumns: {
left: 1,
right: 1
left: 0,
right: 0
}, },
buttons: [buttons], buttons: [buttons],
responsive: true, responsive: true,
@ -264,7 +268,9 @@
row['LOCATION'], row['LOCATION'],
row['COMPDATE'], row['COMPDATE'],
row['TIME'], row['TIME'],
row['STATUS']
row['STATUS'],
row['DEPT_NAME'],
row['MODE']
]).draw(false); ]).draw(false);
}); });

52
src/main/resources/templates/modules/pgr/index.html

@ -3,7 +3,7 @@
<html xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head> <head th:replace="~{fragments/modules/base/head :: head}"></head>
<body> <body>
<link rel="stylesheet" href="/assets/node_modules/amcharts3/amcharts/plugins/export/export.css" type="text/css" media="all" />
<link rel="stylesheet" href="node_modules/amcharts3/amcharts/plugins/export/export.css" type="text/css" media="all" />
<!--[if lt IE 8]> <!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]--> <![endif]-->
@ -90,13 +90,13 @@
<script th:replace="~{fragments/modules/base/script :: script}"></script> <script th:replace="~{fragments/modules/base/script :: script}"></script>
<script th:replace="~{fragments/modules/pgr/script :: script}"></script> <script th:replace="~{fragments/modules/pgr/script :: script}"></script>
<script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/plugins/export/export.min.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/pie.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script>
<!-- <script src="/assets/node_modules/fullcalendar/dist/fullcalendar.min.js"></script>-->
<script src="/assets/node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="node_modules/amcharts3/amcharts/serial.js"></script>
<script src="node_modules/amcharts3/amcharts/plugins/export/export.min.js"></script>
<script src="node_modules/amcharts3/amcharts/pie.js"></script>
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
<!-- <script src="node_modules/fullcalendar/dist/fullcalendar.min.js"></script>-->
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script> <script>
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
@ -127,31 +127,27 @@
departmentlist = departments; departmentlist = departments;
fetchPie_Data(0); // Dropdown fileter value fetchPie_Data(0); // Dropdown fileter value
fetchData_Bar(0); // Dropdown fileter value fetchData_Bar(0); // Dropdown fileter value
}).catch(function(error) { }).catch(function(error) {
// Handle errors // Handle errors
console.error('Error fetching department list:', error);
});
/*
var apiUrl = '/gcc/api/pgr/getDepartments';
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
departmentlist = jsonResponse;
fetchPie_Data(0); // Dropdown fileter value
fetchData_Bar(0); // Dropdown fileter value
console.error('Error fetching department list:', error.message);
//alert('Failed to fetch department list. Please try again later.');
Swal.fire({
title: 'Failed to fetch data from ERP. Please try again later.',
customClass: {
title: 'swal-title-custom' // Add a custom class for the title
}, },
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', status, error);
//text: "Error",
icon: 'error',
showCancelButton: false,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Ok',
}).then(function(result) {
if (result.isConfirmed) {
// Handle after confirmed button (Ok) click
} }
}); });
*/
});
} }
function fetchPie_Data(deptid){ function fetchPie_Data(deptid){

18
src/main/resources/templates/modules/qrfeedback/index.html

@ -106,7 +106,7 @@
</div> </div>
</div> </div>
</div> </div>
<!--
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
@ -128,6 +128,7 @@
</div> </div>
</div> </div>
</div> </div>
-->
</div> </div>
</div> </div>
</div> </div>
@ -252,11 +253,11 @@
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script> <script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script>
<script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script>
<script src="/assets/node_modules/fullcalendar/dist/fullcalendar.min.js"></script>
<script src="/assets/node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script>
<script src="node_modules/amcharts3/amcharts/serial.js"></script>
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script>
<script src="node_modules/fullcalendar/dist/fullcalendar.min.js"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script> <script>
function fetchDashboardSummary(){ function fetchDashboardSummary(){
@ -266,7 +267,7 @@
call_loading('positivecount','start'); call_loading('positivecount','start');
call_loading('negativecount','start'); call_loading('negativecount','start');
var apiUrl = '/api/qrfeedback/dashboard-summary';
var apiUrl = '/gcc/api/qrfeedback/dashboard-summary';
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,
type: 'GET', type: 'GET',
@ -422,6 +423,7 @@
</script> </script>
<script> <script>
/*
// For Calendar // For Calendar
$(document).ready(function(t, e, i) { $(document).ready(function(t, e, i) {
function t(t) { function t(t) {
@ -570,7 +572,7 @@
} }
}); });
})
})*/
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save