Browse Source

Name Transfer Query changes 2

master
Thaqi2021 2 years ago
parent
commit
895d1d35d9
  1. 116
      src/main/java/com/metro/feedback/controller/FeedbackAPIController.java
  2. 13
      src/main/java/com/metro/feedback/controller/FeedbackController.java
  3. 56
      src/main/java/com/metro/services/ReportService.java
  4. 2
      src/main/resources/static/assets/css/dashmix.css
  5. BIN
      src/main/resources/static/assets/media/images/ripon2.jpeg
  6. BIN
      src/main/resources/static/assets/media/images/ripon_building.jpeg
  7. 342
      src/main/resources/templates/feedback/RequestForm.html

116
src/main/java/com/metro/feedback/controller/FeedbackAPIController.java

@ -1,116 +0,0 @@
package com.metro.feedback.controller;
import java.util.List;
import org.hibernate.mapping.Map;
import org.springframework.http.ResponseEntity;
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 org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
@RestController
@RequestMapping("/feedback/api")
public class FeedbackAPIController {
// @GetMapping("/user")
// public ResponseEntity<?> getUser(@RequestParam String mobile){
// System.out.println("1 croce ");
// RestTemplate rest =new RestTemplate();
//
// String s="https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=getProfileNew&serviceinput={Username:"+mobile+"}";
// System.out.println(s);
// Object forObject = rest.getForObject(s, Object.class);
// return ResponseEntity.ok(forObject);
// }
// @GetMapping("/deactive")
// public ResponseEntity<?> getDeactive(@RequestParam String mobile){
// RestTemplate rest =new RestTemplate();
//
// String s="https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=profileDeactivate&serviceinput={Username:"+mobile+"}";
// ResponseEntity<Map> forEntity = rest.getForEntity(s, Map.class);
// return ResponseEntity.ok(forEntity);
// }
@GetMapping("/user")
public ResponseEntity<?> getUser(@RequestParam String mobile) {
StringBuilder content = new StringBuilder();
try {
String urlString = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=getProfileNew&serviceinput={Username:" + mobile + "}";
URL url = new URL(urlString);
URLConnection urlConnection = url.openConnection();
try (BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) {
String inputLine;
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
}
} catch (IOException e) {
e.printStackTrace();
}
// Convert the content to a JSON object using Jackson
ObjectMapper objectMapper = new ObjectMapper();
try {
JsonNode jsonNode = objectMapper.readTree(content.toString());
if(jsonNode==null) {
return ResponseEntity.ok("");
}
return ResponseEntity.ok(jsonNode);
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(500).body("Error parsing JSON response");
}
}
@GetMapping("/deactive")
public ResponseEntity<?> getDeactive(@RequestParam String mobile){
StringBuilder content = new StringBuilder();
try {
String urlString = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=profileDeactivate&serviceinput={Username:"+mobile+"}";
URL url = new URL(urlString);
URLConnection urlConnection = url.openConnection();
try (BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) {
String inputLine;
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
}
} catch (IOException e) {
e.printStackTrace();
}
// Convert the content to a JSON object using Jackson
ObjectMapper objectMapper = new ObjectMapper();
try {
JsonNode jsonNode = objectMapper.readTree(content.toString());
return ResponseEntity.ok(jsonNode);
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(500).body("Error parsing JSON response");
}
}
}

13
src/main/java/com/metro/feedback/controller/FeedbackController.java

@ -1,13 +0,0 @@
package com.metro.feedback.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/support")
@Controller
public class FeedbackController {
@RequestMapping(value={"/",""})
public String getmypage(){
return "feedback/RequestForm";
}
}

56
src/main/java/com/metro/services/ReportService.java

