|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.mfsys.uco.service;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.mfsys.uco.constants.UCOConstants;
|
|
|
|
|
import com.mfsys.uco.constants.UCOURI;
|
|
|
|
|
import com.mfsys.uco.dto.AccountInquiryResponse;
|
|
|
|
|
import com.mfsys.uco.dto.SignupStep3RequestModel;
|
|
|
|
|
@ -20,6 +21,7 @@ import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class UcoAccountService {
|
|
|
|
|
|
|
|
|
|
@ -39,16 +41,19 @@ public class UcoAccountService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AccountInquiryResponse fetchAccountTitile(String porOrgacode, String acntTypeCode, String acntTypeValue) {
|
|
|
|
|
if (acntTypeCode.equals("01")) {
|
|
|
|
|
CustomerProfile customerProfile = customerProfileRepository.findProfilesByMobilePhone(porOrgacode, acntTypeValue);
|
|
|
|
|
CustomerProfile customerProfile = new CustomerProfile();
|
|
|
|
|
|
|
|
|
|
if (acntTypeCode.equals(UCOConstants.CMP_PHONE)) {
|
|
|
|
|
customerProfile = customerProfileRepository.findProfilesByMobilePhone(porOrgacode, acntTypeValue);
|
|
|
|
|
} else if (acntTypeCode.equals(UCOConstants.CMP_EMAIL)) {
|
|
|
|
|
customerProfile = customerProfileRepository.findCustomerProfileByCmpEmailAndPorOrgacode(porOrgacode, acntTypeValue);
|
|
|
|
|
}
|
|
|
|
|
if (Objects.isNull(customerProfile)) {
|
|
|
|
|
throw new AccountDoesntExistsException();
|
|
|
|
|
}
|
|
|
|
|
UcoAccount ucoAccount = ucoAccountRepository.findUcoAccountByCmpCustcode(porOrgacode, customerProfile.getCmpCustcode());
|
|
|
|
|
return AccountInquiryResponse.builder().mbmBkmsnumber(ucoAccount.getId().getMbmBkmsnumber()).mbmBkmstitle(ucoAccount.getMbmBkmstitle()).build();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Double fetchAccountBalance(String porOrgacode, String mbmBkmsNumber) {
|
|
|
|
|
|