Update service reporting
Pembuatan endpoint API untuk cetakan kwitansi di SMART
This commit is contained in:
parent
19c485f717
commit
2b062bff69
@ -283,7 +283,7 @@ public class ReportingController {
|
|||||||
|
|
||||||
@RequestMapping(value = {"/summary-list/{nocm}"}, method = {RequestMethod.GET})
|
@RequestMapping(value = {"/summary-list/{nocm}"}, method = {RequestMethod.GET})
|
||||||
public void exportSummaryList(@PathVariable("nocm") String nocm,
|
public void exportSummaryList(@PathVariable("nocm") String nocm,
|
||||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
JasperPrint jasperPrint = this.reportingService.exportPdfSummaryList(nocm);
|
JasperPrint jasperPrint = this.reportingService.exportPdfSummaryList(nocm);
|
||||||
response.setContentType("application/pdf");
|
response.setContentType("application/pdf");
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
@ -291,11 +291,19 @@ public class ReportingController {
|
|||||||
|
|
||||||
@RequestMapping(value = {"/lap-amprahan-tindakan"}, method = {RequestMethod.GET})
|
@RequestMapping(value = {"/lap-amprahan-tindakan"}, method = {RequestMethod.GET})
|
||||||
public void exportAmprahanTindakan(@RequestParam("idRu") int idRu,
|
public void exportAmprahanTindakan(@RequestParam("idRu") int idRu,
|
||||||
@RequestParam("tglAwal") String tglAwal,
|
@RequestParam("tglAwal") String tglAwal,
|
||||||
@RequestParam("tglAkhir") String tglAkhir, ModelAndView mv,
|
@RequestParam("tglAkhir") String tglAkhir, ModelAndView mv,
|
||||||
HttpServletRequest req, HttpServletResponse response) throws Exception {
|
HttpServletRequest req, HttpServletResponse response) throws Exception {
|
||||||
JasperPrint jasperPrint = this.reportingService.printPdfAmprahanTindakan(idRu, tglAwal, tglAkhir);
|
JasperPrint jasperPrint = this.reportingService.printPdfAmprahanTindakan(idRu, tglAwal, tglAkhir);
|
||||||
response.setContentType("application/pdf");
|
response.setContentType("application/pdf");
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/kwitansi/{noSbm}"}, method = {RequestMethod.GET})
|
||||||
|
public void exportKwitansi(@PathVariable("noSbm") String noSbm,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansi(noSbm);
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -393,4 +393,18 @@ public class ReportingDao {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfKwitansi(String noSbm) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jasperDirPath + "kwitansi.jrxml";
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
|
parameters.put("nosbm", noSbm);
|
||||||
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
|
} catch (Exception var17) {
|
||||||
|
LOG.error("Exception at exportPdfKwitansi");
|
||||||
|
LOG.error(ReportingDao.class, var17);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,4 +119,8 @@ public class ReportingService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportPdfKwitansi(String noSbm) {
|
||||||
|
return this.reportingDao.exportPdfKwitansi(noSbm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user