Browse Source

PGR & Admin Module Added

Based on local & Server some configuration Change's added.
New module Admin & PGR added.
main
Balaji 3 years ago
parent
commit
014f177c1f
  1. BIN
      .DS_Store
  2. BIN
      src/.DS_Store
  3. BIN
      src/main/.DS_Store
  4. BIN
      src/main/java/.DS_Store
  5. BIN
      src/main/java/in/.DS_Store
  6. BIN
      src/main/java/in/gov/.DS_Store
  7. BIN
      src/main/java/in/gov/chennaicorporation/.DS_Store
  8. BIN
      src/main/java/in/gov/chennaicorporation/gccoffice/.DS_Store
  9. 3
      src/main/java/in/gov/chennaicorporation/gccoffice/GccOfficeApplication.java
  10. 6
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java
  11. 13
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
  12. 22
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java
  13. 8
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/ThymeleafConfig.java
  14. 10
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/WebMvcConfig.java
  15. 329
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java
  16. 167
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/AdminController.java
  17. 3
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java
  18. 6
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java
  19. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/login.java
  20. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleAccessEntity.java
  21. 6
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserEntity.java
  22. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemAccessEntity.java
  23. 3
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemEntity.java
  24. 9
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemAccessEntity.java
  25. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemEntity.java
  26. 56
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/UserActivityLog.java
  27. 38
      src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java
  28. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/APIController.java
  29. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MainController.java
  30. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MayorController.java
  31. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/OfficerController.java
  32. 94
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/APIController.java
  33. 57
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/MainController.java
  34. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/package-info.java
  35. 35
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/data/Departments.java
  36. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/data/package-info.java
  37. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/package-info.java
  38. 470
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/PGRCommon.java
  39. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/package-info.java
  40. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/APIController.java
  41. 2
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/MainController.java
  42. 14
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppModuleAccessRepository.java
  43. 17
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserGroupRepository.java
  44. 9
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserRepository.java
  45. 13
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/MenuItemAccessRepository.java
  46. 13
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/SubMenuItemAccessRepository.java
  47. 16
      src/main/java/in/gov/chennaicorporation/gccoffice/repository/UserActivityLogRepository.java
  48. 18
      src/main/java/in/gov/chennaicorporation/gccoffice/service/CustomUserDetailsService.java
  49. 29
      src/main/java/in/gov/chennaicorporation/gccoffice/service/UserActivityService.java
  50. 25
      src/main/java/in/gov/chennaicorporation/gccoffice/service/UserActivityTimelineService.java
  51. 13
      src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/MainController.java
  52. 3
      src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/TaxCollectionRestController.java
  53. BIN
      src/main/resources/.DS_Store
  54. 1
      src/main/resources/application-local.properties
  55. 1
      src/main/resources/application-production.properties
  56. 31
      src/main/resources/application.properties
  57. BIN
      src/main/resources/static/.DS_Store
  58. BIN
      src/main/resources/static/assets/.DS_Store
  59. BIN
      src/main/resources/static/assets/images/hi_robo.gif
  60. BIN
      src/main/resources/static/assets/images/search_ani.gif
  61. 2
      src/main/resources/static/assets/node_modules/datatable/DataTables-1.13.6/css/jquery.dataTables.min.css
  62. BIN
      src/main/resources/templates/.DS_Store
  63. 4
      src/main/resources/templates/error-403.html
  64. 4
      src/main/resources/templates/error-404.html
  65. 4
      src/main/resources/templates/error-500.html
  66. 53
      src/main/resources/templates/fragments/modules/admin/modal-box.html
  67. 100
      src/main/resources/templates/fragments/modules/base/head.html
  68. 4
      src/main/resources/templates/fragments/modules/base/header.html
  69. 2
      src/main/resources/templates/fragments/modules/base/menu.html
  70. 109
      src/main/resources/templates/fragments/modules/base/script.html
  71. 22
      src/main/resources/templates/fragments/modules/mtm/script.html
  72. 68
      src/main/resources/templates/fragments/modules/pgr/modal-box.html
  73. 275
      src/main/resources/templates/fragments/modules/pgr/script.html
  74. 19
      src/main/resources/templates/fragments/modules/pgr/search_form.html
  75. 6
      src/main/resources/templates/login.html
  76. 92
      src/main/resources/templates/modules/admin/index.html
  77. 272
      src/main/resources/templates/modules/admin/user-group-access.html
  78. 183
      src/main/resources/templates/modules/admin/user-group-list.html
  79. 226
      src/main/resources/templates/modules/admin/user-list.html
  80. 284
      src/main/resources/templates/modules/pgr/all-list.html
  81. 792
      src/main/resources/templates/modules/pgr/index.html
  82. 299
      src/main/resources/templates/modules/pgr/qa-qc-list.html
  83. 648
      src/main/resources/templates/modules/pgr/zone-wise-with-reopen.html
  84. 646
      src/main/resources/templates/modules/pgr/zone-wise-without-reopen.html
  85. 6
      src/main/resources/templates/modules/taxcollection/index.html
  86. 100
      src/main/resources/templates/modules/taxcollection/request-create.html
  87. 813
      src/main/resources/templates/modules/taxcollection/request-list.html

BIN
.DS_Store

BIN
src/.DS_Store

BIN
src/main/.DS_Store

BIN
src/main/java/.DS_Store

BIN
src/main/java/in/.DS_Store

BIN
src/main/java/in/gov/.DS_Store

BIN
src/main/java/in/gov/chennaicorporation/.DS_Store

BIN
src/main/java/in/gov/chennaicorporation/gccoffice/.DS_Store

3
src/main/java/in/gov/chennaicorporation/gccoffice/GccOfficeApplication.java

@ -4,6 +4,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@EntityScan(basePackages = { @EntityScan(basePackages = {
@ -16,8 +17,10 @@ import org.springframework.context.annotation.ComponentScan;
"in.gov.chennaicorporation.gccoffice.garbagecollection" "in.gov.chennaicorporation.gccoffice.garbagecollection"
}) })
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
//@EnableDiscoveryClient
public class GccOfficeApplication { public class GccOfficeApplication {
public static void main(String[] args) { public static void main(String[] args) {
//System.setProperty("spring.config.name", "gcc-portal");
SpringApplication.run(GccOfficeApplication.class, args); SpringApplication.run(GccOfficeApplication.class, args);
} }
} }

6
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java

@ -9,10 +9,12 @@ import org.springframework.web.client.RestTemplate;
@Configuration @Configuration
public class AppConfig { public class AppConfig {
public String qrAssetFeedback = "http://localhost:8063";
public String qrAssetFeedback = "http://117.232.67.158:8063";
public String mtm = "http://localhost:8060"; public String mtm = "http://localhost:8060";
public String petRegistration = "http://117.232.67.158:8061"; public String petRegistration = "http://117.232.67.158:8061";
public String garbageCollection = "http://localhost:8067";
public String garbageCollection = "http://117.232.67.158:8067";
public String gccappsMysqlPassword = "gccroot";
@Bean @Bean

13
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java

@ -13,6 +13,8 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import javax.persistence.EntityManagerFactory; import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.Properties; import java.util.Properties;
@ -20,6 +22,7 @@ import java.util.Properties;
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
public class DataSourceConfig { public class DataSourceConfig {
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
@EnableJpaRepositories( @EnableJpaRepositories(
@ -108,4 +111,14 @@ public class DataSourceConfig {
return new JpaTransactionManager(taxEntityManagerFactory); return new JpaTransactionManager(taxEntityManagerFactory);
} }
} }
@Bean(name = "oracleDataSource")
public DataSource oracleDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("oracle.jdbc.OracleDriver");
dataSource.setUrl("jdbc:oracle:thin:@10.1.0.14:1521:chncorp");
dataSource.setUsername("FAS");
dataSource.setPassword("FAS");
return dataSource;
}
} }

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

