fix decrypt password
This commit is contained in:
@ -5,6 +5,8 @@ import com.iconplus.smartproc.helper.model.EmptyResponse;
|
||||
import com.iconplus.smartproc.helper.service.BaseService;
|
||||
import com.iconplus.smartproc.model.request.JenisPengadaanRequest;
|
||||
import com.iconplus.smartproc.repository.JenisPengadaanRepository;
|
||||
import com.iconplus.smartproc.util.Constants;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -18,7 +20,10 @@ public class DeleteJenisPengadaanService implements BaseService<JenisPengadaanRe
|
||||
@Override
|
||||
public EmptyResponse execute(JenisPengadaanRequest input) {
|
||||
var jenisPengadaan = jenisPengadaanRepository.findByIdAndIsDeleteFalse(input.getId())
|
||||
.orElseThrow(() -> new BusinessException("err", "err", "err"));
|
||||
.orElseThrow(() -> new BusinessException(HttpStatus.CONFLICT,
|
||||
Constants.ERR_CODE_10001,
|
||||
Constants.ERR_TTL_10001,
|
||||
String.format(Constants.ERR_MSG_10001, "Jenis Pengadaan", input.getId())));
|
||||
jenisPengadaan.setIsDelete(true);
|
||||
jenisPengadaanRepository.save(jenisPengadaan);
|
||||
return new EmptyResponse();
|
||||
|
@ -5,6 +5,8 @@ import com.iconplus.smartproc.helper.service.BaseService;
|
||||
import com.iconplus.smartproc.model.request.JenisPengadaanRequest;
|
||||
import com.iconplus.smartproc.model.response.JenisPengadaanResponse;
|
||||
import com.iconplus.smartproc.repository.JenisPengadaanRepository;
|
||||
import com.iconplus.smartproc.util.Constants;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -19,7 +21,10 @@ public class GetJenisPengadaanService implements BaseService<JenisPengadaanReque
|
||||
public JenisPengadaanResponse execute(JenisPengadaanRequest input) {
|
||||
|
||||
var jenisPengadaan = jenisPengadaanRepository.findByIdAndIsDeleteFalse(input.getId())
|
||||
.orElseThrow(() -> new BusinessException("err", "err", "err"));
|
||||
.orElseThrow(() -> new BusinessException(HttpStatus.CONFLICT,
|
||||
Constants.ERR_CODE_10001,
|
||||
Constants.ERR_TTL_10001,
|
||||
String.format(Constants.ERR_MSG_10001, "Jenis Pengadaan", input.getId())));
|
||||
|
||||
return JenisPengadaanResponse.builder()
|
||||
.id(jenisPengadaan.getId())
|
||||
|
@ -6,6 +6,8 @@ import com.iconplus.smartproc.model.entity.JenisPengadaan;
|
||||
import com.iconplus.smartproc.model.request.JenisPengadaanRequest;
|
||||
import com.iconplus.smartproc.model.response.JenisPengadaanResponse;
|
||||
import com.iconplus.smartproc.repository.JenisPengadaanRepository;
|
||||
import com.iconplus.smartproc.util.Constants;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -20,7 +22,10 @@ public class PostCreateJenisPengadaanService implements BaseService<JenisPengada
|
||||
public JenisPengadaanResponse execute(JenisPengadaanRequest input) {
|
||||
var jenisPengadaan = jenisPengadaanRepository.findByJenisPengadaanAndIsDeleteFalse(input.getJenisPengadaan());
|
||||
if (jenisPengadaan.isPresent()) {
|
||||
throw new BusinessException("err", "err", "err");
|
||||
throw new BusinessException(HttpStatus.CONFLICT,
|
||||
Constants.ERR_CODE_10002,
|
||||
Constants.ERR_TTL_10002,
|
||||
String.format(Constants.ERR_MSG_10002, "Jenis Pengadaan", input.getJenisPengadaan()));
|
||||
}
|
||||
|
||||
JenisPengadaan jenisPengadaanEntity = JenisPengadaan.builder()
|
||||
|
@ -5,6 +5,8 @@ import com.iconplus.smartproc.helper.service.BaseService;
|
||||
import com.iconplus.smartproc.model.request.JenisPengadaanRequest;
|
||||
import com.iconplus.smartproc.model.response.JenisPengadaanResponse;
|
||||
import com.iconplus.smartproc.repository.JenisPengadaanRepository;
|
||||
import com.iconplus.smartproc.util.Constants;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -18,7 +20,10 @@ public class PutUpdateJenisPengadaanService implements BaseService<JenisPengadaa
|
||||
@Override
|
||||
public JenisPengadaanResponse execute(JenisPengadaanRequest input) {
|
||||
var jenisPengadaan = jenisPengadaanRepository.findByIdAndIsDeleteFalse(input.getId())
|
||||
.orElseThrow(() -> new BusinessException("err", "err", "err"));
|
||||
.orElseThrow(() -> new BusinessException(HttpStatus.CONFLICT,
|
||||
Constants.ERR_CODE_10001,
|
||||
Constants.ERR_TTL_10001,
|
||||
String.format(Constants.ERR_MSG_10001, "Jenis Pengadaan", input.getId())));
|
||||
jenisPengadaan.setJenisPengadaan(input.getJenisPengadaan());
|
||||
jenisPengadaan.setKeterangan(input.getKeterangan());
|
||||
jenisPengadaan.setIsActive(input.getIsActive());
|
||||
|
Reference in New Issue
Block a user