update label gizi
This commit is contained in:
parent
765755172c
commit
8ec5272edb
@ -43,8 +43,9 @@ public class ReportingController {
|
||||
|
||||
@RequestMapping(value = {"/label-gizi/{noregistrasi}"}, method = {RequestMethod.GET})
|
||||
public void exportLabelGiziTest(@PathVariable("noregistrasi") String noregistrasi,
|
||||
@RequestParam(value = "jnsdiet", required = false) String jnsdiet,
|
||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||
JasperPrint jasperPrint = this.reportingService.exportPdfLabelGizi(noregistrasi);
|
||||
JasperPrint jasperPrint = this.reportingService.exportPdfLabelGizi(noregistrasi, jnsdiet);
|
||||
response.setContentType("application/pdf");
|
||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||
}
|
||||
|
||||
@ -76,6 +76,21 @@ public class ReportingDao {
|
||||
}
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfLabelGiziMakanan(String noregistrasi, String jnsdiet) {
|
||||
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||
String path = jasperDirPath + "rpt_labelgizimakanan.jrxml";
|
||||
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("noregistrasi", noregistrasi);
|
||||
parameters.put("jnsdiet", jnsdiet);
|
||||
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||
} catch (Exception var15) {
|
||||
LOG.error("Exception at exportPdfLabelGiziMakanan");
|
||||
LOG.error(ReportingDao.class, var15);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfLabelGizi(String noregistrasi) {
|
||||
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||
String path = jasperDirPath + "rpt_labelgizi.jrxml";
|
||||
@ -90,6 +105,7 @@ public class ReportingDao {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public JasperPrint exportPdfPermintaanMakanan(Integer idRu, String tglAwal, String tglAkhir) {
|
||||
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||
String path = jasperDirPath + "pl_permintaan_makan.jrxml";
|
||||
|
||||
@ -22,6 +22,14 @@ public class ReportingService {
|
||||
public ReportingService() {
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfLabelGizi(String noregistrasi, String jnsdiet) {
|
||||
if (Objects.equals(jnsdiet, "MAKANAN")) {
|
||||
return this.reportingDao.exportPdfLabelGiziMakanan(noregistrasi, jnsdiet);
|
||||
} else {
|
||||
return this.reportingDao.exportPdfLabelGizi(noregistrasi);
|
||||
}
|
||||
}
|
||||
|
||||
public JasperPrint exportPdfLabelGizi(String noregistrasi) {
|
||||
return this.reportingDao.exportPdfLabelGizi(noregistrasi);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user