update export excel dan tugas2
This commit is contained in:
parent
a483e8e290
commit
a2be20151f
25
pom.xml
25
pom.xml
@ -21,6 +21,19 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>jaspersoft-third-party</id>
|
||||||
|
<url>https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@ -131,6 +144,18 @@
|
|||||||
<artifactId>javase</artifactId>
|
<artifactId>javase</artifactId>
|
||||||
<version>2.2</version>
|
<version>2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Apache POI for Excel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi</artifactId>
|
||||||
|
<version>5.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
<version>5.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@ -61,6 +61,28 @@ public class DbConfig {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean(name = "thirdDataSource")
|
||||||
|
public DataSource dataSource3() {
|
||||||
|
try {
|
||||||
|
HikariConfig config = new HikariConfig();
|
||||||
|
config.setPoolName("PoolReporting3");
|
||||||
|
config.setDriverClassName("org.postgresql.Driver");
|
||||||
|
config.setConnectionTestQuery("SELECT 1");
|
||||||
|
config.setJdbcUrl("jdbc:postgresql://172.16.88.22:5432/gen2-development-sosialisasi");
|
||||||
|
config.setUsername("simrs");
|
||||||
|
config.setPassword("@S1mrs.3205@");
|
||||||
|
config.setMinimumIdle(5);
|
||||||
|
config.setIdleTimeout(300000L);
|
||||||
|
config.setMaximumPoolSize(20);
|
||||||
|
config.setConnectionTimeout(100000L);
|
||||||
|
config.setAutoCommit(ConnDb1.autoCommit);
|
||||||
|
return new HikariDataSource(config);
|
||||||
|
} catch (Exception var3) {
|
||||||
|
System.out.println(var3.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Bean(name = {"jdbcTemplate"})
|
@Bean(name = {"jdbcTemplate"})
|
||||||
public JdbcTemplate jdbcTemplate1(@Qualifier("db") DataSource ds) {
|
public JdbcTemplate jdbcTemplate1(@Qualifier("db") DataSource ds) {
|
||||||
return new JdbcTemplate(ds);
|
return new JdbcTemplate(ds);
|
||||||
@ -70,4 +92,9 @@ public class DbConfig {
|
|||||||
public JdbcTemplate jdbcTemplate2(@Qualifier("secondaryDataSource") DataSource ds) {
|
public JdbcTemplate jdbcTemplate2(@Qualifier("secondaryDataSource") DataSource ds) {
|
||||||
return new JdbcTemplate(ds);
|
return new JdbcTemplate(ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean(name = "thirdJdbcTemplate")
|
||||||
|
public JdbcTemplate jdbcTemplate3(@Qualifier("thirdDataSource") DataSource ds) {
|
||||||
|
return new JdbcTemplate(ds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,11 @@ import com.reporting.service.VerifikasiTagihanSupplierServices;
|
|||||||
import com.reporting.service.PostgresArrayService;
|
import com.reporting.service.PostgresArrayService;
|
||||||
import net.sf.jasperreports.engine.JasperExportManager;
|
import net.sf.jasperreports.engine.JasperExportManager;
|
||||||
import net.sf.jasperreports.engine.JasperPrint;
|
import net.sf.jasperreports.engine.JasperPrint;
|
||||||
|
import net.sf.jasperreports.engine.export.JRPdfExporter;
|
||||||
|
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
|
||||||
|
import net.sf.jasperreports.export.SimpleExporterInput;
|
||||||
|
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
|
||||||
|
import net.sf.jasperreports.export.SimpleXlsxReportConfiguration;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -584,16 +589,6 @@ public class ReportingController {
|
|||||||
|
|
||||||
//sim2
|
//sim2
|
||||||
|
|
||||||
/*
|
|
||||||
@RequestMapping(value = {"/label-cetering/{noorder}"}, method = {RequestMethod.GET})
|
|
||||||
public void exportPdfLabelKetring(@PathVariable("noorder") Integer noorder,
|
|
||||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
|
||||||
JasperPrint jasperPrint = this.reportingService.exportPdfLabelKetring(noorder);
|
|
||||||
response.setContentType("application/pdf");
|
|
||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
@RequestMapping(value = {"/label-cetering/{noorder}"}, method = {RequestMethod.GET})
|
@RequestMapping(value = {"/label-cetering/{noorder}"}, method = {RequestMethod.GET})
|
||||||
public void exportPdfLabelKetring(@PathVariable("noorder") String noorder,
|
public void exportPdfLabelKetring(@PathVariable("noorder") String noorder,
|
||||||
ModelAndView mv, HttpServletResponse response) throws Exception {
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
@ -609,4 +604,201 @@ public class ReportingController {
|
|||||||
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ekport Excel
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/visit"}, method = {RequestMethod.GET})
|
||||||
|
public void handleVisit(@RequestParam("tglAwal") String tglAwal,
|
||||||
|
@RequestParam("tglAkhir") String tglAkhir,
|
||||||
|
@RequestParam(value = "idDokter", required = false, defaultValue = "") Integer idDokter,
|
||||||
|
@RequestParam(value = "idRuangan", required = false, defaultValue = "") Integer idRuangan,
|
||||||
|
@RequestParam(value = "format", required = false, defaultValue = "pdf") String format,
|
||||||
|
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
// Generate report (common for both PDF/Excel)
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportVisit(tglAwal, tglAkhir, idDokter, idRuangan);
|
||||||
|
|
||||||
|
if ("excel".equalsIgnoreCase(format)) {
|
||||||
|
// Handle Excel export
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=Visit.xlsx");
|
||||||
|
|
||||||
|
JRXlsxExporter exporter = new JRXlsxExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration();
|
||||||
|
config.setOnePagePerSheet(false);
|
||||||
|
config.setDetectCellType(true);
|
||||||
|
config.setCollapseRowSpan(false);
|
||||||
|
config.setRemoveEmptySpaceBetweenRows(true);
|
||||||
|
config.setWhitePageBackground(false);
|
||||||
|
exporter.setConfiguration(config);
|
||||||
|
exporter.exportReport();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Handle PDF preview
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
response.setHeader("Content-Disposition", "inline; filename=Visit.pdf");
|
||||||
|
|
||||||
|
JRPdfExporter exporter = new JRPdfExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
exporter.exportReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/waktu-rawat-jalan"}, method = {RequestMethod.GET})
|
||||||
|
public void exportExcelWaktuRawatJalan(@RequestParam("tglAwal") String tglAwal,
|
||||||
|
@RequestParam("tglAkhir") String tglAkhir,
|
||||||
|
ModelAndView mv, HttpServletResponse response) throws Exception {
|
||||||
|
// 1. Set content type untuk Excel
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=waktu_rawat_jalan.xlsx");
|
||||||
|
// 2. Dapatkan JasperPrint dari service
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportExcelWaktuRawatJalan(tglAwal, tglAkhir);
|
||||||
|
// 3. Ekspor langsung ke output stream (tanpa menyimpan file sementara)
|
||||||
|
JRXlsxExporter exporter = new JRXlsxExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
|
||||||
|
configuration.setOnePagePerSheet(false);
|
||||||
|
configuration.setDetectCellType(true);
|
||||||
|
configuration.setCollapseRowSpan(false);
|
||||||
|
configuration.setRemoveEmptySpaceBetweenRows(true);
|
||||||
|
configuration.setWhitePageBackground(false);
|
||||||
|
exporter.setConfiguration(configuration);
|
||||||
|
exporter.exportReport();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/waktu-rawat-jalan"}, method = {RequestMethod.GET})
|
||||||
|
public void handleWaktuRawatJalan(
|
||||||
|
@RequestParam("tglAwal") String tglAwal,
|
||||||
|
@RequestParam("tglAkhir") String tglAkhir,
|
||||||
|
@RequestParam(value = "idDokter", required = false, defaultValue = "") Integer idDokter,
|
||||||
|
@RequestParam(value = "idRuangan", required = false, defaultValue = "") Integer idRuangan,
|
||||||
|
@RequestParam(value = "format", required = false, defaultValue = "pdf") String format,
|
||||||
|
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
|
||||||
|
HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
// Generate report (common for both PDF/Excel)
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportWaktuRawatJalan(tglAwal, tglAkhir, idDokter, idRuangan);
|
||||||
|
|
||||||
|
if ("excel".equalsIgnoreCase(format)) {
|
||||||
|
// Handle Excel export
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=waktu_rawat_jalan.xlsx");
|
||||||
|
|
||||||
|
JRXlsxExporter exporter = new JRXlsxExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration();
|
||||||
|
config.setOnePagePerSheet(false);
|
||||||
|
config.setDetectCellType(true);
|
||||||
|
config.setCollapseRowSpan(false);
|
||||||
|
config.setRemoveEmptySpaceBetweenRows(true);
|
||||||
|
config.setWhitePageBackground(false);
|
||||||
|
exporter.setConfiguration(config);
|
||||||
|
exporter.exportReport();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Handle PDF preview
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
response.setHeader("Content-Disposition", "inline; filename=waktu_rawat_jalan.pdf");
|
||||||
|
|
||||||
|
JRPdfExporter exporter = new JRPdfExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
exporter.exportReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/laporan-pendaftaran-online"}, method = {RequestMethod.GET})
|
||||||
|
public void handleLpPendaftaranOnline(
|
||||||
|
@RequestParam("tglAwal") String tglAwal,
|
||||||
|
@RequestParam("tglAkhir") String tglAkhir,
|
||||||
|
@RequestParam(value = "idUnit", required = false, defaultValue = "") Integer idUnit,
|
||||||
|
@RequestParam(value = "idRuangan", required = false, defaultValue = "") Integer idRuangan,
|
||||||
|
@RequestParam(value = "format", required = false, defaultValue = "pdf") String format,
|
||||||
|
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
|
||||||
|
HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
// Generate report (common for both PDF/Excel)
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportLpPendaftaranOnline(tglAwal, tglAkhir, idUnit, idRuangan);
|
||||||
|
|
||||||
|
if ("excel".equalsIgnoreCase(format)) {
|
||||||
|
// Handle Excel export
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=Laporan_Pendaftaran_Online.xlsx");
|
||||||
|
|
||||||
|
JRXlsxExporter exporter = new JRXlsxExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration();
|
||||||
|
config.setOnePagePerSheet(false);
|
||||||
|
config.setDetectCellType(true);
|
||||||
|
config.setCollapseRowSpan(false);
|
||||||
|
config.setRemoveEmptySpaceBetweenRows(true);
|
||||||
|
config.setWhitePageBackground(false);
|
||||||
|
exporter.setConfiguration(config);
|
||||||
|
exporter.exportReport();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Handle PDF preview
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
response.setHeader("Content-Disposition", "inline; filename=Laporan_Pendaftaran_Online.pdf");
|
||||||
|
|
||||||
|
JRPdfExporter exporter = new JRPdfExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
exporter.exportReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/laporan-volume-tindakan"}, method = {RequestMethod.GET})
|
||||||
|
public void handleLpVolumeTindakan(
|
||||||
|
@RequestParam("tglAwal") String tglAwal,
|
||||||
|
@RequestParam("tglAkhir") String tglAkhir,
|
||||||
|
@RequestParam(value = "idInstalasi", required = false, defaultValue = "") Integer idInstalasi,
|
||||||
|
@RequestParam(value = "idRuangan", required = false, defaultValue = "") Integer idRuangan,
|
||||||
|
@RequestParam(value = "idProduk", required = false, defaultValue = "") Integer idProduk,
|
||||||
|
@RequestParam(value = "idPegawai", required = false, defaultValue = "") Integer idPegawai,
|
||||||
|
@RequestParam(value = "idKp", required = false, defaultValue = "") Integer idKp,
|
||||||
|
@RequestParam(value = "format", required = false, defaultValue = "pdf") String format,
|
||||||
|
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
|
||||||
|
HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
// Generate report (common for both PDF/Excel)
|
||||||
|
JasperPrint jasperPrint = this.reportingService.exportLpVolumeTindakan(tglAwal, tglAkhir, idInstalasi, idRuangan, idProduk, idPegawai, idKp);
|
||||||
|
|
||||||
|
if ("excel".equalsIgnoreCase(format)) {
|
||||||
|
// Handle Excel export
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=Laporan_Volume_Tindakan.xlsx");
|
||||||
|
|
||||||
|
JRXlsxExporter exporter = new JRXlsxExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration();
|
||||||
|
config.setOnePagePerSheet(false);
|
||||||
|
config.setDetectCellType(true);
|
||||||
|
config.setCollapseRowSpan(false);
|
||||||
|
config.setRemoveEmptySpaceBetweenRows(true);
|
||||||
|
config.setWhitePageBackground(false);
|
||||||
|
exporter.setConfiguration(config);
|
||||||
|
exporter.exportReport();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Handle PDF preview
|
||||||
|
response.setContentType("application/pdf");
|
||||||
|
response.setHeader("Content-Disposition", "inline; filename=Laporan_Volume_Tindakan.pdf");
|
||||||
|
|
||||||
|
JRPdfExporter exporter = new JRPdfExporter();
|
||||||
|
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
|
||||||
|
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
|
||||||
|
exporter.exportReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,9 @@ package com.reporting.dao;
|
|||||||
import com.reporting.service.PostgresArrayService;
|
import com.reporting.service.PostgresArrayService;
|
||||||
import net.sf.jasperreports.engine.*;
|
import net.sf.jasperreports.engine.*;
|
||||||
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
|
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
|
||||||
|
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
|
||||||
import net.sf.jasperreports.engine.type.OrientationEnum;
|
import net.sf.jasperreports.engine.type.OrientationEnum;
|
||||||
import net.sf.jasperreports.export.SimpleExporterInput;
|
import net.sf.jasperreports.export.*;
|
||||||
import net.sf.jasperreports.export.SimplePrintServiceExporterConfiguration;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -23,7 +23,10 @@ import javax.print.attribute.standard.OrientationRequested;
|
|||||||
import javax.print.attribute.standard.PrinterName;
|
import javax.print.attribute.standard.PrinterName;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
import net.sf.jasperreports.export.SimpleExporterInput;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Repository
|
@Repository
|
||||||
@ -38,6 +41,10 @@ public class ReportingDao {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private JdbcTemplate jdbcTemplate2;
|
private JdbcTemplate jdbcTemplate2;
|
||||||
|
|
||||||
|
@Qualifier("thirdJdbcTemplate")
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate3;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PostgresArrayService postgresArrayService;
|
private PostgresArrayService postgresArrayService;
|
||||||
|
|
||||||
@ -1064,33 +1071,77 @@ public class ReportingDao {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public static String convertToPostgresArray(List<Integer> idList) {
|
|
||||||
if (idList == null || idList.isEmpty()) {
|
|
||||||
return "{}"; // Mengembalikan array kosong
|
|
||||||
}
|
|
||||||
// Mengonversi ke format PostgreSQL array
|
|
||||||
return "{" + idList.stream()
|
|
||||||
.map(String::valueOf)
|
|
||||||
.collect(Collectors.joining(",")) + "}";
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
//Export Excel
|
||||||
|
|
||||||
/* public JasperPrint exportPdfLabelKetring(Integer noorder) {
|
public JasperPrint exportVisit(Date tglAwal, Date tglAkhir, Integer idDokter, Integer idRuangan) {
|
||||||
try (Connection conn = this.jdbcTemplate2.getDataSource().getConnection()) {
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
String path = jaspersim2DirPath + "label_catering.jrxml";
|
String path = jaspersim2DirPath + "visit.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("noorderList", noorder);
|
parameters.put("tglAwal", tglAwal);
|
||||||
|
parameters.put("tglAkhir", tglAkhir);
|
||||||
// Assuming you have a way to handle multiple noorder values in your report
|
parameters.put("idDokter", idDokter);
|
||||||
|
parameters.put("idRuangan", idRuangan);
|
||||||
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
} catch (Exception var15) {
|
} catch (Exception var15) {
|
||||||
LOG.error("Exception at exportPdfLabelKetring");
|
LOG.error("Exception at exportVisit");
|
||||||
LOG.error(ReportingDao.class, var15);
|
LOG.error(ReportingDao.class, var15);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportWaktuRawatJalan(Date tglAwal, Date tglAkhir, Integer idDokter, Integer idRuangan) {
|
||||||
|
try (Connection conn = this.jdbcTemplate3.getDataSource().getConnection()) {
|
||||||
|
String path = jaspersim2DirPath + "waktu_rawat_jalan.jrxml";
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
|
parameters.put("tglAwal", tglAwal);
|
||||||
|
parameters.put("tglAkhir", tglAkhir);
|
||||||
|
parameters.put("idDokter", idDokter);
|
||||||
|
parameters.put("idRuangan", idRuangan);
|
||||||
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
|
} catch (Exception var15) {
|
||||||
|
LOG.error("Exception at exportWaktuRawatJalan");
|
||||||
|
LOG.error(ReportingDao.class, var15);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportLpPendaftaranOnline(Date tglAwal, Date tglAkhir, Integer idUnit, Integer idRuangan) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jaspersim2DirPath + "Laporan_pemanfaatan_pendaftaran.jrxml";
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
|
parameters.put("tglAwal", tglAwal);
|
||||||
|
parameters.put("tglAkhir", tglAkhir);
|
||||||
|
parameters.put("idUnit", idUnit);
|
||||||
|
parameters.put("idRuangan", idRuangan);
|
||||||
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
|
} catch (Exception var15) {
|
||||||
|
LOG.error("Exception at exportLpPendaftaranOnline");
|
||||||
|
LOG.error(ReportingDao.class, var15);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportLpVolumeTindakan(Date tglAwal, Date tglAkhir, Integer idInstalasi, Integer idRuangan, Integer idProduk, Integer idPegawai, Integer idKp) {
|
||||||
|
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
|
||||||
|
String path = jaspersim2DirPath + "laporan_volume_tindakan_pasien.jrxml";
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(path);
|
||||||
|
Map<String, Object> parameters = new HashMap<>();
|
||||||
|
parameters.put("tglAwal", tglAwal);
|
||||||
|
parameters.put("tglAkhir", tglAkhir);
|
||||||
|
parameters.put("idUnit", idInstalasi);
|
||||||
|
parameters.put("idRuangan", idRuangan);
|
||||||
|
parameters.put("idProduk", idProduk);
|
||||||
|
parameters.put("idPegawai", idPegawai);
|
||||||
|
parameters.put("idKp", idKp);
|
||||||
|
return JasperFillManager.fillReport(jasperReport, parameters, conn);
|
||||||
|
} catch (Exception var15) {
|
||||||
|
LOG.error("Exception at exportLpVolumeTindakan");
|
||||||
|
LOG.error(ReportingDao.class, var15);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -305,14 +305,63 @@ public class ReportingService {
|
|||||||
|
|
||||||
//sim2
|
//sim2
|
||||||
|
|
||||||
/*
|
|
||||||
public JasperPrint exportPdfLabelKetring(Integer noorder) {
|
|
||||||
return this.reportingDao.exportPdfLabelKetring(noorder);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public JasperPrint exportPdfLabelKetring(List<Integer> noorder) {
|
public JasperPrint exportPdfLabelKetring(List<Integer> noorder) {
|
||||||
return this.reportingDao.exportPdfLabelKetring(noorder);
|
return this.reportingDao.exportPdfLabelKetring(noorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Export Excel
|
||||||
|
|
||||||
|
public JasperPrint exportVisit(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date parse = formatter.parse(tglAwal);
|
||||||
|
Date parse2 = formatter.parse(tglAkhir);
|
||||||
|
return this.reportingDao.exportVisit(parse, parse2, idDokter, idRuangan);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportWaktuRawatJalan(String tglAwal, String tglAkhir, Integer idDokter, Integer idRuangan) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date parse = formatter.parse(tglAwal);
|
||||||
|
Date parse2 = formatter.parse(tglAkhir);
|
||||||
|
return this.reportingDao.exportWaktuRawatJalan(parse, parse2, idDokter, idRuangan);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportLpPendaftaranOnline(String tglAwal, String tglAkhir, Integer idUnit, Integer idRuangan) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date parse = formatter.parse(tglAwal);
|
||||||
|
Date parse2 = formatter.parse(tglAkhir);
|
||||||
|
return this.reportingDao.exportLpPendaftaranOnline(parse, parse2, idUnit, idRuangan);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPrint exportLpVolumeTindakan(String tglAwal, String tglAkhir, Integer idInstalasi, Integer idRuangan, Integer idProduk, Integer idPegawai, Integer idKp) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date parse = formatter.parse(tglAwal);
|
||||||
|
Date parse2 = formatter.parse(tglAkhir);
|
||||||
|
return this.reportingDao.exportLpVolumeTindakan(parse, parse2, idInstalasi, idRuangan, idProduk, idPegawai, idKp);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,13 @@ spring.datasource.secondary.url=jdbc:postgresql://172.16.88.22:5432/order_gizi
|
|||||||
spring.datasource.secondary.username=simrs
|
spring.datasource.secondary.username=simrs
|
||||||
spring.datasource.secondary.password=@S1mrs.3205@
|
spring.datasource.secondary.password=@S1mrs.3205@
|
||||||
|
|
||||||
|
# Konfigurasi untuk sumber data ketiga
|
||||||
|
spring.datasource.third.type=com.zaxxer.hikari.HikariDataSource
|
||||||
|
spring.datasource.third.driver-class-name=org.postgresql.Driver
|
||||||
|
spring.datasource.third.url=jdbc:postgresql://172.16.88.22:5432/gen2-development-sosialisasi
|
||||||
|
spring.datasource.third.username=simrs
|
||||||
|
spring.datasource.third.password=@S1mrs.3205@
|
||||||
|
|
||||||
# Pengaturan lainnya
|
# Pengaturan lainnya
|
||||||
spring.mvc.dispatch-trace-request=true
|
spring.mvc.dispatch-trace-request=true
|
||||||
spring.main.banner-mode=off
|
spring.main.banner-mode=off
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user