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.

292 lines
12 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //package in.gov.chennaicorporation.gccoffice.pgr.contoller;
  2. //
  3. //import java.text.ParseException;
  4. //
  5. //import java.text.SimpleDateFormat;
  6. //import java.util.ArrayList;
  7. //import java.util.Date;
  8. //import java.util.List;
  9. //import java.util.Map;
  10. //
  11. //import org.springframework.beans.factory.annotation.Autowired;
  12. //import org.springframework.core.io.InputStreamResource;
  13. //import org.springframework.core.io.Resource;
  14. //import org.springframework.http.HttpHeaders;
  15. //import org.springframework.http.HttpStatus;
  16. //import org.springframework.http.MediaType;
  17. //import org.springframework.http.ResponseEntity;
  18. //import org.springframework.web.bind.annotation.GetMapping;
  19. //import org.springframework.web.bind.annotation.PathVariable;
  20. //import org.springframework.web.bind.annotation.RequestMapping;
  21. //import org.springframework.web.bind.annotation.RequestParam;
  22. //import org.springframework.web.bind.annotation.RestController;
  23. //
  24. //import in.gov.chennaicorporation.gccoffice.pgr.service.AgeAnalysisComplaintReports;
  25. //import in.gov.chennaicorporation.gccoffice.pgr.service.AgeAnalysisDaskboards;
  26. //import in.gov.chennaicorporation.gccoffice.pgr.service.AgeAnalysisReports;
  27. //import in.gov.chennaicorporation.gccoffice.pgr.service.AllReports;
  28. //import in.gov.chennaicorporation.gccoffice.pgr.service.MobileAgeAnalysisComplaintReports;
  29. //import in.gov.chennaicorporation.gccoffice.pgr.service.MobileAgeAnalysisReports;
  30. //import in.gov.chennaicorporation.gccoffice.pgr.service.QaQcReports;
  31. //import in.gov.chennaicorporation.gccoffice.pgr.service.ReopenZonewiseComplaintReports;
  32. //import in.gov.chennaicorporation.gccoffice.pgr.service.ReopenZonewiseReports;
  33. //import in.gov.chennaicorporation.gccoffice.pgr.service.ZonewiseComplaintDetails;
  34. //import in.gov.chennaicorporation.gccoffice.pgr.service.ZonewiseComplaintReports;
  35. //import in.gov.chennaicorporation.gccoffice.pgr.service.ZonewiseReports;
  36. //
  37. //@RestController
  38. //@RequestMapping("/pgr/api")
  39. //public class PgrApiController {
  40. //
  41. // @Autowired
  42. // private AllReports allReports;
  43. // private QaQcReports qaqcReports;
  44. // private ZonewiseReports zonewiseReports;
  45. //
  46. // private ReopenZonewiseReports reopenzonewiseReports;
  47. // private AgeAnalysisDaskboards ageanalysisDaskboards;
  48. // private AgeAnalysisReports ageanalysisReports;
  49. // private MobileAgeAnalysisReports mobileageanalysisReports;
  50. // private ZonewiseComplaintReports zonewisecomplaintReports;
  51. // private ReopenZonewiseComplaintReports reopenzonewisecomplaintReports;
  52. // private AgeAnalysisComplaintReports ageanalysiscomplaintReports;
  53. // private MobileAgeAnalysisComplaintReports mobileageanalysiscomplaintReports;
  54. // private ZonewiseComplaintDetails zonewisecomplaintDetails;
  55. //
  56. //
  57. // @Autowired
  58. // public PgrApiController(AllReports allReports, QaQcReports qaqcReports,
  59. // ZonewiseReports zonewiseReports, ReopenZonewiseReports reopenzonewiseReports,
  60. // AgeAnalysisReports ageanalysisReports,
  61. // MobileAgeAnalysisReports mobileAgeAnalysisReports,
  62. // ZonewiseComplaintReports zonewisecomplaintReports,
  63. // ReopenZonewiseComplaintReports reopenzonewisecomplaintReports,
  64. // AgeAnalysisComplaintReports ageanalysiscomplaintReports,
  65. // MobileAgeAnalysisComplaintReports mobileageanalysiscomplaintReports,
  66. // ZonewiseComplaintDetails zonewisecomplaintDetails) {
  67. // this.allReports= allReports;
  68. // this.qaqcReports=qaqcReports;
  69. // this.zonewiseReports=zonewiseReports;
  70. // this.reopenzonewiseReports=reopenzonewiseReports;
  71. // this.ageanalysisReports=ageanalysisReports;
  72. // this.mobileageanalysisReports=mobileageanalysisReports;
  73. // this.zonewisecomplaintReports=zonewisecomplaintReports;
  74. // this.reopenzonewisecomplaintReports=reopenzonewisecomplaintReports;
  75. // this.ageanalysiscomplaintReports=ageanalysiscomplaintReports;
  76. // this.mobileageanalysiscomplaintReports=mobileageanalysiscomplaintReports;
  77. // this.zonewisecomplaintDetails=zonewisecomplaintDetails;
  78. // }
  79. //
  80. // @GetMapping("/getAllReports")
  81. // public List getAllReports() {
  82. //
  83. // System.out.println("AllReports Api...");
  84. // return allReports.check(null, null, null, null, null, null);
  85. // }
  86. //
  87. //
  88. //// @GetMapping("/getMyQuery")
  89. //// public String getMyQuery( @RequestParam(required = false) String sFrDate,
  90. //// @RequestParam(required = false) String sToDate,
  91. //// @RequestParam(required = false) String sRptGroup,
  92. //// @RequestParam(required = false) String sRptType,
  93. //// @RequestParam(required = false) String cbCompStatus,
  94. //// @RequestParam(required = false) String mode){
  95. //// System.out.println("hi how are you");
  96. //// List<Map<String, Object>> pgrreportlist = new ArrayList<>();
  97. //// // Pass the additional parameters to the check method
  98. //// if(sFrDate!=null && !sFrDate.isEmpty() && sToDate!=null && !sToDate.isEmpty() ) {
  99. //// pgrreportlist= allReports.check(sFrDate, sToDate, sRptGroup, sRptType, cbCompStatus,mode);
  100. //// }
  101. ////
  102. ////
  103. //// return pgrreportlist();
  104. //// }
  105. //
  106. //
  107. //
  108. // @GetMapping("/getMyQuery")
  109. // public List<Map<String, Object>> getMyQuery(
  110. // @RequestParam(required = false) String sFrDate,
  111. // @RequestParam(required = false) String sToDate,
  112. // @RequestParam(required = false) String sRptGroup,
  113. // @RequestParam(required = false) String sRptType,
  114. // @RequestParam(required = false) String cbCompStatus,
  115. // @RequestParam(required = false) String mode) {
  116. //
  117. // System.out.println("Get all reports.....");
  118. // List<Map<String, Object>> pgrreportlist = new ArrayList<>();
  119. //
  120. // // Pass the additional parameters to the check method
  121. // if (sFrDate != null && !sFrDate.isEmpty() && sToDate != null && !sToDate.isEmpty()) {
  122. // pgrreportlist = allReports.check(sFrDate, sToDate, sRptGroup, sRptType, cbCompStatus, mode);
  123. // }
  124. //
  125. // return pgrreportlist;
  126. // }
  127. //
  128. //// @GetMapping("/getMyQuery")
  129. //// public ResponseEntity<List<Map<String, Object>>> getMyQuery(
  130. //// @RequestParam(required = false) String sFrDate,
  131. //// @RequestParam(required = false) String sToDate,
  132. //// @RequestParam(required = false) String sRptGroup,
  133. //// @RequestParam(required = false) String sRptType,
  134. //// @RequestParam(required = false) String cbCompStatus,
  135. //// @RequestParam(required = false) String mode) {
  136. ////
  137. //// // Log statement
  138. //// System.out.println("Request received with parameters: " + sFrDate + ", " + sToDate + ", " + sRptGroup + ", " + sRptType + ", " + cbCompStatus + ", " + mode);
  139. ////
  140. //// List<Map<String, Object>> pgrreportlist = new ArrayList<>();
  141. ////
  142. //// // Pass the additional parameters to the check method
  143. //// if (sFrDate != null && !sFrDate.isEmpty() && sToDate != null && !sToDate.isEmpty()) {
  144. //// pgrreportlist = allReports.check(sFrDate, sToDate, sRptGroup, sRptType, cbCompStatus, mode);
  145. //// }
  146. ////
  147. //// // Return the response in JSON format
  148. //// return new ResponseEntity<>(pgrreportlist, HttpStatus.OK);
  149. //// }
  150. //
  151. //
  152. //
  153. //
  154. // @GetMapping("/dashboard")
  155. // public Map<String, Object> getDashboardData(@RequestParam(required = false) String DEPT_NAME) {
  156. // // Call your service method to get the dashboard data based on the department
  157. // List<Map<String, Object>> ageanalysisdashboardList = ageanalysisDaskboards.getdashboardquery(DEPT_NAME);
  158. //
  159. // // Assuming you want to return the first item from the list (you may need to adjust this based on your actual logic)
  160. // Map<String, Object> result = ageanalysisdashboardList.isEmpty() ? Map.of() : ageanalysisdashboardList.get(0);
  161. //
  162. // return result;
  163. // }
  164. //
  165. // @GetMapping("/filtered-reports")
  166. //
  167. // public List<Map<String, Object>> filterReports(@RequestParam("sFrDate") String sFrDate,@RequestParam("sToDate") String sToDate){
  168. //
  169. // // Set the dates in the service
  170. //
  171. // allReports.setdates(sFrDate, sToDate);
  172. //
  173. //
  174. //
  175. // // Call the check method to get the filtered data
  176. //
  177. // List<Map<String, Object>> filteredReports = allReports.check(sFrDate, sToDate, sToDate, sToDate, sToDate);
  178. //
  179. //
  180. //
  181. // return filteredReports;
  182. //
  183. // }
  184. //
  185. // @GetMapping("/getqaqcQuery")
  186. // public List getqaqcQuery(){
  187. // System.out.println("hi how are you qaqc");
  188. // return qaqcReports.check1();
  189. // }
  190. //
  191. // @GetMapping("/getzoneQuery")
  192. // public List getzoneQuery(){
  193. // System.out.println("hi how are you zonewise");
  194. // return zonewiseReports.check();
  195. // }
  196. //
  197. // @GetMapping("/getzonecomplaintQuery")
  198. // public List getzonecomplaintQuery(@PathVariable String nos){
  199. // System.out.println("hi how are you zonewisecomplaints");
  200. // return zonewisecomplaintReports.check(nos, nos, nos, nos, nos, nos, nos);
  201. // }
  202. //
  203. // @GetMapping("/getzonecomplaintdetailsQuery")
  204. // public List getzonecomdetailsQuery(@PathVariable String COMPLAINTNUMBER){
  205. // System.out.println("hi how are you zonewisecomplaintsdetails");
  206. // return zonewisecomplaintDetails.check(COMPLAINTNUMBER);
  207. // }
  208. //
  209. // @GetMapping("/getreopenzoneQuery")
  210. // public List getreopenzoneQuery(){
  211. // System.out.println("hi how are you reopenzonewise");
  212. // return reopenzonewiseReports.check();
  213. // }
  214. //
  215. // @GetMapping("/getreopenzonecomplaintQuery")
  216. // public List getreopenzonecomplaintQuery(){
  217. // System.out.println("hi how are you reopenzonewisecomplaints");
  218. // return reopenzonewisecomplaintReports.check();
  219. // }
  220. //
  221. //
  222. //
  223. // @GetMapping("/getageanalysisQuery")
  224. // public List getageanalysisQuery(){
  225. // System.out.println("hi how are you ageanalysis");
  226. // return ageanalysisReports.check();
  227. // }
  228. //
  229. // @GetMapping("/getageanalysiscomplaintQuery")
  230. // public List getageanalysiscomplaintQuery(){
  231. // System.out.println("hi how are you ageanalysiscomplaints");
  232. // return ageanalysiscomplaintReports.check();
  233. // }
  234. //
  235. // @GetMapping("/getmobileageanalysisQuery")
  236. // public List getmobileageanalysisQuery(){
  237. // System.out.println("hi how are you mobileageanalysis");
  238. // return mobileageanalysisReports.check();
  239. // }
  240. //
  241. // @GetMapping("/getmobileageanalysiscomplaintQuery")
  242. // public List getmobileageanalysiscomplaintQuery(){
  243. // System.out.println("hi how are you mobileageanalysiscomplaints");
  244. // return mobileageanalysiscomplaintReports.check();
  245. // }
  246. //
  247. // @GetMapping("/getreports")
  248. // public ResponseEntity<Resource> getreports(@RequestParam String sFrDate,
  249. // @RequestParam String sToDate
  250. // ) {
  251. //
  252. //
  253. // System.out.println(sFrDate+" "+sToDate);
  254. // String datetype;
  255. // String type = "";
  256. // if(type.equals("new")) {
  257. // datetype="ct.entrydate";
  258. // }else if(type.equals("modify")) {
  259. // datetype="mt.modifydate";
  260. // }
  261. // else {
  262. // datetype=type;
  263. // }
  264. // SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
  265. // SimpleDateFormat outputFormat = new SimpleDateFormat("dd/MM/yyyy");
  266. // String frDate="";
  267. // String toDate="";
  268. // try {
  269. //
  270. // Date sFrdate = inputFormat.parse(sFrDate);
  271. // Date sTodate = inputFormat.parse(sToDate);
  272. //
  273. // frDate = outputFormat.format(sFrdate);
  274. // toDate = outputFormat.format(sTodate);
  275. //
  276. // System.out.println(frDate + " " + toDate );
  277. //
  278. //
  279. // } catch (ParseException e) {
  280. // e.printStackTrace();
  281. // }
  282. // return (ResponseEntity<Resource>) allReports.check(sFrDate,sToDate, toDate, toDate, toDate);
  283. //
  284. // // InputStreamResource file = new InputStreamResource(allReports.check(frDate,toDate));
  285. //
  286. //// return ResponseEntity.ok()
  287. //// .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + filename)
  288. //// .contentType(MediaType.parseMediaType("application/vnd.ms-excel"))
  289. //// .body(file);
  290. // }
  291. //
  292. //}