Update service laporan permintaan makan

Penerapan parameter jenis diet
This commit is contained in:
Salman Manoe 2023-11-16 09:54:03 +07:00
parent 6be92545f9
commit 8765506b7f
3 changed files with 7 additions and 5 deletions

View File

@ -235,9 +235,10 @@ public class ReportingController {
@RequestMapping(value = {"/lap-permintaan-makanan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-permintaan-makanan"}, method = {RequestMethod.GET})
public void exportPermintaanMakanan(@RequestParam("idRu") int idRu, public void exportPermintaanMakanan(@RequestParam("idRu") int idRu,
@RequestParam("tglAwal") String tglAwal, @RequestParam("tglAwal") String tglAwal,
@RequestParam("tglAkhir") String tglAkhir, ModelAndView mv, @RequestParam("tglAkhir") String tglAkhir,
@RequestParam(value = "jenisDiet", required = false, defaultValue = "") String jenisDiet, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printPdfPermintaanMakanan(idRu, tglAwal, tglAkhir); JasperPrint jasperPrint = this.reportingService.printPdfPermintaanMakanan(idRu, tglAwal, tglAkhir, jenisDiet);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
} }

View File

@ -288,7 +288,7 @@ public class ReportingDao {
return null; return null;
} }
public JasperPrint exportPdfPermintaanMakanan(int idRu, String tglAwal, String tglAkhir) { public JasperPrint exportPdfPermintaanMakanan(int idRu, String tglAwal, String tglAkhir, String jenisDiet) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "pl_permintaan_makan.jrxml"; String path = jasperDirPath + "pl_permintaan_makan.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path); JasperReport jasperReport = JasperCompileManager.compileReport(path);
@ -296,6 +296,7 @@ public class ReportingDao {
parameters.put("idRu", idRu); parameters.put("idRu", idRu);
parameters.put("tglAwal", tglAwal); parameters.put("tglAwal", tglAwal);
parameters.put("tglAkhir", tglAkhir); parameters.put("tglAkhir", tglAkhir);
parameters.put("jenisDiet", jenisDiet);
return JasperFillManager.fillReport(jasperReport, parameters, conn); return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var17) { } catch (Exception var17) {
LOG.error("Exception at exportPdfPermintaanMakanan"); LOG.error("Exception at exportPdfPermintaanMakanan");

View File

@ -76,8 +76,8 @@ public class ReportingService {
return this.reportingDao.exportPdfRekapPenjaminByRanap(tglAwal, tglAkhir, idDept, kelompokPasien); return this.reportingDao.exportPdfRekapPenjaminByRanap(tglAwal, tglAkhir, idDept, kelompokPasien);
} }
public JasperPrint printPdfPermintaanMakanan(int idRu, String tglAwal, String tglAkhir) { public JasperPrint printPdfPermintaanMakanan(int idRu, String tglAwal, String tglAkhir, String jenisDiet) {
return this.reportingDao.exportPdfPermintaanMakanan(idRu, tglAwal, tglAkhir); return this.reportingDao.exportPdfPermintaanMakanan(idRu, tglAwal, tglAkhir, jenisDiet);
} }
public JasperPrint printPdfRekapMakanan(int idRu, String tglAwal, String tglAkhir) { public JasperPrint printPdfRekapMakanan(int idRu, String tglAwal, String tglAkhir) {