/** * {@link BeneficiaryAccountRequest} 转 {@link CCPCAccount} * * @param bnyAccountRequest * @return CCPCAccount */ private CCPCAccount bnyAccountRequestToCCPCAccount(BeneficiaryAccountRequest bnyAccountRequest) { CCPCAccount ccpcAccount = new CCPCAccount(); ccpcAccount.setMrchNo(bnyAccountRequest.getMrchNo()); ccpcAccount.setBnyAccNo(bnyAccountRequest.getBnyAccNo()); ccpcAccount.setBnyAccName(bnyAccountRequest.getBnyAccName()); ccpcAccount.setBnyBankName(bnyAccountRequest.getBnyBankName()); ccpcAccount.setUsrLogin(bnyAccountRequest.getUsrLogin()); ccpcAccount.setCnaps(bnyAccountRequest.getCnaps()); return ccpcAccount; }
@Override public CCPCAccount addOrUpdateCCPCAccount(BeneficiaryAccountRequest bnyAccount) { CCPCAccount ccpcAccount = null; CCPCAccount temp = cCPCAccountService.findCCPCAccount(bnyAccount.getUsrLogin(), bnyAccount.getBnyAccNo()); if (temp != null) { temp.setBnyAccName(bnyAccount.getBnyAccName()); ccpcAccount = cCPCAccountService.updateCCPCAccount(temp); } else { ccpcAccount = bnyAccountRequestToCCPCAccount(bnyAccount); CCPCBank ccpcBank = ccpcBankService.findCCPCBankByBankName(bnyAccount.getBnyBankName()); ccpcAccount.setAbbrName(ccpcBank == null ? "DEFAULT" : ccpcBank.getAbbrName()); ccpcAccount = cCPCAccountService.addCCPCAccount(ccpcAccount); } return ccpcAccount; }