Clean code
Delete logger path file
This commit is contained in:
parent
6cd19919d9
commit
9ea54e0ec2
@ -1,25 +1,5 @@
|
||||
package com.jasamedika.medifirst2000.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.DateFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Master;
|
||||
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
|
||||
import com.jasamedika.medifirst2000.converter.PresensiConverter;
|
||||
@ -37,6 +17,19 @@ import com.jasamedika.medifirst2000.util.CommonUtil;
|
||||
import com.jasamedika.medifirst2000.util.ImageUtil;
|
||||
import com.jasamedika.medifirst2000.vo.AbsensiPegawaiVO;
|
||||
import com.jasamedika.medifirst2000.vo.HabsenVO;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.DateFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Implement class for AbsensiPegawaiService
|
||||
@ -46,8 +39,6 @@ import com.jasamedika.medifirst2000.vo.HabsenVO;
|
||||
@Service("absensiPegawaiService")
|
||||
public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements AbsensiPegawaiService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AbsensiPegawaiServiceImpl.class);
|
||||
|
||||
@Value("${systemDirectory}")
|
||||
String systemDirectory;
|
||||
|
||||
@ -174,9 +165,6 @@ public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements Abse
|
||||
String path = systemDirectory + "presensi-pegawai/" + dirname + "/";
|
||||
if (osName.contains("win"))
|
||||
path = systemDirectory.replace("/", "\\") + "presensi-pegawai\\" + dirname + "\\";
|
||||
|
||||
LOGGER.info("Path presensi pegawai {}", path);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@ -194,14 +182,9 @@ public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements Abse
|
||||
byte[] imagedata = Base64.decodeBase64(str.substring(str.indexOf(",") + 1));
|
||||
try {
|
||||
File dire = new File(directory);
|
||||
if (!dire.exists()) {
|
||||
if (!dire.exists())
|
||||
dire.mkdirs();
|
||||
}
|
||||
|
||||
File outputFile = new File(filename);
|
||||
|
||||
LOGGER.info("Path presensi pegawai {}", outputFile.getAbsolutePath());
|
||||
|
||||
OutputStream stream = new FileOutputStream(outputFile);
|
||||
stream.write(imagedata);
|
||||
stream.close();
|
||||
@ -264,8 +247,6 @@ public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements Abse
|
||||
File file = new File(
|
||||
getDirPathPresensiPegawai(map.get("trdate").toString()) + map.get("filePath").toString());
|
||||
|
||||
LOGGER.info("Path presensi pegawai {}", file.getAbsolutePath());
|
||||
|
||||
String encodeRs = ImageUtil.encodeFileToBase64Binary(file);
|
||||
if (CommonUtil.isNotNullOrEmpty(encodeRs)) {
|
||||
imageURLData = "data:image/jpg;base64," + encodeRs;
|
||||
|
||||
@ -1,5 +1,30 @@
|
||||
package com.jasamedika.medifirst2000.service.impl;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Master;
|
||||
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
|
||||
import com.jasamedika.medifirst2000.dao.*;
|
||||
import com.jasamedika.medifirst2000.dao.custom.PegawaiDaoCustom;
|
||||
import com.jasamedika.medifirst2000.entities.*;
|
||||
import com.jasamedika.medifirst2000.service.PegawaiJadwalKerjaService;
|
||||
import com.jasamedika.medifirst2000.service.PegawaiService;
|
||||
import com.jasamedika.medifirst2000.util.CommonUtil;
|
||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
||||
import com.jasamedika.medifirst2000.vo.*;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.joda.time.Chronology;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.chrono.ISOChronology;
|
||||
import org.joda.time.chrono.IslamicChronology;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
@ -10,72 +35,10 @@ import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.joda.time.Chronology;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.chrono.ISOChronology;
|
||||
import org.joda.time.chrono.IslamicChronology;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Master;
|
||||
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
|
||||
import com.jasamedika.medifirst2000.dao.KalenderDao;
|
||||
import com.jasamedika.medifirst2000.dao.ListTanggalCutiDao;
|
||||
import com.jasamedika.medifirst2000.dao.MapKalenderToHariLiburDao;
|
||||
import com.jasamedika.medifirst2000.dao.MapPegawaiJabatanToUnitKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.MonitoringAbsenDao;
|
||||
import com.jasamedika.medifirst2000.dao.PegawaiDao;
|
||||
import com.jasamedika.medifirst2000.dao.PegawaiJadwalKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.ShiftKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.SubUnitKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.UnitKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.custom.PegawaiDaoCustom;
|
||||
import com.jasamedika.medifirst2000.entities.Kalender;
|
||||
import com.jasamedika.medifirst2000.entities.Pegawai;
|
||||
import com.jasamedika.medifirst2000.entities.PegawaiJadwalKerja;
|
||||
import com.jasamedika.medifirst2000.entities.Ruangan;
|
||||
import com.jasamedika.medifirst2000.entities.ShiftKerja;
|
||||
import com.jasamedika.medifirst2000.service.PegawaiJadwalKerjaService;
|
||||
import com.jasamedika.medifirst2000.service.PegawaiService;
|
||||
import com.jasamedika.medifirst2000.util.CommonUtil;
|
||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
||||
import com.jasamedika.medifirst2000.vo.KalenderVO;
|
||||
import com.jasamedika.medifirst2000.vo.KelompokShiftVO;
|
||||
import com.jasamedika.medifirst2000.vo.ListTanggalCutiVO;
|
||||
import com.jasamedika.medifirst2000.vo.PegawaiJadwalKerjaCustomVO;
|
||||
import com.jasamedika.medifirst2000.vo.PegawaiJadwalKerjaExcelVO;
|
||||
import com.jasamedika.medifirst2000.vo.PegawaiJadwalKerjaVO;
|
||||
import com.jasamedika.medifirst2000.vo.PegawaiVO;
|
||||
import com.jasamedika.medifirst2000.vo.PlanningPegawaiStatusVO;
|
||||
import com.jasamedika.medifirst2000.vo.RuanganVO;
|
||||
import com.jasamedika.medifirst2000.vo.ShiftKerjaVO;
|
||||
import java.util.*;
|
||||
|
||||
@Service("PegawaiJadwalKerjaService")
|
||||
public class PegawaiJadwalKerjaServiceImpl extends BaseVoServiceImpl implements PegawaiJadwalKerjaService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PegawaiJadwalKerjaServiceImpl.class);
|
||||
|
||||
@Value("${systemDirectory}")
|
||||
String systemDirectory;
|
||||
@ -1026,9 +989,6 @@ public class PegawaiJadwalKerjaServiceImpl extends BaseVoServiceImpl implements
|
||||
String path = systemDirectory + "jadwal-pegawai/" + filename + "/";
|
||||
if (osName.contains("win"))
|
||||
path = systemDirectory.replace("/", "\\") + "jadwal-pegawai\\" + filename + "\\";
|
||||
|
||||
LOGGER.info("Path jadwal pegawai {}", path);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@ -1106,9 +1066,6 @@ public class PegawaiJadwalKerjaServiceImpl extends BaseVoServiceImpl implements
|
||||
|
||||
absoluteFilePath = getDirPathJadwalPegawai(filename);
|
||||
File file = new File(absoluteFilePath);
|
||||
|
||||
LOGGER.info("Path jadwal pegawai {}", file.getAbsolutePath());
|
||||
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
workbook.write(out);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user