Browse Source

Nulm and vehicle service updated

main
kanimozhi 8 months ago
parent
commit
4584c1bff0
  1. 402
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java
  2. 2379
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java
  3. 479
      gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java
  4. 4
      gcc_officer_portal/src/main/resources/application.properties

402
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/controller/NulmAPIController.java

@ -47,7 +47,7 @@ public class NulmAPIController {
private JdbcTemplate nulmJdbcTemplate; private JdbcTemplate nulmJdbcTemplate;
@Autowired @Autowired
public NulmAPIController(NulmService nulmService,JdbcTemplate nulmJdbcTemplate,Environment environment) {
public NulmAPIController(NulmService nulmService, JdbcTemplate nulmJdbcTemplate, Environment environment) {
this.nulmService = nulmService; this.nulmService = nulmService;
this.nulmJdbcTemplate = nulmJdbcTemplate; this.nulmJdbcTemplate = nulmJdbcTemplate;
this.environment = environment; this.environment = environment;
@ -58,7 +58,6 @@ public class NulmAPIController {
this.nulmJdbcTemplate = new JdbcTemplate(dataSource); this.nulmJdbcTemplate = new JdbcTemplate(dataSource);
} }
@GetMapping("/getYear") @GetMapping("/getYear")
public ResponseEntity<List<Map<String, Object>>> getYear() { public ResponseEntity<List<Map<String, Object>>> getYear() {
List<Map<String, Object>> yearList = nulmService.getYearList(); List<Map<String, Object>> yearList = nulmService.getYearList();
@ -67,7 +66,7 @@ public class NulmAPIController {
@GetMapping("/getMonth") @GetMapping("/getMonth")
public ResponseEntity<List<Map<String, Object>>> getMonth(int year) { public ResponseEntity<List<Map<String, Object>>> getMonth(int year) {
//System.out.println("year: "+year);
// System.out.println("year: "+year);
List<Map<String, Object>> monthList = nulmService.getMonthList(year); List<Map<String, Object>> monthList = nulmService.getMonthList(year);
return ResponseEntity.ok(monthList); return ResponseEntity.ok(monthList);
} }
@ -85,7 +84,6 @@ public class NulmAPIController {
return ResponseEntity.ok(divisionList); return ResponseEntity.ok(divisionList);
} }
@PostMapping("/saveGroup") @PostMapping("/saveGroup")
public ResponseEntity<String> saveSchemeGroup(@RequestBody Map<String, Object> payload) { public ResponseEntity<String> saveSchemeGroup(@RequestBody Map<String, Object> payload) {
try { try {
@ -96,19 +94,22 @@ public class NulmAPIController {
return ResponseEntity.status(500).body("Error saving Scheme Group: " + e.getMessage()); return ResponseEntity.status(500).body("Error saving Scheme Group: " + e.getMessage());
} }
} }
/* /*
@PostMapping("/saveOrder")
public ResponseEntity<String> saveOrderDetails(@RequestBody Map<String, Object> payload) {
try {
Map<String, Object> orderData = new HashMap<>(payload);
nulmService.saveOrderDetails(orderData);
return ResponseEntity.ok("Order saved successfully.");
} catch (IllegalArgumentException e) {
return ResponseEntity.badRequest().body("Invalid data: " + e.getMessage());
} catch (Exception e) {
return ResponseEntity.status(500).body("Error saving order: " + e.getMessage());
}
}
* @PostMapping("/saveOrder")
* public ResponseEntity<String> saveOrderDetails(@RequestBody Map<String,
* Object> payload) {
* try {
* Map<String, Object> orderData = new HashMap<>(payload);
* nulmService.saveOrderDetails(orderData);
* return ResponseEntity.ok("Order saved successfully.");
* } catch (IllegalArgumentException e) {
* return ResponseEntity.badRequest().body("Invalid data: " + e.getMessage());
* } catch (Exception e) {
* return ResponseEntity.status(500).body("Error saving order: " +
* e.getMessage());
* }
* }
*/ */
@PostMapping("/saveStaff") @PostMapping("/saveStaff")
public ResponseEntity<String> saveStaffDetails(@RequestBody Map<String, Object> payload) { public ResponseEntity<String> saveStaffDetails(@RequestBody Map<String, Object> payload) {
@ -142,9 +143,11 @@ public class NulmAPIController {
if (orderDetails != null) { if (orderDetails != null) {
// Step 2: Build the SQL for updating enrollments with dynamic IN clause // Step 2: Build the SQL for updating enrollments with dynamic IN clause
StringBuilder updateSql = new StringBuilder("UPDATE enrollment_table SET order_id = ?, appointed = 'Yes', facial_attendance = 'No', incharge_phoneno = ?, designation = ?, appointed_date = CURRENT_DATE WHERE enrollment_id IN (");
StringBuilder updateSql = new StringBuilder(
"UPDATE enrollment_table SET order_id = ?, appointed = 'Yes', facial_attendance = 'No', incharge_phoneno = ?, designation = ?, appointed_date = CURRENT_DATE WHERE enrollment_id IN (");
// Add placeholders for the IN clause based on the size of the enrollmentIds list
// Add placeholders for the IN clause based on the size of the enrollmentIds
// list
for (int i = 0; i < enrollmentIds.size(); i++) { for (int i = 0; i < enrollmentIds.size(); i++) {
updateSql.append("?"); updateSql.append("?");
if (i < enrollmentIds.size() - 1) { if (i < enrollmentIds.size() - 1) {
@ -153,7 +156,8 @@ public class NulmAPIController {
} }
updateSql.append(")"); updateSql.append(")");
// Combine the orderId, inchargePhoneno, designation, and the list of enrollmentIds
// Combine the orderId, inchargePhoneno, designation, and the list of
// enrollmentIds
List<Object> parameters = new ArrayList<>(); List<Object> parameters = new ArrayList<>();
parameters.add(orderId); parameters.add(orderId);
parameters.add(inchargePhoneno); parameters.add(inchargePhoneno);
@ -166,7 +170,8 @@ public class NulmAPIController {
return new ResponseEntity<>("Order assigned to enrollments and appointed successfully.", HttpStatus.OK); return new ResponseEntity<>("Order assigned to enrollments and appointed successfully.", HttpStatus.OK);
} catch (DataAccessException e) { } catch (DataAccessException e) {
// Handle any data access exceptions // Handle any data access exceptions
return new ResponseEntity<>("Error updating enrollments: " + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
return new ResponseEntity<>("Error updating enrollments: " + e.getMessage(),
HttpStatus.INTERNAL_SERVER_ERROR);
} }
} }
@ -191,9 +196,11 @@ public class NulmAPIController {
if (orderDetails != null) { if (orderDetails != null) {
// Step 2: Build the SQL for updating enrollments with dynamic IN clause // Step 2: Build the SQL for updating enrollments with dynamic IN clause
StringBuilder updateSql = new StringBuilder("UPDATE enrollment_table SET appointed = 'Drop', dropout = 'Yes', dropout_date = CURRENT_DATE WHERE enrollment_id IN (");
StringBuilder updateSql = new StringBuilder(
"UPDATE enrollment_table SET appointed = 'Drop', dropout = 'Yes', dropout_date = CURRENT_DATE WHERE enrollment_id IN (");
// Add placeholders for the IN clause based on the size of the enrollmentIds list
// Add placeholders for the IN clause based on the size of the enrollmentIds
// list
for (int i = 0; i < enrollmentIds.size(); i++) { for (int i = 0; i < enrollmentIds.size(); i++) {
updateSql.append("?"); updateSql.append("?");
if (i < enrollmentIds.size() - 1) { if (i < enrollmentIds.size() - 1) {
@ -210,13 +217,15 @@ public class NulmAPIController {
try { try {
int rowsAffected = nulmJdbcTemplate.update(updateSql.toString(), parameters.toArray()); int rowsAffected = nulmJdbcTemplate.update(updateSql.toString(), parameters.toArray());
if (rowsAffected > 0) { if (rowsAffected > 0) {
return new ResponseEntity<>("Order assigned to enrollments has been Dropout successfully.", HttpStatus.OK);
return new ResponseEntity<>("Order assigned to enrollments has been Dropout successfully.",
HttpStatus.OK);
} else { } else {
return new ResponseEntity<>("No matching records found to update.", HttpStatus.NOT_FOUND); return new ResponseEntity<>("No matching records found to update.", HttpStatus.NOT_FOUND);
} }
} catch (DataAccessException e) { } catch (DataAccessException e) {
// Handle any data access exceptions // Handle any data access exceptions
return new ResponseEntity<>("Error updating enrollments: " + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
return new ResponseEntity<>("Error updating enrollments: " + e.getMessage(),
HttpStatus.INTERNAL_SERVER_ERROR);
} }
} }
@ -226,7 +235,7 @@ public class NulmAPIController {
@GetMapping("/getAllSchemeGroupNames") @GetMapping("/getAllSchemeGroupNames")
public ResponseEntity<List<Map<String, Object>>> getAllSchemeGroupNames() { public ResponseEntity<List<Map<String, Object>>> getAllSchemeGroupNames() {
try { try {
List<Map<String,Object>> schemeGroupNames = nulmService.getAllSchemeGroupNames();
List<Map<String, Object>> schemeGroupNames = nulmService.getAllSchemeGroupNames();
return ResponseEntity.ok(schemeGroupNames); return ResponseEntity.ok(schemeGroupNames);
} catch (Exception e) { } catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
@ -255,7 +264,7 @@ public class NulmAPIController {
} }
} }
///////get all list of orders////////////////////////////
/////// get all list of orders////////////////////////////
@GetMapping("/getAllOrders") @GetMapping("/getAllOrders")
public ResponseEntity<List<Map<String, Object>>> getAllOrders() { public ResponseEntity<List<Map<String, Object>>> getAllOrders() {
try { try {
@ -292,7 +301,8 @@ public class NulmAPIController {
return ResponseEntity.ok(counts); return ResponseEntity.ok(counts);
} catch (Exception e) { } catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); // You can also return the error message
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); // You can also return the error
// message
} }
} }
@ -303,7 +313,8 @@ public class NulmAPIController {
if (result > 0) { if (result > 0) {
return ResponseEntity.ok("Employee marked as absent successfully."); return ResponseEntity.ok("Employee marked as absent successfully.");
} else { } else {
return ResponseEntity.status(304).body("No update made. Employee may already be marked as absent or has attended.");
return ResponseEntity.status(304)
.body("No update made. Employee may already be marked as absent or has attended.");
} }
} }
@ -334,7 +345,6 @@ public class NulmAPIController {
} }
} }
@GetMapping("/getAllOrderDetails") @GetMapping("/getAllOrderDetails")
public ResponseEntity<List<Map<String, Object>>> getAllOrderDetails() { public ResponseEntity<List<Map<String, Object>>> getAllOrderDetails() {
try { try {
@ -351,7 +361,6 @@ public class NulmAPIController {
return ResponseEntity.ok(counts); return ResponseEntity.ok(counts);
} }
@GetMapping("/dropOutCounts") @GetMapping("/dropOutCounts")
public ResponseEntity<Map<String, Integer>> getDropCounts(@RequestParam int orderId) { public ResponseEntity<Map<String, Integer>> getDropCounts(@RequestParam int orderId) {
Map<String, Integer> counts = nulmService.getDropCounts(orderId); Map<String, Integer> counts = nulmService.getDropCounts(orderId);
@ -377,7 +386,8 @@ public class NulmAPIController {
} }
@GetMapping("/getEnrollmentdeatilsByID/{enrollmentId}") @GetMapping("/getEnrollmentdeatilsByID/{enrollmentId}")
public ResponseEntity<List<Map<String, Object>>> getEnrollmentsById(@PathVariable("enrollmentId") int enrollmentId) {
public ResponseEntity<List<Map<String, Object>>> getEnrollmentsById(
@PathVariable("enrollmentId") int enrollmentId) {
List<Map<String, Object>> enrollments = nulmService.getEnrollmentsById(enrollmentId); List<Map<String, Object>> enrollments = nulmService.getEnrollmentsById(enrollmentId);
if (enrollments.isEmpty()) { if (enrollments.isEmpty()) {
@ -454,8 +464,7 @@ public class NulmAPIController {
order_copy_url, order_copy_url,
order_generated_by, order_generated_by,
category, category,
validity_date
);
validity_date);
return ResponseEntity.ok("Order saved successfully with order number: " + savedOrderNumber); return ResponseEntity.ok("Order saved successfully with order number: " + savedOrderNumber);
@ -465,23 +474,34 @@ public class NulmAPIController {
} }
} }
/* /*
@GetMapping("/staffInititeadList")
public ResponseEntity<List<Map<String, Object>>> getAttendanceWithInitiatedSalaryByGroupId(@RequestParam("inchargeName") String inchargeName,
@RequestParam("month") String month) {
List<Map<String, Object>> staffList = nulmService.getAttendanceWithInitiatedSalary(inchargeName, month);
return ResponseEntity.ok(staffList);
}
@GetMapping("/staffInititeadList")
public ResponseEntity<List<Map<String, Object>>> getAttendanceWithInitiatedSalaryByGroupId(
@RequestParam(value = "inchargeId", required = false) String inchargeId,
@RequestParam(value = "month", required = false) String month,
@RequestParam(value = "inchargeName", required = false) String inchargeName,
@RequestParam(value = "zone", required = false) Integer zone) {
List<Map<String, Object>> staffList = nulmService.getAttendanceWithInitiatedSalary(inchargeId, month, inchargeName, zone);
return ResponseEntity.ok(staffList);
}
* @GetMapping("/staffInititeadList")
* public ResponseEntity<List<Map<String, Object>>>
* getAttendanceWithInitiatedSalaryByGroupId(@RequestParam("inchargeName")
* String inchargeName,
*
* @RequestParam("month") String month) {
* List<Map<String, Object>> staffList =
* nulmService.getAttendanceWithInitiatedSalary(inchargeName, month);
* return ResponseEntity.ok(staffList);
* }
*
* @GetMapping("/staffInititeadList")
* public ResponseEntity<List<Map<String, Object>>>
* getAttendanceWithInitiatedSalaryByGroupId(
*
* @RequestParam(value = "inchargeId", required = false) String inchargeId,
*
* @RequestParam(value = "month", required = false) String month,
*
* @RequestParam(value = "inchargeName", required = false) String inchargeName,
*
* @RequestParam(value = "zone", required = false) Integer zone) {
*
* List<Map<String, Object>> staffList =
* nulmService.getAttendanceWithInitiatedSalary(inchargeId, month, inchargeName,
* zone);
* return ResponseEntity.ok(staffList);
* }
*/ */
@GetMapping("/staffInititeadList") @GetMapping("/staffInititeadList")
@ -490,52 +510,61 @@ public class NulmAPIController {
@RequestParam(value = "month", required = false) String month, @RequestParam(value = "month", required = false) String month,
@RequestParam(value = "year", required = false) String year, @RequestParam(value = "year", required = false) String year,
@RequestParam(value = "incharge_name", required = false) String inchargeName, @RequestParam(value = "incharge_name", required = false) String inchargeName,
@RequestParam (value = "enrollmentIds", required = false) List<Integer> enrollmentIds) {
@RequestParam(value = "enrollmentIds", required = false) List<Integer> enrollmentIds) {
List<Map<String, Object>> staffList = nulmService.getAttendanceWithInitiatedSalary(inchargeId, month, year, inchargeName, enrollmentIds);
List<Map<String, Object>> staffList = nulmService.getAttendanceWithInitiatedSalary(inchargeId, month, year,
inchargeName, enrollmentIds);
return ResponseEntity.ok(staffList); return ResponseEntity.ok(staffList);
} }
/*
@PostMapping("/salaryDetailUpdate")
public ResponseEntity<String> addSalaryDetails(@RequestBody List<Map<String, Object>> requestList) {
System.out.println("Received POST request with data: " + requestList);
try {
for (Map<String, Object> request : requestList) {
int totalDaysPresent = Integer.parseInt(request.get("total_days_present").toString());
int totalDaysOd = Integer.parseInt(request.get("total_days_od").toString());
int totalDaysSalary = Integer.parseInt(request.get("total_days_salary").toString());
int totalDaysAbsent = Integer.parseInt(request.get("total_days_absent").toString());
String month = request.get("month").toString();
int year = Integer.parseInt(request.get("year").toString());
int salaryAmount = Integer.parseInt(request.get("salary_amount").toString());
int enrollmentId = Integer.parseInt(request.get("enrollment_id").toString());
int groupId = Integer.parseInt(request.get("group_id").toString());
int wageId = Integer.parseInt(request.get("wage_id").toString());
// Check if the month and year are valid for salary initiation (past month)
if (isFutureOrCurrentMonth(month, year)) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body("Salary cannot be initiated for the current or future months. Please select a past month.");
}
String salaryStatus = "Initiated";
// Call the service method to insert the salary details
int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent, totalDaysOd, totalDaysSalary, totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId);
if (rowsAffected <= 0) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Failed to add salary details for enrollment ID: " + enrollmentId);
}
}
return ResponseEntity.status(HttpStatus.CREATED)
.body("Salary details added successfully for all selected entries.");
} catch (Exception e) {
e.printStackTrace(); // Log the exception for debugging
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body("Invalid request data: " + e.getMessage());
}
}
/*
* @PostMapping("/salaryDetailUpdate")
* public ResponseEntity<String> addSalaryDetails(@RequestBody List<Map<String,
* Object>> requestList) {
* System.out.println("Received POST request with data: " + requestList);
* try {
* for (Map<String, Object> request : requestList) {
* int totalDaysPresent =
* Integer.parseInt(request.get("total_days_present").toString());
* int totalDaysOd = Integer.parseInt(request.get("total_days_od").toString());
* int totalDaysSalary =
* Integer.parseInt(request.get("total_days_salary").toString());
* int totalDaysAbsent =
* Integer.parseInt(request.get("total_days_absent").toString());
* String month = request.get("month").toString();
* int year = Integer.parseInt(request.get("year").toString());
* int salaryAmount = Integer.parseInt(request.get("salary_amount").toString());
* int enrollmentId = Integer.parseInt(request.get("enrollment_id").toString());
* int groupId = Integer.parseInt(request.get("group_id").toString());
* int wageId = Integer.parseInt(request.get("wage_id").toString());
*
* // Check if the month and year are valid for salary initiation (past month)
* if (isFutureOrCurrentMonth(month, year)) {
* return ResponseEntity.status(HttpStatus.BAD_REQUEST)
* .body("Salary cannot be initiated for the current or future months. Please select a past month."
* );
* }
*
* String salaryStatus = "Initiated";
*
* // Call the service method to insert the salary details
* int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent,
* totalDaysOd, totalDaysSalary, totalDaysAbsent, month, year, salaryAmount,
* salaryStatus, enrollmentId, groupId, wageId);
*
* if (rowsAffected <= 0) {
* return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
* .body("Failed to add salary details for enrollment ID: " + enrollmentId);
* }
* }
* return ResponseEntity.status(HttpStatus.CREATED)
* .body("Salary details added successfully for all selected entries.");
* } catch (Exception e) {
* e.printStackTrace(); // Log the exception for debugging
* return ResponseEntity.status(HttpStatus.BAD_REQUEST)
* .body("Invalid request data: " + e.getMessage());
* }
* }
*/ */
@PostMapping("/salaryDetailUpdate") @PostMapping("/salaryDetailUpdate")
public ResponseEntity<String> addSalaryDetails(@RequestBody List<Map<String, Object>> requestList) { public ResponseEntity<String> addSalaryDetails(@RequestBody List<Map<String, Object>> requestList) {
@ -553,8 +582,7 @@ public class NulmAPIController {
int enrollmentId = Integer.parseInt(request.get("enrollment_id").toString()); int enrollmentId = Integer.parseInt(request.get("enrollment_id").toString());
int groupId = Integer.parseInt(request.get("group_id").toString()); int groupId = Integer.parseInt(request.get("group_id").toString());
int wageId = Integer.parseInt(request.get("wage_id").toString()); int wageId = Integer.parseInt(request.get("wage_id").toString());
int inchargeID = 0;//Integer.parseInt(""+request.get("incharge_id"));
int inchargeID = 0;// Integer.parseInt(""+request.get("incharge_id"));
// Check if the month and year are valid for salary initiation (past month) // Check if the month and year are valid for salary initiation (past month)
if (isFutureOrCurrentMonth(month, year)) { if (isFutureOrCurrentMonth(month, year)) {
@ -570,13 +598,17 @@ public class NulmAPIController {
if (!checkexist) { if (!checkexist) {
// Call the service method to insert the salary details // Call the service method to insert the salary details
int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent, totalDaysOd, totalDaysSalary, totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId, inchargeID);
int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent, totalDaysOd, totalDaysSalary,
totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId,
inchargeID);
if (rowsAffected <= 0) { if (rowsAffected <= 0) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Failed to add salary details for enrollment ID: " + enrollmentId); .body("Failed to add salary details for enrollment ID: " + enrollmentId);
} }
} else { } else {
int rowsAffected = nulmService.updateSalaryDetails(totalDaysPresent, totalDaysOd, totalDaysSalary, totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId, inchargeID);
int rowsAffected = nulmService.updateSalaryDetails(totalDaysPresent, totalDaysOd, totalDaysSalary,
totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId,
inchargeID);
if (rowsAffected <= 0) { if (rowsAffected <= 0) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Failed to update salary details for enrollment ID: " + enrollmentId); .body("Failed to update salary details for enrollment ID: " + enrollmentId);
@ -600,7 +632,8 @@ public class NulmAPIController {
int currentYear = currentDate.getYear(); int currentYear = currentDate.getYear();
// Convert the string month from the request to Month enum // Convert the string month from the request to Month enum
Month requestMonth = Month.valueOf(month.toUpperCase()); // Ensure that month is passed in capitalized format like "JANUARY", "FEBRUARY", etc.
Month requestMonth = Month.valueOf(month.toUpperCase()); // Ensure that month is passed in capitalized format
// like "JANUARY", "FEBRUARY", etc.
// Compare the request month and year with the current date // Compare the request month and year with the current date
if (year > currentYear) { if (year > currentYear) {
@ -611,37 +644,46 @@ public class NulmAPIController {
return false; // Past month return false; // Past month
} }
// @PostMapping("/salaryDetailUpdate")
// public ResponseEntity<String> addSalaryDetails(@RequestBody List<Map<String, Object>> requestList) {
// System.out.println("Received POST request with data: " + requestList);
// try {
// for (Map<String, Object> request : requestList) {
// int totalDaysPresent = Integer.parseInt(request.get("total_days_present").toString());
// int totalDaysOd = Integer.parseInt(request.get("total_days_od").toString());
// int totalDaysSalary = Integer.parseInt(request.get("total_days_salary").toString());
// int totalDaysAbsent = Integer.parseInt(request.get("total_days_absent").toString());
// String month = request.get("month").toString();
// int year = Integer.parseInt(request.get("year").toString());
// int salaryAmount = Integer.parseInt(request.get("salary_amount").toString());
// int enrollmentId = Integer.parseInt(request.get("enrollment_id").toString());
// int groupId = Integer.parseInt(request.get("group_id").toString());
// int wageId = Integer.parseInt(request.get("wage_id").toString());
//
// String salaryStatus = "Initiated";
//
// // Call the service method to insert the salary details
// int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent, totalDaysOd, totalDaysSalary, totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId);
//
// if (rowsAffected <= 0) {
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to add salary details for enrollment ID: " + enrollmentId);
// }
// }
// return ResponseEntity.status(HttpStatus.CREATED).body("Salary details added successfully for all selected entries.");
// } catch (Exception e) {
// e.printStackTrace(); // Log the exception for debugging
// return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid request data: " + e.getMessage());
// }
// }
// @PostMapping("/salaryDetailUpdate")
// public ResponseEntity<String> addSalaryDetails(@RequestBody List<Map<String,
// Object>> requestList) {
// System.out.println("Received POST request with data: " + requestList);
// try {
// for (Map<String, Object> request : requestList) {
// int totalDaysPresent =
// Integer.parseInt(request.get("total_days_present").toString());
// int totalDaysOd = Integer.parseInt(request.get("total_days_od").toString());
// int totalDaysSalary =
// Integer.parseInt(request.get("total_days_salary").toString());
// int totalDaysAbsent =
// Integer.parseInt(request.get("total_days_absent").toString());
// String month = request.get("month").toString();
// int year = Integer.parseInt(request.get("year").toString());
// int salaryAmount = Integer.parseInt(request.get("salary_amount").toString());
// int enrollmentId = Integer.parseInt(request.get("enrollment_id").toString());
// int groupId = Integer.parseInt(request.get("group_id").toString());
// int wageId = Integer.parseInt(request.get("wage_id").toString());
//
// String salaryStatus = "Initiated";
//
// // Call the service method to insert the salary details
// int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent,
// totalDaysOd, totalDaysSalary, totalDaysAbsent, month, year, salaryAmount,
// salaryStatus, enrollmentId, groupId, wageId);
//
// if (rowsAffected <= 0) {
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed
// to add salary details for enrollment ID: " + enrollmentId);
// }
// }
// return ResponseEntity.status(HttpStatus.CREATED).body("Salary details added
// successfully for all selected entries.");
// } catch (Exception e) {
// e.printStackTrace(); // Log the exception for debugging
// return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid request
// data: " + e.getMessage());
// }
// }
@PostMapping("/update-salary-status") @PostMapping("/update-salary-status")
public ResponseEntity<String> updateSalaryStatus( public ResponseEntity<String> updateSalaryStatus(
@ -655,30 +697,37 @@ public class NulmAPIController {
return ResponseEntity.ok("Salary status updated to 'Approved' for the provided enrollments."); return ResponseEntity.ok("Salary status updated to 'Approved' for the provided enrollments.");
} }
/***************API For Mobile Application*********************************/
/*************** API For Mobile Application *********************************/
/* /*
@GetMapping("/attendanceWithSalary")
public ResponseEntity<List<Map<String, Object>>> getAttendanceWithSalaryByInchargeId(
@RequestParam(value = "month", required = false) String month,
@RequestParam(value = "year", required = false) Integer year,
@RequestParam(value = "incharge_id", required = false) Integer inchargeId) {
try {
// Call the service method to fetch the data
List<Map<String, Object>> attendanceWithSalary = nulmService.getAttendanceWithSalaryByInchargeId(month, year, inchargeId);
// If no data is found, return a NOT FOUND response
if (attendanceWithSalary.isEmpty()) {
return ResponseEntity.status(404).body(List.of(Map.of("error", "No attendance records found for the specified parameters.")));
}
// Return the data in the response
return ResponseEntity.ok(attendanceWithSalary);
} catch (Exception ex) {
// Return a 500 Internal Server Error with the error message
return ResponseEntity.status(500).body(List.of(Map.of("error", "An error occurred while fetching attendance data: " + ex.getMessage())));
}
}
* @GetMapping("/attendanceWithSalary")
* public ResponseEntity<List<Map<String, Object>>>
* getAttendanceWithSalaryByInchargeId(
*
* @RequestParam(value = "month", required = false) String month,
*
* @RequestParam(value = "year", required = false) Integer year,
*
* @RequestParam(value = "incharge_id", required = false) Integer inchargeId) {
*
* try {
* // Call the service method to fetch the data
* List<Map<String, Object>> attendanceWithSalary =
* nulmService.getAttendanceWithSalaryByInchargeId(month, year, inchargeId);
*
* // If no data is found, return a NOT FOUND response
* if (attendanceWithSalary.isEmpty()) {
* return ResponseEntity.status(404).body(List.of(Map.of("error",
* "No attendance records found for the specified parameters.")));
* }
*
* // Return the data in the response
* return ResponseEntity.ok(attendanceWithSalary);
* } catch (Exception ex) {
* // Return a 500 Internal Server Error with the error message
* return ResponseEntity.status(500).body(List.of(Map.of("error",
* "An error occurred while fetching attendance data: " + ex.getMessage())));
* }
* }
*/ */
@GetMapping("/attendanceWithSalary") @GetMapping("/attendanceWithSalary")
@ -688,14 +737,20 @@ public class NulmAPIController {
@RequestParam(value = "incharge_id", required = false) Integer inchargeId) { @RequestParam(value = "incharge_id", required = false) Integer inchargeId) {
try { try {
//List<Map<String, Object>> attendanceWithSalary = new ArrayList<>();
//Integer check = nulmService.checkInchargeID(inchargeId);
// if (check == 1) {
// Call the service method to fetch the data // Call the service method to fetch the data
List<Map<String, Object>> attendanceWithSalary = nulmService.getAttendanceWithSalaryByInchargeId(month, year, inchargeId); List<Map<String, Object>> attendanceWithSalary = nulmService.getAttendanceWithSalaryByInchargeId(month, year, inchargeId);
// If no data is found, return a NOT FOUND response total_days_salary, total_salary and total_days_absent
//}
// If no data is found, return a NOT FOUND response total_days_salary,
// total_salary and total_days_absent
if (attendanceWithSalary.isEmpty()) { if (attendanceWithSalary.isEmpty()) {
return ResponseEntity.status(404).body(List.of(Map.of("error", "No attendance records found for the specified parameters.")));
return ResponseEntity.status(404)
.body(List.of(Map.of("error", "No attendance records found for the specified parameters.")));
} }
for (Map<String, Object> aa : attendanceWithSalary) { for (Map<String, Object> aa : attendanceWithSalary) {
long days = ((Number) aa.get("total_days")).longValue(); long days = ((Number) aa.get("total_days")).longValue();
long present = ((Number) aa.get("total_days_present")).longValue(); long present = ((Number) aa.get("total_days_present")).longValue();
@ -711,12 +766,12 @@ public class NulmAPIController {
aa.put("total_days_salary", totalPresent); aa.put("total_days_salary", totalPresent);
} }
// Return the data in the response // Return the data in the response
return ResponseEntity.ok(attendanceWithSalary); return ResponseEntity.ok(attendanceWithSalary);
} catch (Exception ex) { } catch (Exception ex) {
// Return a 500 Internal Server Error with the error message // Return a 500 Internal Server Error with the error message
return ResponseEntity.status(500).body(List.of(Map.of("error", "An error occurred while fetching attendance data: " + ex.getMessage())));
return ResponseEntity.status(500).body(
List.of(Map.of("error", "An error occurred while fetching attendance data: " + ex.getMessage())));
} }
} }
@ -731,9 +786,8 @@ public class NulmAPIController {
@RequestParam("salary_amount") List<Integer> salaryAmountList, @RequestParam("salary_amount") List<Integer> salaryAmountList,
@RequestParam("enrollment_id") List<Integer> enrollmentIdList, @RequestParam("enrollment_id") List<Integer> enrollmentIdList,
@RequestParam("group_id") List<Integer> groupIdList, @RequestParam("group_id") List<Integer> groupIdList,
@RequestParam("wage_id") List<Integer> wageIdList
) {
//System.out.println("Received POST request with form-data");
@RequestParam("wage_id") List<Integer> wageIdList) {
// System.out.println("Received POST request with form-data");
try { try {
// Iterate through each list to process the form data // Iterate through each list to process the form data
@ -741,7 +795,7 @@ public class NulmAPIController {
int totalDaysPresent = totalDaysPresentList.get(i); int totalDaysPresent = totalDaysPresentList.get(i);
int totalDaysOd = totalDaysOdList.get(i); int totalDaysOd = totalDaysOdList.get(i);
int total_days_salary = totalDaysSalaryList.get(i); int total_days_salary = totalDaysSalaryList.get(i);
int totalDaysAbsent= totalDaysAbsentList.get(i);
int totalDaysAbsent = totalDaysAbsentList.get(i);
String month = monthList.get(i); String month = monthList.get(i);
int year = yearList.get(i); int year = yearList.get(i);
int salaryAmount = salaryAmountList.get(i); int salaryAmount = salaryAmountList.get(i);
@ -752,27 +806,29 @@ public class NulmAPIController {
String salaryStatus = "Initiated"; String salaryStatus = "Initiated";
// Call the service method to insert the salary details // Call the service method to insert the salary details
int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent, totalDaysOd, total_days_salary, totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId);
int rowsAffected = nulmService.addSalaryDetails(totalDaysPresent, totalDaysOd, total_days_salary,
totalDaysAbsent, month, year, salaryAmount, salaryStatus, enrollmentId, groupId, wageId);
if (rowsAffected <= 0) { if (rowsAffected <= 0) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to add salary details for enrollment ID: " + enrollmentId);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Failed to add salary details for enrollment ID: " + enrollmentId);
} }
} }
return ResponseEntity.status(HttpStatus.CREATED).body("Salary details added successfully for all selected entries.");
return ResponseEntity.status(HttpStatus.CREATED)
.body("Salary details added successfully for all selected entries.");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); // Log the exception for debugging e.printStackTrace(); // Log the exception for debugging
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid request data: " + e.getMessage()); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid request data: " + e.getMessage());
} }
} }
// @GetMapping("/filtered-details")
// public List<Map<String, Object>> getFilteredSalaryDetails(
// @RequestParam(required = false) String month,
// @RequestParam(required = false) Integer year,
// @RequestParam(required = false) String salaryStatus) {
//
// // Call the service method to get the filtered salary details
// return nulmService.getFilteredSalaryDetails(month, year, salaryStatus);
// }
// @GetMapping("/filtered-details")
// public List<Map<String, Object>> getFilteredSalaryDetails(
// @RequestParam(required = false) String month,
// @RequestParam(required = false) Integer year,
// @RequestParam(required = false) String salaryStatus) {
//
// // Call the service method to get the filtered salary details
// return nulmService.getFilteredSalaryDetails(month, year, salaryStatus);
// }
} }

2379
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/nulm/service/NulmService.java
File diff suppressed because it is too large
View File

479
gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/vtrack/service/VehicleService.java

@ -1,4 +1,5 @@
package in.gov.chennaicorporation.gccoffice.vtrack.service; package in.gov.chennaicorporation.gccoffice.vtrack.service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -44,7 +45,7 @@ public class VehicleService {
@Autowired @Autowired
public VehicleService(Environment environment) { public VehicleService(Environment environment) {
this.fileBaseUrl=environment.getProperty("fileBaseUrl");
this.fileBaseUrl = environment.getProperty("fileBaseUrl");
} }
@Autowired @Autowired
@ -99,7 +100,7 @@ public class VehicleService {
var month = DateTimeUtil.getCurrentMonth(); var month = DateTimeUtil.getCurrentMonth();
var date = DateTimeUtil.getCurrentDay(); var date = DateTimeUtil.getCurrentDay();
uploadDirectory = uploadDirectory + serviceFolderName +"/"+ year +"/"+month+"/"+date;
uploadDirectory = uploadDirectory + serviceFolderName + "/" + year + "/" + month + "/" + date;
try { try {
// Create directory if it doesn't exist // Create directory if it doesn't exist
@ -112,12 +113,13 @@ public class VehicleService {
String datetimetxt = DateTimeUtil.getCurrentDateTime(); String datetimetxt = DateTimeUtil.getCurrentDateTime();
// File name // File name
System.out.println(file.getOriginalFilename()); System.out.println(file.getOriginalFilename());
String fileName = name+ "_" +id + "_" + datetimetxt + "_" + generateRandomStringForFile(10) + "_" + file.getOriginalFilename();
String fileName = name + "_" + id + "_" + datetimetxt + "_" + generateRandomStringForFile(10) + "_"
+ file.getOriginalFilename();
fileName = fileName.replaceAll("\\s+", ""); // Remove space on filename fileName = fileName.replaceAll("\\s+", ""); // Remove space on filename
String filePath = uploadDirectory + "/" + fileName; String filePath = uploadDirectory + "/" + fileName;
String filepath_txt = "/"+serviceFolderName + "/" + year + "/" + month + "/" + date + "/" + fileName;
String filepath_txt = "/" + serviceFolderName + "/" + year + "/" + month + "/" + date + "/" + fileName;
// Create a new Path object // Create a new Path object
Path path = Paths.get(filePath); Path path = Paths.get(filePath);
@ -126,8 +128,9 @@ public class VehicleService {
byte[] bytes = file.getBytes(); byte[] bytes = file.getBytes();
// Compress the image // Compress the image
//BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes));
//byte[] compressedBytes = compressImage(image, 0.5f); // Compress with 50% quality
// BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes));
// byte[] compressedBytes = compressImage(image, 0.5f); // Compress with 50%
// quality
// Write the bytes to the file // Write the bytes to the file
Files.write(path, bytes); Files.write(path, bytes);
@ -141,7 +144,7 @@ public class VehicleService {
} }
} }
public List<Map<String,Object>> getAllTemplateNames() {
public List<Map<String, Object>> getAllTemplateNames() {
String sql = "SELECT `id`, `name` as template_name, `whatsapp_temp_name`, `whatsapp_temp_id` FROM `whatsapp_template` WHERE `isactive`=1 AND `isdelete`=0"; String sql = "SELECT `id`, `name` as template_name, `whatsapp_temp_name`, `whatsapp_temp_id` FROM `whatsapp_template` WHERE `isactive`=1 AND `isdelete`=0";
return jdbcTemplate.queryForList(sql); return jdbcTemplate.queryForList(sql);
} }
@ -159,7 +162,7 @@ public class VehicleService {
+ "DATE_FORMAT(ml.`msg_date`, '%d-%m-%Y') AS msg_temp_event_date, " + "DATE_FORMAT(ml.`msg_date`, '%d-%m-%Y') AS msg_temp_event_date, "
+ "DATE_FORMAT(ml.`cdate`, '%d-%m-%Y %r') AS createddate, " + "DATE_FORMAT(ml.`cdate`, '%d-%m-%Y %r') AS createddate, "
+ "ml.`msg_img` as msg_img, " + "ml.`msg_img` as msg_img, "
+ "CONCAT('"+fileBaseUrl+"/gcc/files', ml.msg_img) AS msg_attachfile, "
+ "CONCAT('" + fileBaseUrl + "/gcc/files', ml.msg_img) AS msg_attachfile, "
+ "wt.`name` as template_name, " + "wt.`name` as template_name, "
+ "wt.`id` as template_id " + "wt.`id` as template_id "
+ "FROM `message_list` ml " + "FROM `message_list` ml "
@ -173,7 +176,7 @@ public class VehicleService {
String sql = "SELECT " String sql = "SELECT "
+ "ml.`id` as msgid, " + "ml.`id` as msgid, "
+ "DATE_FORMAT(ml.`msg_date`, '%d-%m-%Y') AS msg_temp_event_date, " + "DATE_FORMAT(ml.`msg_date`, '%d-%m-%Y') AS msg_temp_event_date, "
+ "CONCAT('"+fileBaseUrl+"/gcc/files', ml.msg_img) AS msg_attachfile, "
+ "CONCAT('" + fileBaseUrl + "/gcc/files', ml.msg_img) AS msg_attachfile, "
+ "wt.`id` as template_id " + "wt.`id` as template_id "
+ "FROM `message_list` ml " + "FROM `message_list` ml "
+ "JOIN `whatsapp_template` wt ON ml.`template_type`=wt.`id` " + "JOIN `whatsapp_template` wt ON ml.`template_type`=wt.`id` "
@ -185,7 +188,7 @@ public class VehicleService {
String tempid = ""; String tempid = "";
String msgDate = ""; String msgDate = "";
String fileURL = ""; String fileURL = "";
String sendTo="";
String sendTo = "";
// Check if the result list is not empty // Check if the result list is not empty
if (!result.isEmpty()) { if (!result.isEmpty()) {
Map<String, Object> row = result.get(0); // Get the first row (assuming id is unique) Map<String, Object> row = result.get(0); // Get the first row (assuming id is unique)
@ -196,7 +199,7 @@ public class VehicleService {
fileURL = String.valueOf(row.get("msg_attachfile")); fileURL = String.valueOf(row.get("msg_attachfile"));
sql = "SELECT `id`, `name`, `mobile`, `userid`, `tempids` FROM `send_msg_to` WHERE `isactive` = 1 AND `isdelete` = 0 AND FIND_IN_SET(?, tempids);"; sql = "SELECT `id`, `name`, `mobile`, `userid`, `tempids` FROM `send_msg_to` WHERE `isactive` = 1 AND `isdelete` = 0 AND FIND_IN_SET(?, tempids);";
List<Map<String, Object>> mobileResult = jdbcTemplate.queryForList(sql,tempid);
List<Map<String, Object>> mobileResult = jdbcTemplate.queryForList(sql, tempid);
// Create a StringBuilder to hold the comma-separated mobile numbers // Create a StringBuilder to hold the comma-separated mobile numbers
StringBuilder sendToBuilder = new StringBuilder(); StringBuilder sendToBuilder = new StringBuilder();
@ -218,390 +221,462 @@ public class VehicleService {
System.out.println("Mobile Numbers: " + sendTo); // For debugging, you can print this value System.out.println("Mobile Numbers: " + sendTo); // For debugging, you can print this value
} }
String urlString="";
String urlString = "";
String username="2000233507";
String password="h2YjFNcJ";
//String sendTo="9176617754"; //9176617754,8610011680,9360777472,9123565217
//String msgDate=datetxt;
//String fileURL=fileurl;
String username = "2000233507";
String password = "h2YjFNcJ";
// String sendTo="9176617754"; //9176617754,8610011680,9360777472,9123565217
// String msgDate=datetxt;
// String fileURL=fileurl;
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd"; String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from="919445061913";
String from = "919445061913";
switch (tempid) { switch (tempid) {
case "1": case "1":
System.out.println("TempID is 1 (Vehicle March Out -> officer_test -> 1308878)"); System.out.println("TempID is 1 (Vehicle March Out -> officer_test -> 1308878)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1" + "&v=1.1"
+ "&format=json" + "&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AZone-wise+vehicle+march-out+details+for+Today%27s+%28"+msgDate+"%29+AM+shift+are+shared+above.%0A%0AFor+further+details%2C+please+click+on+the+button+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AZone-wise+vehicle+march-out+details+for+Today%27s+%28"
+ msgDate
+ "%29+AM+shift+are+shared+above.%0A%0AFor+further+details%2C+please+click+on+the+button+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true" + "&isTemplate=true"
+ "&footer=GCC+-+IT+Cell" + "&footer=GCC+-+IT+Cell"
+ "&buttonUrlParam=login.php%3Funame%3Dgcc.admin2024@jtrack.in%26password%3D123456"; + "&buttonUrlParam=login.php%3Funame%3Dgcc.admin2024@jtrack.in%26password%3D123456";
// urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template&apikey="+apikey+"&from="+from+"&to=9444173345&templateid=2784943&url=";
// urlString
// ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template&apikey="+apikey+"&from="+from+"&to=9444173345&templateid=2784943&url=";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20vehicle%20march-out%20details"; + "&placeholders=Zone%20wise%20vehicle%20march-out%20details";
break; break;
case "2": case "2":
System.out.println("TempID is 2 (Fule Dip Details -> fuel_dip_details -> 1309072)"); System.out.println("TempID is 2 (Fule Dip Details -> fuel_dip_details -> 1309072)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AYesterday%27s+%28"+msgDate+"%29+Zone+wise+Fuel+Dip+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AYesterday%27s+%28" + msgDate
+ "%29+Zone+wise+Fuel+Dip+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Fuel%20Dip%20Details"; + "&placeholders=Zone%20wise%20Fuel%20Dip%20Details";
break; break;
case "3": case "3":
System.out.println("TempID is 3 (Late Marchout Details -> late_marchout_details -> 1309075)"); System.out.println("TempID is 3 (Late Marchout Details -> late_marchout_details -> 1309075)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone-wise+Late+Marchout+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone-wise+Late+Marchout+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Late%20Marchout%20Details"; + "&placeholders=Zone%20wise%20Late%20Marchout%20Details";
break; break;
case "4": case "4":
System.out.println("TempID is 4 (LMV Route Deviation Details -> lmv_route_deviation_details -> 1309081)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out
.println("TempID is 4 (LMV Route Deviation Details -> lmv_route_deviation_details -> 1309081)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone-wise+Compactors+LMV+Route+Deviation+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone-wise+Compactors+LMV+Route+Deviation+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Compactors%20LMV%20Route%20%20Deviation%20Details"; + "&placeholders=Zone%20wise%20Compactors%20LMV%20Route%20%20Deviation%20Details";
break; break;
case "5": case "5":
System.out.println("TempID is 5 (HMV Route Deviation Details -> hmv_route_deviation_details -> 1309083)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out
.println("TempID is 5 (HMV Route Deviation Details -> hmv_route_deviation_details -> 1309083)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone-wise+Compactors+HMV+Route+Deviation+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Vehicle+Monitoring+System%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone-wise+Compactors+HMV+Route+Deviation+Details+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Compactors%20HMV%20Route%20%20Deviation%20Details"; + "&placeholders=Zone%20wise%20Compactors%20HMV%20Route%20%20Deviation%20Details";
break; break;
case "6": case "6":
System.out.println("TempID is 6 (C&D Waste Removal Monitoring -> c_and_d_waste_removal_monitoring -> 1335786)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out.println(
"TempID is 6 (C&D Waste Removal Monitoring -> c_and_d_waste_removal_monitoring -> 1335786)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+C%26D+Waste+Removal+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+C%26D+Waste+Removal+Details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+C%26D+Waste+Removal+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+C%26D+Waste+Removal+Details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20C%26D%20Waste%20Removal%20details"; + "&placeholders=Zone%20wise%20C%26D%20Waste%20Removal%20details";
break; break;
case "7": case "7":
System.out.println("TempID is 7 (Enforcement Team Monitoring -> enforcement_team_monitoring -> 1362100)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out
.println("TempID is 7 (Enforcement Team Monitoring -> enforcement_team_monitoring -> 1362100)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AYesterday%27s+%28"+msgDate+"%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AYesterday%27s+%28" + msgDate
+ "%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Enforcement%20Team%20activity%20details"; + "&placeholders=Zone%20wise%20Enforcement%20Team%20activity%20details";
break; break;
case "8": case "8":
System.out.println("TempID is 8 (Toilets Monitoring -> gcc_toilets_monitoring -> 1475869)"); System.out.println("TempID is 8 (Toilets Monitoring -> gcc_toilets_monitoring -> 1475869)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Toilets+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Toilets+Morning+inspection+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Toilets+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Toilets+Morning+inspection+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Toilets%20Morning%20inspection%20details"; + "&placeholders=Zone%20wise%20Toilets%20Morning%20inspection%20details";
break; break;
case "9": case "9":
System.out.println("TempID is 9 (Toilets Monitoring -> gcc_toilets_evening_monitoring -> 1475881)"); System.out.println("TempID is 9 (Toilets Monitoring -> gcc_toilets_evening_monitoring -> 1475881)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Toilets+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Toilets+Evening+inspection+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Toilets+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Toilets+Evening+inspection+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Toilets%20Evening%20inspection%20details"; + "&placeholders=Zone%20wise%20Toilets%20Evening%20inspection%20details";
break; break;
case "10": case "10":
System.out.println("TempID is 10 (Bus Shelter Monitoring -> 1508454 - gcc_bus_shelter_monitoring)"); System.out.println("TempID is 10 (Bus Shelter Monitoring -> 1508454 - gcc_bus_shelter_monitoring)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Bus+Shelter+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Bus+Shelter+inspection+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Bus+Shelter+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Bus+Shelter+inspection+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Bus%20Shelter%20inspection%20details"; + "&placeholders=Zone%20wise%20Bus%20Shelter%20inspection%20details";
break; break;
case "11": case "11":
System.out.println("TempID is 11 (Still Catch Pit -> 1566758 - silt_catch_pit_cleaning )"); System.out.println("TempID is 11 (Still Catch Pit -> 1566758 - silt_catch_pit_cleaning )");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Silt+catch+Pit+Cleaning%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Silt+Catch+Pit+cleaning+details+shared+above+for+your+reference%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Silt+catch+Pit+Cleaning%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Silt+Catch+Pit+cleaning+details+shared+above+for+your+reference%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Silt%20Catch%20Pit%20cleaning%20details"; + "&placeholders=Zone%20wise%20Silt%20Catch%20Pit%20cleaning%20details";
break; break;
case "12": case "12":
System.out.println("TempID is 12 (1590940 - tree_planting_gcc - IMAGE - STATIC)"); System.out.println("TempID is 12 (1590940 - tree_planting_gcc - IMAGE - STATIC)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Tree+Planting%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+tree+planting+details+shared+above+for+your+reference%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Tree+Planting%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+tree+planting+details+shared+above+for+your+reference%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20tree%20planting%20details"; + "&placeholders=Zone%20wise%20tree%20planting%20details";
break; break;
case "13": case "13":
System.out.println("TempID is 13 (1590940 - Chennai Schools (userd of Com Temp ) - IMAGE - STATIC)"); System.out.println("TempID is 13 (1590940 - Chennai Schools (userd of Com Temp ) - IMAGE - STATIC)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
//+ "&caption=%2AGCC+The+Chennai+School%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Students+Aadhar+linked+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&caption=%2AGCC+The+Chennai+School%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Students+Aadhar+linked+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
// +
// "&caption=%2AGCC+The+Chennai+School%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Students+Aadhar+linked+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&caption=%2AGCC+The+Chennai+School%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Students+Aadhar+linked+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Students%20Aadhar%20linked%20details"; + "&placeholders=Zone%20wise%20Students%20Aadhar%20linked%20details";
break; break;
case "14": case "14":
System.out.println("TempID is 14 (1943196 - pet_wp_report - IMAGE - STATIC)"); System.out.println("TempID is 14 (1943196 - pet_wp_report - IMAGE - STATIC)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
//+ "&caption=%2AGCC+The+Chennai+School%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Students+Aadhar+linked+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&caption=%2AGCC+PET+LICENSE+%26+VACCINATION%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Pet+license+%26+Vaccination+details+shared+above+for+your+kind+reference."
+ "&media_url="+fileURL
// +
// "&caption=%2AGCC+The+Chennai+School%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Students+Aadhar+linked+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&caption=%2AGCC+PET+LICENSE+%26+VACCINATION%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Pet+license+%26+Vaccination+details+shared+above+for+your+kind+reference."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Pet%20license%20%26%20Vaccination%20details"; + "&placeholders=Zone%20wise%20Pet%20license%20%26%20Vaccination%20details";
break; break;
case "15": case "15":
System.out.println("TempID is 15 (1590940 - GCC POS Penalty Monitoring Zone (userd of Com Temp ) - IMAGE - STATIC)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out.println(
"TempID is 15 (1590940 - GCC POS Penalty Monitoring Zone (userd of Com Temp ) - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+POS+Penalty+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29++POS+Penalty+Zone+wise+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+POS+Penalty+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29++POS+Penalty+Zone+wise+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=POS%20Penalty%20Zone%20wise%20details"; + "&placeholders=POS%20Penalty%20Zone%20wise%20details";
break; break;
case "16": case "16":
System.out.println("TempID is 16 (1590940 - GCC POS Penalty Monitoring Catagory (userd of Com Temp ) - IMAGE - STATIC)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out.println(
"TempID is 16 (1590940 - GCC POS Penalty Monitoring Catagory (userd of Com Temp ) - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+POS+Penalty+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29++POS+Penalty+Catagory+wise+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+POS+Penalty+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29++POS+Penalty+Catagory+wise+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=POS%20Penalty%20Catagory%20wise%20details"; + "&placeholders=POS%20Penalty%20Catagory%20wise%20details";
break; break;
case "17": case "17":
System.out.println("TempID is 17 (1590940 - GCC Enforcement Team Monitoring Temp (userd of Com Temp ) - IMAGE - STATIC)");
urlString="https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid="+username
+ "&password="+password
+ "&send_to="+sendTo
System.out.println(
"TempID is 17 (1590940 - GCC Enforcement Team Monitoring Temp (userd of Com Temp ) - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json" + "&v=1.1&format=json"
+ "&msg_type=IMAGE" + "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE" + "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AToday%27s+%28"+msgDate+"%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url="+fileURL
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell"; + "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString ="https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey="+apikey
+ "&from="+from
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943" + "&to={{to}}&templateid=2784943"
+ "&url="+fileURL
+ "&url=" + fileURL
+ "&placeholders=Zone%20wise%20Enforcement%20Team%20activity%20details"; + "&placeholders=Zone%20wise%20Enforcement%20Team%20activity%20details";
break;
case "21":
System.out.println("TempID is 21 (1590940 - Namma Salai - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json"
+ "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943"
+ "&url=" + fileURL
+ "&placeholders=Namma%20salai%20activity%20details";
break;
case "22":
System.out.println("TempID is 22 (1590940 - Victoria Hall Booking - IMAGE - STATIC)");
urlString = "https://media.smsgupshup.com/GatewayAPI/rest?"
+ "userid=" + username
+ "&password=" + password
+ "&send_to=" + sendTo
+ "&v=1.1&format=json"
+ "&msg_type=IMAGE"
+ "&method=SENDMEDIAMESSAGE"
+ "&caption=%2AGCC+Enforcement+Team+Monitoring%2A%0A%0AToday%27s+%28" + msgDate
+ "%29+Zone+wise+Enforcement+Team+activity+details+shared+above+for+your+reference.%0A%0AFor+more+details%2C+please+click+the+link+below."
+ "&media_url=" + fileURL
+ "&isTemplate=true&footer=GCC+-+IT+Cell";
urlString = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?type=template"
+ "&apikey=" + apikey
+ "&from=" + from
+ "&to={{to}}&templateid=2784943"
+ "&url=" + fileURL
+ "&placeholders=Victoria%20Hall%20Booking%20Details";
break; break;
default: default:
System.out.println("TempID ("+tempid+") is unknown");
System.out.println("TempID (" + tempid + ") is unknown");
} }
if (!urlString.isBlank()) { if (!urlString.isBlank()) {
sql = "SELECT `id`, `name`, `mobile`, `userid`, `tempids` FROM `send_msg_to` WHERE `isactive` = 1 AND `isdelete` = 0 AND FIND_IN_SET(?, tempids);"; sql = "SELECT `id`, `name`, `mobile`, `userid`, `tempids` FROM `send_msg_to` WHERE `isactive` = 1 AND `isdelete` = 0 AND FIND_IN_SET(?, tempids);";
List<Map<String, Object>> mobileResult2 = jdbcTemplate.queryForList(sql,tempid);
List<Map<String, Object>> mobileResult2 = jdbcTemplate.queryForList(sql, tempid);
for (Map<String, Object> mobileRow2 : mobileResult2) { for (Map<String, Object> mobileRow2 : mobileResult2) {
String mobile = String.valueOf(mobileRow2.get("mobile")); String mobile = String.valueOf(mobileRow2.get("mobile"));
String finalUrl = urlString.replace("{{to}}", mobile); String finalUrl = urlString.replace("{{to}}", mobile);
@ -637,7 +712,7 @@ public class VehicleService {
if (rowsAffected > 0) { if (rowsAffected > 0) {
return "success"; return "success";
}else {
} else {
return "failed"; return "failed";
} }
} }
@ -649,7 +724,7 @@ public class VehicleService {
if (rowsAffected > 0) { if (rowsAffected > 0) {
return "success"; return "success";
}else {
} else {
return "failed"; return "failed";
} }
} }

4
gcc_officer_portal/src/main/resources/application.properties

@ -1,5 +1,5 @@
spring.profiles.active=local
# spring.profiles.active=production
# spring.profiles.active=local
spring.profiles.active=production
#For Server production #For Server production
#assets.base-url=/gcc/assets/ #assets.base-url=/gcc/assets/
#For local test #For local test

Loading…
Cancel
Save