You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
6.0 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package in.gov.chennaicorporation.gccoffice.pensioner.service;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import java.util.Map;
  5. import javax.sql.DataSource;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.beans.factory.annotation.Qualifier;
  8. import org.springframework.jdbc.core.JdbcTemplate;
  9. import org.springframework.stereotype.Service;
  10. import org.springframework.web.client.RestTemplate;
  11. import com.fasterxml.jackson.databind.ObjectMapper;
  12. import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
  13. @Service
  14. public class CompletedService {
  15. @Autowired
  16. private JdbcTemplate jdbcTemplate;
  17. private RestTemplate restTemplate;
  18. private ObjectMapper objectMapper;
  19. @Autowired
  20. private AppConfig appconfig;
  21. public CompletedService(RestTemplate restTemplate, ObjectMapper objectMapper) {
  22. this.restTemplate = restTemplate;
  23. this.objectMapper = objectMapper;
  24. }
  25. @Autowired
  26. public void setDataSource(@Qualifier("mysqlPensionerDataSource") DataSource dataSource) {
  27. this.jdbcTemplate = new JdbcTemplate(dataSource);
  28. }
  29. @Autowired
  30. public GetFileStatusService getFileStatus;
  31. public List<Map<String, Object>> getCPSList(Integer file_cat,Integer deptId) {
  32. String query = "SELECT * FROM cps_pensioner_details where file_category = ? and dept_id=? and file_status=11 ";
  33. try {
  34. return jdbcTemplate.queryForList(query,file_cat,deptId);
  35. } catch (Exception e) {
  36. e.printStackTrace();
  37. return new ArrayList<>();
  38. }
  39. }
  40. ///////////////////CPS completed list method///////////
  41. public List<Map<String, Object>> getCPSListPensionside(Integer file_cat) {
  42. String query = "SELECT * FROM cps_pensioner_details where file_category = ? and file_status=11 ";
  43. try {
  44. return jdbcTemplate.queryForList(query,file_cat);
  45. } catch (Exception e) {
  46. e.printStackTrace();
  47. return new ArrayList<>();
  48. }
  49. }
  50. public List<Map<String, Object>> getCPSListByEmpNo(String empNo) {
  51. String query = "SELECT * FROM cps_pensioner_details WHERE emp_no = ?";
  52. try {
  53. return jdbcTemplate.queryForList(query, empNo);
  54. } catch (Exception e) {
  55. e.printStackTrace();
  56. return new ArrayList<>();
  57. }
  58. }
  59. ////////////////////////////
  60. ////////Retirement completed list method///////////////////
  61. public List<Map<String, Object>> fetchDetailsCompletedRetirement(Integer file_cat,Integer deptId) {
  62. String query = "SELECT * " +
  63. "FROM pensioner_details " +
  64. "WHERE file_category=? AND dept_id=? and file_status=11 AND is_closed=0";
  65. return jdbcTemplate.queryForList(query,file_cat,deptId);
  66. }
  67. public List<Map<String, Object>> fetchDetailsCompletedRetirementPensionside(Integer file_cat) {
  68. String query = "SELECT * " +
  69. "FROM pensioner_details " +
  70. "WHERE file_category=? and file_status=11 AND is_closed=0";
  71. return jdbcTemplate.queryForList(query,file_cat);
  72. }
  73. /////////////////////////
  74. ///////////////////Family pension completed list method//////////////
  75. public List<Map<String, Object>> fetchDetailsCompletedFamilyPension(Integer file_cat,Integer deptId) {
  76. String query = "SELECT * " +
  77. "FROM pensioner_details " +
  78. "WHERE file_category=? AND dept_id=? and file_status=11";
  79. return jdbcTemplate.queryForList(query,file_cat,deptId);
  80. }
  81. public List<Map<String, Object>> fetchDetailsCompletedFamilyPensionPensionSide(Integer file_cat) {
  82. String query = "SELECT * " +
  83. "FROM pensioner_details " +
  84. "WHERE file_category=? and file_status=11";
  85. return jdbcTemplate.queryForList(query,file_cat);
  86. }
  87. //////////////////////////
  88. ///////////////Pendency completed method////////////////
  89. public List<Map<String, Object>> fetchDetailsCompletedPendency(Integer file_cat,Integer deptId) {
  90. String query = "SELECT * " +
  91. "FROM pensioner_details " +
  92. "WHERE file_category=? AND dept_id=? and file_status=11";
  93. return jdbcTemplate.queryForList(query,file_cat,deptId);
  94. }
  95. public List<Map<String, Object>> fetchDetailsCompletedPendencyPensionSide(Integer file_cat) {
  96. String query = "SELECT * " +
  97. "FROM pensioner_details " +
  98. "WHERE file_category=? and file_status=11";
  99. return jdbcTemplate.queryForList(query,file_cat);
  100. }
  101. //////////////////////
  102. ////////////Gis completed list method
  103. public List<Map<String, Object>> fetchDetailsForrecivedGiscompleted(Integer file_cat,Integer deptId) {
  104. String query = "SELECT * FROM pensioner_details WHERE file_category = ? AND dept_id=? AND file_status = 11";
  105. return jdbcTemplate.queryForList(query,file_cat,deptId);
  106. }
  107. public List<Map<String, Object>> fetchDetailsForrecivedGiscompletedPensionside(Integer file_cat) {
  108. String query = "SELECT * FROM pensioner_details WHERE file_category = ? AND file_status = 11";
  109. return jdbcTemplate.queryForList(query,file_cat);
  110. }
  111. ////////////////Provisional retirement completed list method
  112. public List<Map<String, Object>> fetchDetailsProvisionalDepartmentCompleted(Integer file_cat,Integer deptId) {
  113. String query = "SELECT * " +
  114. "FROM pensioner_details " +
  115. "WHERE file_category=? AND dept_id=? and file_status=11";
  116. return jdbcTemplate.queryForList(query,file_cat,deptId);
  117. }
  118. public List<Map<String, Object>> fetchDetailsProvisionalDepartmentPensionside(Integer file_cat) {
  119. String query = "SELECT * " +
  120. "FROM pensioner_details " +
  121. "WHERE file_category=? and file_status=11";
  122. return jdbcTemplate.queryForList(query,file_cat);
  123. }
  124. }