update kwitansi
This commit is contained in:
parent
0e6a5c1378
commit
c4e90986e6
@ -302,8 +302,9 @@ public class ReportingController {
|
||||
@RequestMapping(value = {"/kwitansi/{noregistrasi}"}, method = {RequestMethod.GET})
|
||||
public void exportKwitansi(@PathVariable("noregistrasi") String noregistrasi,
|
||||
@RequestParam(value = "jeniskwitansi", required = false) String jeniskwitansi,
|
||||
@RequestParam(value = "nama_pt", required = false) String nama_pt,
|
||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi);
|
||||
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi, nama_pt);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}
|
||||
|
||||
@ -477,4 +477,35 @@ public class ReportingDao {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfKwitansiPT(String noregistrasi, String nama_pt) {
|
||||
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||
String path = jasperDirPath + "kwitansi_nama_pt.jrxml";
|
||||
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("noregistrasi", noregistrasi);
|
||||
parameters.put("nama_pt", nama_pt);
|
||||
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||
} catch (Exception var17) {
|
||||
LOG.error("Exception at exportPdfKwitansiPT");
|
||||
LOG.error(ReportingDao.class, var17);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfKwitansNonLiPT(String noregistrasi, String nama_pt) {
|
||||
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||
String path = jasperDirPath + "kwitansi_nonLayanan_nama_pt.jrxml";
|
||||
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("noregistrasi", noregistrasi);
|
||||
parameters.put("nama_pt", nama_pt);
|
||||
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||
} catch (Exception var17) {
|
||||
LOG.error("Exception at exportPdfKwitansNonLiPT");
|
||||
LOG.error(ReportingDao.class, var17);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -121,13 +121,17 @@ public class ReportingService {
|
||||
}
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfKwitansi(String noregistrasi, String jeniskwitansi) {
|
||||
public JasperPrint exportPdfKwitansi(String noregistrasi, String jeniskwitansi, String nama_pt) {
|
||||
if (Objects.equals(jeniskwitansi, "DEPOSIT")){
|
||||
return this.reportingDao.exportPdfKwidipo(noregistrasi);
|
||||
} else if (Objects.equals(jeniskwitansi, "NONLAYANAN")){
|
||||
return this.reportingDao.exportPdfKwitansiNonL(noregistrasi);
|
||||
} else if (Objects.equals(jeniskwitansi, "KEMBALIDEPOSIT")){
|
||||
return this.reportingDao.exportPdfKemKwidipo(noregistrasi);
|
||||
} else if (Objects.equals(jeniskwitansi, "KWINAMA_PT")){
|
||||
return this.reportingDao.exportPdfKwitansiPT(noregistrasi, nama_pt);
|
||||
} else if (Objects.equals(jeniskwitansi, "NONLNAMA_PT")){
|
||||
return this.reportingDao.exportPdfKwitansNonLiPT(noregistrasi, nama_pt);
|
||||
} else {
|
||||
return this.reportingDao.exportPdfKwitansi(noregistrasi);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user