12 changed files with 593 additions and 66 deletions
-
259gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/controller/WhatsappController.java
-
65gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/callcenterqaqc/service/WhatsappqaqcMsgService.java
-
19gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
-
2gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/greencommittee/service/PendinglistService.java
-
30gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/Maincontroller.java
-
64gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/controller/RegisterApiController.java
-
58gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/roadwar/service/RegisterService.java
-
4gcc_officer_portal/src/main/resources/application.properties
-
19gcc_officer_portal/src/main/resources/templates/modules/callcenterqaqc/agentqaqccalls.html
-
2gcc_officer_portal/src/main/resources/templates/modules/greencommittee/monitoring.html
-
4gcc_officer_portal/src/main/resources/templates/modules/greencommittee/pendinglist.html
-
121gcc_officer_portal/src/main/resources/templates/modules/roadwar/regform.html
@ -0,0 +1,30 @@ |
|||
package in.gov.chennaicorporation.gccoffice.roadwar.controller; |
|||
|
|||
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.service.LoginUserInfo; |
|||
|
|||
@RequestMapping("/gcc/roadwarweb") |
|||
@Controller("RoadWarMainController") |
|||
public class Maincontroller { |
|||
|
|||
@Autowired |
|||
private LoginUserInfo loginUserInfo; |
|||
|
|||
|
|||
@GetMapping("/regform") |
|||
public String viewdashboard(Model model) { |
|||
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|||
model.addAttribute("LoginUserId", LoginUserId); |
|||
|
|||
String UserRole = LoginUserInfo.getUserRole(); |
|||
model.addAttribute("UserRole", UserRole); |
|||
|
|||
return "modules/roadwar/regform"; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
package in.gov.chennaicorporation.gccoffice.roadwar.controller; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
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.roadwar.service.RegisterService; |
|||
|
|||
@RestController |
|||
@RequestMapping("/gcc/api/roadwarweb/register") |
|||
public class RegisterApiController { |
|||
|
|||
|
|||
@Autowired |
|||
private RegisterService registerService; |
|||
|
|||
|
|||
@GetMapping("/getzones") |
|||
public Map<String, Object> ViewZoneDropdown() { |
|||
|
|||
Map<String, Object> response = new HashMap<>(); |
|||
|
|||
List<Map<String, Object>> zones = registerService.ViewZoneDropdown(); |
|||
|
|||
if (!zones.isEmpty()) { |
|||
response.put("status", true); |
|||
response.put("message", "Zone list fetched successfully"); |
|||
response.put("data", zones); |
|||
} else { |
|||
response.put("status", false); |
|||
response.put("message", "No zones found"); |
|||
response.put("data", Collections.emptyList()); |
|||
} |
|||
|
|||
return response; |
|||
} |
|||
|
|||
@GetMapping("/getwardbyzone") |
|||
public Map<String, Object> ViewWardDropdown(@RequestParam String zone) { |
|||
|
|||
Map<String, Object> response = new HashMap<>(); |
|||
|
|||
List<Map<String, Object>> wards = registerService.ViewWardDropdown(zone); |
|||
|
|||
if (!wards.isEmpty()) { |
|||
response.put("status", true); |
|||
response.put("message", "Ward list fetched successfully"); |
|||
response.put("data", wards); |
|||
} else { |
|||
response.put("status", false); |
|||
response.put("message", "No wards found"); |
|||
response.put("data", Collections.emptyList()); |
|||
} |
|||
|
|||
return response; |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
package in.gov.chennaicorporation.gccoffice.roadwar.service; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import javax.sql.DataSource; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Qualifier; |
|||
import org.springframework.core.env.Environment; |
|||
import org.springframework.jdbc.core.JdbcTemplate; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class RegisterService { |
|||
|
|||
@Autowired |
|||
private JdbcTemplate jdbcTemplate; |
|||
|
|||
@Autowired |
|||
private Environment environment; |
|||
|
|||
@Autowired |
|||
public void setDataSource(@Qualifier("mysqlRoadWarDataSource") DataSource dataSource) { |
|||
this.jdbcTemplate = new JdbcTemplate(dataSource); |
|||
} |
|||
|
|||
|
|||
public List<Map<String, Object>> ViewZoneDropdown() { |
|||
String sql = "SELECT zone_name " |
|||
+ "FROM zone_master " |
|||
+ "WHERE is_active=1 AND is_delete=0"; |
|||
try { |
|||
return jdbcTemplate.queryForList(sql); |
|||
} catch (Exception e) { |
|||
// TODO: handle exception |
|||
e.printStackTrace(); |
|||
return Collections.emptyList(); |
|||
} |
|||
} |
|||
|
|||
public List<Map<String, Object>> ViewWardDropdown(String zone) { |
|||
String sql = "SELECT ward_name " |
|||
+ "FROM ward_master " |
|||
+ "WHERE is_active=1 AND is_delete=0 AND zone_id=?"; |
|||
try { |
|||
return jdbcTemplate.queryForList(sql,zone); |
|||
} catch (Exception e) { |
|||
// TODO: handle exception |
|||
e.printStackTrace(); |
|||
return Collections.emptyList(); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,121 @@ |
|||
<!DOCTYPE html> |
|||
|
|||
<html xmlns:th="http://www.thymeleaf.org"> |
|||
|
|||
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
|||
<style> |
|||
|
|||
</style> |
|||
|
|||
<body> |
|||
|
|||
|
|||
|
|||
<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="fa fa-list-alt bg-blue"></i> |
|||
<div class="d-inline"> |
|||
<h5>Register Form</h5> |
|||
<span>Road War</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="/gcc/index"><i class="ik ik-home"></i></a> |
|||
</li> |
|||
<li class="breadcrumb-item" aria-current="page">Road War</li> |
|||
<li class="breadcrumb-item active" aria-current="page">Register Form</li> |
|||
</ol> |
|||
</nav> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="row mt-3"> |
|||
<div class="col-12"> |
|||
<div class="card"> |
|||
<div class="card-body"> |
|||
<h5 class="card-title">Road Details</h5> |
|||
<div class="card-block"> |
|||
|
|||
<div class="row"> |
|||
|
|||
<div class="col-md-3"> |
|||
<label for="zone">Zone<span class="text-danger">*</span></label> |
|||
<input type="text" class="form-control" id="zone" name="zone" required="required"> |
|||
</div> |
|||
|
|||
<div class="col-md-3"> |
|||
<label for="ward">Ward<span class="text-danger">*</span></label> |
|||
<input type="text" class="form-control" id="ward" name="ward" required="required"> |
|||
</div> |
|||
|
|||
<div class="col-md-6"> |
|||
<label for="roadname">Name of the Road<span class="text-danger">*</span></label> |
|||
<input type="text" class="form-control" id="roadname" name="roadname" required="required"> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
|
|||
<div id="pageLoader" |
|||
style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;"> |
|||
<div style="position: relative; top: 50%; transform: translateY(-50%);"> |
|||
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"> |
|||
<span class="sr-only">Loading...</span> |
|||
</div> |
|||
<!-- Add the 'Please wait' text below the spinner --> |
|||
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p> |
|||
</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 src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script> |
|||
|
|||
|
|||
<script type="text/javascript"> |
|||
|
|||
</script> |
|||
|
|||
</body> |
|||
|
|||
</html> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue