update gabung kwitansi

This commit is contained in:
Kals1um 2024-12-20 10:22:40 +07:00
parent 5e1ff789a9
commit 00e5289b80
2 changed files with 11 additions and 26 deletions

View File

@ -301,8 +301,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,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi);
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@ -323,20 +324,5 @@ public class ReportingController {
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/kwitansi_nonLayanan/{noregistrasi}"}, method = {RequestMethod.GET})
public void exportPdfKwitansiNonL(@PathVariable("noregistrasi") String noregistrasi,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansiNonL(noregistrasi);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
@RequestMapping(value = {"/kwidipo/{noregistrasi}"}, method = {RequestMethod.GET})
public void exportPdfKwidipo(@PathVariable("noregistrasi") String noregistrasi,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKwidipo(noregistrasi);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}
}

View File

@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
@Service
public class ReportingService {
@ -120,8 +121,14 @@ public class ReportingService {
}
}
public JasperPrint exportPdfKwitansi(String noregistrasi) {
return this.reportingDao.exportPdfKwitansi(noregistrasi);
public JasperPrint exportPdfKwitansi(String noregistrasi, String jeniskwitansi) {
if (Objects.equals(jeniskwitansi, "DEPOSIT")){
return this.reportingDao.exportPdfKwidipo(noregistrasi);
} else if (Objects.equals(jeniskwitansi, "NONLAYANAN")){
return this.reportingDao.exportPdfKwitansiNonL(noregistrasi);
} else {
return this.reportingDao.exportPdfKwitansi(noregistrasi);
}
}
public JasperPrint exportPdfMonitoringUsulan(String norec) {
@ -132,12 +139,4 @@ public class ReportingService {
return this.reportingDao.exportPdfSppb(norec);
}
public JasperPrint exportPdfKwitansiNonL(String noregistrasi) {
return this.reportingDao.exportPdfKwitansiNonL(noregistrasi);
}
public JasperPrint exportPdfKwidipo(String noregistrasi) {
return this.reportingDao.exportPdfKwidipo(noregistrasi);
}
}