Merge branch 'sdm' of 172.16.44.33:/mnt/git/SC-be-java into sdm

This commit is contained in:
salmanoe 2021-09-06 09:33:35 +07:00
commit 2bfa28c366
2 changed files with 31 additions and 2 deletions

View File

@ -156,6 +156,24 @@ public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements Abse
return result;
}
public String getDirPath(String dirname) {
String result = "";
String your_os = System.getProperty("os.name").toLowerCase();
if (your_os.indexOf("win") >= 0) {
// if_windows
result = dirname + "\\";
} else if (your_os.indexOf("nix") >= 0 || your_os.indexOf("nux") >= 0 || your_os.indexOf("mac") >= 0) {
// if_unix_or_mac
result = dirname + "//";
} else {
// unknown_os?
result = dirname + "/";
}
return result;
}
public String getImageAbsoluteFilePath(String filename) {
String result = "";
@ -176,16 +194,26 @@ public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements Abse
}
public void uploadPhotoCapture(String imageURLData, String idFinger, Date trDate, Date trTime, Integer trNo) {
DateFormat mf = new SimpleDateFormat("yyyyMM");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
DateFormat tf = new SimpleDateFormat("HH.mm.ss");
String filename = idFinger.toString() + "_" + df.format(trDate) + "_" + tf.format(trTime) + "#" + trNo + ".jpg";
String directory = getDirPath(mf.format(trDate));
String filename = directory + idFinger.toString() + "_" + df.format(trDate) + "_" + tf.format(trTime) + "#"
+ trNo + ".jpg";
String str = imageURLData;
byte[] imagedata = DatatypeConverter.parseBase64Binary(str.substring(str.indexOf(",") + 1));
try {
BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(imagedata));
ImageIO.write(bufferedImage, "jpg", new File(getImageAbsoluteFilePath(filename)));
File dire = new File(directory);
if (!dire.exists()) {
dire.mkdir();
}
File file = new File(getImageAbsoluteFilePath(filename));
ImageIO.write(bufferedImage, "jpg", file);
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -9086,6 +9086,7 @@ public class IndekKinerjaServiceImpl extends BaseVoServiceImpl implements IndekK
}
}
} else {
// FFS : sudah tidak dipakai
if (CommonUtil.isNotNullOrEmpty(listData)) {
if (pegawaiDao.getPegawaiByKategoryPegawai(Arrays.asList(Master.KategoryPegawai.DOKTER_LUAR))
.contains(idPegawai)) {