mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.jsowell.adapay.dto;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class WithdrawDTO {
|
||||
// 运营商id
|
||||
private String merchantId;
|
||||
|
||||
// 提现金额
|
||||
private String cashAmt;
|
||||
|
||||
|
||||
}
|
||||
@@ -5,16 +5,19 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.huifu.adapay.model.CorpMember;
|
||||
import com.huifu.adapay.model.Drawcash;
|
||||
import com.huifu.adapay.model.Member;
|
||||
import com.huifu.adapay.model.SettleAccount;
|
||||
import com.jsowell.adapay.dto.CreateSettleAccountDTO;
|
||||
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
|
||||
import com.jsowell.adapay.dto.WithdrawDTO;
|
||||
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.AdapayUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
@@ -60,6 +63,7 @@ public class AdapayMemberService {
|
||||
public void createMember(CreateSettleAccountDTO dto) throws Exception {
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
|
||||
if (adapayMemberAccount != null) {
|
||||
log.error("通过merchantId:{}, 没有查询到结算账户配置", dto.getMerchantId());
|
||||
return;
|
||||
}
|
||||
log.info("=======execute CreateMember begin=======");
|
||||
@@ -144,6 +148,7 @@ public class AdapayMemberService {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
if (adapayMemberAccount == null) {
|
||||
log.error("通过merchantId:{}, 没有查询到结算账户配置", merchantId);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -241,6 +246,7 @@ public class AdapayMemberService {
|
||||
// 通过merchantId 查询出汇付会员id 和 结算账户id,用来查询余额
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
if (adapayMemberAccount == null) {
|
||||
log.error("通过merchantId:{}, 没有查询到结算账户配置", merchantId);
|
||||
return vo;
|
||||
}
|
||||
String settle_account_id = adapayMemberAccount.getSettleAccountId();
|
||||
@@ -270,6 +276,7 @@ public class AdapayMemberService {
|
||||
// 通过merchantId 查询出汇付会员id 和 结算账户id,用来查询余额
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
|
||||
if (adapayMemberAccount == null) {
|
||||
log.error("通过merchantId:{}, 没有查询到结算账户配置", dto.getMerchantId());
|
||||
return;
|
||||
}
|
||||
// 修改账户配置
|
||||
@@ -329,4 +336,25 @@ public class AdapayMemberService {
|
||||
}
|
||||
|
||||
|
||||
public void withdraw(WithdrawDTO dto) throws BaseAdaPayException {
|
||||
// 通过merchantId 查询出汇付会员id 和 结算账户id,用来查询余额
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
|
||||
if (adapayMemberAccount == null) {
|
||||
log.error("通过merchantId:{}, 没有查询到结算账户配置", dto.getMerchantId());
|
||||
return;
|
||||
}
|
||||
Map<String, Object> settleCountParams = Maps.newHashMap();
|
||||
|
||||
settleCountParams.put("order_no", "jsdk_payment_" + System.currentTimeMillis());
|
||||
settleCountParams.put("cash_amt", AdapayUtil.formatAmount(dto.getCashAmt()));
|
||||
settleCountParams.put("member_id", adapayMemberAccount.getAdapayMemberId());
|
||||
settleCountParams.put("app_id", ADAPAY_APP_ID);
|
||||
settleCountParams.put("settle_account_id", adapayMemberAccount.getSettleAccountId());
|
||||
settleCountParams.put("cash_type", "T1");
|
||||
settleCountParams.put("notify_url", "");
|
||||
|
||||
log.info("取现接口,请求参数:" + JSON.toJSONString(settleCountParams));
|
||||
Map<String, Object> settleCount = Drawcash.create(settleCountParams);
|
||||
log.info("取现接口返回参数" + JSON.toJSONString(settleCount));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.mapper.AdapayMemberAccountMapper;
|
||||
import com.jsowell.pile.service.IAdapayMemberAccountService;
|
||||
import com.jsowell.pile.service.IPileStationInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -19,6 +20,7 @@ import java.util.List;
|
||||
* @author jsowell
|
||||
* @date 2023-06-15
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AdapayMemberAccountServiceImpl implements IAdapayMemberAccountService {
|
||||
@Autowired
|
||||
@@ -119,6 +121,7 @@ public class AdapayMemberAccountServiceImpl implements IAdapayMemberAccountServi
|
||||
}
|
||||
AdapayMemberAccount adapayMemberAccount = selectByMerchantId(pileStationInfo.getMerchantId() + "");
|
||||
if (adapayMemberAccount == null) {
|
||||
log.error("通过merchantId:{}, 没有查询到结算账户配置", pileStationInfo.getMerchantId());
|
||||
return null;
|
||||
}
|
||||
return adapayMemberAccount.getAdapayMemberId();
|
||||
|
||||
Reference in New Issue
Block a user