Create service list master komponen gaji
This commit is contained in:
parent
de9b69b896
commit
89fa18f3e0
@ -4,6 +4,7 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jasamedika.medifirst2000.dto.KomponenGajiDto;
|
||||
import com.jasamedika.medifirst2000.dto.SlipGajiDto;
|
||||
|
||||
/**
|
||||
@ -24,4 +25,6 @@ public interface SlipGajiService {
|
||||
String writeExcel(Long bulan) throws IOException;
|
||||
|
||||
Map<String, Object> previewPdf(Integer pegawaiId, Long bulan);
|
||||
|
||||
List<KomponenGajiDto> listKomponen();
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ import com.jasamedika.medifirst2000.dao.PegawaiDao;
|
||||
import com.jasamedika.medifirst2000.dao.SlipGajiDao;
|
||||
import com.jasamedika.medifirst2000.dao.SlipGajiDetailDao;
|
||||
import com.jasamedika.medifirst2000.dao.SlipGajiKomponenDao;
|
||||
import com.jasamedika.medifirst2000.dto.KomponenGajiDto;
|
||||
import com.jasamedika.medifirst2000.dto.SlipGajiDto;
|
||||
import com.jasamedika.medifirst2000.dto.SlipGajiKomponenDto;
|
||||
import com.jasamedika.medifirst2000.entities.Jabatan;
|
||||
@ -430,4 +431,15 @@ public class SlipGajiServiceImpl implements SlipGajiService {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KomponenGajiDto> listKomponen() {
|
||||
List<KomponenGajiDto> result = new ArrayList<>();
|
||||
Sort sort = new Sort(Sort.Direction.ASC, "id");
|
||||
List<KomponenGaji> listKomponenGaji = komponenGajiDao.findAll(sort);
|
||||
listKomponenGaji.forEach(k -> {
|
||||
result.add(new KomponenGajiDto(k.getId(), k.getNamaKomponen(), k.getJenisKomponen()));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package com.jasamedika.medifirst2000.dto;
|
||||
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
|
||||
/**
|
||||
* @author Salman
|
||||
*
|
||||
*/
|
||||
public class KomponenGajiDto {
|
||||
@Caption(value = "ID")
|
||||
protected Integer id;
|
||||
|
||||
@Caption(value = "Nama Komponen")
|
||||
private String namaKomponen;
|
||||
|
||||
@Caption(value = "Jenis Komponen")
|
||||
private Integer jenisKomponen;
|
||||
|
||||
public KomponenGajiDto() {
|
||||
}
|
||||
|
||||
public KomponenGajiDto(Integer id, String namaKomponen, Integer jenisKomponen) {
|
||||
this.id = id;
|
||||
this.namaKomponen = namaKomponen;
|
||||
this.jenisKomponen = jenisKomponen;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNamaKomponen() {
|
||||
return namaKomponen;
|
||||
}
|
||||
|
||||
public void setNamaKomponen(String namaKomponen) {
|
||||
this.namaKomponen = namaKomponen;
|
||||
}
|
||||
|
||||
public Integer getJenisKomponen() {
|
||||
return jenisKomponen;
|
||||
}
|
||||
|
||||
public void setJenisKomponen(Integer jenisKomponen) {
|
||||
this.jenisKomponen = jenisKomponen;
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.dto.KomponenGajiDto;
|
||||
import com.jasamedika.medifirst2000.dto.SlipGajiDto;
|
||||
import com.jasamedika.medifirst2000.service.SlipGajiService;
|
||||
import com.jasamedika.medifirst2000.util.CommonUtil;
|
||||
@ -128,4 +129,10 @@ public class SlipGajiController {
|
||||
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/komponen/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Object> get() {
|
||||
List<KomponenGajiDto> entity = slipGajiService.listKomponen();
|
||||
return new ResponseEntity<>(entity, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user