update smpk
This commit is contained in:
parent
a31ec6f40a
commit
f2cbf093e8
@ -1022,8 +1022,9 @@ public class ReportingController {
|
|||||||
|
|
||||||
@RequestMapping(value = {"/smpk/{smpk}"}, method = {RequestMethod.GET})
|
@RequestMapping(value = {"/smpk/{smpk}"}, method = {RequestMethod.GET})
|
||||||
public void exportPdfSMPK(@PathVariable("smpk") Integer smpk,
|
public void exportPdfSMPK(@PathVariable("smpk") Integer smpk,
|
||||||
|
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
|
||||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk);
|
JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk,printBy);
|
||||||
response.setContentType("application/pdf");
|
response.setContentType("application/pdf");
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1280,12 +1280,13 @@ public class ReportingDao {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JasperPrint exportPdfSMPK(Integer smpk) {
|
public JasperPrint exportPdfSMPK(Integer smpk, String printBy) {
|
||||||
try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) {
|
try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) {
|
||||||
String path = jasperDirPath + "SMPK_testing.jrxml";
|
String path = jasperDirPath + "SMPK_testing.jrxml";
|
||||||
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
Map<String, Object> parameters = new HashMap<>();
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
parameters.put("smpk", smpk);
|
parameters.put("smpk", smpk);
|
||||||
|
parameters.put("printBy", printBy);
|
||||||
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
} catch (Exception var15) {
|
} catch (Exception var15) {
|
||||||
LOG.error("Exception at exportPdfSMPK");
|
LOG.error("Exception at exportPdfSMPK");
|
||||||
|
|||||||
@ -449,8 +449,8 @@ public class ReportingService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JasperPrint exportPdfSMPK(Integer smpk) {
|
public JasperPrint exportPdfSMPK(Integer smpk, String printBy) {
|
||||||
return this.reportingDao.exportPdfSMPK(smpk);
|
return this.reportingDao.exportPdfSMPK(smpk, printBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JasperPrint exportPdfRekapLogbook(String tahun, String bulan, Integer ksm_id, Integer pegawai_id , String printBy) {
|
public JasperPrint exportPdfRekapLogbook(String tahun, String bulan, Integer ksm_id, Integer pegawai_id , String printBy) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user