update smpk

This commit is contained in:
ridwan 2025-10-14 13:52:45 +07:00
parent a31ec6f40a
commit f2cbf093e8
3 changed files with 6 additions and 4 deletions

View File

@ -1022,8 +1022,9 @@ public class ReportingController {
@RequestMapping(value = {"/smpk/{smpk}"}, method = {RequestMethod.GET})
public void exportPdfSMPK(@PathVariable("smpk") Integer smpk,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk);
JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk,printBy);
response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}

View File

@ -1280,12 +1280,13 @@ public class ReportingDao {
return null;
}
public JasperPrint exportPdfSMPK(Integer smpk) {
public JasperPrint exportPdfSMPK(Integer smpk, String printBy) {
try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) {
String path = jasperDirPath + "SMPK_testing.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();
parameters.put("smpk", smpk);
parameters.put("printBy", printBy);
return JasperFillManager.fillReport(jasperReport, parameters, conn);
} catch (Exception var15) {
LOG.error("Exception at exportPdfSMPK");

View File

@ -449,8 +449,8 @@ public class ReportingService {
}
}
public JasperPrint exportPdfSMPK(Integer smpk) {
return this.reportingDao.exportPdfSMPK(smpk);
public JasperPrint exportPdfSMPK(Integer smpk, String printBy) {
return this.reportingDao.exportPdfSMPK(smpk, printBy);
}
public JasperPrint exportPdfRekapLogbook(String tahun, String bulan, Integer ksm_id, Integer pegawai_id , String printBy) {