Browse Source

MTM Mayor Module Updated

main
Balaji 3 years ago
parent
commit
1d865bbbcc
  1. 44
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MayorController.java
  2. 191
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MTMOfficer.java
  3. 4
      src/main/resources/templates/fragments/modules/mtm/event_search_form.html
  4. 2
      src/main/resources/templates/modules/mtm/mayor/by-event-list.html
  5. 186
      src/main/resources/templates/modules/mtm/mayor/by-officer-list.html

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

@ -1,40 +1,22 @@
package in.gov.chennaicorporation.gccoffice.mtm.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpSession;
import javax.websocket.Session;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.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 org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.databind.JsonNode;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.controller.login;
import in.gov.chennaicorporation.gccoffice.mtm.data.MtmComplaintTypes;
import in.gov.chennaicorporation.gccoffice.mtm.data.MTMOfficer;
import in.gov.chennaicorporation.gccoffice.mtm.data.MtmEvent;
import in.gov.chennaicorporation.gccoffice.mtm.data.Petition;
import in.gov.chennaicorporation.gccoffice.mtm.data.PetitionComplaint;
import in.gov.chennaicorporation.gccoffice.petregistration.data.RequestList;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Asset;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategoryQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameter;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/mtm/mayor")
@ -269,4 +251,26 @@ public class MayorController {
return basePath+"/by-event-list";
}
@GetMapping({"/by-officer-list"})
public String showOfficerListReport(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/by-officer-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
MTMOfficer[] officerTableList = restTemplate.getForObject(builder.toUriString(), MTMOfficer[].class);
model.addAttribute("officerTableList",officerTableList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
return basePath+"/by-officer-list";
}
}

191
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MTMOfficer.java