@ -13,6 +13,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import in.gov.chennaicorporation.gccoffice.service.CustomUserDetailsService; import in.gov.chennaicorporation.gccoffice.service.CustomUserDetailsService;
import in.gov.chennaicorporation.gccoffice.service.UserActivityService;
@Configuration @Configuration
@EnableWebSecurity @EnableWebSecurity
@ -20,6 +21,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
private final CustomUserDetailsService customUserDetailsService; private final CustomUserDetailsService customUserDetailsService;
@Autowired @Autowired
public SecurityConfig(CustomUserDetailsService customUserDetailsService) { public SecurityConfig(CustomUserDetailsService customUserDetailsService) {
this.customUserDetailsService = customUserDetailsService; this.customUserDetailsService = customUserDetailsService;
@ -29,7 +31,8 @@ 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/**" );
.antMatchers("/static/**", "/assets/**", "/api/**","/images/**","/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
} }
@ -41,23 +44,24 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// Configure authorization (URL-based access control) // Configure authorization (URL-based access control)
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http http
.cors().and() // Enable CORS .cors().and() // Enable CORS
.csrf().disable() // Disable CSRF protection for simplicity (Enable if needed) .csrf().disable() // Disable CSRF protection for simplicity (Enable if needed)
.authorizeRequests() .authorizeRequests()
.antMatchers("/error").permitAll()
.antMatchers("/login").permitAll() // Add the login URL
.antMatchers("/admin/**").hasRole("ADMIN") // Add the admin URLs
.antMatchers("/**").hasAnyRole("USER", "ADMIN") // Add other URLs
.antMatchers("/gcc/error").permitAll()
.antMatchers("/gcc/login").permitAll() // Add the login URL
.antMatchers("/gcc/admin/**").hasRole("ADMIN") // Add the admin URLs
.antMatchers("/gcc/**").hasAnyRole("USER", "ADMIN") // Add other URLs
.and() .and()
.formLogin() .formLogin()
.loginPage("/login") // Customize the login page URL
.defaultSuccessUrl("/") // Include the success URL
.loginPage("/gcc/login") // Customize the login page URL
.defaultSuccessUrl("/gcc") // Include the success URL
.permitAll() .permitAll()
.and() .and()
.logout() .logout()
.logoutUrl("/logout") // Include the logout URL
.logoutSuccessUrl("/login") // Include the success logout URL
.logoutUrl("/gcc/logout") // Include the logout URL
.logoutSuccessUrl("/gcc/login") // Include the success logout URL
.and() .and()
.sessionManagement() .sessionManagement()
.sessionFixation() .sessionFixation()

8
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/ThymeleafConfig.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.configuration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring5.SpringTemplateEngine;
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.templatemode.TemplateMode; import org.thymeleaf.templatemode.TemplateMode;
import org.thymeleaf.templateresolver.ITemplateResolver; import org.thymeleaf.templateresolver.ITemplateResolver;
@ -17,4 +18,11 @@ public class ThymeleafConfig {
templateResolver.setCacheable(false); // Disable template caching for development environment templateResolver.setCacheable(false); // Disable template caching for development environment
return templateResolver; return templateResolver;
} }
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
return templateEngine;
}
} }

10
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/WebMvcConfig.java

@ -5,6 +5,7 @@ import java.nio.file.Paths;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -28,6 +29,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
private MenuItemRepository menuItemRepository; private MenuItemRepository menuItemRepository;
private SubMenuItemRepository subMenuItemRepository; private SubMenuItemRepository subMenuItemRepository;
private final Environment environment;
@Autowired @Autowired
public WebMvcConfig( public WebMvcConfig(
@Value("${file.upload.directory}") String uploadDirectory, @Value("${file.upload.directory}") String uploadDirectory,
@ -36,7 +39,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
SubMenuItemAccessRepository subMenuItemAccessRepository, SubMenuItemAccessRepository subMenuItemAccessRepository,
AppModuleRepository appModuleRepository, AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository, MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository) {
SubMenuItemRepository subMenuItemRepository,
Environment environment) {
this.uploadDirectory = uploadDirectory; this.uploadDirectory = uploadDirectory;
this.appModuleAccessRepository = appModuleAccessRepository; this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository; this.menuItemAccessRepository = menuItemAccessRepository;
@ -44,6 +48,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
this.appModuleRepository = appModuleRepository; this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository; this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository; this.subMenuItemRepository = subMenuItemRepository;
this.environment = environment;
} }
@Override @Override
@ -55,7 +60,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
subMenuItemAccessRepository, subMenuItemAccessRepository,
appModuleRepository, appModuleRepository,
menuItemRepository, menuItemRepository,
subMenuItemRepository));
subMenuItemRepository,
environment));
} }
@Override @Override

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

@ -1,10 +1,337 @@
package in.gov.chennaicorporation.gccoffice.controller; package in.gov.chennaicorporation.gccoffice.controller;
import java.util.List;
import java.util.Map;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import org.hibernate.dialect.identity.GetGeneratedKeysDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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.RestController; import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api")
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity;
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppUserGroupRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppUserRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository;
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/gcc/api")
@RestController @RestController
public class APIController { public class APIController {
List<AppUserEntity> getAppUserEntities;
@Autowired
private AppUserRepository appUserRepository;
List<UserActivityLog> getActivityLogs;
@Autowired
private UserActivityLogRepository userActivityLogRepository;
List<AppModuleAccessEntity> getAppModuleAccessEntities;
List<MenuItemAccessEntity> getMenuItemAccessEntities;
List<SubMenuItemAccessEntity> getSubMenuItemAccessEntities;
@Autowired
private AppModuleAccessRepository appModuleAccessRepository;
@Autowired
private MenuItemAccessRepository menuItemAccessRepository;
@Autowired
private SubMenuItemAccessRepository subMenuItemAccessRepository;
List<AppModuleEntity> getAppModuleEntities;
List<MenuItemEntity> getMenuItemEntities;
List<SubMenuItemEntity> getSubMenuItemEntities;
@Autowired
private AppModuleRepository appModuleRepository;
@Autowired
private MenuItemRepository menuItemRepository;
@Autowired
private SubMenuItemRepository subMenuItemRepository;
@Autowired
public APIController(
AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository,
AppModuleAccessRepository appModuleAccessRepository,
MenuItemAccessRepository menuItemAccessRepository,
SubMenuItemAccessRepository subMenuItemAccessRepository,
UserActivityLogRepository userActivityLogRepository) {
this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository;
this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository;
this.subMenuItemAccessRepository = subMenuItemAccessRepository;
this.userActivityLogRepository = userActivityLogRepository;
}
@GetMapping(value="/getAccessTree")
public String getAccessTreeHTML(@RequestParam String groupId,@RequestParam String groupName) {
getAppModuleEntities = appModuleRepository.showAll();
String accessHTML = "";
String accessTableHTML = "";
String MenuHTML = "";
String isSelected = "";
//String subMenuHTML = "";
String groupNameHTML = "<span class=\"badge badge-pill badge-primary mb-1\">"+groupName+"</span>";
for (AppModuleEntity moduleName : getAppModuleEntities) {
// ID to check
Integer desiredId = moduleName.getId();
// Check if the ID exists in the list of entities
getAppModuleAccessEntities = appModuleAccessRepository.findByAll(groupId,desiredId.toString());
// Check Module Id Access
if (getAppModuleAccessEntities != null && !getAppModuleAccessEntities.isEmpty()) { isSelected = "checked"; } else { isSelected = ""; }
accessHTML = accessHTML+"<li><input id=\"m"+moduleName.getId()+"\" type=\"checkbox\" data-type=\"parent\" value=\"m_"+desiredId+"\" "+isSelected+"/>&nbsp;<label for=\"m"+moduleName.getId()+"\" style=\"background-color:#000;color:#fff;\">&nbsp;&nbsp;<i class=\""+moduleName.getIcon()+"\"></i> "+moduleName.getName()+"&nbsp;&nbsp;</label>";
getMenuItemEntities = menuItemRepository.getMenuItemByModuleId(moduleName.getId());
String subMenuHTML = "";
for (MenuItemEntity menuItem : getMenuItemEntities) {
String mmid = desiredId+"_"+menuItem.getId();
// Check if the ID exists in the list of entities
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(groupId, desiredId.toString(),menuItem.getId().toString());
// Check Module Id Access
if (getMenuItemAccessEntities != null && !getMenuItemAccessEntities.isEmpty()) { isSelected = "checked"; } else { isSelected = ""; }
if(menuItem.getHasSub()) {
getSubMenuItemEntities = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId());
String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getSubMenuItemEntities) {
String isSelected2 = "";
String smid = desiredId+"_"+menuItem.getId()+"_"+subMenuItem.getId();
// Check if the ID exists in the list of entities
getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(groupId, desiredId.toString(),menuItem.getId().toString(),subMenuItem.getId().toString());
// Check Module Id Access
if (getSubMenuItemAccessEntities != null && !getSubMenuItemAccessEntities.isEmpty()) { isSelected2 = "checked"; } else { isSelected2 = ""; }
subSubMenuHTML = subSubMenuHTML+"<li><input id=\"sm"+subMenuItem.getId()+"\" type=\"checkbox\" data-type=\"sub-child\" value=\"sm_"+smid+"\" "+isSelected2+"/>&nbsp;<label for=\"sm"+subMenuItem.getId()+"\"><i class=\""+subMenuItem.getIcon()+"\"></i> "+subMenuItem.getName()+"</label></li>";
}
if(subSubMenuHTML.equals(""))
{
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" value=\"mm_"+mmid+"\" "+isSelected+"/>&nbsp;<label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>";
}
else {
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" value=\"mm_"+mmid+"\" "+isSelected+"/>&nbsp;<label for=\"mm"+menuItem.getId()+"\">&nbsp;<i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label> <ul>"+subSubMenuHTML+"</ul></li>";
}
}
else {
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" value=\"mm_"+mmid+"\" "+isSelected+"/>&nbsp;<label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>";
}
}
accessHTML = accessHTML+"<ul>"+subMenuHTML+"</ul></li>";
subMenuHTML = "";
}
accessTableHTML = groupNameHTML+"<ul id=\"tree\" class=\"checktree\" style=\"padding-left:25px;\" >"+accessHTML+"</ul>";
return accessTableHTML;
}
@PostMapping("/saveGroupAccessData")
public String saveGroupAccessData(@RequestBody Map<String, Object> requestBody) {
@SuppressWarnings("unchecked")
List<String> checkedData = (List<String>) requestBody.get("checkedData");
String groupId = (String) requestBody.get("groupId");
String dataType[]= {"","", "module","menu","submenu"};
if (groupId != null) {
System.out.println("groupid value: " + groupId);
// Set isActive = false based on groupId
appModuleAccessRepository.updateActiveStatus(false,groupId);
menuItemAccessRepository.updateActiveStatus(false,groupId);
subMenuItemAccessRepository.updateActiveStatus(false,groupId);
// Now update as per input data
if (checkedData != null) {
for (String data : checkedData) {
System.out.println(data);
// m_x -> Module Value (moduleId) -> 2
// mm_x_x -> Menu Value (moduleId,menuId) ->3
// sm_x_x_x -> SubMenu Value (moduleId, menuId, submenuId) ->4
String[] dataValue = data.split("_");
Integer dataLength = dataValue.length;
System.out.println(dataLength +" ==> "+dataType[dataLength]);
if(dataValue.length==2) { // Module
// Check if the ID exists in the list of entities
getAppModuleAccessEntities = appModuleAccessRepository.findByAll(groupId, dataValue[1]);
if (getAppModuleAccessEntities != null && !getAppModuleAccessEntities.isEmpty()) {
appModuleAccessRepository.update(true,groupId,dataValue[1]);
}
else {
appModuleAccessRepository.insert(groupId,dataValue[1]);
}
}
else if(dataValue.length==3) { // Menu
// Check if the ID exists in the list of entities
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(groupId, dataValue[1], dataValue[2]);
if (getMenuItemAccessEntities != null && !getMenuItemAccessEntities.isEmpty()) {
menuItemAccessRepository.update(true,groupId,dataValue[1],dataValue[2]);
}
else {
menuItemAccessRepository.insert(groupId,dataValue[1],dataValue[2]);
}
}
else if(dataValue.length==4) { // SubMenu
// Check if the ID exists in the list of entities
getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(groupId, dataValue[1], dataValue[2], dataValue[3]);
if (getSubMenuItemAccessEntities != null && !getSubMenuItemAccessEntities.isEmpty()) {
subMenuItemAccessRepository.update(true,groupId,dataValue[1],dataValue[2],dataValue[3]);
}
else {
subMenuItemAccessRepository.insert(groupId,dataValue[1],dataValue[2],dataValue[3]);
}
}
}
}
}
return "";
}
@GetMapping(value="/getUserProfile")
public String getUserProfile(@RequestParam String userId) {
String userHtml ="";
String userProfileHtml ="";
String userProfileTimelineHtml ="";
getAppUserEntities = appUserRepository.showById(userId);
for (AppUserEntity appUserEntity : getAppUserEntities) {
userProfileHtml = ""
+ " <div class='col-lg-4 col-md-5'>"
+ " <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"
+ " </div>";
userProfileTimelineHtml = ""
+ "<div class='col-lg-8 col-md-7'>"
+ " <div class='card'>"
+ " <ul class='nav nav-pills custom-pills' id='pills-tab' role='tablist'>"
+ " <li class='nav-item'>"
+ " <a class='nav-link active' id='pills-timeline-tab' data-toggle='pill' href='#current-month' role='tab' aria-controls='pills-timeline' aria-selected='true'>Timeline</a>"
+ " </li>"
+ " <li class='nav-item'>"
+ " <a class='nav-link' id='pills-profile-tab' data-toggle='pill' href='#last-month' role='tab' aria-controls='pills-profile' aria-selected='false'>Profile</a>"
+ " </li>"
+ " </ul>"
+ " <div class='tab-content' id='pills-tabContent'>"
+ " <div class='tab-pane fade active show' id='current-month' role='tabpanel' aria-labelledby='pills-timeline-tab'>"
+ userTimeLine(appUserEntity.getUserid().getUserid().toString(),appUserEntity.getUserid().getName(),"user.jpg")
+ " </div>"
+ " </div>"
+ " </div>"
+ "</div>";
userHtml ="<div class='row'>" + userProfileHtml + userProfileTimelineHtml + "</div>";
}
return userHtml;
}
public String userTimeLine(String userid, String userName, String img) {
String userTimeLineHTML = "";
getActivityLogs = userActivityLogRepository.findByUserIdOrderByTimestampDesc(userid);
for (UserActivityLog userActivityLog : getActivityLogs) {
userTimeLineHTML += ""
+ " <div class='sl-item'>"
+ " <div class='sl-left'> "
+ " <img src='/assets/images/users/"+img+"' alt='user' class='rounded-circle'> "
+ " </div>"
+ " <div class='sl-right'>"
+ " <div>"
+ " <a href='javascript:void(0)' class='link'>"+userName+"</a> "
+ " <span class='sl-date'>"+dateFormat(userActivityLog.getTimestamp().toString())+"</span>"
+ " <blockquote class='mt-10'>"
+ " "+userActivityLog.getActivityType()
+ " </blockquote>"
+ " </div>"
+ " </div>"
+ " </div><hr>";
}
userTimeLineHTML = ""
+ "<div class='card-body'>"
+ " <div class='profiletimeline mt-0'>"
+ userTimeLineHTML
+ " </div>"
+ "</div>";
return userTimeLineHTML;
}
public String dateFormat(String timestampString) {
//String timestampString = "2023-12-28T16:21:24";
LocalDateTime timestamp = LocalDateTime.parse(timestampString, DateTimeFormatter.ISO_DATE_TIME);
// Define the desired date-time format
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy hh:mm a");
// Format the timestamp
String formattedTimestamp = timestamp.format(formatter);
//System.out.println(formattedTimestamp);
return formattedTimestamp.toUpperCase();
}
} }

167
src/main/java/in/gov/chennaicorporation/gccoffice/controller/AdminController.java

@ -0,0 +1,167 @@
package in.gov.chennaicorporation.gccoffice.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppUserGroupEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppUserGroupRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppUserRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/gcc/admin")
@Controller("gccAdminController")
public class AdminController {
private final LoginUserInfo loginUserInfo;
private final AppUserRepository appUserRepository;
private final AppUserGroupRepository appUserGroupRepository;
private final AppModuleRepository appModuleRepository;
private final MenuItemRepository menuItemRepository;
private final SubMenuItemRepository subMenuItemRepository;
private final AppModuleAccessRepository appModuleAccessRepository;
private final MenuItemAccessRepository menuItemAccessRepository;
private final SubMenuItemAccessRepository subMenuItemAccessRepository;
@Autowired
public AdminController(LoginUserInfo loginUserInfo,
AppUserRepository appUserRepository,
AppUserGroupRepository appUserGroupRepository,
AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository,
AppModuleAccessRepository appModuleAccessRepository,
MenuItemAccessRepository menuItemAccessRepository,
SubMenuItemAccessRepository subMenuItemAccessRepository) {
this.loginUserInfo = loginUserInfo;
this.appUserRepository = appUserRepository;
this.appUserGroupRepository = appUserGroupRepository;
this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository;
this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository;
this.subMenuItemAccessRepository = subMenuItemAccessRepository;
}
@GetMapping({"", "/", "/index"})
public String main(Model model) {
String userId = LoginUserInfo.getLoginUserId();
if (userId != null && !userId.isEmpty()) {
System.out.println("String UserID: " + userId);
}
return "modules/admin/index";
}
@GetMapping("/user-list")
public String userList(Model model) {
model.addAttribute("userlist",getUser());
return "modules/admin/user-list";
}
@GetMapping("/user-group-list")
public String userGroupList(Model model) {
model.addAttribute("userGroupList",getUserGroup());
return "modules/admin/user-group-list";
}
@GetMapping("/user-group-access")
public String userGroupAccess(Model model) {
String accessTableHTML = getAccessTreeHTML();
model.addAttribute("userGroupList",getUserGroup());
model.addAttribute("accessHTML",accessTableHTML);
return "modules/admin/user-group-access";
}
//////////////////////////////////////// (Functions) ////////////////////////////////////////
public List<AppUserEntity> getUser() {
List<AppUserEntity> appUserEntities;
appUserEntities = appUserRepository.showAll();
return appUserEntities;
}
public List<AppUserGroupEntity> getUserGroup() {
List<AppUserGroupEntity> appUserGroupEntities;
appUserGroupEntities = appUserGroupRepository.findAll();
return appUserGroupEntities;
}
public String getAccessTreeHTML() {
List<AppModuleAccessEntity> getAppModuleAccessEntities;
List<AppModuleEntity> getAppModuleEntities;
getAppModuleEntities = appModuleRepository.showAll();
String accessHTML = "";
String accessTableHTML = "";
String MenuHTML = "";
//String subMenuHTML = "";
for (AppModuleEntity moduleName : getAppModuleEntities) {
accessHTML = accessHTML+"<li><input id=\"m"+moduleName.getId()+"\" type=\"checkbox\" data-type=\"parent\" value=\"\"/>&nbsp;<label for=\"m"+moduleName.getId()+"\" style=\"background-color:#000;color:#fff;\">&nbsp;&nbsp;<i class=\""+moduleName.getIcon()+"\"></i> "+moduleName.getName()+"&nbsp;&nbsp;</label>";
List<MenuItemEntity> getMenuItems;
getMenuItems = menuItemRepository.getMenuItemByModuleId(moduleName.getId());
String subMenuHTML = "";
for (MenuItemEntity menuItem : getMenuItems) {
if(menuItem.getHasSub()) {
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId());
String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
subSubMenuHTML = subSubMenuHTML+"<li><input id=\"sm"+subMenuItem.getId()+"\" type=\"checkbox\" data-type=\"sub-child\"/> <label for=\"sm"+subMenuItem.getId()+"\"><i class=\""+subMenuItem.getIcon()+"\"></i> "+subMenuItem.getName()+"</label></li>";
}
if(subSubMenuHTML.equals(""))
{
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" /> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>";
}
else {
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\"/> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label> <ul>"+subSubMenuHTML+"</ul></li>";
}
}
else {
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\"/> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>";
}
}
accessHTML = accessHTML+"<ul>"+subMenuHTML+"</ul></li>";
subMenuHTML = "";
}
accessTableHTML = "<ul id=\"tree\" class=\"checktree\">"+accessHTML+"</ul>";
return accessTableHTML;
}
}

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

@ -4,10 +4,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; 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 in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
//@RequestMapping("/mtmtest")
@RequestMapping("/gcc")
@Controller("gccOfficeController") @Controller("gccOfficeController")
public class MainController { public class MainController {
private final LoginUserInfo loginUserInfo; private final LoginUserInfo loginUserInfo;

6
src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java

@ -103,7 +103,7 @@ public class MenuController {
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId()); List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId());
String subSubMenuHTML = ""; String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) { for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
subSubMenuHTML = subSubMenuHTML+"<a href=\"/"+subMenuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
subSubMenuHTML = subSubMenuHTML+"<a href=\"/gcc/"+subMenuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
} }
if(subSubMenuHTML.equals("")) if(subSubMenuHTML.equals(""))
{ {
@ -128,7 +128,7 @@ public class MenuController {
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemIdAccess(menuItem.getId(),checkSubMenuId); List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemIdAccess(menuItem.getId(),checkSubMenuId);
String subSubMenuHTML = ""; String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) { for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
subSubMenuHTML = subSubMenuHTML+"<a href=\"/"+subMenuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
subSubMenuHTML = subSubMenuHTML+"<a href=\"/gcc/"+subMenuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
} }
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a><div class=\"submenu-content\">"+subSubMenuHTML+"</div></div>"; subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a><div class=\"submenu-content\">"+subSubMenuHTML+"</div></div>";
} }
@ -139,7 +139,7 @@ public class MenuController {
} }
else { else {
subMenuHTML = subMenuHTML+"<a href=\"/"+menuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i><span>"+menuItem.getName()+"</span></a>";
subMenuHTML = subMenuHTML+"<a href=\"/gcc/"+menuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i><span>"+menuItem.getName()+"</span></a>";
} }
} }

5
src/main/java/in/gov/chennaicorporation/gccoffice/controller/login.java

@ -3,8 +3,9 @@ package in.gov.chennaicorporation.gccoffice.controller;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
//@RequestMapping("/mtmtest")
@Controller
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/gcc")
@Controller("gccLoginController")
public class login { public class login {
@GetMapping("/login") @GetMapping("/login")
public String home(Model model) { public String home(Model model) {

5
src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleAccessEntity.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -17,11 +18,11 @@ public class AppModuleAccessEntity {
@Column(name = "id",nullable = false) @Column(name = "id",nullable = false)
private Integer id; private Integer id;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "usergroup_id", referencedColumnName = "id") @JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity userGroupId; private AppUserGroupEntity userGroupId;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "module_id", referencedColumnName = "id") @JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId; private AppModuleEntity moduleId;

6
src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserEntity.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -17,11 +18,11 @@ public class AppUserEntity {
@Column(name = "id",nullable = false) @Column(name = "id",nullable = false)
private Integer id; private Integer id;
@ManyToOne
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "userid", referencedColumnName = "userid") @JoinColumn(name = "userid", referencedColumnName = "userid")
private UserInfoEntity userid; private UserInfoEntity userid;
@ManyToOne
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "usergroup_id", referencedColumnName = "id") @JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity usergroup_id; private AppUserGroupEntity usergroup_id;
@ -51,6 +52,7 @@ public class AppUserEntity {
} }
public Integer getId() { public Integer getId() {
return id; return id;
} }

5
src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemAccessEntity.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -17,11 +18,11 @@ public class MenuItemAccessEntity {
@Column(name = "id",nullable = false) @Column(name = "id",nullable = false)
private Integer id; private Integer id;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "usergroup_id", referencedColumnName = "id") @JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity userGroupId; private AppUserGroupEntity userGroupId;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "menuitem_id", referencedColumnName = "id") @JoinColumn(name = "menuitem_id", referencedColumnName = "id")
private MenuItemEntity menuItemId; private MenuItemEntity menuItemId;

3
src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemEntity.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -17,7 +18,7 @@ public class MenuItemEntity {
@Column(name = "id",nullable = false) @Column(name = "id",nullable = false)
private Integer id; private Integer id;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "module_id", referencedColumnName = "id") @JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId; private AppModuleEntity moduleId;

9
src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemAccessEntity.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -17,19 +18,19 @@ public class SubMenuItemAccessEntity {
@Column(name = "id",nullable = false) @Column(name = "id",nullable = false)
private Integer id; private Integer id;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "usergroup_id", referencedColumnName = "id") @JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity userGroupId; private AppUserGroupEntity userGroupId;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "submenuitem_id", referencedColumnName = "id") @JoinColumn(name = "submenuitem_id", referencedColumnName = "id")
private SubMenuItemEntity subMenuItemId; private SubMenuItemEntity subMenuItemId;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "module_id", referencedColumnName = "id") @JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId; private AppModuleEntity moduleId;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "menuitem_id", referencedColumnName = "id") @JoinColumn(name = "menuitem_id", referencedColumnName = "id")
private MenuItemEntity menuItemId; private MenuItemEntity menuItemId;

5
src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemEntity.java

@ -2,6 +2,7 @@ package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -17,11 +18,11 @@ public class SubMenuItemEntity {
@Column(name = "id",nullable = false) @Column(name = "id",nullable = false)
private Integer id; private Integer id;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "module_id", referencedColumnName = "id") @JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId; private AppModuleEntity moduleId;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "menuitem_id", referencedColumnName = "id") @JoinColumn(name = "menuitem_id", referencedColumnName = "id")
private MenuItemEntity menuItemId; private MenuItemEntity menuItemId;

56
src/main/java/in/gov/chennaicorporation/gccoffice/entity/UserActivityLog.java

@ -0,0 +1,56 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.*;
import java.time.LocalDateTime;
@Entity
@Table(name = "user_activity_log")
public class UserActivityLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String userId;
private String activityType;
private LocalDateTime timestamp;
public UserActivityLog() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getActivityType() {
return activityType;
}
public void setActivityType(String activityType) {
this.activityType = activityType;
}
public LocalDateTime getTimestamp() {
return timestamp;
}
public void setTimestamp(LocalDateTime timestamp) {
this.timestamp = timestamp;
}
}

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

@ -1,6 +1,7 @@
package in.gov.chennaicorporation.gccoffice.interceptor; package in.gov.chennaicorporation.gccoffice.interceptor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
@ -46,13 +47,17 @@ public class AppInterceptor implements HandlerInterceptor {
private MenuItemRepository menuItemRepository; private MenuItemRepository menuItemRepository;
private SubMenuItemRepository subMenuItemRepository; private SubMenuItemRepository subMenuItemRepository;
private final Environment environment;
@Autowired @Autowired
public AppInterceptor(AppModuleAccessRepository appModuleAccessRepository, public AppInterceptor(AppModuleAccessRepository appModuleAccessRepository,
MenuItemAccessRepository menuItemAccessRepository, MenuItemAccessRepository menuItemAccessRepository,
SubMenuItemAccessRepository subMenuItemAccessRepository, SubMenuItemAccessRepository subMenuItemAccessRepository,
AppModuleRepository appModuleRepository, AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository, MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository) {
SubMenuItemRepository subMenuItemRepository,
Environment environment) {
this.appModuleAccessRepository = appModuleAccessRepository; this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository; this.menuItemAccessRepository = menuItemAccessRepository;
@ -61,15 +66,17 @@ public class AppInterceptor implements HandlerInterceptor {
this.appModuleRepository = appModuleRepository; this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository; this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository; this.subMenuItemRepository = subMenuItemRepository;
this.environment = environment;
} }
private boolean isLoginPage(HttpServletRequest request) { private boolean isLoginPage(HttpServletRequest request) {
RequestMatcher loginPageMatcher = new AntPathRequestMatcher("/login");
RequestMatcher loginPageMatcher = new AntPathRequestMatcher("/gcc/login");
return loginPageMatcher.matches(request); return loginPageMatcher.matches(request);
} }
private boolean isErrorPage(HttpServletRequest request) { private boolean isErrorPage(HttpServletRequest request) {
RequestMatcher errorPageMatcher = new AntPathRequestMatcher("/error");
RequestMatcher errorPageMatcher = new AntPathRequestMatcher("/gcc/error");
return errorPageMatcher.matches(request); return errorPageMatcher.matches(request);
} }
@ -177,10 +184,16 @@ public class AppInterceptor implements HandlerInterceptor {
} }
private boolean hasAccess(String path) { private boolean hasAccess(String path) {
String userRole = LoginUserInfo.getUserRole();
if (userRole != null && userRole.equals("ADMIN")) {
return true;
}
/*
if(LoginUserInfo.getUserRole().equals("ADMIN")) { if(LoginUserInfo.getUserRole().equals("ADMIN")) {
return true; return true;
} }
*/
String url = removeLeadingSlash(path); String url = removeLeadingSlash(path);
System.out.println("Give URL : "+path+" After remove leading slash : "+url); System.out.println("Give URL : "+path+" After remove leading slash : "+url);
@ -197,7 +210,7 @@ public class AppInterceptor implements HandlerInterceptor {
System.out.println(parts.length); System.out.println(parts.length);
if(parts.length>0) {
if(parts.length>1) {
int j=0; int j=0;
for (String part : parts) { for (String part : parts) {
System.out.println(j+") URL SPLIT: "+part); System.out.println(j+") URL SPLIT: "+part);
@ -206,8 +219,8 @@ public class AppInterceptor implements HandlerInterceptor {
String moduleName = ""; String moduleName = "";
String menuName = ""; String menuName = "";
String subMenuName = ""; String subMenuName = "";
if(parts.length==1) { // Check Only Module Access
moduleName = parts[0];
if(parts.length==2) { // Check Only Module Access
moduleName = parts[1];
return hasModuleAccess(moduleName); return hasModuleAccess(moduleName);
} }
else if(parts.length==2) { // Check Module & Menu Access else if(parts.length==2) { // Check Module & Menu Access
@ -236,6 +249,8 @@ public class AppInterceptor implements HandlerInterceptor {
@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");
request.setAttribute("assetsBaseUrl", assetsBaseUrl);
if (!isLoginPage(request) && !isErrorPage(request) && !isfavicon(request)) { if (!isLoginPage(request) && !isErrorPage(request) && !isfavicon(request)) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
@ -244,10 +259,10 @@ public class AppInterceptor implements HandlerInterceptor {
String contextPath = request.getContextPath(); String contextPath = request.getContextPath();
String path = fullRequestURI.substring(contextPath.length()); String path = fullRequestURI.substring(contextPath.length());
if(!hasAccess(path)) { if(!hasAccess(path)) {
Object principal = authentication.getPrincipal();
UserDetails userDetails = (UserDetails) principal;
//Object principal = authentication.getPrincipal();
//UserDetails userDetails = (UserDetails) principal;
System.out.println("1) Access Deny For --- " + userDetails.getAuthorities().toString());
//System.out.println("1) Access Deny For --- " + userDetails.getAuthorities().toString());
// Redirect to the error page // Redirect to the error page
//response.sendRedirect(request.getContextPath() + "/error"); //response.sendRedirect(request.getContextPath() + "/error");
request.getRequestDispatcher("/error").forward(request, response); request.getRequestDispatcher("/error").forward(request, response);
@ -265,6 +280,9 @@ public class AppInterceptor implements HandlerInterceptor {
// Check if the current request matches the login or error page URLs // Check if the current request matches the login or error page URLs
if (!isLoginPage(request) && !isErrorPage(request) && !isfavicon(request)) { if (!isLoginPage(request) && !isErrorPage(request) && !isfavicon(request)) {
if (modelAndView != null) { if (modelAndView != null) {
String assetsBaseUrl = environment.getProperty("assets.base-url");
request.setAttribute("assetsBaseUrl", assetsBaseUrl);
modelAndView.addObject("assetsBaseUrl", assetsBaseUrl);
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated()) { if (authentication != null && authentication.isAuthenticated()) {
Object principal = authentication.getPrincipal(); Object principal = authentication.getPrincipal();

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

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

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

@ -23,7 +23,7 @@ import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback; import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/mtm")
@RequestMapping("/gcc/mtm")
@Controller("mtmController") @Controller("mtmController")
public class MainController { public class MainController {

2
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MayorController.java

@ -19,7 +19,7 @@ import in.gov.chennaicorporation.gccoffice.mtm.data.Petition;
import in.gov.chennaicorporation.gccoffice.mtm.data.PetitionComplaint; import in.gov.chennaicorporation.gccoffice.mtm.data.PetitionComplaint;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/mtm/mayor")
@RequestMapping("/gcc/mtm/mayor")
@Controller("mtmMayorController") @Controller("mtmMayorController")
public class MayorController { public class MayorController {

2
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/OfficerController.java

@ -20,7 +20,7 @@ import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQu
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion; import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback; import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
@RequestMapping("/mtm/officer")
@RequestMapping("/gcc/mtm/officer")
@Controller("mtmOfficerController") @Controller("mtmOfficerController")
public class OfficerController { public class OfficerController {

94
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/APIController.java

@ -0,0 +1,94 @@
package in.gov.chennaicorporation.gccoffice.pgr.controller;
import java.net.URLDecoder;
import java.io.UnsupportedEncodingException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import in.gov.chennaicorporation.gccoffice.pgr.service.PGRCommon;
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository;
@RequestMapping("/gcc/api/pgr")
@RestController("pgrRest")
public class APIController {
private PGRCommon pgrCommon;
@Autowired
public APIController(PGRCommon pgrCommon) {
this.pgrCommon = pgrCommon;
}
@GetMapping(value="/getDepartments")
public List getDepartmentList() {
return pgrCommon.getDeaprtmentList();
}
@GetMapping(value="/getPendingComplaintCount")
public List getPendingComplaintCount() {
return pgrCommon.getPendingComplanitCount();
}
@GetMapping(value="/getZoneWisePendingComplaintCount")
public List getZoneWisePendingComplaintCount() {
return pgrCommon.getZoneWisePendingComplanitCount();
}
@GetMapping(value="/getZoneWiseReopenComplaintCount")
public List getZoneWiseReopenComplaintCount() {
return pgrCommon.getZoneWiseReopenComplanitCount();
}
@GetMapping(value="/getComplaintsList")
public List getComplaintsList() {
return pgrCommon.getComplaintsList();
}
@GetMapping(value="/getQaQcList")
public List getQaQcList() {
return pgrCommon.getQaQcList();
}
@GetMapping(value="/getZoneWiseComplaintCountList")
public List getZoneWiseComplaintList() {
return pgrCommon.getZoneWiseComplaintCountList();
}
@GetMapping(value="/getZoneWiseWithoutReopenComplaintList")
public List getZoneWiseWithoutReopenComplaintList() {
return pgrCommon.getZoneWiseWithoutReopenComplaintCountList();
}
@GetMapping(value="/getComplaintDetails")
public List getComplaintDetails(@RequestParam("complaintNumber") String complaintNumber) {
return pgrCommon.getComplaintDetails(complaintNumber);
}
// For Sub Pages
@GetMapping(value="/getZoneWiseOfficerComplaintCountList")
public List getZoneWiseOfficerComplaintCountList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype) {
return pgrCommon.getZoneWiseOfficerComplaintCountList(deptid, complainttype);
}
@GetMapping(value="/getZoneWiseOfficerComplaintList")
public List getZoneWiseOfficerComplaintList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype, @RequestParam("iduser") String iduser) {
return pgrCommon.getZoneWiseOfficerComplaintList(deptid, complainttype,iduser);
}
@GetMapping(value="/getZoneWiseOfficerWithoutReopenComplaintCountList")
public List getZoneWiseOfficerWithoutReopenComplaintCountList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype) {
return pgrCommon.getZoneWiseOfficerWithoutReopenComplaintCountList(deptid, complainttype);
}
@GetMapping(value="/getZoneWiseOfficerWithoutReopenComplaintList")
public List getZoneWiseOfficerWithoutReopenComplaintList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype, @RequestParam("iduser") String iduser) {
return pgrCommon.getZoneWiseOfficerWithoutReopenComplaintList(deptid, complainttype,iduser);
}
}

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

@ -0,0 +1,57 @@
package in.gov.chennaicorporation.gccoffice.pgr.controller;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import in.gov.chennaicorporation.gccoffice.pgr.service.PGRCommon;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/gcc/pgr")
@Controller("pgrController")
public class MainController {
private final LoginUserInfo loginUserInfo;
private final PGRCommon dashboards;
@Autowired
public MainController(LoginUserInfo loginUserInfo,
PGRCommon dashboards) {
this.loginUserInfo = loginUserInfo;
this.dashboards = dashboards;
}
@GetMapping({"", "/", "/index"})
public String main(Model model) {
String userId = LoginUserInfo.getLoginUserId();
if (userId != null && !userId.isEmpty()) {
System.out.println("String UserID: " + userId);
}
return "modules/pgr/index";
}
@GetMapping("/all-list")
public String allList(Model model) {
return "modules/pgr/all-list";
}
@GetMapping("/qa-qc-list")
public String qaqcList(Model model) {
return "modules/pgr/qa-qc-list";
}
@GetMapping("/zone-wise-with-reopen")
public String zoneWiseWithReopnList(Model model) {
return "modules/pgr/zone-wise-with-reopen";
}
@GetMapping("/zone-wise-without-reopen")
public String zoneWiseWithoutReopnList(Model model) {
return "modules/pgr/zone-wise-without-reopen";
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.pgr.controller;

35
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/data/Departments.java

@ -0,0 +1,35 @@
package in.gov.chennaicorporation.gccoffice.pgr.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Departments {
private String id;
private String name;
@JsonCreator
public Departments(
@JsonProperty("id") String id,
@JsonProperty("name") String name
) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/data/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.pgr.data;

1
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.pgr;

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

@ -0,0 +1,470 @@
package in.gov.chennaicorporation.gccoffice.pgr.service;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@Service
public class PGRCommon {
private JdbcTemplate jdbcTemplate;
@Autowired
public void setDataSource(@Qualifier("oracleDataSource") DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
@Transactional
public List<Map<String, Object>> getDeaprtmentList() {
String SqlQuery = "";
SqlQuery="SELECT Distinct id_dept,dept_name "
+ "FROM EG_DEPARTMENT@ERP "
+ "WHERE NVL(dept_name, '0') NOT LIKE 'F%' AND dept_name IS NOT NULL "
+ "ORDER BY id_dept";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneList() {
String SqlQuery = "";
SqlQuery="SELECT Distinct id_dept,dept_name "
+ "FROM EG_DEPARTMENT@ERP "
+ "WHERE NVL(dept_name, '0') NOT LIKE 'F%' AND dept_name IS NOT NULL AND (id_dept >= 32 AND id_dept <= 46)"
+ "ORDER BY id_dept";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getPendingComplanitCount() {
String SqlQuery = "";
SqlQuery = "SELECT c.dept_name, a.deptid, a.days_90, a.days_90_pen, a.days_90_reopen, "
+ "a.days_61_90, a.days_61_90_pen, a.days_61_90_reopen, "
+ "a.days_31_60, a.days_31_60_pen, a.days_31_60_reopen, "
+ "a.days_16_30, a.days_16_30_pen, a.days_16_30_reopen, "
+ "a.days_0_15, a.days_0_15_pen, a.days_0_15_reopen, "
+ "a.Total, a.Total_pen, a.Total_reopen "
+ "FROM ( "
+ "SELECT "
+ "a.deptid, "
+ "nvl(sum(case when sysdate - a.complaintdate > 90 then 1 end), '0') AS days_90, "
+ "nvl(sum(case when sysdate - a.complaintdate > 90 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_90_pen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 90 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_90_reopen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 60 AND sysdate - a.complaintdate <= 90 then 1 end), '0') AS days_61_90, "
+ "nvl(sum(case when sysdate - a.complaintdate > 60 AND sysdate - a.complaintdate <= 90 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_61_90_pen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 60 AND sysdate - a.complaintdate <= 90 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_61_90_reopen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 30 AND sysdate - a.complaintdate <= 60 then 1 end), '0') AS days_31_60, "
+ "nvl(sum(case when sysdate - a.complaintdate > 30 AND sysdate - a.complaintdate <= 60 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_31_60_pen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 30 AND sysdate - a.complaintdate <= 60 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_31_60_reopen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 15 AND sysdate - a.complaintdate <= 30 then 1 end), '0') AS days_16_30, "
+ "nvl(sum(case when sysdate - a.complaintdate > 15 AND sysdate - a.complaintdate <= 30 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_16_30_pen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 15 AND sysdate - a.complaintdate <= 30 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_16_30_reopen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 0 AND sysdate - a.complaintdate <= 15 then 1 end), '0') AS days_0_15, "
+ "nvl(sum(case when sysdate - a.complaintdate > 0 AND sysdate - a.complaintdate <= 15 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_0_15_pen, "
+ "nvl(sum(case when sysdate - a.complaintdate > 0 AND sysdate - a.complaintdate <= 15 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_0_15_reopen, "
+ "nvl(count(*), '0') AS Total, "
+ "nvl(count(case when b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS Total_pen, "
+ "nvl(count(case when b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS Total_reopen "
+ "FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b "
+ "WHERE a.complaintid = b.complaintid ";
//25-oct-2010
SqlQuery += " AND a.complaintdate >= '25-oct-2010' GROUP BY a.deptid) a, EG_DEPARTMENT@ERP c "
+ "WHERE a.deptid = c.id_dept AND (NVL(DEPT_NAME, 0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL)";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWisePendingComplanitCount() {
String SqlQuery = "";
SqlQuery = "SELECT deptid, DEPT_NAME"
+ ", NVL(SUM(CASE WHEN complainttype IN (52,146) THEN 1 END), 0) AS NonBURSTLT"
+ ", NVL(SUM(CASE WHEN complainttype IN (1,97) THEN 1 END), 0) AS REOFGAR"
+ ", NVL(SUM(CASE WHEN complainttype IN (22,32,57,59,70,113,114,130,145) THEN 1 END), 0) AS ROAD"
+ ", NVL(SUM(CASE WHEN complainttype IN (18,118) THEN 1 END), 0) AS MOSQUITE"
+ ", NVL(SUM(CASE WHEN complainttype IN (69,138) THEN 1 END), 0) AS WATER"
+ ", NVL(SUM(CASE WHEN complainttype IN (7,99) THEN 1 END), 0) AS REOFDEB"
+ ", NVL(SUM(CASE WHEN complainttype IN (71,152) THEN 1 END), 0) AS TREE"
+ ", NVL(SUM(CASE WHEN complainttype IN (19,119) THEN 1 END), 0) AS DOGS"
+ ", NVL(SUM(CASE WHEN complainttype IN (75,181) THEN 1 END), 0) AS ENCMTN"
+ ", NVL(SUM(CASE WHEN complainttype IN (58,112) THEN 1 END), 0) AS POT"
+ ", NVL(SUM(CASE WHEN complainttype IN (43,166) THEN 1 END), 0) AS PTAX"
+ ", NVL(SUM(CASE WHEN complainttype NOT IN (52,146,1,97,22,32,57,59,70,113,114,130,145,18,118,69,138,7,99,71,152,19,119,75,181,58,112,43,166) THEN 1 END), 0) AS OTHERS"
+ ", COUNT(*) AS Total FROM "
+ "eggr_complaintdetails@erp a"
+ ", eggr_redressaldetails@erp b"
+ ", EG_DEPARTMENT@ERP c "
+ "WHERE a.complaintdate >= '01-apr-2009' "
+ "AND a.complaintid = b.complaintid "
+ "AND b.COMPLAINTSTATUSID IN (2,3,4,9) "
+ "AND a.deptid = c.id_dept "
+ "AND (NVL(DEPT_NAME, 0) NOT LIKE 'F%' "
+ "AND DEPT_NAME IS NOT NULL) "
+ "GROUP BY a.deptid,c.DEPT_NAME ORDER BY a.deptid";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseReopenComplanitCount() {
String SqlQuery = "";
SqlQuery = "SELECT deptid, DEPT_NAME"
+ ", NVL(SUM(CASE WHEN complainttype IN (52,146) THEN 1 END), 0) AS NonBURSTLT"
+ ", NVL(SUM(CASE WHEN complainttype IN (1,97) THEN 1 END), 0) AS REOFGAR"
+ ", NVL(SUM(CASE WHEN complainttype IN (22,32,57,59,70,113,114,130,145) THEN 1 END), 0) AS ROAD"
+ ", NVL(SUM(CASE WHEN complainttype IN (18,118) THEN 1 END), 0) AS MOSQUITE"
+ ", NVL(SUM(CASE WHEN complainttype IN (69,138) THEN 1 END), 0) AS WATER"
+ ", NVL(SUM(CASE WHEN complainttype IN (7,99) THEN 1 END), 0) AS REOFDEB"
+ ", NVL(SUM(CASE WHEN complainttype IN (71,152) THEN 1 END), 0) AS TREE"
+ ", NVL(SUM(CASE WHEN complainttype IN (19,119) THEN 1 END), 0) AS DOGS"
+ ", NVL(SUM(CASE WHEN complainttype IN (75,181) THEN 1 END), 0) AS ENCMTN"
+ ", NVL(SUM(CASE WHEN complainttype IN (58,112) THEN 1 END), 0) AS POT"
+ ", NVL(SUM(CASE WHEN complainttype IN (43,166) THEN 1 END), 0) AS PTAX"
+ ", NVL(SUM(CASE WHEN complainttype NOT IN (52,146,1,97,22,32,57,59,70,113,114,130,145,18,118,69,138,7,99,71,152,19,119,75,181,58,112,43,166) THEN 1 END), 0) AS OTHERS"
+ ", COUNT(*) AS Total FROM "
+ "eggr_complaintdetails@erp a"
+ ", eggr_redressaldetails@erp b"
+ ", EG_DEPARTMENT@ERP c "
+ "WHERE a.complaintdate >= '01-apr-2009' "
+ "AND a.complaintid = b.complaintid "
+ "AND b.COMPLAINTSTATUSID IN (9) "
+ "AND a.deptid = c.id_dept "
+ "AND (NVL(DEPT_NAME, 0) NOT LIKE 'F%' "
+ "AND DEPT_NAME IS NOT NULL) "
+ "GROUP BY a.deptid,c.DEPT_NAME ORDER BY a.deptid";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getComplaintsList() {
String SqlQuery = "";
SqlQuery ="SELECT z.name AS zone_name, "
+ " dn.name AS division_name, "
+ " location.name AS location, "
+ " d.dept_name, "
+ " TO_CHAR(cd.complaintdate, 'dd-mm-yyyy') AS COMPDATE, "
+ " TO_CHAR(cd.complaintdate, 'HH24:MI:SS') AS Time, "
+ " cs.statusname AS status, "
+ " usr.user_name, "
+ " cd.complaintnumber, "
+ " COALESCE(ct.complainttypename, 'Unspecified') AS complainttypename, "
+ " cg.complaintgroupname "
+ "FROM eggr_complaintdetails@erp cd "
+ "INNER JOIN eggr_redressaldetails@erp rd ON cd.complaintid = rd.complaintid "
+ "INNER JOIN eggr_complaintstatus@erp cs ON rd.complaintstatusid = cs.complaintstatusid "
+ "INNER JOIN eggr_complainttypes@erp ct ON TRIM(cd.complainttype) = ct.complainttypeid "
+ "INNER JOIN eg_user@erp usr ON rd.redressalofficerid = usr.id_user "
+ "INNER JOIN eg_department@erp d ON cd.deptid = d.id_dept "
+ "INNER JOIN eggr_complaintgroup@erp cg ON cg.id_complaintgroup = ct.complaintgroup_id "
+ "INNER JOIN eg_boundary@erp dn ON dn.id_bndry = cd.bndry "
+ "INNER JOIN eg_boundary@erp z ON dn.parent = z.id_bndry "
+ "INNER JOIN eg_boundary@ERP location ON location.id_bndry = cd.locbndryid "
+ "WHERE (cd.deptid IS NULL OR (cd.deptid < 21 OR cd.deptid > 30)) "
+ " AND cd.complaintdate >= TO_DATE('2024-02-23', 'yyyy-MM-dd') "
+ " AND cd.complaintdate < (TO_DATE('2024-02-23', 'yyyy-MM-dd') + 1) "
+ "ORDER BY zone_name, division_name, cd.complaintdate"
+ "";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getQaQcList() {
String SqlQuery = "";
SqlQuery ="select cd.COMPLAINTNUMBER, "
+ "dep.DEPT_NAME,ct.COMPLAINTTYPENAME, "
+ "TO_CHAR(cd.COMPLAINTDATE,'DD-MM-RRRR') COMPLAINTDATE, "
+ "TO_CHAR(cd.COMPLAINTDATE,'HH:MI:SS AM') COMPLAINTTIME, "
+ "cd.COMPLAINTDETAILS,cd.COMPLAINANTFIRSTNAME, "
+ "cd.MOBILENUMBER AS COMPLAINANTMOBILENUMBER, usr.USER_NAME, usr.extrafield2 as Mobile_number, "
+ "TO_CHAR(c.compl_date,'DD-MM-RRRR HH:MI:SS AM') as COMPLAINTCOMPLETIONDATE, DECODE ( qa.STATUS,null,'Not Attended','Attended') STATUS "
+ "from EGGR_COMPLAINTDETAILS@erp cd , "
+ "eg_department@erp dep, "
+ "EGGR_COMPLAINTTYPES@erp ct, "
+ "eg_user@erp usr, "
+ "eggr_qams_store@erp qa, "
+ "EGGR_REDRESSALDETAILS@erp rd, "
+ "(SELECT c.redressalid, MAX(c.TIMESTAMP) compl_date "
+ "FROM eggr_status_tracker@erp c,eggr_redressaldetails@ERP d "
+ "WHERE c.statusid in(5,10) "
+ "AND TRUNC(c.TIMESTAMP) between TO_DATE('2024-02-23', 'yyyy-MM-dd') and TO_DATE('2024-02-24', 'yyyy-MM-dd') "
+ "AND d.COMPLAINTSTATUSID in(5,10) "
+ "AND d.REDRESSALID=c.redressalid "
+ "GROUP BY c.redressalid) c "
+ "where cd.DEPTID=dep.ID_DEPT "
+ "and cd.COMPLAINTTYPE=ct.COMPLAINTTYPEID "
+ "AND rd.COMPLAINTID =cd.COMPLAINTID "
+ "AND rd.REDRESSALOFFICERID =usr.id_user "
+ "and qa.FDBK_OBJ_REF =cd.COMPLAINTID(+) "
+ "and rd.COMPLAINTSTATUSID not in(2,3,4,9) and rd.redressalid=c.redressalid(+) and "
+ "TRUNC(cd.COMPLAINTDATE) between TO_DATE('2024-02-23', 'yyyy-MM-dd') and TO_DATE('2024-02-24', 'yyyy-MM-dd') "
+ "order by dept_name";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseComplaintCountList() {
String SqlQuery = "";
SqlQuery ="select * from (SELECT deptid , "
+ "nvl(sum( case when complainttype in (52,146) then 1 end),0) as \"NonBURSTLT\" , "
+ "nvl(sum( case when complainttype in (1,97) then 1 end),0) as \"REOFGAR\" ,"
+ "nvl(sum( case when complainttype in (22,32,57,59,70,113,114,130,145) then 1 end),0) as \"ROAD\" ,"
+ "nvl(sum( case when complainttype in (18,118) then 1 end),0) as \"MOSQUITE\" , "
+ "nvl(sum( case when complainttype in (69,138) then 1 end),0) as \"WATER\" , "
+ "nvl(sum( case when complainttype in (7,99) then 1 end),0) as \"REOFDEB\" ,"
+ "nvl(sum( case when complainttype in (71,152) then 1 end),0) as \"TREE\" , "
+ "nvl(sum( case when complainttype in (19,119) then 1 end),0) as \"DOGS\" , "
+ "nvl(sum( case when complainttype in (75,181) then 1 end),0) as \"ENCMTN\" ,"
+ "nvl(sum( case when complainttype in (58,112) then 1 end),0) as \"POT\" , "
+ "nvl(sum( case when complainttype in (43,166) then 1 end),0) as \"PTAX\" , "
+ "nvl(sum( case when complainttype not in (52,1,22,32,57,59,70,18,69,7,71,19,75,58,43,146,97,113,114,130,145,118,138,99,152,119,181,112,166) then 1 end),0) as \"OTHERS\" , "
+ "COUNT(*) Total FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b "
+ "WHERE a.complaintid=b.complaintid "
+ "and b.COMPLAINTSTATUSID IN(2,3,4,9) "
+ "group by a.deptid ) a "
+ "inner join EG_DEPARTMENT@ERP c on a.deptid=c.id_dept "
+ "left outer join ( SELECT deptid , "
+ "nvl(sum( case when sysdate-complaintdate>90 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_90_pen , "
+ "nvl(sum( case when sysdate-complaintdate>60 and sysdate-complaintdate<=90 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_61_90_pen ,"
+ "nvl(sum( case when sysdate-complaintdate>30 and sysdate-complaintdate<=60 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_31_60_pen , "
+ "nvl(sum( case when sysdate-complaintdate>15 and sysdate-complaintdate<=30 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_16_30_pen , "
+ "nvl(sum( case when sysdate-complaintdate<=15 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_0_15_pen , "
+ "nvl(count(case when b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as Total_pen "
+ "FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b "
+ " WHERE a.complaintid=b.complaintid "
+ "AND EXISTS (SELECT 1 FROM EG_DEPARTMENT@ERP c "
+ "WHERE a.deptid = c.id_dept "
+ "AND (NVL(c.id_dept, 0) NOT LIKE 'F%' "
+ "AND c.id_dept IS NOT NULL)) group by a.deptid ) d on d.deptid=c.id_dept "
+ "where (NVL(DEPT_NAME,0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND (a.deptid>=32 AND a.deptid<=46)"
+ "order by a.deptid";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseOfficerComplaintCountList(String deptid, String complainttype) {
String SqlQuery = "";
String where_1="";
if(!complainttype.equals("all")) {
where_1 = "and cd.complainttype in ("+complainttype+") ";
}
SqlQuery ="Select c.dept_name,a.iduser,a.user_name,nvl(b.extrafield2,' ') MOBILENO,a.nos,a.deptid from "
+ "(SELECT cd.deptid, u.user_name, COUNT (cd.complaintid) nos, max(u.id_user) iduser "
+ "FROM eggr_complaintdetails@erp cd, eggr_redressaldetails@erp rd, eg_user@erp u "
+ "WHERE cd.complaintid = rd.complaintid "
+ "AND rd.redressalofficerid = u.id_user and complaintdate >= '25-oct-2010' "
+ "and rd.COMPLAINTSTATUSID IN(2,3,4,9) "
+ where_1 +""
+ "AND cd.deptid = "+deptid+" "
+ "GROUP BY cd.deptid, u.user_name "
+ "ORDER BY cd.deptid,u.user_name) a , eg_user@erp b,eg_department@erp c "
+ "where a.deptid="+deptid+" AND(a.deptid=c.id_dept(+) and a.user_name=b.user_name ) "
+ "order by c.dept_name,a.user_name";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseOfficerComplaintList(String deptid, String complainttype, String redressalofficerid) {
String SqlQuery = "";
String where_1="";
if(!complainttype.equals("all")) {
where_1 = "and a.complainttype in ("+complainttype+") ";
}
SqlQuery ="SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate,c.DEPT_NAME, u.user_name, ct.COMPLAINTTYPEName "
+ "FROM eggr_complaintdetails@erp a, "
+ "EG_DEPARTMENT@ERP c, "
+ "eggr_redressaldetails@erp b, "
+ "eg_user@erp u, "
+ "EGGR_COMPLAINTTYPES@erp ct "
+ "WHERE a.deptid = c.id_dept "
+ "AND a.complainttype = ct.COMPLAINTTYPEID "
+ "AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND a.complaintid = b.complaintid "
+ "AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') "
+ "AND u.id_user = b.redressalofficerid "
+ "AND b.COMPLAINTSTATUSID IN (2, 3, 4, 9) "
+ where_1 +""
+ "AND a.deptid = "+deptid+" "
+ "AND b.redressalofficerid = "+redressalofficerid+" "
+ "ORDER BY user_name, a.complaintdate";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseWithoutReopenComplaintCountList() {
String SqlQuery = "";
SqlQuery ="select * from (SELECT deptid , "
+ "nvl(sum( case when complainttype in (52,146) then 1 end),0) as \"NonBURSTLT\" , "
+ "nvl(sum( case when complainttype in (1,97) then 1 end),0) as \"REOFGAR\" ,"
+ "nvl(sum( case when complainttype in (22,32,57,59,70,113,114,130,145) then 1 end),0) as \"ROAD\" ,"
+ "nvl(sum( case when complainttype in (18,118) then 1 end),0) as \"MOSQUITE\" , "
+ "nvl(sum( case when complainttype in (69,138) then 1 end),0) as \"WATER\" , "
+ "nvl(sum( case when complainttype in (7,99) then 1 end),0) as \"REOFDEB\" ,"
+ "nvl(sum( case when complainttype in (71,152) then 1 end),0) as \"TREE\" , "
+ "nvl(sum( case when complainttype in (19,119) then 1 end),0) as \"DOGS\" , "
+ "nvl(sum( case when complainttype in (75,181) then 1 end),0) as \"ENCMTN\" ,"
+ "nvl(sum( case when complainttype in (58,112) then 1 end),0) as \"POT\" , "
+ "nvl(sum( case when complainttype in (43,166) then 1 end),0) as \"PTAX\" , "
+ "nvl(sum( case when complainttype not in (52,1,22,32,57,59,70,18,69,7,71,19,75,58,43,146,97,113,114,130,145,118,138,99,152,119,181,112,166) then 1 end),0) as \"OTHERS\" , "
+ "COUNT(*) Total FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b "
+ "WHERE a.complaintid=b.complaintid "
+ "and b.COMPLAINTSTATUSID IN(2,3,4) "
+ "group by a.deptid ) a "
+ "inner join EG_DEPARTMENT@ERP c on a.deptid=c.id_dept "
+ "left outer join ( SELECT deptid , "
+ "nvl(sum( case when sysdate-complaintdate>90 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_90_pen , "
+ "nvl(sum( case when sysdate-complaintdate>60 and sysdate-complaintdate<=90 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_61_90_pen ,"
+ "nvl(sum( case when sysdate-complaintdate>30 and sysdate-complaintdate<=60 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_31_60_pen , "
+ "nvl(sum( case when sysdate-complaintdate>15 and sysdate-complaintdate<=30 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_16_30_pen , "
+ "nvl(sum( case when sysdate-complaintdate<=15 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_0_15_pen , "
+ "nvl(count(case when b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as Total_pen "
+ "FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b "
+ " WHERE a.complaintid=b.complaintid "
+ "AND EXISTS (SELECT 1 FROM EG_DEPARTMENT@ERP c "
+ "WHERE a.deptid = c.id_dept "
+ "AND (NVL(c.id_dept, 0) NOT LIKE 'F%' "
+ "AND c.id_dept IS NOT NULL)) group by a.deptid ) d on d.deptid=c.id_dept "
+ "where (NVL(DEPT_NAME,0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND (a.deptid>=32 AND a.deptid<=46)"
+ "order by a.deptid";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseOfficerWithoutReopenComplaintCountList(String deptid, String complainttype) {
String SqlQuery = "";
String where_1="";
if(!complainttype.equals("all")) {
where_1 = "and cd.complainttype in ("+complainttype+") ";
}
SqlQuery ="Select c.dept_name,a.iduser,a.user_name,nvl(b.extrafield2,' ') MOBILENO,a.nos,a.deptid from "
+ "(SELECT cd.deptid, u.user_name, COUNT (cd.complaintid) nos, max(u.id_user) iduser "
+ "FROM eggr_complaintdetails@erp cd, eggr_redressaldetails@erp rd, eg_user@erp u "
+ "WHERE cd.complaintid = rd.complaintid "
+ "AND rd.redressalofficerid = u.id_user and complaintdate >= '25-oct-2010' "
+ "and rd.COMPLAINTSTATUSID IN(2,3,4) "
+ where_1 +""
+ "AND cd.deptid = "+deptid+" "
+ "GROUP BY cd.deptid, u.user_name "
+ "ORDER BY cd.deptid,u.user_name) a , eg_user@erp b,eg_department@erp c "
+ "where a.deptid="+deptid+" AND(a.deptid=c.id_dept(+) and a.user_name=b.user_name ) "
+ "order by c.dept_name,a.user_name";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getZoneWiseOfficerWithoutReopenComplaintList(String deptid, String complainttype, String redressalofficerid) {
String SqlQuery = "";
String where_1="";
if(!complainttype.equals("all")) {
where_1 = "and a.complainttype in ("+complainttype+") ";
}
SqlQuery ="SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate,c.DEPT_NAME, u.user_name, ct.COMPLAINTTYPEName "
+ "FROM eggr_complaintdetails@erp a, "
+ "EG_DEPARTMENT@ERP c, "
+ "eggr_redressaldetails@erp b, "
+ "eg_user@erp u, "
+ "EGGR_COMPLAINTTYPES@erp ct "
+ "WHERE a.deptid = c.id_dept "
+ "AND a.complainttype = ct.COMPLAINTTYPEID "
+ "AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND a.complaintid = b.complaintid "
+ "AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') "
+ "AND u.id_user = b.redressalofficerid "
+ "AND b.COMPLAINTSTATUSID IN (2, 3, 4) "
+ where_1 +""
+ "AND a.deptid = "+deptid+" "
+ "AND b.redressalofficerid = "+redressalofficerid+" "
+ "ORDER BY user_name, a.complaintdate";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
return result;
}
@Transactional
public List<Map<String, Object>> getComplaintDetails(String complaintNumber) {
String SqlQuery = "";
SqlQuery ="SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate,c.DEPT_NAME, u.user_name, ct.COMPLAINTTYPEName "
+ "FROM eggr_complaintdetails@erp a, "
+ "EG_DEPARTMENT@ERP c, "
+ "eggr_redressaldetails@erp b, "
+ "eg_user@erp u, "
+ "EGGR_COMPLAINTTYPES@erp ct "
+ "WHERE a.deptid = c.id_dept "
+ "AND a.complainttype = ct.COMPLAINTTYPEID "
+ "AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND a.complaintid = b.complaintid "
+ "AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') "
+ "AND u.id_user = b.redressalofficerid "
+ "AND a.COMPLAINTNUMBER = '"+complaintNumber+"' "
+ "ORDER BY user_name, a.complaintdate";
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery);
// Iterate over the result list
for (Map<String, Object> row : result) {
// Iterate over each key-value pair in the map
for (Map.Entry<String, Object> entry : row.entrySet()) {
// Check if the value is null
if (entry.getValue() == null) {
// If the value is null, replace it with an empty string
entry.setValue("");
}
}
}
return result;
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.pgr.service;

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

@ -17,7 +17,7 @@ import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig; import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
@RequestMapping("/api/qrfeedback")
@RequestMapping("/gcc/api/qrfeedback")
@RestController("qrassetfeedbackcontroller") @RestController("qrassetfeedbackcontroller")
public class APIController { public class APIController {
private final RestTemplate restTemplate; private final RestTemplate restTemplate;

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

@ -20,7 +20,7 @@ import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQu
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion; import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback; import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
@RequestMapping("/qrfeedback")
@RequestMapping("/gcc/qrfeedback")
@Controller("qrAssetFeedbackController") @Controller("qrAssetFeedbackController")
public class MainController { public class MainController {

14
src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppModuleAccessRepository.java

@ -5,6 +5,7 @@ import java.util.List;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -23,4 +24,17 @@ public interface AppModuleAccessRepository extends JpaRepository<AppModuleAccess
@Query(value = "SELECT * FROM `modules_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id) AND (`isactive`=1 AND `isdelete`=0)", nativeQuery = true) @Query(value = "SELECT * FROM `modules_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id) AND (`isactive`=1 AND `isdelete`=0)", nativeQuery = true)
List<AppModuleAccessEntity> findByAll(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id); List<AppModuleAccessEntity> findByAll(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id);
@Modifying
@Query(value = "INSERT INTO `modules_access`(`module_id`, `usergroup_id`) VALUES (:module_id,:usergroup_id)", nativeQuery = true)
void insert(@Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id);
@Modifying
@Query(value = "UPDATE `modules_access` SET `isactive`=:isactive WHERE `module_id`=:module_id AND `usergroup_id`=:usergroup_id", nativeQuery = true)
void update(@Param("isactive") Boolean isactive, @Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id);
@Modifying
@Query(value = "UPDATE `modules_access` SET `isactive`=:isactive WHERE `usergroup_id`=:usergroup_id", nativeQuery = true)
void updateActiveStatus(@Param("isactive") Boolean isactive, @Param("usergroup_id") String usergroup_id);
} }

17
src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserGroupRepository.java

@ -0,0 +1,17 @@
package in.gov.chennaicorporation.gccoffice.repository;
import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppUserGroupEntity;
@Repository
@Transactional
public interface AppUserGroupRepository extends JpaRepository<AppUserGroupEntity, Integer>{
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true)
Integer getLastInsertedId();
}

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

@ -1,5 +1,7 @@
package in.gov.chennaicorporation.gccoffice.repository; package in.gov.chennaicorporation.gccoffice.repository;
import java.util.List;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
@ -7,6 +9,7 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity; import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity;
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity;
@Repository @Repository
@Transactional @Transactional
@ -14,5 +17,11 @@ public interface AppUserRepository extends JpaRepository<AppUserEntity, Integer>
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) @Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true)
Integer getLastInsertedId(); Integer getLastInsertedId();
@Query(value = "SELECT * FROM `appusers`", nativeQuery = true)
List<AppUserEntity> showAll();
@Query(value = "SELECT * FROM `appusers` WHERE (id=:userId AND `isdelete`=0)", nativeQuery = true)
List<AppUserEntity> showById(String userId);
AppUserEntity findByUsername(String username); AppUserEntity findByUsername(String username);
} }

13
src/main/java/in/gov/chennaicorporation/gccoffice/repository/MenuItemAccessRepository.java

@ -5,6 +5,7 @@ import java.util.List;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -26,4 +27,16 @@ public interface MenuItemAccessRepository extends JpaRepository<MenuItemAccessEn
@Query(value = "SELECT * FROM `menuitem_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id AND `menuitem_id`=:menuitem_id) AND (`isactive`=1 AND `isdelete`=0) LIMIT 0,1", nativeQuery = true) @Query(value = "SELECT * FROM `menuitem_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id AND `menuitem_id`=:menuitem_id) AND (`isactive`=1 AND `isdelete`=0) LIMIT 0,1", nativeQuery = true)
List<MenuItemAccessEntity> findByAll(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id,@Param("menuitem_id") String menuitem_id); List<MenuItemAccessEntity> findByAll(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id,@Param("menuitem_id") String menuitem_id);
@Modifying
@Query(value = "INSERT INTO `menuitem_access`(`menuitem_id`, `module_id`, `usergroup_id`) VALUES (:menuitem_id,:module_id,:usergroup_id)", nativeQuery = true)
void insert(@Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id, @Param("menuitem_id") String menuitem_id);
@Modifying
@Query(value = "UPDATE `menuitem_access` SET `isactive`=:isactive WHERE `module_id`=:module_id AND `usergroup_id`=:usergroup_id AND `menuitem_id`=:menuitem_id", nativeQuery = true)
void update(@Param("isactive") Boolean isactive, @Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id,@Param("menuitem_id") String menuitem_id);
@Modifying
@Query(value = "UPDATE `menuitem_access` SET `isactive`=:isactive WHERE `usergroup_id`=:usergroup_id", nativeQuery = true)
void updateActiveStatus(@Param("isactive") Boolean isactive, @Param("usergroup_id") String usergroup_id);
} }

13
src/main/java/in/gov/chennaicorporation/gccoffice/repository/SubMenuItemAccessRepository.java

@ -5,6 +5,7 @@ import java.util.List;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -29,4 +30,16 @@ public interface SubMenuItemAccessRepository extends JpaRepository<SubMenuItemAc
@Query(value = "SELECT * FROM `submenuitem_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id AND `menuitem_id`=:menuitem_id AND `submenuitem_id`=:submenuitem_id) AND (`isactive`=1 AND `isdelete`=0) LIMIT 0,1", nativeQuery = true) @Query(value = "SELECT * FROM `submenuitem_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id AND `menuitem_id`=:menuitem_id AND `submenuitem_id`=:submenuitem_id) AND (`isactive`=1 AND `isdelete`=0) LIMIT 0,1", nativeQuery = true)
List<SubMenuItemAccessEntity> findByAll(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id,@Param("menuitem_id") String menuitem_id,@Param("submenuitem_id") String submenuitem_id); List<SubMenuItemAccessEntity> findByAll(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id,@Param("menuitem_id") String menuitem_id,@Param("submenuitem_id") String submenuitem_id);
@Modifying
@Query(value = "INSERT INTO `submenuitem_access`(`submenuitem_id`, `menuitem_id`, `module_id`, `usergroup_id`) VALUES (:submenuitem_id, :menuitem_id, :module_id, :usergroup_id)", nativeQuery = true)
void insert(@Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id, @Param("menuitem_id") String menuitem_id, @Param("submenuitem_id") String submenuitem_id);
@Modifying
@Query(value = "UPDATE `submenuitem_access` SET `isactive`=:isactive WHERE `module_id`=:module_id AND `usergroup_id`=:usergroup_id AND `menuitem_id`=:menuitem_id AND `submenuitem_id`=:submenuitem_id", nativeQuery = true)
void update(@Param("isactive") Boolean isactive, @Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id, @Param("menuitem_id") String menuitem_id, @Param("submenuitem_id") String submenuitem_id);
@Modifying
@Query(value = "UPDATE `submenuitem_access` SET `isactive`=:isactive WHERE `usergroup_id`=:usergroup_id", nativeQuery = true)
void updateActiveStatus(@Param("isactive") Boolean isactive, @Param("usergroup_id") String usergroup_id);
} }

16
src/main/java/in/gov/chennaicorporation/gccoffice/repository/UserActivityLogRepository.java

@ -0,0 +1,16 @@
package in.gov.chennaicorporation.gccoffice.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog;
import java.util.List;
import javax.transaction.Transactional;
@Repository
@Transactional
public interface UserActivityLogRepository extends JpaRepository<UserActivityLog, Long> {
List<UserActivityLog> findByUserIdOrderByTimestampDesc(String userId);
}

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

@ -19,18 +19,23 @@ import in.gov.chennaicorporation.gccoffice.repository.AppUserRepository;
public class CustomUserDetailsService implements UserDetailsService { public class CustomUserDetailsService implements UserDetailsService {
private final AppUserRepository appUserRepository; private final AppUserRepository appUserRepository;
private final UserActivityService userActivityService;
@Autowired @Autowired
public CustomUserDetailsService(AppUserRepository appUserRepository) {
public CustomUserDetailsService(AppUserRepository appUserRepository,UserActivityService userActivityService ) {
this.appUserRepository = appUserRepository; this.appUserRepository = appUserRepository;
this.userActivityService = userActivityService;
} }
@Override @Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
AppUserEntity appUserEntity = appUserRepository.findByUsername(username); AppUserEntity appUserEntity = appUserRepository.findByUsername(username);
System.out.println(username);
userActivityService.logUserActivity("0", "Trying to Login with Username: " + username);
//System.out.println(username);
if (appUserEntity == null) { if (appUserEntity == null) {
System.out.println("User not found");
//System.out.println("User not found");
userActivityService.logUserActivity("0","User (" + username +") not found");
throw new UsernameNotFoundException("User not found"); throw new UsernameNotFoundException("User not found");
} }
/* /*
@ -46,7 +51,7 @@ public class CustomUserDetailsService implements UserDetailsService {
// Ensure that the role starts with "ROLE_" // Ensure that the role starts with "ROLE_"
if (!userRole.startsWith("ROLE_")) { if (!userRole.startsWith("ROLE_")) {
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);
@ -70,6 +75,11 @@ public class CustomUserDetailsService implements UserDetailsService {
) )
); );
userActivityService.logUserActivity(appUserEntity.getUserid().getUserid().toString(), "Login Success: <br>Username: "+appUserEntity.getUsername()
+"<br>Role: "+appUserEntity.getRoles().toString()
+"<br>Access Group: "+appUserEntity.getUsergroup_id().getName()
+"<br>Access Group ID: "+appUserEntity.getUsergroup_id().getId());
return userDetails; return userDetails;
} }
} }

29
src/main/java/in/gov/chennaicorporation/gccoffice/service/UserActivityService.java

@ -0,0 +1,29 @@
package in.gov.chennaicorporation.gccoffice.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog;
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository;
import java.time.LocalDateTime;
@Service
public class UserActivityService {
private final UserActivityLogRepository userActivityLogRepository;
@Autowired
public UserActivityService(UserActivityLogRepository userActivityLogRepository) {
this.userActivityLogRepository = userActivityLogRepository;
}
public void logUserActivity(String userId, String activityType) {
UserActivityLog userActivityLog = new UserActivityLog();
userActivityLog.setUserId(userId);
userActivityLog.setActivityType(activityType);
userActivityLog.setTimestamp(LocalDateTime.now());
userActivityLogRepository.save(userActivityLog);
}
}

25
src/main/java/in/gov/chennaicorporation/gccoffice/service/UserActivityTimelineService.java

@ -0,0 +1,25 @@
package in.gov.chennaicorporation.gccoffice.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog;
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository;
import java.util.List;
@Service
public class UserActivityTimelineService {
private final UserActivityLogRepository userActivityLogRepository;
@Autowired
public UserActivityTimelineService(UserActivityLogRepository userActivityLogRepository) {
this.userActivityLogRepository = userActivityLogRepository;
}
public List<UserActivityLog> getUserActivityTimeline(String userId) {
return userActivityLogRepository.findByUserIdOrderByTimestampDesc(userId);
}
}

13
src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/MainController.java

@ -21,7 +21,7 @@ import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity; import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity;
import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository; import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository;
@RequestMapping("/taxcollection")
@RequestMapping("/gcc/taxcollection")
@Controller("taxCollectionController") @Controller("taxCollectionController")
public class MainController { public class MainController {
@ -45,7 +45,7 @@ public class MainController {
} }
@GetMapping("/request-create") @GetMapping("/request-create")
public String category(Model model) {
public String CreateRequest(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId(); String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId); model.addAttribute("LoginUserId",LoginUserId);
List<TaxCollectionRequestEntity> taxCollectionRequestEntities = taxCollectionRequestRepository.showAll(); List<TaxCollectionRequestEntity> taxCollectionRequestEntities = taxCollectionRequestRepository.showAll();
@ -53,6 +53,15 @@ public class MainController {
return "modules/taxcollection/request-create"; return "modules/taxcollection/request-create";
} }
@GetMapping("/request-list")
public String RequestList(Model model) {
String LoginUserId = LoginUserInfo.getLoginUserId();
model.addAttribute("LoginUserId",LoginUserId);
List<TaxCollectionRequestEntity> taxCollectionRequestEntities = taxCollectionRequestRepository.showAll();
model.addAttribute("taxCollectionRequestEntities",taxCollectionRequestEntities);
return "modules/taxcollection/request-list";
}
@GetMapping("/showimage") @GetMapping("/showimage")
public String showimage(Model model) { public String showimage(Model model) {
return "modules/taxcollection/request-create"; return "modules/taxcollection/request-create";

3
src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/TaxCollectionRestController.java

@ -30,7 +30,7 @@ import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionReq
import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository; import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository;
import in.gov.chennaicorporation.gccoffice.taxcollection.service.TaxCollectionService; import in.gov.chennaicorporation.gccoffice.taxcollection.service.TaxCollectionService;
@RequestMapping("/api/taxcollection")
@RequestMapping("/gcc/api/taxcollection")
@RestController("taxCollectionRestController") @RestController("taxCollectionRestController")
public class TaxCollectionRestController { public class TaxCollectionRestController {
@ -118,6 +118,7 @@ public class TaxCollectionRestController {
taxCollectionRequestEntity.setcDate(cdate.toString()); taxCollectionRequestEntity.setcDate(cdate.toString());
taxCollectionRequestEntity.setIsActive(true); taxCollectionRequestEntity.setIsActive(true);
taxCollectionRequestEntity.setIsDelete(false); taxCollectionRequestEntity.setIsDelete(false);
taxCollectionRequestEntity.setStatus("open");
Integer lastinsertid = taxCollectionService.saveTaxCollectionRequest(taxCollectionRequestEntity); Integer lastinsertid = taxCollectionService.saveTaxCollectionRequest(taxCollectionRequestEntity);
return "Success"; return "Success";
} }

BIN
src/main/resources/.DS_Store

1
src/main/resources/application-local.properties

@ -0,0 +1 @@
assets.base-url=/assets/

1
src/main/resources/application-production.properties

@ -0,0 +1 @@
assets.base-url=/gcc/assets/

31
src/main/resources/application.properties

@ -1,15 +1,29 @@
spring.profiles.active=local
#spring.profiles.active=production
#For Server production
#assets.base-url=/gcc/assets/
#For local test
#assets.base-url=/assets/
# Spring properties
spring.application.name=gcc-portal
# Discovery Server Access
#eureka.client.serviceUrl.defaultZone=http://localhost:8061/eureka/
# HTTP Server
server.port = 8064 server.port = 8064
#server.servlet.context-path=/gccoffice #server.servlet.context-path=/gccoffice
server.error.include-stacktrace= on_param server.error.include-stacktrace= on_param
# Hibernate logging # Hibernate logging
#logging.level.org.hibernate.SQL=DEBUG
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
# Enable CORS globally for all endpoints # Enable CORS globally for all endpoints
spring.webmvc.cors.enabled=true spring.webmvc.cors.enabled=true
# Comma-separated list of allowed origins # Comma-separated list of allowed origins
spring.webmvc.cors.allowed-origins=http://gccservices.chennaicorporation.gov.in,http://chennaicorporation.gov.in,http://117.232.67.158
spring.webmvc.cors.allowed-origins=http://gccservices.chennaicorporation.gov.in:8064,http://chennaicorporation.gov.in:8064,http://117.232.67.158:8064,http://localhost:8064
# Comma-separated list of allowed HTTP methods # Comma-separated list of allowed HTTP methods
spring.webmvc.cors.allowed-methods=GET,POST,PUT,DELETE spring.webmvc.cors.allowed-methods=GET,POST,PUT,DELETE
@ -22,7 +36,7 @@ spring.webmvc.cors.max-age=3600
server.servlet.session.tracking-modes=COOKIE server.servlet.session.tracking-modes=COOKIE
#server.servlet.session.cookie.domain=.chennaicorporation.gov.in
#server.servlet.session.cookie.domain=chennaicorporation.gov.in
#logging.level.root=DEBUG #logging.level.root=DEBUG
@ -30,7 +44,10 @@ file.upload.directory=${user.dir}/gccoffice_uploads
server.address=0.0.0.0 server.address=0.0.0.0
server.servlet.session.timeout: 5m
server.servlet.session.cookie.name: MYSESSIONID
server.servlet.session.cookie.max-age: 10m
server.servlet.session.timeout=-1
server.servlet.session.cookie.name= GCCONEPORTALSESSION
server.servlet.session.cookie.max-age= -1
#server.servlet.session.timeout:5m
#server.servlet.session.cookie.name: MYSESSIONID
#server.servlet.session.cookie.max-age: 10m

BIN
src/main/resources/static/.DS_Store

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

BIN
src/main/resources/static/assets/images/hi_robo.gif

After

Width: 600  |  Height: 600  |  Size: 2.9 MiB

BIN
src/main/resources/static/assets/images/search_ani.gif

After

Width: 512  |  Height: 512  |  Size: 95 KiB

2
src/main/resources/static/assets/node_modules/datatable/DataTables-1.13.6/css/jquery.dataTables.min.css
File diff suppressed because it is too large
View File

BIN
src/main/resources/templates/.DS_Store

4
src/main/resources/templates/error-403.html

@ -13,13 +13,13 @@
<div class="col-xl-6 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none"> <div class="col-xl-6 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none">
<div class="lavalite-bg authentication-form mx-auto text-center"> <div class="lavalite-bg authentication-form mx-auto text-center">
<div class="logo-centered" style="padding-top: 30px;"></div> <div class="logo-centered" style="padding-top: 30px;"></div>
<img src="/assets/images/403.png" width="90%"/>
<img src="images/403.png" width="90%"/>
</div> </div>
</div> </div>
<div class="col-xl-6 col-lg-6 col-md-7 my-auto p-0"> <div class="col-xl-6 col-lg-6 col-md-7 my-auto p-0">
<div class="authentication-form mx-auto text-center"> <div class="authentication-form mx-auto text-center">
<div class="logo-centered"> <div class="logo-centered">
<a href="/"><img src="/assets/images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
<a href="/"><img src="images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
</div> </div>
<h3>Greater Chennai Corporation</h3> <h3>Greater Chennai Corporation</h3>
<!-- Content --> <!-- Content -->

4
src/main/resources/templates/error-404.html

@ -13,13 +13,13 @@
<div class="col-xl-6 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none my-auto"> <div class="col-xl-6 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none my-auto">
<div class="lavalite-bg authentication-form mx-auto text-center" > <div class="lavalite-bg authentication-form mx-auto text-center" >
<div class="logo-centered" style="padding-top: 120px;"></div> <div class="logo-centered" style="padding-top: 120px;"></div>
<img src="/assets/images/error-bg-404.png" width="90%"/>
<img src="images/error-bg-404.png" width="90%"/>
</div> </div>
</div> </div>
<div class="col-xl-6 col-lg-6 col-md-7 my-auto p-0"> <div class="col-xl-6 col-lg-6 col-md-7 my-auto p-0">
<div class="authentication-form mx-auto text-center"> <div class="authentication-form mx-auto text-center">
<div class="logo-centered"> <div class="logo-centered">
<a href="/"><img src="/assets/images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
<a href="/"><img src="images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
</div> </div>
<h3>Greater Chennai Corporation</h3> <h3>Greater Chennai Corporation</h3>
<!-- Content --> <!-- Content -->

4
src/main/resources/templates/error-500.html

@ -13,13 +13,13 @@
<div class="col-xl-6 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none"> <div class="col-xl-6 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none">
<div class="lavalite-bg authentication-form mx-auto text-center"> <div class="lavalite-bg authentication-form mx-auto text-center">
<div class="logo-centered" style="padding-top: 30px;"></div> <div class="logo-centered" style="padding-top: 30px;"></div>
<img src="/assets/images/error-bg.png" width="90%"/>
<img src="images/error-bg.png" width="90%"/>
</div> </div>
</div> </div>
<div class="col-xl-6 col-lg-6 col-md-7 my-auto p-0"> <div class="col-xl-6 col-lg-6 col-md-7 my-auto p-0">
<div class="authentication-form mx-auto text-center"> <div class="authentication-form mx-auto text-center">
<div class="logo-centered"> <div class="logo-centered">
<a href="/"><img src="/assets/images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
<a href="/"><img src="images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
</div> </div>
<h3>Greater Chennai Corporation</h3> <h3>Greater Chennai Corporation</h3>
<!-- Content --> <!-- Content -->

53
src/main/resources/templates/fragments/modules/admin/modal-box.html

@ -0,0 +1,53 @@
<div class="modal fade" id="viewUserDetails" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title m-0" id="exampleModalDefaultLabel">Exploring User Details:</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div><!--end modal-header-->
<div class="modal-body pb-1">
<div id="profilehtml">
</div>
</div><!--end modal-body-->
<div class="modal-footer bg-body">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div><!--end modal-footer-->
</div><!--end modal-content-->
</div><!--end modal-dialog-->
</div><!--end modal-->
<!-- END Page Content -->
<div class="modal fade" id="petitionStatus" tabindex="-1" role="dialog" aria-labelledby="otpFormLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title m-0" id="exampleModalDefaultLabel">புகார் நிலை / Complaint Status</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div><!--end modal-header-->
<div class="modal-body">
<div class="row">
<div class="col-sm-6 col-xl-6">
<div class="block block-rounded d-flex flex-column h-100 mb-0" id="petitionStatusForm" style="font-size:12px;">
</div>
</div>
<div class="col-sm-6 col-xl-6">
<div class="block block-rounded d-flex flex-column h-100 mb-0" id="petitionUpdateForm" style="font-size:12px;">
</div>
</div>
</div><!--end row-->
</div><!--end modal-body-->
<div class="modal-footer bg-body">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div><!--end modal-footer-->
</div><!--end modal-content-->
</div><!--end modal-dialog-->
</div><!--end modal-->

100
src/main/resources/templates/fragments/modules/base/head.html

@ -7,37 +7,40 @@
<meta name="keywords" content=""> <meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<base th:href="${assetsBaseUrl}">
<link rel="icon" href="/favicon.ico" type="image/x-icon" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800" rel="stylesheet">
<link rel="stylesheet" href="/assets/node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/assets/node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="/assets/node_modules/ionicons/dist/css/ionicons.min.css">
<link rel="stylesheet" href="/assets/node_modules/icon-kit/dist/css/iconkit.min.css">
<link rel="stylesheet" href="/assets/node_modules/fullcalendar/dist/fullcalendar.min.css">
<link rel="stylesheet" href="/assets/node_modules/perfect-scrollbar/css/perfect-scrollbar.css">
<link rel="stylesheet" href="/assets/node_modules/weather-icons/css/weather-icons.min.css">
<link rel="stylesheet" href="/assets/node_modules/sweetalert2/sweetalert2.min.css">
<link href="/assets/node_modules/datatable/DataTables-1.13.6/css/jquery.dataTables.min.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css">
<link href="/assets/node_modules/datatable/AutoFill-2.6.0/css/autoFill.bootstrap4.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/Buttons-2.4.1/css/buttons.bootstrap4.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/ColReorder-1.7.0/css/colReorder.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/DateTime-1.5.1/css/dataTables.dateTime.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/FixedColumns-4.3.0/css/fixedColumns.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/FixedHeader-3.4.0/css/fixedHeader.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/KeyTable-2.10.0/css/keyTable.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/Responsive-2.5.0/css/responsive.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/RowGroup-1.4.0/css/rowGroup.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/RowReorder-1.4.1/css/rowReorder.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/Scroller-2.2.0/css/scroller.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/SearchBuilder-1.5.0/css/searchBuilder.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/SearchPanes-2.2.0/css/searchPanes.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/Select-1.7.0/css/select.bootstrap4.min.css" rel="stylesheet">
<link href="/assets/node_modules/datatable/StateRestore-1.3.0/css/stateRestore.bootstrap4.min.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/dist/css/theme.css">
<script src="/assets/js/vendor/modernizr-2.8.3.min.js"></script>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="node_modules/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="node_modules/ionicons/dist/css/ionicons.min.css">
<link rel="stylesheet" href="node_modules/icon-kit/dist/css/iconkit.min.css">
<link rel="stylesheet" href="node_modules/fullcalendar/dist/fullcalendar.min.css">
<link rel="stylesheet" href="node_modules/perfect-scrollbar/css/perfect-scrollbar.css">
<link rel="stylesheet" href="node_modules/select2/dist/css/select2.min.css">
<link rel="stylesheet" href="node_modules/weather-icons/css/weather-icons.min.css">
<link rel="stylesheet" href="node_modules/sweetalert2/sweetalert2.min.css">
<link href="node_modules/datatable/DataTables-1.13.6/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/AutoFill-2.6.0/css/autoFill.bootstrap4.css" rel="stylesheet">
<link href="node_modules/datatable/Buttons-2.4.1/css/buttons.bootstrap4.css" rel="stylesheet">
<link href="node_modules/datatable/ColReorder-1.7.0/css/colReorder.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/DateTime-1.5.1/css/dataTables.dateTime.min.css" rel="stylesheet">
<link href="node_modules/datatable/FixedColumns-4.3.0/css/fixedColumns.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/FixedHeader-3.4.0/css/fixedHeader.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/KeyTable-2.10.0/css/keyTable.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/Responsive-2.5.0/css/responsive.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/RowGroup-1.4.0/css/rowGroup.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/RowReorder-1.4.1/css/rowReorder.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/Scroller-2.2.0/css/scroller.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/SearchBuilder-1.5.0/css/searchBuilder.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/SearchPanes-2.2.0/css/searchPanes.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/Select-1.7.0/css/select.bootstrap4.min.css" rel="stylesheet">
<link href="node_modules/datatable/StateRestore-1.3.0/css/stateRestore.bootstrap4.min.css" rel="stylesheet">
<link rel="stylesheet" href="dist/css/theme.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<style> <style>
.showInputValue { .showInputValue {
padding: 0.375rem 0.75rem !important; padding: 0.375rem 0.75rem !important;
@ -100,5 +103,44 @@
.close{ .close{
color: #fff !important; color: #fff !important;
} }
/* For tree view */
ul {
list-style-type: none;
margin: 3px;
}
ul.checktree li:before {
height: 1em;
width: 12px;
border-bottom: 1px dashed;
content: "";
display: inline-block;
top: -0.3em;
}
ul.checktree li { border-left: 1px dashed; }
ul.checktree li:last-child:before { border-left: 1px dashed; }
ul.checktree li:last-child { border-left: none; }
/* For datatable */
th.no-sort {
pointer-events: none;
cursor: default;
}
th.no-sort::after {
display: none !important;
}
th.no-sort::before {
display: none !important;
}
.link{
color:#0d6efd;
}
</style> </style>
</head> </head>

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

@ -29,7 +29,7 @@
</a> </a>
<a href="#" class="media"> <a href="#" class="media">
<span class="d-flex"> <span class="d-flex">
<img src="/assets/images/users/user.jpg" class="rounded-circle" alt="">
<img src="images/users/user.jpg" class="rounded-circle" alt="">
</span> </span>
<span class="media-body"> <span class="media-body">
<span class="heading-font-family media-heading">Steve Smith</span> <span class="heading-font-family media-heading">Steve Smith</span>
@ -71,7 +71,7 @@
<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">
<img class="avatar" src="/assets/images/users/user.jpg" alt="">
<img class="avatar" src="images/users/user.jpg" alt="">
</a> </a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown"> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
<a class="dropdown-item" href="profile.html"><i class="ik ik-user dropdown-icon"></i> Profile</a> <a class="dropdown-item" href="profile.html"><i class="ik ik-user dropdown-icon"></i> Profile</a>

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

@ -3,7 +3,7 @@
<div class="sidebar-header"> <div class="sidebar-header">
<a class="header-brand" href="index.html"> <a class="header-brand" href="index.html">
<div class="logo-img"> <div class="logo-img">
<img src="/assets/images/logo.png" class="header-brand-img" alt="GCC" width="25px">
<img src="images/logo.png" class="header-brand-img" alt="GCC" width="25px">
</div> </div>
<span class="text"> GCC APP</span> <span class="text"> GCC APP</span>
</a> </a>

109
src/main/resources/templates/fragments/modules/base/script.html

@ -1,37 +1,38 @@
<script src="/assets/node_modules/datatable/jQuery-3.7.0/jquery-3.7.0.min.js"></script>
<script src="/assets/node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="/assets/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/assets/node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>
<script src="/assets/node_modules/screenfull/dist/screenfull.js"></script>
<script src="/assets/node_modules/moment/moment.js"></script>
<script src="/assets/node_modules/sweetalert2/sweetalert2.min.js"></script>
<script src="/assets/node_modules/datatable/JSZip-3.10.1/jszip.min.js"></script>
<script src="/assets/node_modules/datatable/pdfmake-0.2.7/pdfmake.min.js"></script>
<script src="/assets/node_modules/datatable/pdfmake-0.2.7/vfs_fonts.js"></script>
<script src="/assets/node_modules/datatable/DataTables-1.13.6/js/jquery.dataTables.min.js"></script>
<script src="/assets/node_modules/datatable/AutoFill-2.6.0/js/dataTables.autoFill.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/dataTables.buttons.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.bootstrap4.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.colVis.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.html5.min.js"></script>
<script src="/assets/node_modules/datatable/Buttons-2.4.1/js/buttons.print.min.js"></script>
<script src="/assets/node_modules/datatable/ColReorder-1.7.0/js/dataTables.colReorder.min.js"></script>
<script src="/assets/node_modules/datatable/DateTime-1.5.1/js/dataTables.dateTime.min.js"></script>
<script src="/assets/node_modules/datatable/FixedColumns-4.3.0/js/dataTables.fixedColumns.min.js"></script>
<script src="/assets/node_modules/datatable/FixedHeader-3.4.0/js/dataTables.fixedHeader.min.js"></script>
<script src="/assets/node_modules/datatable/KeyTable-2.10.0/js/dataTables.keyTable.min.js"></script>
<script src="/assets/node_modules/datatable/Responsive-2.5.0/js/dataTables.responsive.min.js"></script>
<script src="/assets/node_modules/datatable/RowGroup-1.4.0/js/dataTables.rowGroup.min.js"></script>
<script src="/assets/node_modules/datatable/RowReorder-1.4.1/js/dataTables.rowReorder.min.js"></script>
<script src="/assets/node_modules/datatable/Scroller-2.2.0/js/dataTables.scroller.min.js"></script>
<script src="/assets/node_modules/datatable/SearchBuilder-1.5.0/js/dataTables.searchBuilder.min.js"></script>
<script src="/assets/node_modules/datatable/SearchPanes-2.2.0/js/dataTables.searchPanes.min.js"></script>
<script src="/assets/node_modules/datatable/Select-1.7.0/js/dataTables.select.min.js"></script>
<script src="/assets/node_modules/datatable/StateRestore-1.3.0/js/dataTables.stateRestore.min.js"></script>
<script src="/assets/dist/js/theme.js"></script>
<script src="node_modules/datatable/jQuery-3.7.0/jquery-3.7.0.min.js"></script>
<script src="node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>
<script src="node_modules/select2/dist/js/select2.min.js"></script>
<script src="node_modules/screenfull/dist/screenfull.js"></script>
<script src="node_modules/moment/moment.js"></script>
<script src="node_modules/sweetalert2/sweetalert2.min.js"></script>
<script src="node_modules/datatable/JSZip-3.10.1/jszip.min.js"></script>
<script src="node_modules/datatable/pdfmake-0.2.7/pdfmake.min.js"></script>
<script src="node_modules/datatable/pdfmake-0.2.7/vfs_fonts.js"></script>
<script src="node_modules/datatable/DataTables-1.13.6/js/jquery.dataTables.min.js"></script>
<script src="node_modules/datatable/AutoFill-2.6.0/js/dataTables.autoFill.min.js"></script>
<script src="node_modules/datatable/Buttons-2.4.1/js/dataTables.buttons.min.js"></script>
<script src="node_modules/datatable/Buttons-2.4.1/js/buttons.bootstrap4.min.js"></script>
<script src="node_modules/datatable/Buttons-2.4.1/js/buttons.colVis.min.js"></script>
<script src="node_modules/datatable/Buttons-2.4.1/js/buttons.html5.min.js"></script>
<script src="node_modules/datatable/Buttons-2.4.1/js/buttons.print.min.js"></script>
<script src="node_modules/datatable/ColReorder-1.7.0/js/dataTables.colReorder.min.js"></script>
<script src="node_modules/datatable/DateTime-1.5.1/js/dataTables.dateTime.min.js"></script>
<script src="node_modules/datatable/FixedColumns-4.3.0/js/dataTables.fixedColumns.min.js"></script>
<script src="node_modules/datatable/FixedHeader-3.4.0/js/dataTables.fixedHeader.min.js"></script>
<script src="node_modules/datatable/KeyTable-2.10.0/js/dataTables.keyTable.min.js"></script>
<script src="node_modules/datatable/Responsive-2.5.0/js/dataTables.responsive.min.js"></script>
<script src="node_modules/datatable/RowGroup-1.4.0/js/dataTables.rowGroup.min.js"></script>
<script src="node_modules/datatable/RowReorder-1.4.1/js/dataTables.rowReorder.min.js"></script>
<script src="node_modules/datatable/Scroller-2.2.0/js/dataTables.scroller.min.js"></script>
<script src="node_modules/datatable/SearchBuilder-1.5.0/js/dataTables.searchBuilder.min.js"></script>
<script src="node_modules/datatable/SearchPanes-2.2.0/js/dataTables.searchPanes.min.js"></script>
<script src="node_modules/datatable/Select-1.7.0/js/dataTables.select.min.js"></script>
<script src="node_modules/datatable/StateRestore-1.3.0/js/dataTables.stateRestore.min.js"></script>
<script src="dist/js/theme.js"></script>
<script> <script>
// Get the current page URL path // Get the current page URL path
var currentPagePath = window.location.pathname; var currentPagePath = window.location.pathname;
@ -48,7 +49,7 @@
subMenuItem.classList.add('active'); subMenuItem.classList.add('active');
} }
</script> </script>
-->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var currentPagePath = window.location.pathname; var currentPagePath = window.location.pathname;
@ -76,12 +77,14 @@
$(document).ready(function(){ $(document).ready(function(){
$('[data-toggle="popover"]').popover(); $('[data-toggle="popover"]').popover();
}); });
$(".select2").select2();
}); });
function call_loading(div,action){ function call_loading(div,action){
var divID="#"+div; var divID="#"+div;
var loadingimage= `<center><img src="/assets/images/loading.svg" style="opacity: 1; visibility: visible; height:40px;"></center>`;
var loadingimage= `<center><img src="images/loading.svg" style="opacity: 1; visibility: visible; height:40px;"></center>`;
if(action=='start'){ if(action=='start'){
$(divID).html(loadingimage) $(divID).html(loadingimage)
} }
@ -142,6 +145,40 @@ function date_difference(fromdate,todate,type='time'){
return (hoursDifference) + ' hours and ' + (minutesDifference) + ' minutes'; return (hoursDifference) + ' hours and ' + (minutesDifference) + ' minutes';
} }
} }
function nodata(message="Data are not availble at this moment please check later"){
var nodata = `<center><img src="images/nodata_ani.gif" width="40%"><br><p class="text-warning">`+message+`</p></center>`;
return nodata;
}
function searchinfo(message="Data are not availble at this moment please check later"){
var nodata = `<center><img src="images/hi_robo.gif" width="20%"><br><p class="text-warning">`+message+`</p></center>`;
return nodata;
}
//Function to display random messages while waiting
function getLoadingMessage() {
var messages = [
"Please wait as we fetch the data. It will take less than 30 seconds.",
"Loading data... This won't take long.",
"Fetching information. Thank you for your patience.",
"Just a moment while we gather the data.",
"Loading... Sit tight!",
"Hold on tight! We're almost there.",
"Data is on its way. Thanks for waiting.",
"Patience is a virtue! We're working on it.",
"Just a few more seconds...",
"Almost done! Thanks for your patience.",
"We appreciate your patience. Data is coming shortly.",
"Stay tuned! Data is loading."
];
// Select a random message from the array
var randomMessage = messages[Math.floor(Math.random() * messages.length)];
// Display the random message
return randomMessage;
}
</script> </script>
<!-- <!--
<script th:inline="javascript"> <script th:inline="javascript">

22
src/main/resources/templates/fragments/modules/mtm/script.html

@ -1,5 +1,5 @@
<script th:inline="javascript"> <script th:inline="javascript">
var nodata = `<center><img src="../../assets/images/nodata_ani.gif" width="40%"><br><p class="text-warning">Data are not availble at this moment please check later</p></center>`;
var nodata = `<center><img src="assets/images/nodata_ani.gif" width="40%"><br><p class="text-warning">Data are not availble at this moment please check later</p></center>`;
var complaintTypesList = /*[[${complaintTypesList}]]*/ []; var complaintTypesList = /*[[${complaintTypesList}]]*/ [];
var complaintTypes =[]; var complaintTypes =[];
@ -13,7 +13,7 @@
function callReSetEventId(eventid){ function callReSetEventId(eventid){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/setEventId',
url: '/gcc/api/mtm/setEventId',
data: { data: {
'eventid': eventid 'eventid': eventid
}, },
@ -32,7 +32,7 @@
var eventid = $("#search_eid").val(); var eventid = $("#search_eid").val();
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/setEventId',
url: '/gcc/api/mtm/setEventId',
data: { data: {
'eventid': eventid 'eventid': eventid
}, },
@ -51,7 +51,7 @@
function callSetEventById(eventid,link){ function callSetEventById(eventid,link){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/setEventId',
url: '/gcc/api/mtm/setEventId',
data: { data: {
'eventid': eventid 'eventid': eventid
}, },
@ -75,7 +75,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
url: "/api/mtm/petitionFilesBypetitionId?pid="+id,
url: "/gcc/api/mtm/petitionFilesBypetitionId?pid="+id,
success: function(data){ success: function(data){
petitionFiles = data; petitionFiles = data;
@ -168,7 +168,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/getComMappingDetailsByMapId',
url: '/gcc/api/mtm/getComMappingDetailsByMapId',
data: { data: {
'mapid': mapid, 'mapid': mapid,
}, },
@ -287,7 +287,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/getPetitionStatusPublic',
url: '/gcc/api/mtm/getPetitionStatusPublic',
data: { data: {
'petition_no': petition_no, 'petition_no': petition_no,
}, },
@ -307,7 +307,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/getComMappingDetailsByPetId',
url: '/gcc/api/mtm/getComMappingDetailsByPetId',
data: { data: {
'petid': response[0].petitionId 'petid': response[0].petitionId
}, },
@ -459,7 +459,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/getComMappingActionByMapId',
url: '/gcc/api/mtm/getComMappingActionByMapId',
data: { data: {
'mapid': mapid, 'mapid': mapid,
}, },
@ -578,7 +578,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/getComMappingActionByMapId',
url: '/gcc/api/mtm/getComMappingActionByMapId',
data: { data: {
'mapid': mapid, 'mapid': mapid,
}, },
@ -657,7 +657,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/api/mtm/viewBlobData',
url: '/gcc/api/mtm/viewBlobData',
data: { data: {
'id': id, 'id': id,
'table': inTable, 'table': inTable,

68
src/main/resources/templates/fragments/modules/pgr/modal-box.html

@ -0,0 +1,68 @@
<!-- Box 1 -->
<div class="modal fade" id="pgrModalBox" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title m-0" id="modalTitle">Modal Title</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div><!--end modal-header-->
<div class="modal-body">
<div id="modalBody">
</div>
</div><!--end modal-body-->
<div class="modal-footer bg-body">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div><!--end modal-footer-->
</div><!--end modal-content-->
</div><!--end modal-dialog-->
</div><!--end modal-->
<!-- END Page Content -->
<!-- Box 2 -->
<div class="modal fade" id="pgrModalBox_2" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title m-0" id="modalTitle_2">Modal Box 2 Title</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div><!--end modal-header-->
<div class="modal-body">
<div id="modalBody_2">
</div>
</div><!--end modal-body-->
<div class="modal-footer bg-body">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div><!--end modal-footer-->
</div><!--end modal-content-->
</div><!--end modal-dialog-->
</div><!--end modal-->
<!-- END Page Content -->
<!-- Box 3 -->
<div class="modal fade" id="pgrModalBox_3" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color: #28a745 !important;">
<h6 class="modal-title m-0" id="modalTitle_3">Complaint Details</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div><!--end modal-header-->
<div class="modal-body">
<div id="modalBody_3">
</div>
</div><!--end modal-body-->
<div class="modal-footer bg-body">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div><!--end modal-footer-->
</div><!--end modal-content-->
</div><!--end modal-dialog-->
</div><!--end modal-->
<!-- END Page Content -->

275
src/main/resources/templates/fragments/modules/pgr/script.html

@ -0,0 +1,275 @@
<script th:inline="javascript">
var nodata = `<center><img src="/assets/images/nodata_ani.gif" width="40%"><br><p class="text-warning">Data are not availble at this moment please check later</p></center>`;
var baseURL = "/gcc/pgr/";
/* Department List */
function get_department_list() {
var apiUrl = '/gcc/api/pgr/getDepartments';
// 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);
}
});
});
}
/* Event Id Search */
function callReSetEventId(eventid){
$.ajax({
type: "GET",
url: '/gcc/api/mtm/setEventId',
data: {
'eventid': eventid
},
}).done(function(response) {
location.reload();
}).fail(function(jqXHR, textStatus, errorThrown) {
/*
// Log the error and any relevant information
console.error("Error sending request: " + textStatus + " " + errorThrown);
*/
});
return false;
}
function complaintTypes() {
var complaintList = {
"NonBURSTLT": "Street Light not burning",
"REOFGAR": "Removal of Garbage",
"ROAD": "Road Damaged",
"MOSQUITE": "Mosquito Nuisance",
"WATER": "Water Stagnation",
"REOFDEB": "Removal of Debris",
"TREE": "Tree Fallen",
"DOGS": "Dog Menace",
"ENCMTN": "Encroachment",
"POT": "Pothole",
"PTAX": "Property Tax",
"OTHERS": "Others"
};
return complaintList;
}
function complaintTypeId() {
var complaintIdList = {
"NonBURSTLT": "52,146",
"REOFGAR": "1,97",
"ROAD": "22,32,57,59,70,113,114,130,145",
"MOSQUITE": "18,118",
"WATER": "69,138",
"REOFDEB": "7,99",
"TREE": "71,152",
"DOGS": "19,119",
"ENCMTN": "75,181",
"POT": "58,112",
"PTAX": "43,166",
"OTHERS": "52,146,1,97,22,32,57,59,70,113,114,130,145,18,118,69,138,7,99,71,152,19,119,75,181,58,112,43,166"
};
return complaintIdList;
}
/////////////////////////////////////// Common Modal Box - 3 ///////////////////////////////////////
var model_box_3 = "#pgrModalBox_3";
function viewComplaintDetails(complaintNumber)
{
get_table_list_modal_box_3(complaintNumber);
/*
var dept_name_txt = dept_name.split("-");
if(dept_name_txt.length<=1){
dept_name_txt[0] = "-";
}
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase();
$('#modalTitle_2').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title
*/
loading_text_msg = getLoadingMessage(); // get Loading random text
$('#modalBody_3').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body)
$(model_box_3).modal({
backdrop: 'static',
keyboard: false
}); // Show Modal Box
//$(model_box_2).modal('show'); // Show Modal Box
return false;
}
/* Get Data of Main Page 1 */
function get_modal_box_3_table_data(complaintNumber){
var apiUrl = '/gcc/api/pgr/getComplaintDetails';
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
data: {
'complaintNumber': complaintNumber,
},
dataType: 'json',
success: function(jsonResponse) {
// Resolve the Promise with the department list
//console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list_modal_box_3(complaintNumber){
get_modal_box_3_table_data(complaintNumber).then(function(complaintDetails) {
// Handle the data list
//console.log('Response list:', complaintList);
//$('#modalBody_3').html(get_modal_box_3_table_html()); // Box content (Body)
generate_table_modal_box_3(complaintDetails);
//$(model_box_3).modal('show'); // Show Modal Box
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call Complaints Details function */
function generate_table_modal_box_3(data){
var complaintDetailsHTML = "";
$.each(data, function(index, row) {
complaintDetailsHTML = `<table class="table table-bordered table-vcenter p-0 m-0" style="font-size:12px;">
<thead>
<tr>
<th colspan="4">Complaint Information:</th>
</tr>
</thead>
<tbody>
<tr>
<th style="padding: 0.45rem 0.45rem;">Complaint No: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINTNUMBER"]+`
</td>
<th style="padding: 0.45rem 0.45rem;">Department: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["DEPT_NAME"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Complaint Date: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPDATE"]+`
</td>
<th style="padding: 0.45rem 0.45rem;">Complaint Type:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINTTYPENAME"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Complaint Title: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINTTITLE"]+`
</td>
<th style="padding: 0.45rem 0.45rem; background-color:#fbffe0;">Officer ID:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem; background-color:#fbffe0;">
`+row["USER_NAME"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Details of Complaint:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" colspan="3">
`+row["COMPLAINTDETAILS"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Complaint Location:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" colspan="3">
`+row["COMPLAINTLOCATION"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Complaint Specific Location:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" colspan="3">
`+row["COMPLAINTLANDMARK"]+`
</td>
</tr>
</tbody>
</table>`;
complaintDetailsHTML +=`<br>
<table class="table table-bordered table-vcenter p-0 m-0" style="font-size:12px;">
<thead>
<tr>
<th colspan="4">Complaining Person\'s Details:</th>
</tr>
</thead>
<tbody>
<tr>
<th style="padding: 0.45rem 0.45rem;">Person Name: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINANTFIRSTNAME"]+`
</td>
<th style="padding: 0.45rem 0.45rem;">Email: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINANTEMAIL"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Phone Number: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINANTTELEPHONE"]+`
</td>
<th style="padding: 0.45rem 0.45rem;">Mobile Number: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["MOBILENUMBER"]+`
</td>
</tr>
<tr>
<th style="padding: 0.45rem 0.45rem;">Address: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["COMPLAINANTADDRESS"]+`
</td>
<th style="padding: 0.45rem 0.45rem;">Pincode: </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;">
`+row["PINCODE"]+`
</td>
</tr>
</tbody>
</table>`;
});
$('#modalBody_3').html(complaintDetailsHTML); // Box content (Body)
}
</script>

19
src/main/resources/templates/fragments/modules/pgr/search_form.html

@ -0,0 +1,19 @@
<div class="row">
<div class="col-12 mb-2">
<div class="input-group mb-0">
<span class="input-group-prepend">
<button type="button" id="filter_reset_btn" class="btn btn-success" onclick="callReSetEventId(0);" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Reset" title="Reset">
<i class="ik ik-refresh-ccw"></i>
</button>
</span>
<select class="form-control" id="search_department_id" name="search_department_id">
<option value="0">All Department`s</option>
</select>
<span class="input-group-append">
<button type="button" id="filter_search_btn" class="btn btn-success" onclick="callSetEventId();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title="Search">
<i class="ik ik-search me-1"></i> Search
</button>
</span>
</div>
</div>
</div>

6
src/main/resources/templates/login.html

@ -11,21 +11,21 @@
<div class="container-fluid h-100"> <div class="container-fluid h-100">
<div class="row flex-row h-100 bg-white"> <div class="row flex-row h-100 bg-white">
<div class="col-xl-8 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none"> <div class="col-xl-8 col-lg-6 col-md-5 p-0 d-md-block d-lg-block d-sm-none d-none">
<div class="lavalite-bg" style="background-image: url('/assets/images/login-bg.jpg')">
<div class="lavalite-bg" style="background-image: url('images/login-bg.jpg')">
<div class="lavalite-overlay"></div> <div class="lavalite-overlay"></div>
</div> </div>
</div> </div>
<div class="col-xl-4 col-lg-6 col-md-7 my-auto p-0"> <div class="col-xl-4 col-lg-6 col-md-7 my-auto p-0">
<div class="authentication-form mx-auto text-center"> <div class="authentication-form mx-auto text-center">
<div class="logo-centered"> <div class="logo-centered">
<a href="/"><img src="/assets/images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
<a href="/gcc"><img src="images/logo.png" alt="Greater Chennai Corporation" class="header-brand-img" width="100%"></a>
</div> </div>
<h3>Greater Chennai Corporation</h3> <h3>Greater Chennai Corporation</h3>
<p>Happy to see you again!</p> <p>Happy to see you again!</p>
<div th:if="${param.error}"> <div th:if="${param.error}">
<p style="color: red;">Invalid credentials.</p> <p style="color: red;">Invalid credentials.</p>
</div> </div>
<form th:action="@{/login}" method="post">
<form th:action="@{/gcc/login}" method="post">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" id="username" name="username" placeholder="Username" required="" value="balaji"> <input type="text" class="form-control" id="username" name="username" placeholder="Username" required="" value="balaji">
<i class="ik ik-user"></i> <i class="ik ik-user"></i>

92
src/main/resources/templates/modules/admin/index.html

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="ik ik-bar-chart-2 bg-blue"></i>
<div class="d-inline">
<h5>User List</h5>
<span>GCC Application Admin (Configuration Page)</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active" aria-current="page">Admin</li>
</ol>
</nav>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3>Page Title</h3>
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3>Datatable Test</h3>
</div>
<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>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
</body>
</html>

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

@ -0,0 +1,272 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="fa fa-id-badge bg-blue"></i>
<div class="d-inline">
<h5>User Group Access</h5>
<span>GCC Application Configuration</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Admin</li>
<li class="breadcrumb-item active" aria-current="page">User Group Access</li>
</ol>
</nav>
</div>
</div>
</div>
<p></p>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-md-12"></div>
<div class="input-group col-md-12 mb-0">
<label for="search_groupid" class="pt-2"> User Group: &nbsp;</label>
<select class="form-control select2" id="search_groupid" name="search_groupid">
<option value="">Please choose a User Group Name to retrieve data.</option>
<option th:each="userGroup: ${userGroupList}" th:value="${userGroup.id}" th:text="${userGroup.name}">-</option>
</select>
<span class="input-group-append">
<button type="button" id="groupSearchbtn" class="btn btn-success" onclick="showAccessTree();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title="">
<i class="ik ik-search me-1"></i> Search
</button>
</span>
</div>
</div>
</div>
<div class="card-body">
<div class="col-sm-12">
<div id="loadaccesstree"></div>
<!-- <div th:utext="${accessHTML}"></div> -->
</div>
</div>
<div class="card-footer">
<div class="col-sm-12 text-right">
<button type="reset" class="btn btn-secondary btn-sm" data-dismiss="modal" onclick="return closeModel();"><i class="ik ik-x-square"></i>Close</button>
<button type="submit" class="btn btn-success btn-sm" id="savebtn" onclick="return getCheckedData()"><i class="ik ik-save"></i>Save</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script>
(function($){
$.fn.extend({
// Tree Check By Paranet (Check All)
checktree: function(){
$(this)
.addClass('checktree-root')
.on('change', 'input[type="checkbox"]', function(e){
e.stopPropagation();
e.preventDefault();
checkParents($(this));
checkChildren($(this));
})
;
var checkParents = function (c)
{
var parentLi = c.parents('ul:eq(0)').parents('li:eq(0)');
if (parentLi.length)
{
var siblingsChecked = parseInt($('input[type="checkbox"]:checked', c.parents('ul:eq(0)')).length),
rootCheckbox = parentLi.find('input[type="checkbox"]:eq(0)')
;
if (c.is(':checked'))
rootCheckbox.prop('checked', true)
else if (siblingsChecked === 0)
rootCheckbox.prop('checked', false);
checkParents(rootCheckbox);
}
}
var checkChildren = function (c)
{
var childLi = $('ul li input[type="checkbox"]', c.parents('li:eq(0)'));
if (childLi.length)
childLi.prop('checked', c.is(':checked'));
}
}
});
})(jQuery);
callMenuTreeAccess = function(groupId,groupName){
const loadaccesstree = $("#loadaccesstree");
const searchBtn = $("#groupSearchbtn");
const savebtn = $("#savebtn");
const apiUrl = "/gcc/api/getAccessTree?groupId="+groupId+"&groupName="+groupName;
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'text',
success: function(Response) {
// Handle the API response data here
//console.log('Data from API:', Response);
// Parse the JSON response into a JavaScript object
var data = Response;
if(data.ResultStatus=="False")
{
loadaccesstree.html("<center>"+nodata(data.Message)+"</center>");
searchBtn.prop("disabled", false);
searchBtn.html('<i class="ik ik-search me-1"></i> Search');
}
else{
loadaccesstree.html(data);
$('#tree').checktree();
// Enable the button
searchBtn.prop("disabled", false);
searchBtn.html('<i class="ik ik-search me-1"></i> Search');
savebtn.prop("disabled", false);
}
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', xhr.status, error);
if (xhr.status == 404) {
// Handle 404 error specifically
loadaccesstree.html(nodata("<b>Unable to fetch data. Please try again later.<br>Error 404: Resource not found. Please check the URL.</b>"));
} else {
// Handle other errors
loadaccesstree.html(nodata("<b>Error: Unable to fetch data. Please try again later.</b>"));
}
// Enable the button
searchBtn.prop("disabled", false);
searchBtn.html('<i class="ik ik-search me-1"></i> Search');
}
});
}
// Load Access Tree
showAccessTree = function(){
const loadaccesstree = $("#loadaccesstree");
const selectedGroup = $('#search_groupid');
const selectedGroupId = selectedGroup.val();
const selectedGroupName = selectedGroup.find('option:selected').text();
const searchBtn = $("#groupSearchbtn");
const savebtn = $("#savebtn");
call_loading('loadaccesstree','start');
savebtn.prop("disabled", true); // Stop Save button
if(selectedGroupId>0){
// Disable the button to prevent multiple clicks
searchBtn.prop("disabled", true);
// Show the loading icon on the button
searchBtn.html('<i class="fas fa-spinner fa-spin"></i>');
callMenuTreeAccess(selectedGroupId,selectedGroupName);
}
else{
loadaccesstree.html(searchinfo("<b>Please select and search for a User Group to continue.</b>"));
}
}
showAccessTree();
var getCheckedData = function() {
var checkedData = [];
$('input[type="checkbox"]:checked', "#tree").each(function() {
checkedData.push($(this).val());
});
// Push Group ID
const selectedGroup = $('#search_groupid');
const selectedGroupId = selectedGroup.val();;
console.log(checkedData);
submitCheckedData(checkedData,selectedGroupId);
return false;//checkedData;
};
var submitCheckedData = function(checkedData, groupId) {
// Perform your AJAX request here using checkedData
// Replace the URL and other options with your actual API endpoint and data
const apiUrl = "/api/saveGroupAccessData";
const selectedGroup = $('#search_groupid');
const selectedGroupName = selectedGroup.find('option:selected').text();
$.ajax({
url: apiUrl,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ checkedData: checkedData, groupId: groupId }),
success: function(response) {
// Handle the success response
console.log('API response:', response);
Swal.fire(
'User Group Access!',
'Access has been successfully mapped to the User Group (' + selectedGroupName + ')!',
'success'
).then(() => {
location.reload();
});
},
error: function(error) {
// Handle the error response
console.error('API error:', error);
}
});
};
</script>
</body>
</html>

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

@ -0,0 +1,183 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="fa fa-users bg-blue"></i>
<div class="d-inline">
<h5>User Group List</h5>
<span>GCC Application Configuration</span>
</div>
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item">Admin </li>
<li class="breadcrumb-item active" aria-current="page">User Group List</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div>
<table id="assetDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Petition No.</th>
<th class="text-center">Name</th>
<th class="text-center">Mobile</th>
<th class="text-center">Address</th>
<th class="text-center">Postal code</th>
<th class="text-center">Type of complaint</th>
<th class="text-center" width="10%">Status</th>
<th class="text-center" width="10%">Action</th>
</tr>
</thead>
<tbody>
<tr th:each="petition, i : ${petitionlist}" class="${petitionlist}">
<td th:utext="${i.count}">0</td>
<td th:utext="${petition.petitionNumber}"></td>
<td th:utext="${petition.petitionerName}" class="text-center"></td>
<td th:text="${petition.petitionerMobile}"></td>
<td th:utext="${petition.petitionerAddress}"></td>
<td th:utext="${petition.petitionerPincode}"></td>
<td th:text="${petition.PetitionerComplaint_txt}"></td>
<td style="text-transform: capitalize;" class="text-center"><a href="#" th:onclick="return call_view_petition([[${petition.petitionNumber}]]);" th:utext="${petition.status}" class="text-warning"></a></td>
<td class="text-center">
<a th:href="@{#}" th:onclick="return callViewFiles( [[${petition.petitionId}]],[[${petition.petitionNumber}]] );" data-toggle="tooltip" data-animation="true" data-placement="top" title="View Files" data-original-title="View Files"><i class="ik ik-file-text text-green" style="font-size: 18px;"></i></a>
<a th:href="@{/petition-ack/{petitionNumber}(petitionNumber=${petition.petitionNumber})}"
data-toggle="tooltip" data-animation="true" data-placement="top" title="View ACK" data-original-title="View ACK">
<i class="far fa-thumbs-up" style="font-size: 18px;"></i>
</a>
</td>
</tr>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Petition No.</th>
<th class="text-center">Name</th>
<th class="text-center">Mobile</th>
<th class="text-center">Address</th>
<th class="text-center">Postal code</th>
<th class="text-center">Type of complaint</th>
<th class="text-center" width="10%">Status</th>
<th class="text-center" width="10%">Action</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/mtm/modal-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/mtm/script :: script}"></script>
<script th:inline="javascript">
//var qrAssetFeedbackApiUrl = "[[${qrAssetFeedbackApiUrl}]]";
$(document).ready(function() {
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: 'Petition List'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: 'Petition List'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: 'Petition List'
}
];
$('#assetDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [buttons],
responsive: true,
searching: false,
select: false,
processing: false,
} );
} );
</script>
</body>
</html>

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

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="fa fa-user bg-blue"></i>
<div class="d-inline">
<h5>User List</h5>
<span>GCC Application Configuration</span>
</div>
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item">Admin</li>
<li class="breadcrumb-item active" aria-current="page">User List</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div>
<table id="assetDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Name</th>
<th class="text-center">E-mail</th>
<th class="text-center">Mobile</th>
<th class="text-center">Username</th>
<th class="text-center">Role</th>
<th class="text-center">Access Group</th>
<th class="text-center" width="10%">Status</th>
<th class="text-center" width="10%">Action</th>
</tr>
</thead>
<tbody>
<tr th:each="userlistData, i : ${userlist}" class="${userlist}">
<td th:utext="${i.count}">0</td>
<td th:utext="${userlistData.userid.name}"></td>
<td th:utext="${userlistData.userid.email}"></td>
<td th:utext="${userlistData.userid.phone}"></td>
<td th:text="${userlistData.username}"></td>
<td th:utext="${userlistData.roles}" class="text-center"></td>
<td th:text="${userlistData.usergroup_id.name}"></td>
<td style="text-transform: capitalize;" th:utext="${userlistData.isActive} ? 'Active' : 'Inactive'" th:class="${userlistData.isActive} ? 'text-center text-green' : 'text-center text-red'"></td>
<td class="text-center">
<a th:href="@{#}" th:onclick="return callUserDetails([[${userlistData.id}]]);" data-toggle="tooltip" data-animation="true" data-placement="top" title="View User Details" data-original-title="View User Details"><i class="ik ik-file-text text-green" style="font-size: 18px;"></i></a>
</td>
</tr>
</tbody>
<tfoot class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Name</th>
<th class="text-center">E-mail</th>
<th class="text-center">Mobile</th>
<th class="text-center">Username</th>
<th class="text-center">Role</th>
<th class="text-center">Access Group</th>
<th class="text-center" width="10%">Status</th>
<th class="text-center" width="10%">Action</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/admin/modal-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:inline="javascript">
//var qrAssetFeedbackApiUrl = "[[${qrAssetFeedbackApiUrl}]]";
$(document).ready(function() {
var exportTitle = "GCC Application User List";
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: exportTitle
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: exportTitle
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: exportTitle
}
];
$('#assetDatatable').DataTable( {
/* Disable initial sort */
aaSorting: [],
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
dom: 'Bftip',
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [buttons],
responsive: true,
searching: false,
select: false,
processing: false,
} );
} );
// For view user details
function callUserDetails(userid){
$("#profilehtml").html(searchinfo("<b>Retrieving Information, Please Wait...<div id=\"loadingimg\"></div></b>"));
call_loading("loadingimg","start");
$('#viewUserDetails').modal({
backdrop: 'static',
keyboard: false
})
$('#viewUserDetails').modal('show');
var userProfileHtml = "";
getUserDetails(userid).then(response => {
// Handle the success response
$("#profilehtml").html(response);
})
.catch(error => {
// Handle the error response
$("#profilehtml").html(error);
});
}
function getUserDetails(userid){
const apiUrl = "/api/getUserProfile";
return new Promise((resolve, reject) => {
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'text',
data: { userId: userid},
success: function(response) {
// Handle the success response
resolve(response);
},
error: function(error) {
// Handle the error response
console.error('API error:', error);
reject(error);
}
});
});
}
</script>
</body>
</html>

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

@ -0,0 +1,284 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="far fa-list-alt bg-blue"></i>
<div class="d-inline">
<h5>PGR - All Reports</h5>
<span>Public Grievance Redressal Reports</span>
</div>
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active" aria-current="page">All Reports</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div>
<div id="tableLoading"></div>
<div>
<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Zone No.</th>
<th class="text-center">Div No.</th>
<th class="text-center">User Name</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Location</th>
<th class="text-center">Date</th>
<th class="text-center">Time</th>
<th class="text-center">Status</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Zone No.</th>
<th class="text-center">Div No.</th>
<th class="text-center">User Name</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Location</th>
<th class="text-center">Date</th>
<th class="text-center">Time</th>
<th class="text-center">Status</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/pgr/modal-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/pgr/script :: script}"></script>
<script th:inline="javascript">
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
// Loading Div id
const loading = $("#tableLoading");
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: 'Petition List'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: 'Petition List'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: 'Petition List'
},
{
extend: 'print',
text: 'Print',
className: 'btn btn-secondary',
id: 'printBtn',
title: 'Petition List'
}
];
function call_loading(){
$("#filter_reset_btn").prop("disabled", true);
$("#filter_search_btn").prop("disabled", true);
loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
}
function remove_loading(){
$("#filter_reset_btn").prop("disabled", false);
$("#filter_search_btn").prop("disabled", false);
loading.html("");
}
/* Get Department Data */
function get_department_data(){
get_department_list().then(function(departments) {
// Handle the department list
departmentlist = departments;
// Iterate through the department list and add options to the select element
$.each(departmentlist, function(index, department) {
// Create an option element
var option = $('<option>', {
value: department.ID_DEPT, // case-sensitive as per object
text: department.DEPT_NAME
});
// Append the option to the select element
$('#search_department_id').append(option);
});
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Get Complaints Data */
function get_complaints_data(){
var apiUrl = '/gcc/api/pgr/getComplaintsList';
// 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_complaints_list(){
get_complaints_data().then(function(complaintList) {
// Handle the department list
generate_table(complaintList);
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table(data){
var table = $('#complaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [buttons],
responsive: true,
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
row['ZONE_NAME'],
row['DIVISION_NAME'],
row['USER_NAME'],
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>",
row['COMPLAINTTYPENAME'],
row['LOCATION'],
row['COMPDATE'],
row['TIME'],
row['STATUS']
]).draw(false);
});
// Now call for Filter
get_department_data();
remove_loading(); // remove Loading
}
$(document).ready(function() {
call_loading();
get_complaints_list();
});
</script>
</body>
</html>

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

@ -0,0 +1,792 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<link rel="stylesheet" href="/assets/node_modules/amcharts3/amcharts/plugins/export/export.css" type="text/css" media="all" />
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="ik ik-bar-chart-2 bg-blue"></i>
<div class="d-inline">
<h5>PGR</h5>
<span>Public Grievance Redressal Reports</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active" aria-current="page">Dashboard</li>
</ol>
</nav>
</div>
</div>
</div>
<!-- <h4 class="h4 text-right text-mute" style="font-size: 12px;">Auot refresh in <font id="refresh-countdown">00</font> seconds</h4> -->
<div class="row">
<div class="col-md-12">
<div class="card sale-card">
<div class="card-header">
<i class="fas fa-chart-pie pr-2"></i><h3>OverAll Complaint Age Analysis</h3>
<div class="card-header-right">
<i id="update_pie_loading"></i>
</div>
</div>
<div class="card-block text-center" id="">
<h3 id="pie_card" style="font-size:12px"></h3>
<div id="pie_content_html">
<h6>OverAll Pending</h6>
<h3 id="pie_pending" class="chart-shadow" style="height:350px; font-size:12px;border-bottom: 1px solid #dee2e6;">0</h3>
<h6>OverAll Reopen</h6>
<h3 id="pie_reopen_pending" class="chart-shadow" style="height:350px; font-size:12px">0</h3>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card sale-card">
<div class="card-header">
<i class="fas fa-chart-bar pr-2"></i><h3>Complaint`s Type Wise Pending Count`s</h3>
</div>
<div class="card-block">
<div id="deal-analytic-chart" class="chart-shadow" style="height:300px"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</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/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>
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
const loading = $("#pie_card");
var pie_data = "";
var departmentlist = "";
function callPieFilter(){
var filter = $("#search_id").val();
pass_pie_data(filter);
pass_bar_data(filter);
}
function callReSetPieFilter(){
var filter = 0;
$("#search_id").val(filter);
pass_pie_data(filter);
pass_bar_data(filter);
}
function get_department_data(){
get_department_list().then(function(departments) {
// Handle the department list
//console.log('Department list:', departmentlist);
departmentlist = departments;
fetchPie_Data(0); // Dropdown fileter value
fetchData_Bar(0); // Dropdown fileter value
}).catch(function(error) {
// 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
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', status, error);
}
});
*/
}
function fetchPie_Data(deptid){
var pie_option = "";
for (var i = 0; i < departmentlist.length; i++) {
pie_option +='<option value="'+departmentlist[i]["ID_DEPT"]+'">'+departmentlist[i]["DEPT_NAME"]+'</option>';
}
call_loading('update_pie_loading','start');
var apiUrl = '/gcc/api/pgr/getPendingComplaintCount';
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
pie_data = jsonResponse;
$("#pie_content_html").html('' +
'<div class="row">' +
'<div class="col-12 mb-2">' +
'<div class="input-group mb-0">' +
'<span class="input-group-prepend">' +
'<button type="button" class="btn btn-success" onclick="callReSetPieFilter(0);" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Reset" title="Reset">' +
'<i class="ik ik-refresh-ccw"></i>' +
'</button>' +
'</span>' +
'<select class="form-control" id="search_id" name="search_id">' +
'<option value="0">All Departments</option>' +
'' + pie_option +
'</select>' +
'<span class="input-group-append">' +
'<button type="button" class="btn btn-success" onclick="callPieFilter();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title="Search">' +
'<i class="ik ik-search me-1"></i> Search' +
'</button>' +
'</span>' +
'</div>' +
'</div>' +
'</div>' +
'<h3 id="pie_pending" class="chart-shadow" style="height:350px; font-size:12px;border-bottom: 1px solid #dee2e6;">0</h3>' +
'<h3 id="pie_reopen_pending" class="chart-shadow" style="height:350px; font-size:12px">0</h3>'
);
pass_pie_data(0);
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', status, error);
}
});
}
/*
let refreshInterval;
let remainingTime = 60; // Initial countdown time in seconds
function updateCountdown() {
let remainingTimetxt = remainingTime;
if(remainingTime<10){
remainingTimetxt = "0"+remainingTime;
}
document.getElementById("refresh-countdown").textContent = remainingTimetxt;
remainingTime--;
if (remainingTime < 0) {
clearInterval(refreshInterval);
remainingTime = 60;
fetchDashboardSummary_Pie();
refreshInterval = setInterval(updateCountdown, 1000);
}
}
*/
</script>
<script>
function pass_pie_data(filter){
jsonResponse = pie_data;
// Initialize variables to store sums
var pending_title = "OverAll Pending Without Reopen";
var pending_reoprn_title = "OverAll Reopen Pending";
var DAYS_90_PEN = 0;
var DAYS_90_REOPEN = 0;
var DAYS_61_90_PEN = 0;
var DAYS_61_90_REOPEN = 0;
var DAYS_31_60_PEN = 0;
var DAYS_31_60_REOPEN = 0;
var DAYS_16_30_PEN = 0;
var DAYS_16_30_REOPEN = 0;
var DAYS_0_15_PEN = 0;
var DAYS_0_15_REOPEN = 0;
var filterSearch = [];
// Loop through the jsonResponse array
for (var i = 0; i < jsonResponse.length; i++) {
// Accumulate values for each data
if(filter>0){
/*
if(filter==48){ // Regional Office North (48)
//Zones Under 48: NA-THIRUVOTTIYR ID -32 || NB-MANALI ID- 33 || NC-MADHAVARAM ID- 34 || ND-TONDIARPET ID- 35 || NE-ROYAPURAM ID- 36
filterSearch = [32, 33, 34, 35, 36];
}
else if(filter==50){ //Regional Office Central (50)
//Zones Under 50: NF-THIRU-VI-KA-NAGAR ID- 37 || NG-AMBATTUR ID- 38 || NH-ANNA NAGAR ID- 39 || NJ-TEYNAMPET ID- 40 || NK-KODAMBAKKAM ID- 41
filterSearch = [37, 38, 39, 40, 41];
}
else if(filter==49){ //Regional Office South (49)
//Zones Under 49: NA-VALASARAVAKKAM ID - 42 || NM-ALANDUR ID- 43 || NN-ADYAR ID - 44 || NP-PERUNGUDI ID- 45 || NQ-SHOZHINGANALLUR - 46
filterSearch = [42, 43, 44, 45, 46];
}
else{
filterSearch =[filter];
}
console.log(filterSearch);
*/
//if (filterSearch.includes(jsonResponse[i]["DEPTID"])) { // Only Seleted Departments or Zone
if(jsonResponse[i]["DEPTID"]==filter){
//alert(filter);
pending_title = "OverAll Pending Witout Reopen of "+jsonResponse[i]["DEPT_NAME"];
pending_reoprn_title = "OverAll Reopen Pending of "+jsonResponse[i]["DEPT_NAME"];
DAYS_90_PEN += jsonResponse[i]["DAYS_90_PEN"];
DAYS_90_REOPEN += jsonResponse[i]["DAYS_90_REOPEN"];
DAYS_61_90_PEN += jsonResponse[i]["DAYS_61_90_PEN"];
DAYS_61_90_REOPEN += jsonResponse[i]["DAYS_61_90_REOPEN"];
DAYS_31_60_PEN += jsonResponse[i]["DAYS_31_60_PEN"];
DAYS_31_60_REOPEN += jsonResponse[i]["DAYS_31_60_REOPEN"];
DAYS_16_30_PEN += jsonResponse[i]["DAYS_16_30_PEN"];
DAYS_16_30_REOPEN += jsonResponse[i]["DAYS_16_30_REOPEN"];
DAYS_0_15_PEN += jsonResponse[i]["DAYS_0_15_PEN"];
DAYS_0_15_REOPEN += jsonResponse[i]["DAYS_0_15_REOPEN"];
}
}
else{
// All data
DAYS_90_PEN += jsonResponse[i]["DAYS_90_PEN"];
DAYS_90_REOPEN += jsonResponse[i]["DAYS_90_REOPEN"];
DAYS_61_90_PEN += jsonResponse[i]["DAYS_61_90_PEN"];
DAYS_61_90_REOPEN += jsonResponse[i]["DAYS_61_90_REOPEN"];
DAYS_31_60_PEN += jsonResponse[i]["DAYS_31_60_PEN"];
DAYS_31_60_REOPEN += jsonResponse[i]["DAYS_31_60_REOPEN"];
DAYS_16_30_PEN += jsonResponse[i]["DAYS_16_30_PEN"];
DAYS_16_30_REOPEN += jsonResponse[i]["DAYS_16_30_REOPEN"];
DAYS_0_15_PEN += jsonResponse[i]["DAYS_0_15_PEN"];
DAYS_0_15_REOPEN += jsonResponse[i]["DAYS_0_15_REOPEN"];
}
}
var pieData = [
{ "title":"Above 90 Days", "color": "#F22613", "value": DAYS_90_PEN },
{ "title":"61 - 90 Days", "color": "#F29D13", "value": DAYS_61_90_PEN },
{ "title":"31 - 60 Days", "color": "#F2BA13", "value": DAYS_31_60_PEN },
{ "title":"16 - 30 Days", "color": "#F2EB13", "value": DAYS_16_30_PEN },
{ "title":"0 - 15 Days", "color": "#91F213", "value": DAYS_0_15_PEN }
];
var pieData_reoprn = [
{ "title":"Above 90 Days", "color": "#F22613", "value": DAYS_90_REOPEN },
{ "title":"61 - 90 Days", "color": "#F29D13", "value": DAYS_61_90_REOPEN },
{ "title":"31 - 60 Days", "color": "#F2BA13", "value": DAYS_31_60_REOPEN },
{ "title":"16 - 30 Days", "color": "#F2EB13", "value": DAYS_16_30_REOPEN },
{ "title":"0 - 15 Days", "color": "#91F213", "value": DAYS_0_15_REOPEN }
];
call_pending_pie(pieData,pending_title);
call_pending_reopen_pie(pieData_reoprn,pending_reoprn_title);
loading.html("");
$("#update_pie_loading").html("");
}
function call_pending_pie(pieData,title){
var chart = AmCharts.makeChart("pie_pending", {
"type": "pie",
"theme": "light",
"dataProvider": pieData,
"valueField": "value",
"titleField": "title",
"colorField": "color",
"alpha": 0.8,
"outlineAlpha": 0.5,
//"depth3D": 25,
"balloonText": "[[[[title]]]]<br><span style='font-size:14px'><b>[[[[value]]]]</b> ([[[[percents]]]]%)</span>",
"angle": 45,
"export": {
"enabled": true,
"fileName": title
},
"legend": {
"position": "right"
},
"titles": [{
"text": title,
"size": 15,
"marginBottom": 20
}]
});
}
function call_pending_reopen_pie(pieData,title){
var chart = AmCharts.makeChart("pie_reopen_pending", {
"type": "pie",
"theme": "light",
"dataProvider": pieData,
"valueField": "value",
"titleField": "title",
"colorField": "color",
"alpha": 0.8,
"outlineAlpha": 0.5,
//"depth3D": 25,
"balloonText": "[[[[title]]]]<br><span style='font-size:14px'><b>[[[[value]]]]</b> ([[[[percents]]]]%)</span>",
"angle": 45,
"export": {
"enabled": true,
"fileName": title
},
"legend": {
"position": "right"
},
"titles": [{
"text": title,
"size": 15,
"marginBottom": 20
}]
});
}
</script>
<script>
var bar_data_1 = "";
var bar_data_2 = "";
var chart = "";
var pending_title = "OverAll Pending By Complaint`s Type";
var pending_reopen_title = "OverAll Reopen By Complaint`s Type";
function fetchData_Bar(deptid){
call_loading('update_bar_loading','start');
var apiUrl = '/gcc/api/pgr/getZoneWisePendingComplaintCount';
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
bar_data_1 = jsonResponse;
fetch2Data_Bar(0);
//loading.html("");
//$("#update_pie_loading").html("");
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', status, error);
}
});
}
function fetch2Data_Bar(deptid){
var apiUrl = '/gcc/api/pgr/getZoneWiseReopenComplaintCount';
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
bar_data_2 = jsonResponse;
pass_bar_data(0);
//loading.html("");
//$("#update_pie_loading").html("");
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', status, error);
}
});
}
function pass_bar_data(filter){
jsonResponse = bar_data_1;
jsonResponse2 = bar_data_2;
// Initialize variables to store sums
var NONBURSTLT = 0;
var REOFGAR = 0;
var ROAD = 0;
var MOSQUITE = 0;
var WATER = 0;
var REOFDEB = 0;
var TREE = 0;
var DOGS = 0;
var ENCMTN = 0;
var POT = 0;
var PTAX = 0;
var OTHERS = 0;
var NONBURSTLT_REOPEN = 0;
var REOFGAR_REOPEN = 0;
var ROAD_REOPEN = 0;
var MOSQUITE_REOPEN = 0;
var WATER_REOPEN = 0;
var REOFDEB_REOPEN = 0;
var TREE_REOPEN = 0;
var DOGS_REOPEN = 0;
var ENCMTN_REOPEN = 0;
var POT_REOPEN = 0;
var PTAX_REOPEN = 0;
var OTHERS_REOPEN = 0;
var filterSearch = [];
// Loop through the jsonResponse array
for (var i = 0; i < jsonResponse.length; i++) {
// Accumulate values for each data
if(filter>0){
if(filter==48){ // Regional Office North (48)
//Zones Under 48: NA-THIRUVOTTIYR ID -32 || NB-MANALI ID- 33 || NC-MADHAVARAM ID- 34 || ND-TONDIARPET ID- 35 || NE-ROYAPURAM ID- 36
filterSearch = [32, 33, 34, 35, 36];
}
else if(filter==50){ //Regional Office Central (50)
//Zones Under 50: NF-THIRU-VI-KA-NAGAR ID- 37 || NG-AMBATTUR ID- 38 || NH-ANNA NAGAR ID- 39 || NJ-TEYNAMPET ID- 40 || NK-KODAMBAKKAM ID- 41
filterSearch = [37, 38, 39, 40, 41];
}
else if(filter==49){ //Regional Office South (49)
//Zones Under 49: NA-VALASARAVAKKAM ID - 42 || NM-ALANDUR ID- 43 || NN-ADYAR ID - 44 || NP-PERUNGUDI ID- 45 || NQ-SHOZHINGANALLUR - 46
filterSearch = [42, 43, 44, 45, 46];
}
else{
filterSearch =[filter];
}
if (filterSearch.includes(jsonResponse[i]["DEPTID"])) { // Only Seleted Departments or Zone
pending_title = "OverAll Pending of "+jsonResponse[i]["DEPT_NAME"]+" By Complaint`s Type";
pending_reopen_title = "OverAll Reopen of "+jsonResponse[i]["DEPT_NAME"]+" By Complaint`s Type";
NONBURSTLT += jsonResponse[i]["NONBURSTLT"];
REOFGAR += jsonResponse[i]["REOFGAR"];
ROAD += jsonResponse[i]["ROAD"];
MOSQUITE += jsonResponse[i]["MOSQUITE"];
WATER += jsonResponse[i]["WATER"];
REOFDEB += jsonResponse[i]["REOFDEB"];
TREE += jsonResponse[i]["TREE"];
DOGS += jsonResponse[i]["DOGS"];
ENCMTN += jsonResponse[i]["ENCMTN"];
POT += jsonResponse[i]["POT"];
PTAX += jsonResponse[i]["PTAX"];
OTHERS += jsonResponse[i]["OTHERS"];
}
}
else{
// All data
NONBURSTLT += jsonResponse[i]["NONBURSTLT"];
REOFGAR += jsonResponse[i]["REOFGAR"];
ROAD += jsonResponse[i]["ROAD"];
MOSQUITE += jsonResponse[i]["MOSQUITE"];
WATER += jsonResponse[i]["WATER"];
REOFDEB += jsonResponse[i]["REOFDEB"];
TREE += jsonResponse[i]["TREE"];
DOGS += jsonResponse[i]["DOGS"];
ENCMTN += jsonResponse[i]["ENCMTN"];
POT += jsonResponse[i]["POT"];
PTAX += jsonResponse[i]["PTAX"];
OTHERS += jsonResponse[i]["OTHERS"];
}
}
// Loop through the jsonResponse array
for (var i = 0; i < jsonResponse2.length; i++) {
// Accumulate values for each data
if(filter>0){
if(jsonResponse2[i]["DEPTID"]==filter){ // Only Seleted Departments or Zone
pending_title = "OverAll Pending of "+jsonResponse2[i]["DEPT_NAME"]+" By Complaint`s Type";
pending_reoprn_title = "OverAll Reopen of "+jsonResponse2[i]["DEPT_NAME"]+" By Complaint`s Type";
NONBURSTLT_REOPEN += jsonResponse2[i]["NONBURSTLT"];
REOFGAR_REOPEN += jsonResponse2[i]["REOFGAR"];
ROAD_REOPEN += jsonResponse2[i]["ROAD"];
MOSQUITE_REOPEN += jsonResponse2[i]["MOSQUITE"];
WATER_REOPEN += jsonResponse2[i]["WATER"];
REOFDEB_REOPEN += jsonResponse2[i]["REOFDEB"];
TREE_REOPEN += jsonResponse2[i]["TREE"];
DOGS_REOPEN += jsonResponse2[i]["DOGS"];
ENCMTN_REOPEN += jsonResponse2[i]["ENCMTN"];
POT_REOPEN += jsonResponse2[i]["POT"];
PTAX_REOPEN += jsonResponse2[i]["PTAX"];
OTHERS_REOPEN += jsonResponse2[i]["OTHERS"];
}
}
else{
// All data
NONBURSTLT_REOPEN += jsonResponse2[i]["NONBURSTLT"];
REOFGAR_REOPEN += jsonResponse2[i]["REOFGAR"];
ROAD_REOPEN += jsonResponse2[i]["ROAD"];
MOSQUITE_REOPEN += jsonResponse2[i]["MOSQUITE"];
WATER_REOPEN += jsonResponse2[i]["WATER"];
REOFDEB_REOPEN += jsonResponse2[i]["REOFDEB"];
TREE_REOPEN += jsonResponse2[i]["TREE"];
DOGS_REOPEN += jsonResponse2[i]["DOGS"];
ENCMTN_REOPEN += jsonResponse2[i]["ENCMTN"];
POT_REOPEN += jsonResponse2[i]["POT"];
PTAX_REOPEN += jsonResponse2[i]["PTAX"];
OTHERS_REOPEN += jsonResponse2[i]["OTHERS"];
}
}
var barData = [
{
"issueCategory": "Street Light<br>not burning",
"AllPendingwithReopen": NONBURSTLT,
"onlyReopen": NONBURSTLT_REOPEN
},
{
"issueCategory": "Removal of<br>Garbage",
"AllPendingwithReopen": REOFGAR,
"onlyReopen": REOFGAR_REOPEN
},
{
"issueCategory": "Road<br>Damaged",
"AllPendingwithReopen": ROAD,
"onlyReopen": ROAD_REOPEN
},
{
"issueCategory": "Mosquito<br>Nuisance",
"AllPendingwithReopen": MOSQUITE,
"onlyReopen": MOSQUITE_REOPEN
},
{
"issueCategory": "Water<br>Stagnation",
"AllPendingwithReopen": WATER,
"onlyReopen": WATER_REOPEN
},
{
"issueCategory": "Removal of<br>Debries",
"AllPendingwithReopen": REOFDEB,
"onlyReopen": REOFDEB_REOPEN
},
{
"issueCategory": "Tree<br>Fallen",
"AllPendingwithReopen": TREE,
"onlyReopen": TREE_REOPEN
},
{
"issueCategory": "Dog<br>Menace",
"AllPendingwithReopen": DOGS,
"onlyReopen": DOGS_REOPEN
},
{
"issueCategory": "Encroachment",
"AllPendingwithReopen": ENCMTN,
"onlyReopen": ENCMTN_REOPEN
},
{
"issueCategory": "Potshole",
"AllPendingwithReopen": POT,
"onlyReopen": POT_REOPEN
},
{
"issueCategory": "Property Tax",
"AllPendingwithReopen": PTAX,
"onlyReopen": PTAX_REOPEN
},
{
"issueCategory": "Others",
"AllPendingwithReopen": OTHERS,
"onlyReopen": OTHERS_REOPEN
},
];
call_zonewise_pending_bar(barData);
}
function call_zonewise_pending_bar(chartData){
/*
var chartData = [];
var currentDate = new Date();
var currentMonth = currentDate.getMonth() + 1;
var currentYear = currentDate.getFullYear();
var daysInMonth = new Date(currentYear, currentMonth, 0).getDate();
// Generate random data for each date in the current month
for (var i = 1; i <= daysInMonth; i++) {
var randomValue1 = Math.floor(Math.random() * 100); // Replace 100 with the maximum value you want
var randomValue2 = Math.floor(Math.random() * 100); // Replace 100 with the maximum value you want
var issueCategory = currentYear + '-' + (currentMonth < 10 ? '0' : '') + currentMonth + '-' + (i < 10 ? '0' : '') + i;
var dataPoint = {
"issueCategory": issueCategory,
"AllPendingwithReopen": randomValue1,
"onlyReopen": randomValue2
};
chartData.push(dataPoint);
}
*/
// deal-analytic-chart
chart = AmCharts.makeChart("deal-analytic-chart", {
"type": "serial",
"theme": "light",
//"dataDateFormat": "YYYY-MM-DD",
//"precision": 2,
"valueAxes": [{
"id": "v1",
"position": "left",
"autoGridCount": false,
"labelFunction": function(value) {
return "$" + Math.round(value) + "M";
}
}, {
"id": "v2",
"gridAlpha": 0,
"autoGridCount": false
}],
"graphs": [{
"id": "g1",
"valueAxis": "v2",
/*"bullet": "round",
"bulletBorderAlpha": 1,
"bulletColor": "#FFFFFF",
"bulletSize": 8,
"hideBulletsCount": 50,
"lineThickness": 3,
"lineColor": "#2ed8b6",*/
"lineColor": "#2ed8b6",
"fillColors": "#2ed8b6",
"type": "column",
"fillAlphas": 0.3,
"columnWidth": 0.5,
"title": pending_title,
"useLineColorForBulletBorder": true,
"valueField": "AllPendingwithReopen",
"balloonText": "[[[[title]]]]<br /><b style='font-size: 130%'>[[[[value]]]]</b>"
}, {
"id": "g2",
"valueAxis": "v2",
//"bullet": "round",
//"bulletBorderAlpha": 1,
//"bulletColor": "#FFFFFF",
//"bulletSize": 8,
//"hideBulletsCount": 50,
//"lineThickness": 3,
//"lineColor": "#e95753",
"lineColor": "#F22613",
"fillColors": "#F22613",
"type": "column",
"fillAlphas": 0.3,
"columnWidth": 0.5,
"title": pending_reopen_title,
"useLineColorForBulletBorder": true,
"valueField": "onlyReopen",
"balloonText": "[[[[title]]]]<br /><b style='font-size: 130%'>[[[[value]]]]</b>"
}],
"chartCursor": {
"pan": true,
"valueLineEnabled": true,
"valueLineBalloonEnabled": true,
"cursorAlpha": 0,
"valueLineAlpha": 0.2
},
"categoryField": "issueCategory",
"categoryAxis": {
//"parseDates": true,
"dashLength": 1,
"minorGridEnabled": true
},
"legend": {
"useGraphSettings": true,
"position": "top"
},
"balloon": {
"borderThickness": 1,
"shadowAlpha": 0
},
"export": {
"enabled": true,
"fileName": "Complaint`s Type Wise Pending Count`s"
},
"dataProvider": chartData,
});
}
</script>
<script>
$(document).ready(function() {
//loading.html(searchinfo("<b>Please wait as I'm trying to fetch the data. It will take less than 30 seconds.</b>"));
loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
call_loading('deal-analytic-chart','start');
$("#pie_content_html").html("");
// Initial fetch and countdown start
get_department_data(); // Dropdown fileter value
//refreshInterval = setInterval(updateCountdown, 1000);
});
</script>
</body>
</html>

299
src/main/resources/templates/modules/pgr/qa-qc-list.html

@ -0,0 +1,299 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="ik ik-thumbs-up bg-blue"></i>
<div class="d-inline">
<h5>QA AND QC Report</h5>
<span>Public Grievance Redressal Reports</span>
</div>
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item active" aria-current="page">All Reports</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div>
<div id="tableLoading"></div>
<div>
<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Department</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Date</th>
<th class="text-center">Time</th>
<th class="text-center">Complaint Details</th>
<th class="text-center">Reporter Name</th>
<th class="text-center">Reporter Mobile</th>
<th class="text-center">Officer ID</th>
<th class="text-center">Officer Mobile</th>
<th class="text-center">Completion Date</th>
<th class="text-center">Status</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Department</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Date</th>
<th class="text-center">Time</th>
<th class="text-center">Complaint Details</th>
<th class="text-center">Reporter Name</th>
<th class="text-center">Reporter Mobile</th>
<th class="text-center">Officer ID</th>
<th class="text-center">Officer Mobile</th>
<th class="text-center">Completion Date</th>
<th class="text-center">Status</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/pgr/modal-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/pgr/script :: script}"></script>
<script th:inline="javascript">
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
// Loading Div id
const loading = $("#tableLoading");
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: 'Petition List'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: 'Petition List'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: 'Petition List'
},
{
extend: 'print',
text: 'Print',
className: 'btn btn-secondary',
id: 'printBtn',
title: 'Petition List'
}
];
function call_loading(){
$("#filter_reset_btn").prop("disabled", true);
$("#filter_search_btn").prop("disabled", true);
loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
}
function remove_loading(){
$("#filter_reset_btn").prop("disabled", false);
$("#filter_search_btn").prop("disabled", false);
loading.html("");
}
/* Get Department Data */
function get_department_data(){
get_department_list().then(function(departments) {
// Handle the department list
departmentlist = departments;
// Iterate through the department list and add options to the select element
$.each(departmentlist, function(index, department) {
// Create an option element
var option = $('<option>', {
value: department.ID_DEPT, // case-sensitive as per object
text: department.DEPT_NAME
});
// Append the option to the select element
$('#search_department_id').append(option);
});
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Get QaQc Data */
function get_qaqc_data(){
var apiUrl = '/gcc/api/pgr/getQaQcList';
// 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
console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_qaqc_list(){
get_qaqc_data().then(function(complaintList) {
// Handle the department list
generate_table(complaintList);
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table(data){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#complaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>",
row['DEPT_NAME'],
row['COMPLAINTTYPENAME'],
row['COMPLAINTDATE'],
row['COMPLAINTTIME'],
row['COMPLAINTDETAILS'],
row['COMPLAINANTFIRSTNAME'],
row['COMPLAINANTMOBILENUMBER'],
row['USER_NAME'],
row['MOBILE_NUMBER'],
row['COMPLAINTCOMPLETIONDATE'],
row['STATUS']
]).draw(false);
});
// Now call for Filter
get_department_data();
remove_loading(); // remove Loading
}
$(document).ready(function() {
call_loading();
get_qaqc_list();
});
</script>
</body>
</html>

648
src/main/resources/templates/modules/pgr/zone-wise-with-reopen.html

@ -0,0 +1,648 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="fas fa-street-view bg-blue"></i>
<div class="d-inline">
<h5>Zone Wise With Reopen Report</h5>
<span>Public Grievance Redressal Reports</span>
</div>
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Zone Wise Report</li>
<li class="breadcrumb-item active" aria-current="page">With Reopen</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div>
<div id="tableLoading"></div>
<div id="tableBody"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/pgr/modal-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/pgr/script :: script}"></script>
<script th:inline="javascript">
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
// Loading Div id
const loading = $("#tableLoading");
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: 'Petition List'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: 'Petition List'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: 'Petition List'
},
{
extend: 'print',
text: 'Print',
className: 'btn btn-secondary',
id: 'printBtn',
title: 'Petition List'
}
];
// Complaint Config Array (See script page)
var complaintIds = complaintTypeId();
///////////////////////////// End ///////////////////////////
function call_loading(){
loading_text_msg = getLoadingMessage();
$("#filter_reset_btn").prop("disabled", true);
$("#filter_search_btn").prop("disabled", true);
loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
}
function remove_loading(){
$("#filter_reset_btn").prop("disabled", false);
$("#filter_search_btn").prop("disabled", false);
loading.html("");
}
/* Get Department Data */
function get_department_data(){
get_department_list().then(function(departments) {
// Handle the department list
departmentlist = departments;
// Iterate through the department list and add options to the select element
$.each(departmentlist, function(index, department) {
// Create an option element
var option = $('<option>', {
value: department.ID_DEPT, // case-sensitive as per object
text: department.DEPT_NAME
});
// Append the option to the select element
$('#search_department_id').append(option);
});
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Get Data of Main Page 1 */
function get_table_data(){
var apiUrl = '/gcc/api/pgr/getZoneWiseComplaintCountList';
// 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
console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list(){
get_table_data().then(function(complaintList) {
$('#tableBody').html(getPageTableBody()); // Call Table Html
// Handle the department list
generate_table(complaintList);
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table(data){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#complaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DEPT_NAME']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["NonBURSTLT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['NonBURSTLT']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFGAR"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFGAR']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ROAD"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ROAD']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["MOSQUITE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['MOSQUITE']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["WATER"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['WATER']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFDEB"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFDEB']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["TREE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TREE']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["DOGS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DOGS']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ENCMTN"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ENCMTN']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["POT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['POT']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["PTAX"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['PTAX']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["OTHERS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['OTHERS']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TOTAL']+"</a>",
row['DAYS_90_PEN'],
row['DAYS_61_90_PEN'],
row['DAYS_31_60_PEN'],
row['DAYS_16_30_PEN'],
row['DAYS_0_15_PEN']
]).draw(false);
});
// Now call for Filter
get_department_data();
remove_loading(); // remove Loading
}
$(document).ready(function() {
call_loading();
get_table_list();
});
function getPageTableBody(){
var tableBodyHTML = "";
tableBodyHTML = `<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Zone Name</th>
<th class="text-center">Street Light not burning</th>
<th class="text-center">Removal of Garbage</th>
<th class="text-center">Road Damaged</th>
<th class="text-center">Mosquito Nuisance</th>
<th class="text-center">Water Stagnation</th>
<th class="text-center">Removal of Debries</th>
<th class="text-center">Tree Fallen</th>
<th class="text-center">Dog Menace</th>
<th class="text-center">Encroachment</th>
<th class="text-center">Potshole</th>
<th class="text-center">Property Tax</th>
<th class="text-center">Others</th>
<th class="text-center">Total</th>
<th class="text-center">&gt; 90 Days</th>
<th class="text-center">61 - 90 Days</th>
<th class="text-center">31-60 days</th>
<th class="text-center">16-30 days</th>
<th class="text-center">0-15 days</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Zone Name</th>
<th class="text-center">Street Light not burning</th>
<th class="text-center">Removal of Garbage</th>
<th class="text-center">Road Damaged</th>
<th class="text-center">Mosquito Nuisance</th>
<th class="text-center">Water Stagnation</th>
<th class="text-center">Removal of Debries</th>
<th class="text-center">Tree Fallen</th>
<th class="text-center">Dog Menace</th>
<th class="text-center">Encroachment</th>
<th class="text-center">Potshole</th>
<th class="text-center">Property Tax</th>
<th class="text-center">Others</th>
<th class="text-center">Total</th>
<th class="text-center">&gt; 90 Days</th>
<th class="text-center">61 - 90 Days</th>
<th class="text-center">31-60 days</th>
<th class="text-center">16-30 days</th>
<th class="text-center">0-15 days</th>
</tr>
</tfoot>
</table>`;
return tableBodyHTML;
}
/////////////////////////////////////// Modal Box -1 ///////////////////////////////////////
var model_box_1 = "#pgrModalBox";
function viewZoneWiseOfficerComplaintCountList(deptid, complainttype, dept_name)
{
get_table_list_modal_box_1(deptid, complainttype);
var dept_name_txt = dept_name.split("-");
if(dept_name_txt.length<=1){
dept_name_txt[0] = "-";
}
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase();
$('#modalTitle').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title
loading_text_msg = getLoadingMessage(); // get Loading random text
$('#modalBody').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body)
$(model_box_1).modal({
backdrop: 'static',
keyboard: false
}); // Show Modal Box
//$(model_box_1).modal('show'); // Show Modal Box
return false;
}
/* Get Data of Main Page 1 */
function get_modal_box_1_table_data(deptid, complainttype){
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerComplaintCountList';
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
data: {
'deptid': deptid,
'complainttype': complainttype,
},
dataType: 'json',
success: function(jsonResponse) {
// Resolve the Promise with the department list
//console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list_modal_box_1(deptid, complainttype){
get_modal_box_1_table_data(deptid, complainttype).then(function(complaintList) {
// Handle the data list
//console.log('Response list:', complaintList);
$('#modalBody').html(get_modal_box_1_table_html()); // Box content (Body)
generate_table_modal_box_1(complaintList,complainttype);
$(model_box_1).modal('show'); // Show Modal Box
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table_modal_box_1(data,complainttype){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#modal_1_ComplaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
row['DEPT_NAME'],
row['USER_NAME'],
row['MOBILENO'],
"<a href=\"#\" onclick=\"return viewOfficerBasedPendidngComplaintList("+row['DEPTID']+", '"+complainttype+"','"+row["IDUSER"]+"')\" class=\"link\">"+row['NOS']+"</a>"
]).draw(false);
});
}
function get_modal_box_1_table_html(){
var modal_box_1_html=`<table id="modal_1_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Department</th>
<th class="text-center">Officer ID</th>
<th class="text-center">Mobile Number</th>
<th class="text-center">No\`s</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Department</th>
<th class="text-center">Officer ID</th>
<th class="text-center">Mobile Number</th>
<th class="text-center">No\`s</th>
</tr>
</tfoot>
</table>`;
return modal_box_1_html
}
/////////////////////////////////////// Modal Box - 2 ///////////////////////////////////////
var model_box_2 = "#pgrModalBox_2";
function viewOfficerBasedPendidngComplaintList(deptid, complainttype, iduser)
{
get_table_list_modal_box_2(deptid, complainttype, iduser);
/*
var dept_name_txt = dept_name.split("-");
if(dept_name_txt.length<=1){
dept_name_txt[0] = "-";
}
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase();
$('#modalTitle_2').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title
*/
loading_text_msg = getLoadingMessage(); // get Loading random text
$('#modalBody_2').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body)
$(model_box_2).modal({
backdrop: 'static',
keyboard: false
}); // Show Modal Box
//$(model_box_2).modal('show'); // Show Modal Box
return false;
}
/* Get Data of Main Page 1 */
function get_modal_box_2_table_data(deptid, complainttype, iduser){
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerComplaintList';
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
data: {
'deptid': deptid,
'complainttype': complainttype,
'iduser': iduser,
},
dataType: 'json',
success: function(jsonResponse) {
// Resolve the Promise with the department list
//console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list_modal_box_2(deptid, complainttype, iduser){
get_modal_box_2_table_data(deptid, complainttype, iduser).then(function(complaintList) {
// Handle the data list
//console.log('Response list:', complaintList);
$('#modalBody_2').html(get_modal_box_2_table_html()); // Box content (Body)
generate_table_modal_box_2(complaintList);
//$(model_box_2).modal('show'); // Show Modal Box
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table_modal_box_2(data){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#modal_2_ComplaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>",
row['DEPT_NAME'],
row['COMPLAINTTYPENAME'],
row['COMPDATE'],
row['COMPLAINTDETAILS'],
row['COMPLAINANTFIRSTNAME'],
row['USER_NAME']
]).draw(false);
});
}
function get_modal_box_2_table_html(){
var modal_box_2_html=`<table id="modal_2_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Department</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Complaint Date</th>
<th class="text-center">Complaint Details</th>
<th class="text-center">Person Name</th>
<th class="text-center">Officer ID</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Department</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Complaint Date</th>
<th class="text-center">Complaint Details</th>
<th class="text-center">Person Name</th>
<th class="text-center">Officer ID</th>
</tr>
</tfoot>
</table>`;
return modal_box_2_html
}
/////////////////////////////////////// Modal Box - 3 ///////////////////////////////////////
<!-- See Common Script page -->
</script>
</body>
</html>

646
src/main/resources/templates/modules/pgr/zone-wise-without-reopen.html

@ -0,0 +1,646 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-6">
<div class="page-header-title">
<i class="ik ik-map-pin bg-blue"></i>
<div class="d-inline">
<h5>Zone Wise Without Reopen Report</h5>
<span>Public Grievance Redressal Reports</span>
</div>
</div>
</div>
<div class="col-lg-6">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Zone Wise Report</li>
<li class="breadcrumb-item active" aria-current="page">Without Reopen</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-block">
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div>
<div id="tableLoading"></div>
<div id="tableBody"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/modules/pgr/modal-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/pgr/script :: script}"></script>
<script th:inline="javascript">
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script
// Loading Div id
const loading = $("#tableLoading");
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: 'Petition List'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: 'Petition List'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: 'Petition List'
},
{
extend: 'print',
text: 'Print',
className: 'btn btn-secondary',
id: 'printBtn',
title: 'Petition List'
}
];
// Complaint Config Array (See script page)
var complaintIds = complaintTypeId();
///////////////////////////// End ///////////////////////////
function call_loading(){
loading_text_msg = getLoadingMessage();
$("#filter_reset_btn").prop("disabled", true);
$("#filter_search_btn").prop("disabled", true);
loading.html(searchinfo("<b>"+loading_text_msg+"</b>"));
}
function remove_loading(){
$("#filter_reset_btn").prop("disabled", false);
$("#filter_search_btn").prop("disabled", false);
loading.html("");
}
/* Get Department Data */
function get_department_data(){
get_department_list().then(function(departments) {
// Handle the department list
departmentlist = departments;
// Iterate through the department list and add options to the select element
$.each(departmentlist, function(index, department) {
// Create an option element
var option = $('<option>', {
value: department.ID_DEPT, // case-sensitive as per object
text: department.DEPT_NAME
});
// Append the option to the select element
$('#search_department_id').append(option);
});
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Get Data of Main Page 1 */
function get_table_data(){
var apiUrl = '/gcc/api/pgr/getZoneWiseWithoutReopenComplaintList';
// 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
console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list(){
get_table_data().then(function(complaintList) {
$('#tableBody').html(getPageTableBody()); // Call Table Html
// Handle the department list
generate_table(complaintList);
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table(data){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#complaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DEPT_NAME']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["NonBURSTLT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['NonBURSTLT']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFGAR"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFGAR']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ROAD"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ROAD']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["MOSQUITE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['MOSQUITE']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["WATER"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['WATER']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFDEB"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFDEB']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["TREE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TREE']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["DOGS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DOGS']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ENCMTN"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ENCMTN']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["POT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['POT']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["PTAX"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['PTAX']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["OTHERS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['OTHERS']+"</a>",
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TOTAL']+"</a>",
row['DAYS_90_PEN'],
row['DAYS_61_90_PEN'],
row['DAYS_31_60_PEN'],
row['DAYS_16_30_PEN'],
row['DAYS_0_15_PEN']
]).draw(false);
});
// Now call for Filter
get_department_data();
remove_loading(); // remove Loading
}
$(document).ready(function() {
call_loading();
get_table_list();
});
function getPageTableBody(){
var tableBodyHTML = "";
tableBodyHTML = `<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Zone Name</th>
<th class="text-center">Street Light not burning</th>
<th class="text-center">Removal of Garbage</th>
<th class="text-center">Road Damaged</th>
<th class="text-center">Mosquito Nuisance</th>
<th class="text-center">Water Stagnation</th>
<th class="text-center">Removal of Debries</th>
<th class="text-center">Tree Fallen</th>
<th class="text-center">Dog Menace</th>
<th class="text-center">Encroachment</th>
<th class="text-center">Potshole</th>
<th class="text-center">Property Tax</th>
<th class="text-center">Others</th>
<th class="text-center">Total</th>
<th class="text-center">&gt; 90 Days</th>
<th class="text-center">61 - 90 Days</th>
<th class="text-center">31-60 days</th>
<th class="text-center">16-30 days</th>
<th class="text-center">0-15 days</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Zone Name</th>
<th class="text-center">Street Light not burning</th>
<th class="text-center">Removal of Garbage</th>
<th class="text-center">Road Damaged</th>
<th class="text-center">Mosquito Nuisance</th>
<th class="text-center">Water Stagnation</th>
<th class="text-center">Removal of Debries</th>
<th class="text-center">Tree Fallen</th>
<th class="text-center">Dog Menace</th>
<th class="text-center">Encroachment</th>
<th class="text-center">Potshole</th>
<th class="text-center">Property Tax</th>
<th class="text-center">Others</th>
<th class="text-center">Total</th>
<th class="text-center">&gt; 90 Days</th>
<th class="text-center">61 - 90 Days</th>
<th class="text-center">31-60 days</th>
<th class="text-center">16-30 days</th>
<th class="text-center">0-15 days</th>
</tr>
</tfoot>
</table>`;
return tableBodyHTML;
}
/////////////////////////////////////// Modal Box -1 ///////////////////////////////////////
var model_box_1 = "#pgrModalBox";
function viewZoneWiseOfficerComplaintCountList(deptid, complainttype, dept_name)
{
get_table_list_modal_box_1(deptid, complainttype);
var dept_name_txt = dept_name.split("-");
if(dept_name_txt.length<=1){
dept_name_txt[0] = "-";
}
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase();
$('#modalTitle').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title
loading_text_msg = getLoadingMessage(); // get Loading random text
$('#modalBody').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body)
$(model_box_1).modal({
backdrop: 'static',
keyboard: false
}); // Show Modal Box
//$(model_box_1).modal('show'); // Show Modal Box
return false;
}
/* Get Data of Main Page 1 */
function get_modal_box_1_table_data(deptid, complainttype){
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerWithoutReopenComplaintCountList';
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
data: {
'deptid': deptid,
'complainttype': complainttype,
},
dataType: 'json',
success: function(jsonResponse) {
// Resolve the Promise with the department list
//console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list_modal_box_1(deptid, complainttype){
get_modal_box_1_table_data(deptid, complainttype).then(function(complaintList) {
// Handle the data list
//console.log('Response list:', complaintList);
$('#modalBody').html(get_modal_box_1_table_html()); // Box content (Body)
generate_table_modal_box_1(complaintList,complainttype);
$(model_box_1).modal('show'); // Show Modal Box
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table_modal_box_1(data,complainttype){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#modal_1_ComplaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
row['DEPT_NAME'],
row['USER_NAME'],
row['MOBILENO'],
"<a href=\"#\" onclick=\"return viewOfficerBasedPendidngComplaintList("+row['DEPTID']+", '"+complainttype+"','"+row["IDUSER"]+"')\" class=\"link\">"+row['NOS']+"</a>"
]).draw(false);
});
}
function get_modal_box_1_table_html(){
var modal_box_1_html=`<table id="modal_1_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Department</th>
<th class="text-center">Officer ID</th>
<th class="text-center">Mobile Number</th>
<th class="text-center">No\`s</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Department</th>
<th class="text-center">Officer ID</th>
<th class="text-center">Mobile Number</th>
<th class="text-center">No\`s</th>
</tr>
</tfoot>
</table>`;
return modal_box_1_html
}
/////////////////////////////////////// Modal Box - 2 ///////////////////////////////////////
var model_box_2 = "#pgrModalBox_2";
function viewOfficerBasedPendidngComplaintList(deptid, complainttype, iduser)
{
get_table_list_modal_box_2(deptid, complainttype, iduser);
/*
var dept_name_txt = dept_name.split("-");
if(dept_name_txt.length<=1){
dept_name_txt[0] = "-";
}
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase();
$('#modalTitle_2').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title
*/
loading_text_msg = getLoadingMessage(); // get Loading random text
$('#modalBody_2').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body)
$(model_box_2).modal({
backdrop: 'static',
keyboard: false
}); // Show Modal Box
//$(model_box_2).modal('show'); // Show Modal Box
return false;
}
/* Get Data of Main Page 1 */
function get_modal_box_2_table_data(deptid, complainttype, iduser){
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerWithoutReopenComplaintList';
// Return a Promise
return new Promise(function(resolve, reject) {
$.ajax({
url: apiUrl,
type: 'GET',
data: {
'deptid': deptid,
'complainttype': complainttype,
'iduser': iduser,
},
dataType: 'json',
success: function(jsonResponse) {
// Resolve the Promise with the department list
//console.log('Response list:', jsonResponse);
resolve(jsonResponse);
},
error: function(xhr, status, error) {
// Reject the Promise with the error message
reject(error);
}
});
});
}
/* Get Complaints List */
function get_table_list_modal_box_2(deptid, complainttype, iduser){
get_modal_box_2_table_data(deptid, complainttype, iduser).then(function(complaintList) {
// Handle the data list
//console.log('Response list:', complaintList);
$('#modalBody_2').html(get_modal_box_2_table_html()); // Box content (Body)
generate_table_modal_box_2(complaintList);
//$(model_box_2).modal('show'); // Show Modal Box
}).catch(function(error) {
// Handle errors
console.error('Error fetching department list:', error);
});
}
/* Call DataTable function */
function generate_table_modal_box_2(data){
// Check for mobile
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed
var table = $('#modal_2_ComplaintDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
scrollX: '50vh',
fixedColumns: {
left: 0,
right: 0
},
buttons: [buttons],
responsive: isMobile, // Set responsive option based on device width
searching: false,
select: false,
processing: false,
} );
// Clearn Table data
table.clear().draw();
// Add rows to DataTable
var rowNum = 1;
$.each(data, function(index, row) {
table.row.add([
rowNum++,
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>",
row['DEPT_NAME'],
row['COMPLAINTTYPENAME'],
row['COMPDATE'],
row['COMPLAINTDETAILS'],
row['COMPLAINANTFIRSTNAME'],
row['USER_NAME']
]).draw(false);
});
}
function get_modal_box_2_table_html(){
var modal_box_2_html=`<table id="modal_2_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr class="table-bordered">
<th class="text-center no-sort">S.No</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Department</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Complaint Date</th>
<th class="text-center">Complaint Details</th>
<th class="text-center">Person Name</th>
<th class="text-center">Officer ID</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Complaint No.</th>
<th class="text-center">Department</th>
<th class="text-center">Complaint Type</th>
<th class="text-center">Complaint Date</th>
<th class="text-center">Complaint Details</th>
<th class="text-center">Person Name</th>
<th class="text-center">Officer ID</th>
</tr>
</tfoot>
</table>`;
return modal_box_2_html
}
/////////////////////////////////////// Modal Box - 3 ///////////////////////////////////////
<!-- See Common Script page -->
</script>
</body>
</html>

6
src/main/resources/templates/modules/taxcollection/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 = [];

100
src/main/resources/templates/modules/taxcollection/request-create.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" type="text/css" href="/assets/node_modules/jquery.datetimepicker/jquery.datetimepicker.css"/ >
<link rel="stylesheet" type="text/css" href="node_modules/jquery.datetimepicker/jquery.datetimepicker.css"/ >
<!--[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]-->
@ -252,11 +252,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/jquery.mask/1.14.16/jquery.mask.min.js"></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/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
<script src="node_modules/jquery.mask/1.14.16/jquery.mask.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/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
<script th:inline="javascript"> <script th:inline="javascript">
var loginUserID = /*[[${LoginUserId}]]*/''; var loginUserID = /*[[${LoginUserId}]]*/'';
$(document).ready(function() { $(document).ready(function() {
@ -328,7 +328,7 @@
function getPtaxInfo(ptax){ function getPtaxInfo(ptax){
call_loading('ptaxPersonalInfo','start'); call_loading('ptaxPersonalInfo','start');
//var ptax = '04-042-03251-000'; //var ptax = '04-042-03251-000';
var apiUrl = '/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,
type: 'GET', type: 'GET',
@ -336,41 +336,49 @@
success: function(jsonResponse) { success: function(jsonResponse) {
// Handle the API response data here // Handle the API response data here
console.log('Data from API:', jsonResponse); console.log('Data from API:', jsonResponse);
// Parse the JSON response into a JavaScript object // Parse the JSON response into a JavaScript object
var data = jsonResponse; var data = jsonResponse;
if(data.ResultStatus=="False")
{
$("#ptaxPersonalInfo").html("<center>"+nodata(data.Message)+"</center>");
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
else{
// Access the values
var owner = data.PROPTAX[0].Owner;
var address = data.PROPTAX[0].Address;
//var famCardNo = data.PROPTAX[0].Fam_Card_No;
var mobNo = data.PROPTAX[0].Mob_No;
var email = data.PROPTAX[0].Email_ID;
// Access the values
var owner = data.PROPTAX[0].Owner;
var address = data.PROPTAX[0].Address;
//var famCardNo = data.PROPTAX[0].Fam_Card_No;
var mobNo = data.PROPTAX[0].Mob_No;
var email = data.PROPTAX[0].Email_ID;
// HTML content
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
' <tbody>' +
' <tr>' +
' <td>Property tax number</td>' +
' <td class="font-medium">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Owner Name</td>' +
' <td class="font-medium">'+owner+'</td>' +
' </tr>' +
' <tr>' +
' <td>Address</td>' +
' <td class="font-medium">'+address+'</td>' +
' </tr>' +
' <tr>' +
' <td>Mobile No</td>' +
' <td class="font-medium">'+mobNo+'</td>' +
' </tr>' +
' </tbody>' +
'</table>';
$("#ptaxPersonalInfo").html(ptaxPersonalinfoHtml);
// Enable the button
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
// HTML content
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
' <tbody>' +
' <tr>' +
' <td>Property tax number</td>' +
' <td class="font-medium">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Owner Name</td>' +
' <td class="font-medium">'+owner+'</td>' +
' </tr>' +
' <tr>' +
' <td>Address</td>' +
' <td class="font-medium">'+address+'</td>' +
' </tr>' +
' <tr>' +
' <td>Mobile No</td>' +
' <td class="font-medium">'+mobNo+'</td>' +
' </tr>' +
' </tbody>' +
'</table>';
$("#ptaxPersonalInfo").html(ptaxPersonalinfoHtml);
// Enable the button
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
// Handle errors here // Handle errors here
@ -457,7 +465,7 @@
function submitSaveRequest(formData){ function submitSaveRequest(formData){
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '/api/taxcollection/saveTaxCollectionRequest',
url: '/gcc/api/taxcollection/saveTaxCollectionRequest',
data: formData, data: formData,
contentType: false, contentType: false,
processData: false, processData: false,
@ -554,7 +562,7 @@
} }
function getTaxCollectionRequestDetails(request_id){ function getTaxCollectionRequestDetails(request_id){
var apiUrl = '/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,
type: 'GET', type: 'GET',
@ -622,7 +630,7 @@
function getpTaxDetails(ptax){ function getpTaxDetails(ptax){
var apiUrl = '/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,
type: 'GET', type: 'GET',
@ -672,7 +680,7 @@
var inValidPtax = ptax+'&nbsp;<font class="custom-tooltip-warning"><a href="#" class="text-warning" onclick="return false;" data-container=".custom-tooltip-warning" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify failed" data-original-title="Property tax number cross-verify failed"><i class="ik ik-alert-triangle"></i></font>'; var inValidPtax = ptax+'&nbsp;<font class="custom-tooltip-warning"><a href="#" class="text-warning" onclick="return false;" data-container=".custom-tooltip-warning" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify failed" data-original-title="Property tax number cross-verify failed"><i class="ik ik-alert-triangle"></i></font>';
$("#pTaxVerification").html(inValidPtax); $("#pTaxVerification").html(inValidPtax);
$("#pTaxdetails").html('<center><img src="/assets/images/nodata.png"></br>No Record Found</center>');
$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>');
} }
// Enable tooltip for model page // Enable tooltip for model page
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
@ -700,7 +708,7 @@
} }
function getTaxCollectionRequestUpdate(request_id){ function getTaxCollectionRequestUpdate(request_id){
var apiUrl = '/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,
type: 'GET', type: 'GET',
@ -797,7 +805,7 @@
$("#statusUpdateForm").html(ptaxPersonalinfoHtml); $("#statusUpdateForm").html(ptaxPersonalinfoHtml);
var apiUrl = '/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
$.ajax({ $.ajax({
url: apiUrl, url: apiUrl,
type: 'GET', type: 'GET',
@ -845,7 +853,7 @@
else { else {
// No data found // No data found
console.log("Status history: " + data.Message); console.log("Status history: " + data.Message);
//$("#pTaxdetails").html('<center><img src="/assets/images/nodata.png"></br>No Record Found</center>');
//$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>');
} }
// Enable tooltip for model page // Enable tooltip for model page
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();

813
src/main/resources/templates/modules/taxcollection/request-list.html

@ -0,0 +1,813 @@
<!DOCTYPE html>
<html lang="en" dir="">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<body>
<link rel="stylesheet" type="text/css" href="node_modules/jquery.datetimepicker/jquery.datetimepicker.css"/ >
<!--[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>
<![endif]-->
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="fas fa-headset bg-blue"></i>
<div class="d-inline">
<h5>Request List</h5>
<span>1913 Tax Collection Module</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">1913 Tax Collection</li>
<li class="breadcrumb-item active" aria-current="page">Request List</li>
</ol>
</nav>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="card">
<div class="card-block">
<div class="d-flex">
<h4 class="card-title">Tax collection request list</h4>
</div>
<div>
<table id="requestDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
<thead class="thead-dark">
<tr role="row">
<th class="text-center no-sort" width="1%">S.No</th>
<th class="text-center" width="20%">Name</th>
<th class="text-center" width="20%">Property tax number</th>
<th class="text-center" width="20%">Mobile Number</th>
<th class="text-center" width="20%">Availability Date</th>
<th class="text-center" width="20%">User Type</th>
<th class="text-center" width="20%">Status</th>
<th class="text-center no-sort" style="width:50px;">Action</th>
</tr>
</theadclass="thead-dark">
<tbody>
<tr th:each="taxCollectionRequestList, i : ${taxCollectionRequestEntities}" class="taxCollectionRequestList text-capitalize">
<td th:text="${i.count}">0</td>
<td th:text="${taxCollectionRequestList.name}"></td>
<td th:text="${taxCollectionRequestList.ptax}"></td>
<td th:text="${taxCollectionRequestList.mobile}"></td>
<td th:text="${taxCollectionRequestList.availabilitydate}"></td>
<td th:text="${taxCollectionRequestList.usertype}"></td>
<td>
<a th:href="@{#}" th:text="${taxCollectionRequestList.status}" th:classappend="${taxCollectionRequestList.status == 'open'} ? 'badge badge-success mb-1' : 'badge badge-secondary mb-1'" th:onclick="return callStatusUpdate([[${taxCollectionRequestList.request_id}]])" data-animation="true" data-toggle="tooltip" data-placement="top" title="Update Current Status" data-original-title="Update Current Status"></a>
</td>
<td class="text-center">
<a th:href="@{#}" th:onclick="return callView([[${taxCollectionRequestList.request_id}]])" data-animation="true" data-toggle="tooltip" data-placement="top" title="View Request Details" data-original-title="View Request Details"><i class="ik ik-eye f-16 text-blue"></i></a>&nbsp;&nbsp;
</td>
</tr>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center">S.No</th>
<th class="text-center">Name</th>
<th class="text-center">Property tax number</th>
<th class="text-center">Mobile Number</th>
<th class="text-center">Availability Date</th>
<th class="text-center">User Type</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<div class="modal fade" id="taxCollectionRequestView" tabindex="-1" role="dialog" aria-labelledby="modalCenterLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalCenterLabel"><i class="ik ik-file-text text-primary"></i> Collection Request Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xl-6 col-md-6" id="requestDetails">
</div>
<div class="col-xl-6 col-md-6" style="border-left: 1px solid #dee2e6;" id="pTaxdetails">
&nbsp;
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="ik ik-x-square"></i>Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="taxCollectionRequestUpdate" tabindex="-1" role="dialog" aria-labelledby="modalCenterLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalCenterLabel"><i class="ik ik-file-text text-primary"></i> Collection Request Status Update Form</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xl-6 col-md-6" id="requestDetailsUpdate">
</div>
<div class="col-xl-6 col-md-6" style="border-left: 1px solid #dee2e6;" id="statusUpdateForm">
&nbsp;
</div>
<div class="card table-card mb-0">
<h5 class="text-warning pl-10 text-center">Status History</h5>
<div class="card-block pb-0">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead>
<tr>
<th>Company</th>
<th>Start Date</th>
<th>End Date</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apple Company</td>
<td>23/05/2017</td>
<td>04/08/2018</td>
<td><label class="badge badge-success">Paid</label></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="ik ik-x-square"></i>Close</button>
</div>
</div>
</div>
</div>
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script src="node_modules/jquery.mask/1.14.16/jquery.mask.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/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script>
<script th:inline="javascript">
var loginUserID = /*[[${LoginUserId}]]*/'';
$(document).ready(function() {
// Input masking for the desired format
$('#ptax').mask('00-000-00000-000');
$('#mobileno').mask('0000000000');
// For datetime picker
jQuery('#availabilitydate').datetimepicker({
minTime:'10:00',
maxTime:'18:01',
minDate: 0, // Today
//minDate:'-1970/01/2',
//maxDate:'+1970/01/2',
//timepicker:false, // Disable time picker
mask:false,
disabledWeekDays:[0], //[0,1,2,3,4,5,6] -> 0-Sunday .... 6-saturday
disabledDates:['2023/08/31','2023/08/11','2023/08/12'], // Disable date on holidays
/*
// Disable all weekends
onGenerate:function( ct ){
jQuery(this).find('.xdsoft_date.xdsoft_weekend')
.addClass('xdsoft_disabled');
}
*/
});
});
function displayPtaxInfo(ptax){
var inputElement = $('#ptax');
inputElement.removeClass('is-invalid');
// Disable the button to prevent multiple clicks
$("#ptaxsearchbtn").prop("disabled", true);
// Show the loading icon on the button
$("#ptaxsearchbtn").html('<i class="fas fa-spinner fa-spin"></i>');
var ptax = inputElement.val();
var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000';
// Check if the tax value is not null and follows the format
if (ptax !== null && formatRegex.test(ptax)) {
console.log('ptax value is valid:', ptax);
// Check if the tax value has the correct length as per the format (15 characters)
if (ptax.length === 16) {
console.log('ptax value length is correct.');
getPtaxInfo(ptax);
} else {
console.log('ptax value length is incorrect.');
inputElement.addClass('is-invalid');
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
} else {
console.log('ptax value is not valid or null.');
inputElement.addClass('is-invalid'); //Error
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
}
function getPtaxInfo(ptax){
call_loading('ptaxPersonalInfo','start');
//var ptax = '04-042-03251-000';
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
// Parse the JSON response into a JavaScript object
var data = jsonResponse;
if(data.ResultStatus=="False")
{
$("#ptaxPersonalInfo").html("<center>"+nodata(data.Message)+"</center>");
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
else{
// Access the values
var owner = data.PROPTAX[0].Owner;
var address = data.PROPTAX[0].Address;
//var famCardNo = data.PROPTAX[0].Fam_Card_No;
var mobNo = data.PROPTAX[0].Mob_No;
var email = data.PROPTAX[0].Email_ID;
// HTML content
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
' <tbody>' +
' <tr>' +
' <td>Property tax number</td>' +
' <td class="font-medium">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Owner Name</td>' +
' <td class="font-medium">'+owner+'</td>' +
' </tr>' +
' <tr>' +
' <td>Address</td>' +
' <td class="font-medium">'+address+'</td>' +
' </tr>' +
' <tr>' +
' <td>Mobile No</td>' +
' <td class="font-medium">'+mobNo+'</td>' +
' </tr>' +
' </tbody>' +
'</table>';
$("#ptaxPersonalInfo").html(ptaxPersonalinfoHtml);
// Enable the button
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching data:', status, error);
// Enable the button
$("#ptaxsearchbtn").prop("disabled", false);
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>');
}
});
}
function saveRequest(){
// Disable the button to prevent multiple clicks
$("#requestSubmitBtn").prop("disabled", true);
// Show the loading icon on the button
$("#requestSubmitBtn").html('<i class="fas fa-spinner fa-spin"></i> Validating your request, please wait...');
var name = $('#name').val();
var inputElement = $('#ptax');
var ptax = inputElement.val();
var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000';
inputElement.removeClass('is-invalid');
var inputElementMobileNo = $('#mobileno');
var mobileNo = inputElementMobileNo.val();
var mobileFormatRegex = /^\d{10}$/; //'0000000000';
inputElementMobileNo.removeClass('is-invalid');
var inputElementUsertype = $('#usertype');
var usertype = inputElementUsertype.val();
//inputElementUsertype.removeClass('is-invalid');
var inputElementAvailabilityDate = $('#availabilitydate');
var availabilitydate = inputElementAvailabilityDate.val();
var selectedDateTime = new Date(availabilitydate);
var currentDateTime = new Date();
if (selectedDateTime < currentDateTime) {
alert('Selected date and time must be greater than or equal to the current date and time.');
inputElementAvailabilityDate.addClass('is-invalid');
$("#requestSubmitBtn").prop("disabled", false);
$("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save');
return false; // Prevent form submission
}
var formData = new FormData();
// Check if the tax value is not null and follows the format
if (ptax !== null && formatRegex.test(ptax) && ptax.length == 16) {
// Mobile number Check
if (mobileNo !== null && mobileFormatRegex.test(mobileNo) && mobileNo.length == 10) {
$("#requestSubmitBtn").html('<i class="fas fa-spinner fa-spin"></i> Submitting your request, please wait...');
formData.append('name',name);
formData.append('ptax', ptax );
formData.append('mobile', mobileNo );
formData.append('usertype', usertype );
formData.append('availabilitydate', availabilitydate);
formData.append('created_by', loginUserID);
submitSaveRequest(formData);
$("#requestSubmitBtn").html('Your request has been successfully submitted!');
} else {
inputElementMobileNo.addClass('is-invalid');
$("#requestSubmitBtn").prop("disabled", false);
$("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save');
}
} else {
console.log('ptax value is not valid or null.');
inputElement.addClass('is-invalid'); //Error
$("#requestSubmitBtn").prop("disabled", false);
$("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save');
}
return false;
}
function submitSaveRequest(formData){
$.ajax({
type: "POST",
url: '/gcc/api/taxcollection/saveTaxCollectionRequest',
data: formData,
contentType: false,
processData: false,
}).done(function(response) {
Swal.fire(
'Complaint Status Update!',
'Complaint closed Successfully!',
'success'
).then(() => {
location.reload();
});
}).fail(function(jqXHR, textStatus, errorThrown) {
$("#requestSubmitBtn").prop("disabled", false);
// Log the error and any relevant information
console.error("Error sending request: " + textStatus + " " + errorThrown);
});
}
</script>
<script>
$(document).ready(function() {
// DataTables buttons configuration
var buttons = [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn'
},
];
$('#requestDatatable').DataTable( {
dom: 'Bftip',
columnDefs: [
{ targets: 'no-sort', orderable: false }
],
lengthMenu: [
[ 50, 100, 200, 500, -1 ],
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
],
scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
},
buttons: [buttons],
fixedHeader: true,
autoWidth: true,
responsive: true,
searching: false,
select: false,
processing: false,
} );
} );
function callView(request_id){
$('#taxCollectionRequestView').modal({
backdrop: 'static',
keyboard: false
})
$('#taxCollectionRequestView').modal('show');
call_loading('requestDetails','start');
getTaxCollectionRequestDetails(request_id);
call_loading('pTaxdetails','start');
return false;
}
function getTaxCollectionRequestDetails(request_id){
var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
// Parse the JSON response into a JavaScript object
var data = jsonResponse;
// Access the values
var request_id = data.request_id;
var requestNo = data.requestNo;
var name = data.name;
var mobile = data.mobile;
var ptax = data.ptax;
var usertype = data.usertype;
var availabilitydate = data.availabilitydate;
var status = data.status;
var cdate = data.cDate;
// HTML content
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
' <tbody>' +
' <tr>' +
' <td>Name</td>' +
' <td class="font-medium">'+name+'</td>' +
' </tr>' +
' <tr>' +
' <td>Property tax number</td>' +
' <td class="font-medium font-weight-bold" id="pTaxVerification">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Mobile Number</td>' +
' <td class="font-medium">'+mobile+'</td>' +
' </tr>' +
' <tr>' +
' <td>Availability Date & Time</td>' +
' <td class="font-medium">'+availabilitydate+'</td>' +
' </tr>' +
' <tr>' +
' <td>User Type</td>' +
' <td class="font-medium">'+usertype+'</td>' +
' </tr>' +
' <tr>' +
' <td>Current Status</td>' +
' <td class="font-medium">'+status+'</td>' +
' </tr>' +
' <tr>' +
' <td>Request Created On</td>' +
' <td class="font-medium">'+cdate+'</td>' +
' </tr>' +
' </tbody>' +
'</table>';
$("#requestDetails").html(ptaxPersonalinfoHtml);
getpTaxDetails(ptax);
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching collection reqtest data:', status, error);
}
});
}
function getpTaxDetails(ptax){
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
// Parse the JSON response into a JavaScript object
var data = jsonResponse;
if (data.ResultStatus === "True") {
// Access the values
var owner = data.PROPTAX[0].Owner;
var address = data.PROPTAX[0].Address;
var mobNo = data.PROPTAX[0].Mob_No;
var email = data.PROPTAX[0].Email_ID;
// HTML content
var ptaxPersonalinfoHtml = '<table class="table table-borderless">' +
' <tbody>' +
' <tr>' +
' <td>Property tax number</td>' +
' <td class="font-medium">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Owner Name</td>' +
' <td class="font-medium">'+owner+'</td>' +
' </tr>' +
' <tr>' +
' <td>Address</td>' +
' <td class="font-medium">'+address+'</td>' +
' </tr>' +
' <tr>' +
' <td>Mobile No</td>' +
' <td class="font-medium">'+mobNo+'</td>' +
' </tr>' +
' </tbody>' +
'</table>';
$("#pTaxdetails").html(ptaxPersonalinfoHtml);
// if Ptax data fetched then load valid message
var validPtax = ptax+'&nbsp;<font class="custom-tooltip-success"><a href="#" class="text-success" onclick="return false;" data-container=".custom-tooltip-success" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify success" data-original-title="Property tax number cross-verify success"><i class="ik ik-check-circle"></i></font>';
$("#pTaxVerification").html(validPtax);
}
else {
// No data found
console.log("Message: " + data.Message);
var inValidPtax = ptax+'&nbsp;<font class="custom-tooltip-warning"><a href="#" class="text-warning" onclick="return false;" data-container=".custom-tooltip-warning" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify failed" data-original-title="Property tax number cross-verify failed"><i class="ik ik-alert-triangle"></i></font>';
$("#pTaxVerification").html(inValidPtax);
$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>');
}
// Enable tooltip for model page
$('[data-toggle="tooltip"]').tooltip();
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching pTax data:', status, error);
}
});
}
function callStatusUpdate(request_id){
$('#taxCollectionRequestUpdate').modal({
backdrop: 'static',
keyboard: false
})
$('#taxCollectionRequestUpdate').modal('show');
call_loading('requestDetailsUpdate','start');
getTaxCollectionRequestUpdate(request_id);
call_loading('statusUpdateForm','start');
return false;
}
function getTaxCollectionRequestUpdate(request_id){
var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id;
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
// Parse the JSON response into a JavaScript object
var data = jsonResponse;
// Access the values
var request_id = data.request_id;
var requestNo = data.requestNo;
var name = data.name;
var mobile = data.mobile;
var ptax = data.ptax;
var usertype = data.usertype;
var availabilitydate = data.availabilitydate;
var status = data.status;
var cdate = data.cDate;
// HTML content
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' +
' <tbody>' +
' <tr>' +
' <td>Name</td>' +
' <td class="font-medium">'+name+'</td>' +
' </tr>' +
' <tr>' +
' <td>Property tax number</td>' +
' <td class="font-medium font-weight-bold" id="pTaxVerification">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Mobile Number</td>' +
' <td class="font-medium">'+mobile+'</td>' +
' </tr>' +
' <tr>' +
' <td>Availability Date & Time</td>' +
' <td class="font-medium">'+availabilitydate+'</td>' +
' </tr>' +
' <tr>' +
' <td>User Type</td>' +
' <td class="font-medium">'+usertype+'</td>' +
' </tr>' +
' <tr>' +
' <td>Current Status</td>' +
' <td class="font-medium">'+status+'</td>' +
' </tr>' +
' <tr>' +
' <td>Request Created On</td>' +
' <td class="font-medium">'+cdate+'</td>' +
' </tr>' +
' </tbody>' +
'</table>';
$("#requestDetailsUpdate").html(ptaxPersonalinfoHtml);
showStatusUpdateForm(request_id, status);
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching collection reqtest data:', status, error);
}
});
}
function showStatusUpdateForm(request_id, status){
var selectInput = `<select class="form-control" name="requestStatus" id="requestStatus" required>
<option value="open">Open</option>
<option value="close">Close</option>
</select>`;
var textareaInput=`<textarea class="form-control" name="statusComments" id="statusComments" rows="4"></textarea>`;
var ptaxPersonalinfoHtml = '<form class="request-form" id="request-form" onsubmit="return saveStatus();">' +
'<div class="card table-card mb-0"><div class="card-header" style="background-color: #ffe1003b !important;"><h3>Update Form</h3></div>' +
'<div class="card-block p-0">' +
'<table class="table table-borderless">' +
' <tbody>' +
' <tr>' +
' <td width="30%">Current Status</td>' +
' <td class="font-medium">'+selectInput+'</td>' +
' </tr>' +
' <tr>' +
' <td colspan="2">Status Comments' + textareaInput+'</td>' +
' </tr>' +
' </tbody>' +
'</table>' +
'</div><div class="card-footer text-center">' +
' <button type="reset" class="btn btn-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>'+
' <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</button>'+
'</div></div></form>';
$("#statusUpdateForm").html(ptaxPersonalinfoHtml);
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax;
$.ajax({
url: apiUrl,
type: 'GET',
dataType: 'json',
success: function(jsonResponse) {
// Handle the API response data here
console.log('Data from API:', jsonResponse);
// Parse the JSON response into a JavaScript object
var data = jsonResponse;
if (data.ResultStatus === "True") {
// Access the values
var owner = data.PROPTAX[0].Owner;
var address = data.PROPTAX[0].Address;
var mobNo = data.PROPTAX[0].Mob_No;
var email = data.PROPTAX[0].Email_ID;
// HTML content
var ptaxPersonalinfoHtml = '<form class="request-form" id="request-form" onsubmit="return saveStatus();">' +
'<div class="card table-card"><div class="card-header"><h3>Update Form</h3></div>' +
'<div class="card-block">' +
'<table class="table table-borderless">' +
' <tbody>' +
' <tr>' +
' <td>Current Status</td>' +
' <td class="font-medium">'+ptax+'</td>' +
' </tr>' +
' <tr>' +
' <td>Status Comments</td>' +
' <td class="font-medium">'+owner+'</td>' +
' </tr>' +
' <tr>' +
' <td>Address</td>' +
' <td class="font-medium">'+
' </td>' +
' </tr>' +
' </tbody>' +
'</table>' +
'</div><div class="card-footer text-center">' +
' <button type="reset" class="btn btn-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>'+
' <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</button>'+
'</div></div></form>';
$("#statusUpdateForm").html(ptaxPersonalinfoHtml);
}
else {
// No data found
console.log("Status history: " + data.Message);
//$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>');
}
// Enable tooltip for model page
$('[data-toggle="tooltip"]').tooltip();
},
error: function(xhr, status, error) {
// Handle errors here
console.error('Error fetching Status history:', status, error);
}
});
}
function saveStatus(){
return false;
}
</script>
</body>
</html>
Loading…
Cancel
Save