From b72c5d3e23f844653f6c9e9208ea64594154ac70 Mon Sep 17 00:00:00 2001 From: aswinsundar Date: Tue, 2 May 2023 11:29:10 +0530 Subject: [PATCH] initial commit --- pom.xml | 22 +- .../html/Entity/PetRegisterEntity.java | 26 +- .../html/controller/AcceptReject.java | 4 +- .../okayjava/html/controller/Acknowledge.java | 3 +- .../html/controller/IndexController.java | 88 +- .../com/okayjava/html/model/PetRegister.java | 17 +- src/main/resources/application.properties | 4 +- src/main/resources/templates/Homepage.html | 47 + .../resources/templates/acknowledged.html | 2 +- src/main/resources/templates/index.html | 1006 ++++++++++------- src/main/resources/templates/welcome.html | 14 +- 11 files changed, 752 insertions(+), 481 deletions(-) create mode 100644 src/main/resources/templates/Homepage.html diff --git a/pom.xml b/pom.xml index ce462c4..5144e16 100644 --- a/pom.xml +++ b/pom.xml @@ -62,13 +62,33 @@ test + - + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + package diff --git a/src/main/java/com/okayjava/html/Entity/PetRegisterEntity.java b/src/main/java/com/okayjava/html/Entity/PetRegisterEntity.java index 61eca0a..055881a 100644 --- a/src/main/java/com/okayjava/html/Entity/PetRegisterEntity.java +++ b/src/main/java/com/okayjava/html/Entity/PetRegisterEntity.java @@ -13,7 +13,9 @@ import javax.persistence.*; public class PetRegisterEntity { @Id private long Id; - + public long getId() { + return Id; + } public String getPaymentid() { return paymentid; } @@ -22,9 +24,6 @@ public class PetRegisterEntity { this.paymentid = paymentid; } - public long getId() { - return Id; - } @Lob private byte[] addressProofPhoto; @Lob @@ -111,7 +110,6 @@ public class PetRegisterEntity { } @Lob - private byte[] applicantPhoto; private String name; private String petID; private String zone; @@ -122,9 +120,9 @@ public class PetRegisterEntity { private String street; private String area; private String city; - private String phone; private String pincode; private String state; + private String phone; private String email; private String pancardnumber; private String aadhar; @@ -138,6 +136,8 @@ public class PetRegisterEntity { private String gender; private String VeterinaryConsultant; private String TNVCNo; + private byte[] applicantPhoto; + public String getDivision() { return division; @@ -304,6 +304,7 @@ public class PetRegisterEntity { } private String Ageyears; + private String Months; public String getMonths() { return Months; @@ -313,7 +314,6 @@ public class PetRegisterEntity { Months = months; } - private String Months; public String getARVdate() { return ARVdate; @@ -398,8 +398,8 @@ public class PetRegisterEntity { } public PetRegisterEntity(long id, String petID, String zone, String division, String title, String fname, String doornumber, - String street, String area, String city, String phone, String pincode, - String state, String email, String pancardnumber, String aadhar, String votercard, + String street, String area, String city, String pincode, + String state, String phone, String email, String pancardnumber, String aadhar, String votercard, String previouslicense, String petname, String species, String identificationmark, String breed, String petcolor, String gender, String veterinaryConsultant, String TNVCNo, String ageyears, String months, String ARVdate, String Lastdate, @@ -414,9 +414,9 @@ public class PetRegisterEntity { this.street = street; this.area = area; this.city = city; - this.phone = phone; this.pincode = pincode; this.state = state; + this.phone = phone; this.email = email; this.pancardnumber = pancardnumber; this.aadhar = aadhar; @@ -428,10 +428,10 @@ public class PetRegisterEntity { this.breed = breed; this.petcolor = petcolor; this.gender = gender; - VeterinaryConsultant = veterinaryConsultant; + this.VeterinaryConsultant = veterinaryConsultant; this.TNVCNo = TNVCNo; - Ageyears = ageyears; - Months = months; + this.Ageyears = ageyears; + this.Months = months; this.ARVdate = ARVdate; this.Lastdate = Lastdate; this.sterilization = sterilization; diff --git a/src/main/java/com/okayjava/html/controller/AcceptReject.java b/src/main/java/com/okayjava/html/controller/AcceptReject.java index e0bfd78..36046c2 100644 --- a/src/main/java/com/okayjava/html/controller/AcceptReject.java +++ b/src/main/java/com/okayjava/html/controller/AcceptReject.java @@ -48,8 +48,8 @@ public class AcceptReject { /** * add your secretId and secretValue you got from your RazorPay account. */ - private static final String SECRET_ID = "rzp_live_dZkTTP32cjf3wj"; - private static final String SECRET_KEY = "pPgFK4AwzQoBC7zoPKSPl1At"; + private static final String SECRET_ID = "rzp_live_ySI5Ns54Y7qOcJ"; + private static final String SECRET_KEY = "Nwf1TjhUtaskof8vePkRR8Sb"; public AcceptReject() throws RazorpayException { this.client = new RazorpayClient(SECRET_ID, SECRET_KEY); } diff --git a/src/main/java/com/okayjava/html/controller/Acknowledge.java b/src/main/java/com/okayjava/html/controller/Acknowledge.java index cd0e2e4..5c71437 100644 --- a/src/main/java/com/okayjava/html/controller/Acknowledge.java +++ b/src/main/java/com/okayjava/html/controller/Acknowledge.java @@ -49,7 +49,8 @@ public class Acknowledge { try { petRegisters.get(0).setPet_photo(Base64.getEncoder().encodeToString(petRegisters.get(0).getPetPhoto_bytes())); petRegisters.get(0).setVaccination_certificate_photo(Base64.getEncoder().encodeToString(petRegisters.get(0).getVaccinationCertificatePhoto_bytes())); - + petRegisters.get(0).setApplicant_photo(Base64.getEncoder().encodeToString(petRegisters.get(0).getApplicant_photo_bytes())); + petRegisters.get(0).setAddress_proof_photo(Base64.getEncoder().encodeToString(petRegisters.get(0).getAddressProofPhoto_bytes())); System.out.println(petRegisters.get(0).getApplicant_photo_bytes().length > 5); if (petRegisters.get(0).getApplicant_photo_bytes().length > 5) { diff --git a/src/main/java/com/okayjava/html/controller/IndexController.java b/src/main/java/com/okayjava/html/controller/IndexController.java index 31bb5ab..7d4ea8b 100644 --- a/src/main/java/com/okayjava/html/controller/IndexController.java +++ b/src/main/java/com/okayjava/html/controller/IndexController.java @@ -1,27 +1,25 @@ package com.okayjava.html.controller; -import java.time.format.DateTimeFormatter; -import java.time.LocalDateTime; import com.okayjava.html.utils.imageCompress; import com.okayjava.html.Repository.PetRepository; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; + +import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; -import org.springframework.util.StringUtils; + import org.springframework.web.bind.annotation.*; -import com.okayjava.html.Service.PetRegisterService; import com.okayjava.html.model.PetRegister; -import com.okayjava.html.Entity.PetRegisterEntity; + import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.time.Instant; -import java.util.Base64; + import java.util.List; @Controller @@ -30,19 +28,35 @@ public class IndexController { @Autowired private JdbcTemplate jdbcTemplate; private PetRepository petRepository; + + @GetMapping("") + public String viewHomePage() { + return "HomePage"; + } + + @GetMapping({"/register"}) + public String showRegistrationForm(Model model) { + model.addAttribute("user", new SecurityProperties.User()); + + return "/index.html"; + } + @GetMapping("/index") public String index() { - + return "index"; } + + + @GetMapping("/GetRegisteredPetdetails") public String getRegisteredPetdetails(ModelMap model){ List petRegisters = jdbcTemplate.query("select * from petregister ", (rs, rowNum) -> { PetRegister petRegister = new PetRegister(rs.getString("petID"), rs.getString("zone"), - rs.getString("division"), rs.getString("title"), rs.getString("fname"), - rs.getString("doornumber"), rs.getString("street"), rs.getString("area"), rs.getString("city"), rs.getString("phone"), - rs.getString("pincode"), rs.getString("state"), rs.getString("email"), rs.getString("pancardnumber"), + rs.getString("division"), rs.getString("title"), rs.getString("name"), + rs.getString("doornumber"), rs.getString("street"), rs.getString("area"), rs.getString("city"), + rs.getString("pincode"), rs.getString("state"), rs.getString("phone"),rs.getString("email"), rs.getString("pancardnumber"), rs.getString("aadhar"), rs.getString("votercard"), rs.getString("previouslicense"), rs.getString("petname"), rs.getString("species"), rs.getString("identificationmark"), rs.getString("breed"), rs.getString("petcolor"), rs.getString("gender"), rs.getString("Veterinary_Consultant"), rs.getString("TNVCNo"), @@ -100,30 +114,38 @@ public class IndexController { // System.out.println(pet.getPincode()); System.out.println(pet.getPetID()); - model.addAttribute("firstname", pet.getFname()); - model.addAttribute("email", pet.getEmail()); - model.addAttribute("aadhar", pet.getAadhar()); - model.addAttribute("pan", pet.getPan()); - model.addAttribute("adopted", pet.getAdopted()); - model.addAttribute("AntiRabies_vaccination", pet.getAntiRabies_vaccination()); - model.addAttribute("ageyears", pet.getAgeyears()); - model.addAttribute("ARVdate", pet.getARVdate()); - model.addAttribute("Lastdate", pet.getLastdate()); - model.addAttribute("area", pet.getArea()); - model.addAttribute("breed", pet.getBreed()); - model.addAttribute("city", pet.getCity()); + model.addAttribute("zone", pet.getZone()); model.addAttribute("division", pet.getDivision()); + model.addAttribute("title", pet.getTitle()); + model.addAttribute("fname", pet.getFname()); model.addAttribute("doornumber", pet.getDoornumber()); - model.addAttribute("identificationmark", pet.getIdentificationmark()); - model.addAttribute("petcolour", pet.getPetcolor()); + model.addAttribute("street", pet.getStreet()); + model.addAttribute("area", pet.getArea()); + model.addAttribute("city", pet.getCity()); + model.addAttribute("pincode", pet.getPincode()); + model.addAttribute("state", pet.getState()); + model.addAttribute("phone", pet.getPhone()); + model.addAttribute("email", pet.getEmail()); + model.addAttribute("pan", pet.getPan()); + model.addAttribute("aadhar", pet.getAadhar()); + model.addAttribute("votercard", pet.getVotercard()); model.addAttribute("previouslicense", pet.getPreviouslicense()); + model.addAttribute("petname",pet.getPetname()); model.addAttribute("species", pet.getSpecies()); - model.addAttribute("sterilization", pet.getSterilization()); + model.addAttribute("identificationmark", pet.getIdentificationmark()); + model.addAttribute("breed", pet.getBreed()); + model.addAttribute("petcolor", pet.getPetcolor()); + model.addAttribute("gender",pet.getGender()); model.addAttribute("veterinaryconsultant", pet.getVeterinaryConsultant()); model.addAttribute("TNVCNo", pet.getTNVCNo()); - model.addAttribute("title", pet.getTitle()); - model.addAttribute("street", pet.getStreet()); - model.addAttribute("pincode", pet.getPincode()); + model.addAttribute("ageyears", pet.getAgeyears()); + model.addAttribute("months",pet.getMonths()); + model.addAttribute("ARVdate", pet.getARVdate()); + model.addAttribute("Lastdate", pet.getLastdate()); + model.addAttribute("sterilization", pet.getSterilization()); + model.addAttribute("adopted", pet.getAdopted()); + model.addAttribute("AntiRabies_vaccination", pet.getAntiRabies_vaccination()); + model.addAttribute("state", pet.getPetID()); long id = Instant.now().toEpochMilli(); @@ -135,8 +157,8 @@ public class IndexController { "address_proof_photo, vaccination_certificate_photo, pet_photo, comments) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; jdbcTemplate.update(sql, id, "PetReg_" + String.valueOf(id), pet.getZone(), pet.getDivision(), pet.getTitle(), pet.getFname(), - pet.getDoornumber(), pet.getStreet(), pet.getArea(), pet.getCity(), pet.getPhone(), - pet.getPincode(), pet.getState(), pet.getEmail(), pet.getPancardnumber(), + pet.getDoornumber(), pet.getStreet(), pet.getArea(), pet.getCity(), + pet.getPincode(), pet.getState(), pet.getPhone(), pet.getEmail(), pet.getPancardnumber(), pet.getAadhar(), pet.getVotercard(), pet.getPreviouslicense(), pet.getPetname(), pet.getSpecies(), pet.getIdentificationmark(), pet.getBreed(), pet.getPetcolor(), pet.getGender(), pet.getVeterinaryConsultant(), pet.getTNVCNo(), @@ -151,8 +173,8 @@ public class IndexController { List petRegisters = jdbcTemplate.query("select * from petregister where paymentid is null", (rs, rowNum) -> { PetRegister petRegister = new PetRegister(rs.getString("petID"), rs.getString("zone"), rs.getString("division"), rs.getString("title"), rs.getString("fname"), - rs.getString("doornumber"), rs.getString("street"), rs.getString("area"), rs.getString("city"), rs.getString("phone"), - rs.getString("pincode"), rs.getString("state"), rs.getString("email"), rs.getString("pancardnumber"), + rs.getString("doornumber"), rs.getString("street"), rs.getString("area"), rs.getString("city"), + rs.getString("pincode"), rs.getString("state"), rs.getString("phone"), rs.getString("email"), rs.getString("pancardnumber"), rs.getString("aadhar"), rs.getString("votercard"), rs.getString("previouslicense"), rs.getString("petname"), rs.getString("species"), rs.getString("identificationmark"), rs.getString("breed"), rs.getString("petcolor"), rs.getString("gender"), rs.getString("Veterinary_Consultant"), rs.getString("TNVCNo"), diff --git a/src/main/java/com/okayjava/html/model/PetRegister.java b/src/main/java/com/okayjava/html/model/PetRegister.java index 0da97ef..69e7e6a 100644 --- a/src/main/java/com/okayjava/html/model/PetRegister.java +++ b/src/main/java/com/okayjava/html/model/PetRegister.java @@ -434,7 +434,7 @@ public class PetRegister { public PetRegister(String petID, String zone, String division, String title, String fname, String doornumber, String street, String area, - String city, String phone, String pincode, String state, String email, + String city, String pincode, String state, String phone, String email, String pancardnumber, String aadhar, String votercard, String previouslicense, String petname, String species, String identificationmark, String breed, String petcolor, String gender, String veterinaryConsultant, String TNVCNo, @@ -459,9 +459,9 @@ public class PetRegister { setStreet(street); setArea(area); setCity(city); - setPhone(phone); setPincode(pincode); setState(state); + setPhone(phone); setEmail(email); setPancardnumber(pancardnumber); setAadhar(aadhar); @@ -481,7 +481,7 @@ public class PetRegister { this.Lastdate = Lastdate; this.sterilization = sterilization; this.adopted = adopted; -// this.AntiRabies_vaccination = AntiRabies_vaccination; + this.AntiRabies_vaccination = AntiRabies_vaccination; this.petID = petID; this.name = name; } @@ -496,9 +496,9 @@ public class PetRegister { "street= " + street +", " + "area= " + area +", " + "city= " + city +", " + - "phone= " + phone +", " + "pincode= " + pincode +", " + "state= " + state +", " + + "phone= " + phone +", " + "email= " + email + ", " + "pancardnumber= " + pancardnumber +", " + "aadhar= " + aadhar +", " + @@ -513,11 +513,10 @@ public class PetRegister { "VeterinaryConsultant= " + VeterinaryConsultant +", " + "TNVCNo= " + TNVCNo +", " + "Ageyears= " + Ageyears +", " + - "AgeMonths= " + Months +", " + - "AgeMonths= " + ARVdate +", " + - "AgeMonths= " + Lastdate +", " + - "AgeMonths= " + sterilization +", " + - + "Months= " + Months +", " + + "ARVdate= " + ARVdate +", " + + "Lastdate= " + Lastdate +", " + + "sterilization= " + sterilization +", " + "adopted= " + adopted + ", " + "AntiRabies_vaccination= " + AntiRabies_vaccination + "]"; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 22c0786..60b9c48 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url = jdbc:mysql://localhost:3306/pet +spring.datasource.url = jdbc:mysql://localhost:3306/asset spring.datasource.username = root -spring.datasource.password = Test@1234 +spring.datasource.password = password spring.jpa.show-sql = true spring.jpa.hibernate.ddl-auto = update spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect diff --git a/src/main/resources/templates/Homepage.html b/src/main/resources/templates/Homepage.html new file mode 100644 index 0000000..a636da8 --- /dev/null +++ b/src/main/resources/templates/Homepage.html @@ -0,0 +1,47 @@ + + + + + + + + + + + +
+ + +
பெருநகர சென்னை மாநகராட்சி +
Greater Chennai Corporation
+
+

Pet License

+ + +
+
+ +
+
+ +

+

+

+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/src/main/resources/templates/acknowledged.html b/src/main/resources/templates/acknowledged.html index 5664fa4..cf6c405 100644 --- a/src/main/resources/templates/acknowledged.html +++ b/src/main/resources/templates/acknowledged.html @@ -32,7 +32,7 @@ margin-top:12px; acknowledged -
+
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index f269df2..9151b8b 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -1,24 +1,60 @@ - + + + + + + + + Pet Registration + + + + + +
- -
+
பெருநகர சென்னை மாநகராட்சி +
Greater Chennai Corporation
-
Greater Chennai Corporation
+
பொது சுகாதாரத்துறை/Public Health Department
-
Public Health Department
- -
Veterinary Section
+
கால்நடை மருத்துவப் பிரிவு/Veterinary Section

-
Application Form for Pet Animal License Under Section 116 of
+
சென்னை மாநகராட்சி சட்டம் 1919, பிரிவு – 116 –ன் கீழ்/Application Form for Pet Animal License Under Section 116 of
The Chennai City Municipal Corporation Act 1919

- -
    @@ -28,7 +64,7 @@

    1. - Name of the Owner/ + Name of the Owner/

    உரிமையாளரின் பெயர்:* @@ -52,7 +88,7 @@
    - +
+

+ + + -
-
-
+ + - - -
-
-
-
-
- - Yes + +
+
+
+
+ +
-
-
-
-
- - -
-
-
- - - - - - No - -
-
+
+
+
+
+ + +
+
+ +
+ +
+ +
+
+
+
+ - If no or ARV administered date more than 365 days: - Pop-up message: -
- Registration cannot be processed because of invalid ARV administered date. Kindly get your pet vaccinated in the following Pet Clinics run by Greater Chennai Corporation. - 1.Thiru.Vi.Ka Nagar Pet Clinic, - Pallavan Salai, - Thiru.Vi.Ka Nagar - Div-68, Zone – 6 - 2.Nungambakkam Pet Clinic - School Road, - Nungambakkam, - Chennai-600 034. - Division-110 Zone – 9 - 3. Kannammapet Pet Clinic, - Muthu Rangam Salai, - T.Nagar, - Chennai-600 017 - Division-141, Zone - 10 - - 4. Meenambakkam Pet Clinic - Nehru High Road, - Meenambakkam, - Chennai- 600 116. - Division-166, Zone-12. / - -
-
+
+
+ +

+
+
-
-
- - -
-
- - -
-
- -
+
+
+
-
-
-
-
-
-
- - -
-
- -
+
+
+
+
+
+
+ VETERINARY CONSULTANT DETAILS / + சிகிச்சை அளிக்கும் கால்நடை மருத்துவரின் விபரம்: +
+
+
+
+ + +
+
+ +
+
+
+
+
+
+


-
-
- - -
- -
- Dog: -
-
-
- - - - -
-
- - - - -
-
- - - -
-
- - -

-
-
- - -
- -
-
-
- - -
-
- -

- -
-
+
+ + +
+
+ -
-
-
-
- -
-
- -
-
-
-
+
+

- VETERINARY CONSULTANT DETAILS / - சிகிச்சை அளிக்கும் கால்நடை மருத்துவரின் விபரம்: -
-
-
-
- - -
-
- -
-
-
-
-
-
-
-
- - -
-
- -
-
-
-

- Attachment Details / - இணைக்கப்பட வேண்டிய விவரங்கள்:* -
-
-
-
- - -
-
- -
-
-
-
-
-
+
+
+
+
+
+ - -
-
- + -
-
-
-
-
-
- - -
-
- -
-
-
-
-
-
- - -
-
- -
-
- +
+
+
+
+
+
+
+
+
+ + +
+
+ +
+
+
+
+
+
+
+ + +
+
+ +
+
+


+
Declaration / உறுதிமொழி:

- -
- -
+ + +
+ +

@@ -679,9 +858,10 @@

- +


+
diff --git a/src/main/resources/templates/welcome.html b/src/main/resources/templates/welcome.html index 9671537..3f77d92 100644 --- a/src/main/resources/templates/welcome.html +++ b/src/main/resources/templates/welcome.html @@ -28,7 +28,7 @@ -
+
@@ -40,17 +40,17 @@ Operations Status Payment ID - Title First Name + zone division doornumber street area city - phone pincode state + phone email pancardnumber aadhar @@ -71,7 +71,7 @@ sterilization adopted antirabies_vaccination - ` + @@ -82,18 +82,20 @@
+ + - + @@ -106,7 +108,7 @@ - +