@ -0,0 +1,191 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class MTMOfficer {
private String mapId;
private String petitionNumber;
private String mtmEventsPetitionId;
private String mtmEvents;
private String offID;
private String status;
private String mtmComplaintTypes;
private String isDelete;
private String isActive;
private String createdBy;
private String cDate;
private String officerName;
private String eventName;
private String officerPetitionCount;
private String officerCompletedCount;
private String officerPendingCount;
@JsonCreator
public MTMOfficer(
@JsonProperty("mapId") String mapId,
@JsonProperty("petitionNumber") String petitionNumber,
@JsonProperty("mtmEventsPetitionId") String mtmEventsPetitionId,
@JsonProperty("mtmEvents") String mtmEvents,
@JsonProperty("offID") String offID,
@JsonProperty("status") String status,
@JsonProperty("mtmComplaintTypes") String mtmComplaintTypes,
@JsonProperty("isDelete") String isDelete,
@JsonProperty("isActive") String isActive,
@JsonProperty("createdBy") String createdBy,
@JsonProperty("cDate") String cDate,
@JsonProperty("officer_name") String officerName,
@JsonProperty("event_name") String eventName,
@JsonProperty("officer_petition_count") String officerPetitionCount,
@JsonProperty("officer_completed_count") String officerCompletedCount,
@JsonProperty("officer_pending_count") String officerPendingCount
) {
this.mapId = mapId;
this.petitionNumber = petitionNumber;
this.mtmEventsPetitionId = mtmEventsPetitionId;
this.mtmEvents = mtmEvents;
this.offID = offID;
this.status = status;
this.mtmComplaintTypes = mtmComplaintTypes;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
this.officerName = officerName;
this.eventName = eventName;
this.officerPetitionCount = officerPetitionCount;
this.officerCompletedCount = officerCompletedCount;
this.officerPendingCount = officerPendingCount;
}
public String getMapId() {
return mapId;
}
public void setMapId(String mapId) {
this.mapId = mapId;
}
public String getPetitionNumber() {
return petitionNumber;
}
public void setPetitionNumber(String petitionNumber) {
this.petitionNumber = petitionNumber;
}
public String getMtmEventsPetitionId() {
return mtmEventsPetitionId;
}
public void setMtmEventsPetitionId(String mtmEventsPetitionId) {
this.mtmEventsPetitionId = mtmEventsPetitionId;
}
public String getMtmEvents() {
return mtmEvents;
}
public void setMtmEvents(String mtmEvents) {
this.mtmEvents = mtmEvents;
}
public String getOffID() {
return offID;
}
public void setOffID(String offID) {
this.offID = offID;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMtmComplaintTypes() {
return mtmComplaintTypes;
}
public void setMtmComplaintTypes(String mtmComplaintTypes) {
this.mtmComplaintTypes = mtmComplaintTypes;
}
public String getIsDelete() {
return isDelete;
}
public void setIsDelete(String isDelete) {
this.isDelete = isDelete;
}
public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getOfficerName() {
return officerName;
}
public void setOfficerName(String officerName) {
this.officerName = officerName;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getOfficerPetitionCount() {
return officerPetitionCount;
}
public void setOfficerPetitionCount(String officerPetitionCount) {
this.officerPetitionCount = officerPetitionCount;
}
public String getOfficerCompletedCount() {
return officerCompletedCount;
}
public void setOfficerCompletedCount(String officerCompletedCount) {
this.officerCompletedCount = officerCompletedCount;
}
public String getOfficerPendingCount() {
return officerPendingCount;
}
public void setOfficerPendingCount(String officerPendingCount) {
this.officerPendingCount = officerPendingCount;
}
}

4
src/main/resources/templates/fragments/modules/mtm/event_search_form.html

@ -2,7 +2,7 @@
<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="callReSetEventId(0);" title="Reset">
<button type="button" 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>
@ -13,7 +13,7 @@
th:selected="${session.eventid == #strings.toString(mtmEvents.mtmId)}"></option>
</select>
<span class="input-group-append">
<button type="button" class="btn btn-success" onclick="callSetEventId();" title="Search">
<button type="button" 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>

2
src/main/resources/templates/modules/mtm/mayor/by-event-list.html

@ -92,7 +92,7 @@
<th class="text-center" colspan=4>Petitions</th>
<th class="text-center" colspan=3>Compliants</th>
</tr>
<tr class="table-bordered">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="">Name</th>
<th class="">Date</th>

186
src/main/resources/templates/modules/mtm/mayor/by-officer-list.html

@ -0,0 +1,186 @@
<!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-th-large bg-blue"></i>
<div class="d-inline">
<h5>Officer`s report based on complaint`s</h5>
<span>Makkalai Thedi Mayoral Module</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">Makkalai Thedi Mayoral </li>
<li class="breadcrumb-item">Mayor</li>
<li class="breadcrumb-item active" aria-current="page">Petition List</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/mtm/event_search_form :: div}"></div>
<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="">Officer`s</th>
<th class="">Off&nbsp;ID</th>
<th class="">Event</th>
<th class="text-center">Total</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</th>
</tr>
</theadclass="thead-dark">
<tbody>
<tr th:each="officers, i : ${officerTableList}" class="${officerTableList}">
<td th:text="${i.index + 1}">0</td>
<td th:text="${officers.officerName}"></td>
<td th:text="${officers.offID}"></td>
<td th:text="${officers.eventName}"></td>
<td th:text="${officers.officerPetitionCount}"></td>
<td th:text="${officers.officerCompletedCount}"></td>
<td th:text="${officers.officerPendingCount}"></td>
</tr>
</tbody>
<tfoot class="thead-dark">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="">Officer`s</th>
<th class="">Event</th>
<th class="">Off ID</th>
<th class="text-center">Total</th>
<th class="text-center">Completed</th>
<th class="text-center">Pending</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',
exportOptions: {
columns: ':not(.export-hidden)', // Exclude columns with class 'export-hidden'
},
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn',
title: 'Complaint List',
exportOptions: {
columns: ':not(.export-hidden)', // Exclude columns with class 'export-hidden'
},
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn',
title: 'Complaint List',
exportOptions: {
columns: ':not(.export-hidden)', // Exclude columns with class 'export-hidden'
},
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn',
title: 'Complaint List',
exportOptions: {
columns: ':not(.export-hidden)', // Exclude columns with class 'export-hidden'
},
}
];
$('#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>
Loading…
Cancel
Save