@ -107,29 +107,47 @@ public class ReportService {
// "AND TRUNC(CREATE_TIMESTAMP) BETWEEN TRUNC(TO_DATE('"+ getFromdate() +"','dd/mm/yyyy')) " +
// "AND TRUNC(TO_DATE('"+ getTodate() +"','dd/mm/yyyy')) " +
// "ORDER BY BILL_NO, CREATE_TIMESTAMP";
// }
// else if(getDatetype().equals("nameTransfer")){
// System.out.println("Name Transfer......");
// query="select " +
// "wm.propertyid, n.noticetype, n.noticeno, n.noticedate, wm.application_no, wm.application_date, wm.deed_no, " +
// "wm.deed_date, wm.mobileno, mm.mutation_name, wm.remarks, wm_concat(distinct wfcit.firstname) newowner, wm_concat( distinct c.firstname) oldowner " +
// "from EGPT_WFMUTATION@erp wm " +
// "left outer join EGPT_MUTATION_MASTER@erp mm on wm.id_mutation=mm.id_mutation " +
// "inner join EGPT_REV_TABLE228@erp wt on wt.mutid=wm.id " +
// "left outer join notice@erp n on (n.id_notice=wt.noticeid and n.noticetype='NOTICE9') " +
// "left outer join EGPT_WFMUTATION_OWNER@erp wfmo on wm.id=wfmo.ID_WFMUTATION " +
// "left outer join EGPT_WFCITIZEN@erp wfcit on wfmo.ownerid=wfcit.id " +
// "left outer join EGPT_PROPERTY_MUTATION@erp a on a.id_prop_mutation = wt.prop_mutation " +
// "left outer join egpt_mutation_owner@erp b on b.id_prop_mutation=a.ID_PROP_MUTATION " +
// "left outer join EG_CITIZEN@erp c on b.ownerid=c.citizenid " +
// "where " +
// " n.noticedate >= to_Date('"+ getFromdate() +"', 'dd/mm/yyyy') " +
// "and n.noticedate < to_Date('"+ getTodate() +"', 'dd/mm/yyyy') " +
// "group by wm.propertyid, n.noticetype, n.noticeno, n.noticedate, wm.application_no, wm.application_date, wm.deed_no, " +
// "wm.deed_date, wm.mobileno, mm.mutation_name, wm.remarks " +
// "order by 1";
// }
else if(getDatetype().equals("nameTransfer")){
System.out.println("Name Transfer......");
query="select " +
"wm.propertyid, n.noticetype, n.noticeno, n.noticedate, wm.application_no, wm.application_date, wm.deed_no, " +
"wm.deed_date, wm.mobileno, mm.mutation_name, wm.remarks, wm_concat(distinct wfcit.firstname) newowner, wm_concat( distinct c.firstname) oldowner " +
"from EGPT_WFMUTATION@erp wm " +
"left outer join EGPT_MUTATION_MASTER@erp mm on wm.id_mutation=mm.id_mutation " +
"inner join EGPT_REV_TABLE228@erp wt on wt.mutid=wm.id " +
"left outer join notice@erp n on (n.id_notice=wt.noticeid and n.noticetype='NOTICE9') " +
"left outer join EGPT_WFMUTATION_OWNER@erp wfmo on wm.id=wfmo.ID_WFMUTATION " +
"left outer join EGPT_WFCITIZEN@erp wfcit on wfmo.ownerid=wfcit.id " +
"left outer join EGPT_PROPERTY_MUTATION@erp a on a.id_prop_mutation = wt.prop_mutation " +
"left outer join egpt_mutation_owner@erp b on b.id_prop_mutation=a.ID_PROP_MUTATION " +
"left outer join EG_CITIZEN@erp c on b.ownerid=c.citizenid " +
"where " +
" n.noticedate >= to_Date('"+ getFromdate() +"', 'dd/mm/yyyy') " +
"and n.noticedate < to_Date('"+ getTodate() +"', 'dd/mm/yyyy') " +
"group by wm.propertyid, n.noticetype, n.noticeno, n.noticedate, wm.application_no, wm.application_date, wm.deed_no, " +
"wm.deed_date, wm.mobileno, mm.mutation_name, wm.remarks " +
"order by 1";
query="select\n" +
"wm.propertyid, n.noticetype, n.noticeno, n.noticedate, wm.application_no, wm.application_date, wm.deed_no,\n" +
"wm.deed_date, wm.mobileno, mm.mutation_name, wm.remarks, wfmo.newowner newowner, a.oldowner oldowner\n" +
"from EGPT_WFMUTATION@erp wm\n" +
"left outer join EGPT_MUTATION_MASTER@erp mm on wm.id_mutation=mm.id_mutation\n" +
"inner join EGPT_REV_TABLE228@erp wt on wt.mutid=wm.id\n" +
"left outer join notice@erp n on (n.id_notice=wt.noticeid and n.noticetype='NOTICE9')\n" +
"left outer join ptis_mutation_new_owner@erp wfmo on wm.id=wfmo.ID_WFMUTATION\n" +
"left outer join ptis_mutation_old_owner@erp a on a.id_prop_mutation = wt.prop_mutation\n" +
"where\n" +
"n.noticedate >= to_Date('"+ getFromdate() +"', 'dd/mm/yyyy')\n" +
"and n.noticedate < to_Date('"+ getTodate() +"', 'dd/mm/yyyy')\n" +
// "and wm.propertyid='05-058-00524-000'\n" +
"group by wm.propertyid, n.noticetype, n.noticeno, n.noticedate, wm.application_no, wm.application_date, wm.deed_no,\n" +
"wm.deed_date, wm.mobileno, mm.mutation_name, wm.remarks,wfmo.newowner,a.oldowner\n" +
"order by wm.propertyid";
}
else if(getDatetype().equals("entries")){
query="SELECT wfp.id, wfp.propertyid, wfp.zone, wfp.divnum, citizen.firstname || citizen.lastname AS citizen_name, wfp.doornumnew, wfp.bndry_street_dmdcalc, wfp.locality, wfp.area, s.value AS application_status, TO_CHAR(wfp.createtimestamp, 'dd/mm/yyyy') createtimestamp, wfp.remarks FROM egpt_wfproperty@erp wfp, EGPT_WFPROPERTY_OWNER@erp owner, EGPT_WFCITIZEN@erp citizen, eg_wf_states@erp s " +
"WHERE " +

2
src/main/resources/static/assets/css/dashmix.css

@ -2005,7 +2005,7 @@ progress {
border-color: var(--bs-table-border-color);
}
.table > :not(caption) > * > * {
padding: 0.75rem 0.75rem;
/*padding: 0.75rem 0.75rem;*/
background-color: var(--bs-table-bg);
border-bottom-width: 1px;
box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);

BIN
src/main/resources/static/assets/media/images/ripon2.jpeg

After

Width: 1280  |  Height: 423  |  Size: 153 KiB

BIN
src/main/resources/static/assets/media/images/ripon_building.jpeg

After

Width: 1280  |  Height: 423  |  Size: 153 KiB

342
src/main/resources/templates/feedback/RequestForm.html

@ -1,342 +0,0 @@
<!doctype html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0" >
<title>GCC Feedback</title>
<meta name="description" content="GCC Feedback request application">
<meta name="author" content="gcc">
<meta name="robots" content="noindex, nofollow">
<!-- Open Graph Meta -->
<meta property="og:title" content="Dashmix - Bootstrap 5 Admin Template &amp; UI Framework">
<meta property="og:site_name" content="gcc">
<meta property="og:description" content="GCC Public Garbage collection request application">
<meta property="og:type" content="website">
<meta property="og:url" content="">
<meta property="og:image" content="">
<link rel="shortcut icon" href="/assets/media/favicons/favicon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/assets/media/favicons/favicon-192x192.png">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/media/favicons/apple-touch-icon-180x180.png">
<link rel="stylesheet" id="css-main" href="/assets/css/dashmix.min.css">
</head>
<body>
<style>
.otp-input-box {
/*display: flex;
justify-content: space-between;*/
width: 100%;
}
.otp-input {
width: 30px;
height: 30px;
border: 1px solid #ccc;
border-radius: 5px;
text-align: center;
font-size: 16px;
margin-right: 10px;
}
</style>
<div id="page-container" class="page-header-dark main-content-boxed">
<!-- Header -->
<header id="page-header" style="background-color:#1e6a7f">
<!-- Header Content -->
<div class="content-header">
<!-- Left Section -->
<div class="d-flex align-items-center">
<!-- Logo -->
<a class="fw-semibold text-dual tracking-wide" href="index.html">
<table>
<tr>
<td>
<img id="site-logo" src="https://chennaicorporation.gov.in/gcc/images/270-2709575_greater-chennai-corporation-dr-greater-chennai-corporation-logo.png" style="width: 40px;">
</td>
<td>
<h6 id="logo-txt" class="logo-text ml-1" style="font-size: 12.4px; margin-bottom: 0px;">GREATER<br>
CHENNAI<br>
CORPORATION</h6>
</td>
</tr>
</table>
</a>
<!-- END Logo -->
</div>
<!-- END Left Section -->
</div>
<!-- END Header Content -->
<!-- Please check out the Loaders page under Components category to see examples of showing/hiding it -->
<div id="page-header-loader" class="overlay-header bg-sidebar-dark">
<div class="content-header">
<div class="w-100 text-center">
<i class="fa fa-fw fa-2x fa-spinner fa-spin text-primary"></i>
</div>
</div>
</div>
<!-- END Header Loader -->
</header>
<!-- END Header -->
<!-- Main Container -->
<main id="main-container">
<!-- Hero -->
<div class="bg-image" style="background-image: url('/assets/media/photos/photo15@2x.jpg');">
<div class="bg-primary-dark-op" style="background-color:rgb(4 128 146 / 80%)!important">
<div class="content content-full">
<div class="py-3 text-center">
<h2 class="text-white mb-2">Government of Tamil Nadu</h2>
<h3 class="h4 fw-normal text-white-75 mb-0">தமிழ்நாடு அரசு பெருநகர சென்னை மாநகராட்சி</h3>
<br>
<h4 class="text-white mb-2">Namma Chennai Support</h4>
</div>
</div>
</div>
</div>
<!-- END Hero -->
<!-- Page Content -->
<div class="content" >
<div class="row" id="req" style="display: block;">
<div class="col-12">
<form action="" id="reqForm" onsubmit="return newUserCall();" >
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title">New Request Form</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="name">Name</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">Mobile No</label>
<input type="text" class="form-control" id="mobile" minlength="10" maxlength="10" name="mobile" required>
</div>
</div>
</div>
<hr class="m-0">
<div class="block-content block-content-full text-end">
<button type="button" class="btn btn-de-secondary btn-sm" onclick="reset()">Reset</button>
<button type="submit" class="btn btn-primary btn-sm" >Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- -->
<div class="content" >
<div class="row" id="req1" style="display: none;">
<div class="col-12">
<form action="" id="reqForm1" onsubmit="return deactive();">
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title">Request Details</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="name">Name</label>
<input type="text" class="form-control" id="name1" name="name1" readonly>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">Mobile No</label>
<input type="text" class="form-control" id="mobile1" minlength="10" maxlength="10" name="mobile1" readonly>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">Email</label>
<input type="text" class="form-control" id="email" minlength="10" maxlength="10" name="mobile1" readonly>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">Door No</label>/label>
<input type="text" class="form-control" id="doorno" minlength="10" maxlength="10" name="mobile1"readonly >
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">Area</label>
<input type="text" class="form-control" id="area" minlength="10" maxlength="10" name="mobile1" readonly>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">aadhar No</label>
<input type="text" class="form-control" id="aadhar" minlength="10" maxlength="10" name="mobile1"readonly >
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">pincode</label>
<input type="text" class="form-control" id="pincode" minlength="10" maxlength="10" name="mobile1" readonly>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">property No</label>
<input type="text" class="form-control" id="property" minlength="10" maxlength="10" name="mobile1" readonly>
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="mobile">Street</label>
<input type="text" class="form-control" id="Street" minlength="10" maxlength="10" name="mobile1" readonly >
</div>
</div>
<div class="col-md-6 alert-light border-0">
<div class="mb-3">
<label class="form-check-label" for="name">Remark</label>
<input type="text" class="form-control" id="Remark" name="Remark" required>
</div>
</div>
</div>
<hr class="m-0">
<div class="block-content block-content-full text-end">
<button type="button" class="btn btn-de-secondary btn-sm" onclick="back()">Back</button>
<button type="submit" class="btn btn-danger btn-sm" >Deactive</button>
</div>
</form>
</div>
</div>
</div>
<!-- -->
</main>
</div>
<!-- Footer -->
<footer id="page-footer" class="footer-static bg-body-extra-light">
<div class="content py-4">
<!-- Footer Copyright -->
<div class="row fs-sm pt-0">
<div class="col-sm-6 order-sm-1 text-center text-sm-start">
<a class="fw-semibold" href="https://chennaicorporation.gov.in/gcc/" target="_blank">GREATER CHENNAI CORPORATION</a> &copy; <span data-toggle="year-copy"></span>
</div>
</div>
<!-- END Footer Copyright -->
</div>
</footer>
<!-- END Footer -->
</div>
<!-- END Page Container -->
<script th:replace="fragments/script :: script"></script>
<script>
function reset(){
document.getElementById("reqForm").reset();
document.getElementById("reqForm1").reset();
}
function back(){
document.getElementById("req1").style.display="none";
document.getElementById("req").style.display="block";
}
function newUserCall(){
var mobile= document.getElementById('mobile').value;
$.ajax({
type: "GET",
url: "/feedback/api/user",
data:{'mobile':mobile},
success: function(response) {
UserDetails(response) ;
}
});
return false;
}
function UserDetails(res) {
console.log(res);
if(res.Message=="Success"){
document.getElementById("name1").value=res.Profile[0].NAME;
document.getElementById("mobile1").value=res.Profile[0].MOBILE;
document.getElementById("email").value=res.Profile[0].EMAIL;
document.getElementById("doorno").value=res.Profile[0].DOORNO;
document.getElementById("area").value=res.Profile[0].AREA;
document.getElementById("aadhar").value=res.Profile[0].AADHAA_NO;
document.getElementById("pincode").value=res.Profile[0].PINCODE;
document.getElementById("property").value=res.Profile[0].PROPERTYTAXNO;
document.getElementById("Street").value=res.Profile[0].STREET;
document.getElementById("req").style.display="none";
document.getElementById("req1").style.display="block";
}else if(res.ResultStatus=="false"){
alert("No Data Found");
}
else{
alert("your Account is already Deactived ");
}
}
function deactive(){
var mobile= document.getElementById('mobile1').value;
if(confirm("Are you sure to Deactive the Account ?")){
$.ajax({
type: "GET",
url: "/feedback/api/deactive",
data:{'mobile':mobile},
success: function(response) {
console.log(response)
alert("Successfully deactived") ;
window.location.reload();
}
});
}
else{
alert("We are here to help you.")
}
return false;
}
</script>
</body>
</html>
Loading…
Cancel
Save