Nabeel-DG-BS
Raja Nabeel 2 years ago
parent eb48ddf4ad
commit ab7e7e3058

@ -12,6 +12,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import java.io.IOException;
import java.net.URLDecoder;
import java.time.LocalDateTime;

@ -1,16 +1,13 @@
package com.mfsys.uco.controller;
import com.mfsys.comm.util.FunctionReturnDetail;
import com.mfsys.uco.UCOURI;
import com.mfsys.uco.dto.CashInTransactionRequest;
import com.mfsys.uco.dto.CashOutTransactionRequest;
import com.mfsys.uco.dto.Transaction.TransactionOtpRequestModel;
import com.mfsys.uco.dto.TransactionPinResponseModel;
import com.mfsys.uco.dto.webclientdto.AccountDetail;
import com.mfsys.uco.model.TransactionTrail;
import com.mfsys.uco.service.TransactionService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@ -9,8 +9,6 @@ import com.mfsys.uco.dto.*;
import com.mfsys.uco.dto.webclientdto.AccountDetail;
import com.mfsys.uco.model.CustomerAccountActivity;
import com.mfsys.uco.model.CustomerProfile;
import com.mfsys.uco.model.UcoAccount;
import com.mfsys.uco.repository.UCOAccountRepository;
import com.mfsys.uco.service.*;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@ -18,11 +16,9 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.ByteArrayOutputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
@RestController
@RequiredArgsConstructor
@ -119,6 +115,7 @@ public class UserController {
return "Error generating report";
}
}
@PostMapping(UCOURI.CREATE_TRAN_PIN)
public ResponseEntity<HttpStatus> createTransactionPin(@RequestBody CreateTransactionPinRequest request) {
try {

@ -1,4 +1,5 @@
package com.mfsys.uco.dto.Transaction;
import lombok.Data;
import lombok.RequiredArgsConstructor;

@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Map;
@Data
@RequiredArgsConstructor
@AllArgsConstructor

@ -4,8 +4,6 @@ package com.mfsys.uco.exception;
import com.mfsys.comm.exception.ApplicationException;
import com.mfsys.comm.exception.ERRCode;
import javax.swing.*;
public class OldPinIncorrectException extends ApplicationException {
public OldPinIncorrectException() {
super(null, ERRCode.OLD_PIN_INCORRECT, null);

@ -37,25 +37,18 @@ public class CustomerProfile {
@Column(name = "KYC_RENEWAL_DATE", nullable = true, columnDefinition = FieldNameLength.DATE)
protected LocalDate kycRenewalDate;
@Column(name = "CMP_EMAIL", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String cmpEmail;
@Column(name = "CMP_NAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String cmpName;
@Column(name = "CMP_USERNAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String cmpUserName;
@Column(name = "CMP_ISKYC_VERIFIED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
protected boolean cmpIsKycVerified = false;
@Column(name = "CMP_TRAN_PIN", nullable = true, columnDefinition = FieldNameLength.PIN_VALUE)
protected String cmpTranpin;
@Column(name = "CMP_UNVERIFIED_TRAN_PIN", nullable = true, columnDefinition = FieldNameLength.PIN_VALUE)
protected String cmpUnverifiedTranpin;
@Column(name = "CMP_TRAN_PIN_VERIFIED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
protected boolean cmpTranpinVerfied = false;
@Column(name = "CMP_EMAIL", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String cmpEmail;
@Column(name = "CMP_NAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String cmpName;
@Column(name = "CMP_USERNAME", nullable = true, columnDefinition = FieldNameLength.CODE_50)
private String cmpUserName;
}

@ -9,6 +9,14 @@ public class CustomerProfileId implements Serializable {
private String porOrgacode;
private String cmpCustcode;
public CustomerProfileId() {
}
public CustomerProfileId(String porOrgacode, String cmpCustcode) {
this.porOrgacode = porOrgacode;
this.cmpCustcode = cmpCustcode;
}
public String getPorOrgacode() {
return porOrgacode;
}
@ -25,14 +33,6 @@ public class CustomerProfileId implements Serializable {
this.cmpCustcode = cmpCustcode;
}
public CustomerProfileId() {
}
public CustomerProfileId(String porOrgacode, String cmpCustcode) {
this.porOrgacode = porOrgacode;
this.cmpCustcode = cmpCustcode;
}
@Override
public int hashCode() {
final int prime = 31;

@ -18,62 +18,44 @@ import java.time.LocalDate;
@Table(name = "BN_MS_UA_UCOACCOUNTTRAIL")
public class TransactionTrail {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "POR_ORGACODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.POR_ORGACODE)
protected String porOrgacode;
@Column(name = "DR_MBM_BKMSNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
protected String drMbmBkmsnumber;
@Column(name = "CR_MBM_BKMSNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.ACCOUNT_NUMBER)
protected String crMbmBkmsnumber;
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
protected String dmpProdcode;
@Column(name = "DR_MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
protected String drmbmBkmstitle;
@Column(name = "DR_PCR_CURRDESC", nullable=false, columnDefinition=FieldNameLength.DESCRIPTION_LONG)
private String drpcrCurrdesc;
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
protected String cmpCustcode;
@Column(name = "DR_PCR_CURRCODE", columnDefinition=FieldNameLength.PCR_CURRCODE)
private String drPcrCurrcode;
@Column(name = "CR_MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
protected String crMbmBkmstitle;
@Column(name = "CR_PCR_CURRDESC", nullable=false, columnDefinition=FieldNameLength.DESCRIPTION_LONG)
private String crPcrCurrdesc;
@Column(name = "CR_PCR_CURRCODE", columnDefinition=FieldNameLength.PCR_CURRCODE)
private String crPcrCurrcode;
@Column(name = "SGT_SENTGNTRNUMBER", nullable = false, updatable = false, columnDefinition = FieldNameLength.CODE_500)
protected String sgtSentGntrnumber;
@Column(name = "DR_SGT_GNTRDATE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DATE)
protected LocalDate drSgtGntrdate;
@Column(name = "CR_SGT_GNTRDATE", nullable = true, updatable = false, columnDefinition = FieldNameLength.DATE)
protected LocalDate crSgtGntrdate;
@Column(name = "SGT_GNTRAMT", nullable = false, updatable = false, columnDefinition = FieldNameLength.AMOUNT_REAL)
protected BigDecimal sgtGntramt = BigDecimal.ZERO;
@Column(name = "BAT_ACNTTRANSENT", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
protected boolean batAcnttranSend;
@Column(name = "BAT_ACNTTRANRECEIVED", nullable = true, columnDefinition = FieldNameLength.BOOLEAN_BIT)
protected boolean batAcnttranReceived;
@Column(name = "SGT_RECEIVEGNTRNUMBER", nullable = true, updatable = true, columnDefinition = FieldNameLength.CODE_500)
protected String sgtReceiveGntrnumber;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "DR_PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
private String drpcrCurrdesc;
@Column(name = "DR_PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
private String drPcrCurrcode;
@Column(name = "CR_PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
private String crPcrCurrdesc;
@Column(name = "CR_PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
private String crPcrCurrcode;
}

@ -1,7 +1,10 @@
package com.mfsys.uco.model;
import com.mfsys.comm.util.FieldNameLength;
import jakarta.persistence.*;
import jakarta.persistence.Column;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -16,31 +19,23 @@ import java.time.LocalDate;
@AllArgsConstructor
@NoArgsConstructor
public class UcoAccount {
@EmbeddedId
private AccountId id;
@Column(name = "DMP_PRODCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.DMP_PRODCODE)
protected String dmpProdcode;
@Column(name = "MBM_BKMSTITLE", nullable = false, updatable = true, columnDefinition = FieldNameLength.ACCOUNT_TITLE)
protected String mbmBkmstitle;
@Column(name = "PCR_CURRDESC", nullable=false, columnDefinition=FieldNameLength.DESCRIPTION_LONG)
private String pcrCurrdesc;
@Column(name = "CMP_CUSTCODE", nullable = false, updatable = false, columnDefinition = FieldNameLength.CUSTOMER_CODE)
protected String cmpCustcode;
@Column(name = "PCR_CURRCODE", columnDefinition=FieldNameLength.PCR_CURRCODE)
private String pcrCurrcode;
@Column(name = "MBM_BKMSCLOSED", nullable = false, columnDefinition = FieldNameLength.BOOLEAN_BIT)
protected boolean mbmBkmsclosed;
@Column(name = "SGT_LASTTRANDATE", nullable = true, updatable = true, columnDefinition = FieldNameLength.DATE)
protected LocalDate sgtLasttrandate;
@Column(name = "MBM_BKMSOPENDATE", nullable = false, columnDefinition = FieldNameLength.DATE)
protected LocalDate mbmBkmsopendate;
@EmbeddedId
private AccountId id;
@Column(name = "PCR_CURRDESC", nullable = false, columnDefinition = FieldNameLength.DESCRIPTION_LONG)
private String pcrCurrdesc;
@Column(name = "PCR_CURRCODE", columnDefinition = FieldNameLength.PCR_CURRCODE)
private String pcrCurrcode;
}

@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
public interface CustomerProfileRepository extends JpaRepository<CustomerProfile, CustomerProfileId> {
@Query("SELECT c FROM BN_CS_MP_CUSTOMERPROFILE c WHERE c.porOrgacode =:porOrgacode and c.padAdrsmobphone = :phone")
CustomerProfile findProfilesByMobilePhone(String porOrgacode, String phone);
@Query("SELECT c FROM BN_CS_MP_CUSTOMERPROFILE c WHERE c.porOrgacode =:porOrgacode and c.cmpEmail = :email")
CustomerProfile findbyEmail(String porOrgacode, String email);
}

@ -1,8 +1,6 @@
package com.mfsys.uco.repository;
import com.mfsys.uco.model.AccountId;
import com.mfsys.uco.model.CustomerProfile;
import com.mfsys.uco.model.CustomerProfileId;
import com.mfsys.uco.model.UcoAccount;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

@ -1,17 +1,15 @@
package com.mfsys.uco.service;
import com.mfsys.uco.dto.webclientdto.AccountDetail;
import com.mfsys.uco.model.CustomerProfile;
import com.mfsys.uco.repository.CustomerProfileRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class CustomerProfileService {
private final CustomerProfileRepository customerProfileRepository;
public CustomerProfile fetchCustcodeBasedOnEmail(String porOrgacode, String email) {
return customerProfileRepository.findbyEmail(porOrgacode, email);
}

@ -59,6 +59,7 @@ public class NotificationService {
}
throw new InvalidOTPException(porOrgacode);
}
public void verifyOtpViaOtpId(String id, String pinType, String obpPincode) {
Pin pin = pinRepository.findsss(id, pinType, obpPincode)
.orElseThrow(() -> new IllegalArgumentException("Notification not found for ID: " + id));

@ -1,6 +1,5 @@
package com.mfsys.uco.service;
import com.mfsys.comm.util.FunctionReturnDetail;
import com.mfsys.uco.UCOURI;
import com.mfsys.uco.dto.*;
import com.mfsys.uco.dto.Transaction.TransactionOtpRequestModel;

@ -13,6 +13,7 @@ import com.mfsys.uco.model.UcoAccount;
import com.mfsys.uco.repository.CustomerProfileRepository;
import com.mfsys.uco.repository.UCOAccountRepository;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@ -53,6 +54,7 @@ public class UcoAccountService {
public Double fetchAccountBalance(String porOrgacode, String mbmBkmsNumber) {
return (Double) getIndvAccountDetails(porOrgacode, mbmBkmsNumber);
}
public Object getIndvAccountDetails(String porOrgacode, String mbmBkmsnumber) {
String url = UCOURI.GET_UCOACC_BALANCE + "?porOrgacode=" + porOrgacode + "&mbmBkmsnumber=" + mbmBkmsnumber;
return webClientDeposit.getUcoAccountBalance(url, porOrgacode);

@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mfsys.comm.exception.ApplicationException;
import com.mfsys.comm.exception.ApplicationExceptionMapper;
import org.apache.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
@ -25,12 +24,14 @@ public class WebClientCrmService {
public WebClientCrmService(WebClient webClientCrm) {
this.webClientCrm = webClientCrm;
}
public Object getUcoAccountBalance(String url, String porOrgacode) {
return handleResponse(webClientCrm.get().uri(url).accept(MediaType.APPLICATION_JSON)
.header("SUS_USERCODE", porOrgacode)
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
null);
}
public Object onboardCustomer(Map onBoardingData, String url, String porOrgaCode) {
return handleResponse(webClientCrm.post().uri(url).bodyValue(onBoardingData).accept(MediaType.APPLICATION_JSON)
.header("SUS_USERCODE", porOrgaCode)

@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mfsys.comm.exception.ApplicationException;
import com.mfsys.comm.exception.ApplicationExceptionMapper;
import com.mfsys.comm.util.FunctionReturnDetail;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
@ -15,7 +14,6 @@ import reactor.core.publisher.Mono;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Service
public class WebClientDepositService {
@ -25,6 +23,7 @@ public class WebClientDepositService {
public WebClientDepositService(WebClient webClientDeposit) {
this.webClientDeposit = webClientDeposit;
}
public Object getUcoAccountBalance(String url, String porOrgacode) {
return handleResponse(webClientDeposit.get().uri(url).accept(MediaType.APPLICATION_JSON)
.header("SUS_USERCODE", porOrgacode)
@ -38,6 +37,7 @@ public class WebClientDepositService {
.header("POR_ORGACODE", porOrgacode).retrieve().toEntity(Object.class),
null);
}
public Object postTransaction(Object tranData, String url, String porOrgaCode) {
return handleResponse(webClientDeposit.post().uri(url).bodyValue(tranData).accept(MediaType.APPLICATION_JSON)
.header("SUS_USERCODE", porOrgaCode)
@ -47,7 +47,6 @@ public class WebClientDepositService {
}
public Object fetchExchangeRate(String url, String porOrgacode) {
return handleResponse(webClientDeposit.get().uri(url).accept(MediaType.APPLICATION_JSON)
.header("SUS_USERCODE", porOrgacode)

Loading…
Cancel
Save