updateupdate 创建企业用户

This commit is contained in:
2023-06-20 16:24:04 +08:00
parent a21751b723
commit a02d6b00ba
4 changed files with 103 additions and 123 deletions

View File

@@ -7,13 +7,13 @@ import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.huifu.adapay.model.CorpMember;
import com.huifu.adapay.model.Member;
import com.huifu.adapay.model.SettleAccount;
import com.jsowell.adapay.dto.AdapayMemberInfoDTO;
import com.jsowell.adapay.dto.CreateCorpMemberDTO;
import com.jsowell.adapay.dto.CreateSettleAccountDTO;
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
import com.jsowell.adapay.response.QueryMemberResponse;
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
import com.jsowell.adapay.vo.AdapayMemberInfoVO;
import com.jsowell.adapay.vo.AdapaySettleAccountVO;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.id.IdUtils;
@@ -41,6 +41,15 @@ public class AdapayMemberService {
@Autowired
private IAdapayMemberAccountService adapayMemberAccountService;
public void createSettleAccount(CreateSettleAccountDTO dto) throws Exception {
String bankAcctType = dto.getBankAcctType();
if (StringUtils.equals(bankAcctType, Constants.ONE)) {
createMember(dto);
} else if (StringUtils.equals(bankAcctType, Constants.TWO)) {
createCorpMember(dto);
}
}
/**
* 创建汇付会员
*
@@ -48,7 +57,7 @@ public class AdapayMemberService {
* @throws Exception
*/
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void createMember(AdapayMemberInfoDTO dto) throws Exception {
public void createMember(CreateSettleAccountDTO dto) throws Exception {
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
if (adapayMemberAccount != null) {
return;
@@ -283,7 +292,7 @@ public class AdapayMemberService {
/**
* 创建企业用户
*/
public void createCorpMember(CreateCorpMemberDTO dto) throws BaseAdaPayException, IOException {
public void createCorpMember(CreateSettleAccountDTO dto) throws BaseAdaPayException, IOException {
Map<String, Object> memberParams = Maps.newHashMap();
String adapayMemberId = "ACM" + IdUtils.getMemberId();
memberParams.put("member_id", adapayMemberId);
@@ -318,4 +327,6 @@ public class AdapayMemberService {
// adapayMemberAccount.setSettleAccountId(settleAccountId);
adapayMemberAccountService.insertAdapayMemberAccount(adapayMemberAccount);
}
}