update config

This commit is contained in:
ridwan 2026-04-23 11:57:31 +07:00
parent 659f2d8979
commit 7887366328
5 changed files with 64 additions and 30 deletions

View File

@ -83,27 +83,27 @@ public class DbConfig {
return null;
}
@Bean(name = "fourDataSource")
public DataSource dataSource4() {
try {
HikariConfig config = new HikariConfig();
config.setPoolName("PoolReporting3");
config.setDriverClassName("org.postgresql.Driver");
config.setConnectionTestQuery("SELECT 1");
config.setJdbcUrl("jdbc:postgresql://192.168.12.3:5432/rsab_hk_25_01_14");
config.setUsername("postgres");
config.setPassword("postgres");
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 = "fourDataSource")
// public DataSource dataSource4() {
// try {
// HikariConfig config = new HikariConfig();
// config.setPoolName("PoolReporting3");
// config.setDriverClassName("org.postgresql.Driver");
// config.setConnectionTestQuery("SELECT 1");
// config.setJdbcUrl("jdbc:postgresql://192.168.12.3:5432/rsab_hk_25_01_14");
// config.setUsername("postgres");
// config.setPassword("postgres");
// 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"})
public JdbcTemplate jdbcTemplate1(@Qualifier("db") DataSource ds) {
@ -120,8 +120,8 @@ public class DbConfig {
return new JdbcTemplate(ds);
}
@Bean(name = "fourJdbcTemplate")
public JdbcTemplate jdbcTemplate4(@Qualifier("fourDataSource") DataSource ds) {
return new JdbcTemplate(ds);
}
// @Bean(name = "fourJdbcTemplate")
// public JdbcTemplate jdbcTemplate4(@Qualifier("fourDataSource") DataSource ds) {
// return new JdbcTemplate(ds);
// }
}

View File

@ -1810,6 +1810,20 @@ public class ReportingController {
}
}
// @RequestMapping(value = {"/smpktes/{smpk}"}, method = {RequestMethod.GET})
// public void exportPdfSMPKtes(@PathVariable("smpk") Integer smpk,
// @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
// ModelAndView mv, HttpServletResponse response) throws Exception {
// JasperPrint jasperPrint = null;
// try {
// jasperPrint = this.reportingService.exportPdfSMPKtes(smpk, printBy);
// response.setContentType("application/pdf");
// JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
// } finally {
// jasperPrint = null;
// }
// }
@RequestMapping(value = {"/rekap-logbook"}, method = {RequestMethod.GET})
public void handleRekapLogbook(
@RequestParam("tahun") String tahun,

View File

@ -46,9 +46,9 @@ public class ReportingDao {
@Autowired
private JdbcTemplate jdbcTemplate3;
@Qualifier("fourJdbcTemplate")
@Autowired
private JdbcTemplate jdbcTemplate4;
// @Qualifier("fourJdbcTemplate")
// @Autowired
// private JdbcTemplate jdbcTemplate4;
@Autowired
private PostgresArrayService postgresArrayService;
@ -1446,6 +1446,21 @@ public class ReportingDao {
return null;
}
// public JasperPrint exportPdfSMPKtes(Integer smpk, String printBy) {
// try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) {
// String path = jaspersim2DirPath + "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 exportPdfSMPKtes");
// LOG.error(ReportingDao.class, var15);
// }
// return null;
// }
public JasperPrint exportPdfRekapLogbook(String tahun, String bulan, Integer ksm_id, Integer pegawai_id , String printBy) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "rekap_logbook_dong.jrxml";
@ -1554,7 +1569,7 @@ public class ReportingDao {
}
public JasperPrint exportLpTreaseHasil(String norec) {
try (Connection conn = this.jdbcTemplate4.getDataSource().getConnection()) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
String path = jasperDirPath + "trease_hasil.jrxml";
JasperReport jasperReport = JasperCompileManager.compileReport(path);
Map<String, Object> parameters = new HashMap<>();

View File

@ -473,6 +473,11 @@ public class ReportingService {
return this.reportingDao.exportPdfSMPK(smpk, printBy);
}
// public JasperPrint exportPdfSMPKtes(Integer smpk, String printBy) {
// log.info("Starting exportPdfSMPK with smpk: {}, printBy: {}", smpk, printBy);
// return this.reportingDao.exportPdfSMPKtes(smpk, printBy);
// }
public JasperPrint exportPdfRekapLogbook(String tahun, String bulan, Integer ksm_id, Integer pegawai_id, String printBy) {
log.info("Starting exportPdfRekapLogbook with tahun: {}, bulan: {}, ksm_id: {}, pegawai_id: {}, printBy: {}", tahun, bulan, ksm_id, pegawai_id, printBy);
return this.reportingDao.exportPdfRekapLogbook(tahun, bulan, ksm_id, pegawai_id, printBy);

View File

@ -32,6 +32,6 @@ spring.mvc.dispatch-trace-request=true
spring.main.banner-mode=off
application.jasper-xml.dir-path=/mnt/files/jasper-xml/
application.jasper-xml.dir-bintaro-path=/mnt/files/jasper-xml-bintaro/
application.jasper-xml.dir-sim2-path=/mnt/files/jasper-xml-sim2/
application.jasper-xml.dir-sim2-path=D:\\COBA\\
application.pdf.dir-sep=/mnt/files/sep/
application.pdf.dir-lis=/mnt/lis/