From 6e425f5c18ca9e5d464cf0e66bbde2cba087d68a Mon Sep 17 00:00:00 2001 From: Salman Manoe Date: Tue, 14 May 2024 13:21:18 +0700 Subject: [PATCH] Update ReportServiceImpl.java Perbaikan validasi panjang nilai data fix untuk penandatangan cuti kemenkes --- .../service/impl/ReportServiceImpl.java | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/jasamedika-business/src/main/java/com/jasamedika/medifirst2000/service/impl/ReportServiceImpl.java b/jasamedika-business/src/main/java/com/jasamedika/medifirst2000/service/impl/ReportServiceImpl.java index 78d8a663..f9b42512 100644 --- a/jasamedika-business/src/main/java/com/jasamedika/medifirst2000/service/impl/ReportServiceImpl.java +++ b/jasamedika-business/src/main/java/com/jasamedika/medifirst2000/service/impl/ReportServiceImpl.java @@ -1885,7 +1885,7 @@ public class ReportServiceImpl extends BaseVoServiceImpl implements ReportServic String labelTtdMenkes = "Menteri Kesehatan Republik Indonesia"; String menteriKesehatan = settingDataFixedDao.getSettingDataFixed("menteriKesehatan"); - String nipMenkes; + String nipMenkes = ""; result.put("labelTtdMenkes", labelTtdMenkes); result.put("menteriKesehatan", menteriKesehatan); @@ -1959,9 +1959,12 @@ public class ReportServiceImpl extends BaseVoServiceImpl implements ReportServic .contains(Integer.parseInt(pegawai.get("idGolongan").toString()))) { String cutiA1 = settingDataFixedDao.getSettingDataFixed("cutiB1"); String[] arrCutiA1 = cutiA1.split("_"); - labelTtdMenkes = arrCutiA1[0]; - menteriKesehatan = arrCutiA1[1]; - nipMenkes = arrCutiA1[2]; + if (arrCutiA1.length >= 1) + labelTtdMenkes = arrCutiA1[0]; + if (arrCutiA1.length >= 2) + menteriKesehatan = arrCutiA1[1]; + if (arrCutiA1.length >= 3) + nipMenkes = arrCutiA1[2]; result.put("labelTtdMenkes", labelTtdMenkes); result.put("menteriKesehatan", menteriKesehatan); @@ -1969,9 +1972,12 @@ public class ReportServiceImpl extends BaseVoServiceImpl implements ReportServic } else { String cutiA1 = settingDataFixedDao.getSettingDataFixed("cutiB2C"); String[] arrCutiA1 = cutiA1.split("_"); - labelTtdMenkes = arrCutiA1[0]; - menteriKesehatan = arrCutiA1[1]; - nipMenkes = arrCutiA1[2]; + if (arrCutiA1.length >= 1) + labelTtdMenkes = arrCutiA1[0]; + if (arrCutiA1.length >= 2) + menteriKesehatan = arrCutiA1[1]; + if (arrCutiA1.length >= 3) + nipMenkes = arrCutiA1[2]; result.put("labelTtdMenkes", labelTtdMenkes); result.put("menteriKesehatan", menteriKesehatan); @@ -2112,7 +2118,7 @@ public class ReportServiceImpl extends BaseVoServiceImpl implements ReportServic String labelTtdMenkes = "Menteri Kesehatan Republik Indonesia"; String menteriKesehatan = settingDataFixedDao.getSettingDataFixed("menteriKesehatan"); - String nipMenkes; + String nipMenkes = ""; result.put("labelTtdMenkes", labelTtdMenkes); result.put("menteriKesehatan", menteriKesehatan); @@ -2149,9 +2155,12 @@ public class ReportServiceImpl extends BaseVoServiceImpl implements ReportServic .contains(Integer.parseInt(pegawai.get("idGolongan").toString()))) { String cutiA1 = settingDataFixedDao.getSettingDataFixed("cutiA1"); String[] arrCutiA1 = cutiA1.split("_"); - labelTtdMenkes = arrCutiA1[0]; - menteriKesehatan = arrCutiA1[1]; - nipMenkes = arrCutiA1[2]; + if (arrCutiA1.length >= 1) + labelTtdMenkes = arrCutiA1[0]; + if (arrCutiA1.length >= 2) + menteriKesehatan = arrCutiA1[1]; + if (arrCutiA1.length >= 3) + nipMenkes = arrCutiA1[2]; result.put("labelTtdMenkes", labelTtdMenkes); result.put("menteriKesehatan", menteriKesehatan); @@ -2159,9 +2168,12 @@ public class ReportServiceImpl extends BaseVoServiceImpl implements ReportServic } else { String cutiA1 = settingDataFixedDao.getSettingDataFixed("cutiA2"); String[] arrCutiA1 = cutiA1.split("_"); - labelTtdMenkes = arrCutiA1[0]; - menteriKesehatan = arrCutiA1[1]; - nipMenkes = arrCutiA1[2]; + if (arrCutiA1.length >= 1) + labelTtdMenkes = arrCutiA1[0]; + if (arrCutiA1.length >= 2) + menteriKesehatan = arrCutiA1[1]; + if (arrCutiA1.length >= 3) + nipMenkes = arrCutiA1[2]; result.put("labelTtdMenkes", labelTtdMenkes); result.put("menteriKesehatan", menteriKesehatan);