mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-06 06:57:59 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -13,7 +13,9 @@ import com.google.common.primitives.Bytes;
|
|||||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||||
import com.huifu.adapay.model.Refund;
|
import com.huifu.adapay.model.Refund;
|
||||||
import com.jsowell.JsowellApplication;
|
import com.jsowell.JsowellApplication;
|
||||||
|
import com.jsowell.adapay.common.DivMember;
|
||||||
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
||||||
|
import com.jsowell.adapay.dto.QueryAcctFlowDTO;
|
||||||
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
||||||
import com.jsowell.adapay.service.AdapayService;
|
import com.jsowell.adapay.service.AdapayService;
|
||||||
import com.jsowell.common.constant.CacheConstants;
|
import com.jsowell.common.constant.CacheConstants;
|
||||||
@@ -175,7 +177,7 @@ public class SpringBootTestController {
|
|||||||
private IAdapayRefundRecordService adapayRefundRecordService;
|
private IAdapayRefundRecordService adapayRefundRecordService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AdapayService adapayMemberService;
|
private AdapayService adapayService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AMapService aMapService;
|
private AMapService aMapService;
|
||||||
@@ -195,6 +197,40 @@ public class SpringBootTestController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderPileOccupyService orderPileOccupyService;
|
private OrderPileOccupyService orderPileOccupyService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void queryPaymentConfirmListTest() {
|
||||||
|
// QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||||||
|
// dto.setWechatAppId("wxbb3e0d474569481d");
|
||||||
|
// dto.setPaymentId("002212023081523574610537553706393288704");
|
||||||
|
// adapayService.queryPaymentConfirmList(dto);
|
||||||
|
|
||||||
|
Map<String, Object> map = Maps.newHashMap();
|
||||||
|
DivMember divMember = new DivMember();
|
||||||
|
divMember.setMember_id("adapayMemberAccount.getAdapayMemberId()");
|
||||||
|
divMember.setAmount("AdapayUtil.formatAmount(confirmAmt)");
|
||||||
|
divMember.setFee_flag(Constants.Y);
|
||||||
|
map.put("div_members", Lists.newArrayList(divMember));
|
||||||
|
System.out.println(map);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void queryAcctFlowListTest() {
|
||||||
|
QueryAcctFlowDTO dto = new QueryAcctFlowDTO();
|
||||||
|
try {
|
||||||
|
dto.setPageNo(1);
|
||||||
|
dto.setPageSize(100);
|
||||||
|
dto.setAcctType("03");
|
||||||
|
dto.setWechatAppId("wxbb3e0d474569481d");
|
||||||
|
dto.setAdapayMemberId("0");
|
||||||
|
dto.setBeginDate("20230801");
|
||||||
|
dto.setEndDate("20230807");
|
||||||
|
adapayService.queryAcctFlowList(dto);
|
||||||
|
} catch (BaseAdaPayException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCalculateTheBalanceDeductionAmount() {
|
public void testCalculateTheBalanceDeductionAmount() {
|
||||||
String memberId = "123456";
|
String memberId = "123456";
|
||||||
@@ -241,7 +277,7 @@ public class SpringBootTestController {
|
|||||||
list.add("0022120230803181517990533118859674951680");
|
list.add("0022120230803181517990533118859674951680");
|
||||||
list.add("0022120230803181517990533118861063364608");
|
list.add("0022120230803181517990533118861063364608");
|
||||||
for (String s : list) {
|
for (String s : list) {
|
||||||
adapayMemberService.createConfirmReverse(s);
|
adapayService.createConfirmReverse(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,7 +751,7 @@ public class SpringBootTestController {
|
|||||||
try {
|
try {
|
||||||
// adapayMemberService.queryAdapayMemberInfo(adapayMemberId);
|
// adapayMemberService.queryAdapayMemberInfo(adapayMemberId);
|
||||||
|
|
||||||
adapayMemberService.queryAdapaySettleAccount(adapayMemberId, settleAccountId, "");
|
adapayService.queryAdapaySettleAccount(adapayMemberId, settleAccountId, "");
|
||||||
} catch (BaseAdaPayException e) {
|
} catch (BaseAdaPayException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.jsowell.adapay.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询账务流水DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QueryAcctFlowDTO {
|
||||||
|
/**
|
||||||
|
* 控制台 主页面应用的app_id
|
||||||
|
*/
|
||||||
|
private String wechatAppId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户对象的member_id,若查询商户本身时,传入值0
|
||||||
|
*/
|
||||||
|
private String adapayMemberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账户类型,01-基本户,02-手续费账户,03-临时过渡户,若查询主体为用户,则只支持查询基本户
|
||||||
|
*/
|
||||||
|
private String acctType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前页码,取值范围1~10000,默认值为1
|
||||||
|
*/
|
||||||
|
private Integer pageNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面容量,取值范围1~100,默认值为10
|
||||||
|
*/
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询起始日期,格式为 yyyyMMdd
|
||||||
|
*/
|
||||||
|
private String beginDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询结束日期,格式为 yyyyMMdd,日期间隔必须小于等于7天
|
||||||
|
*/
|
||||||
|
private String endDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.jsowell.adapay.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QueryPaymentConfirmDTO {
|
||||||
|
/**
|
||||||
|
* 控制台 主页面应用的app_id
|
||||||
|
*/
|
||||||
|
private String wechatAppId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adapay生成的支付对象id
|
||||||
|
*/
|
||||||
|
private String paymentId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.jsowell.adapay.response;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付确认对象详情反参
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QueryPaymentConfirmDetailResponse {
|
||||||
|
@JSONField(name = "payment_id")
|
||||||
|
private String paymentId;
|
||||||
|
|
||||||
|
@JSONField(name = "prod_mode")
|
||||||
|
private String prodMode;
|
||||||
|
|
||||||
|
@JSONField(name = "payment_confirms")
|
||||||
|
private String paymentConfirms;
|
||||||
|
|
||||||
|
@JSONField(name = "has_more")
|
||||||
|
private Boolean hasMore;
|
||||||
|
|
||||||
|
@JSONField(name = "app_id")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
@JSONField(name = "object")
|
||||||
|
private String object;
|
||||||
|
|
||||||
|
@JSONField(name = "status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
static class PaymentConfirm {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,9 +11,7 @@ import com.huifu.adapay.model.*;
|
|||||||
import com.jsowell.adapay.common.CreateAdaPaymentParam;
|
import com.jsowell.adapay.common.CreateAdaPaymentParam;
|
||||||
import com.jsowell.adapay.common.DivMember;
|
import com.jsowell.adapay.common.DivMember;
|
||||||
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
||||||
import com.jsowell.adapay.dto.SettleAccountDTO;
|
import com.jsowell.adapay.dto.*;
|
||||||
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
|
|
||||||
import com.jsowell.adapay.dto.WithdrawDTO;
|
|
||||||
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
||||||
import com.jsowell.adapay.response.*;
|
import com.jsowell.adapay.response.*;
|
||||||
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
|
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
|
||||||
@@ -868,4 +866,47 @@ public class AdapayService {
|
|||||||
List<PaymentReverseResponse> payment_reverses = jsonObject.getList("payment_reverses", PaymentReverseResponse.class);
|
List<PaymentReverseResponse> payment_reverses = jsonObject.getList("payment_reverses", PaymentReverseResponse.class);
|
||||||
return payment_reverses;
|
return payment_reverses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付确认对象列表
|
||||||
|
*/
|
||||||
|
public void queryPaymentConfirmList(QueryPaymentConfirmDTO dto) {
|
||||||
|
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
|
||||||
|
if (config == null) {
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
|
||||||
|
}
|
||||||
|
Map<String, Object> param = Maps.newHashMap();
|
||||||
|
param.put("payment_id", dto.getPaymentId());
|
||||||
|
param.put("app_id", config.getAdapayAppId());
|
||||||
|
|
||||||
|
try {
|
||||||
|
Map<String, Object> map = PaymentConfirm.queryList(param, config.getWechatAppId());
|
||||||
|
QueryPaymentConfirmDetailResponse queryPaymentConfirmDetailResponse = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class);
|
||||||
|
log.info("queryPaymentConfirmDetailResponse:{}", JSON.toJSONString(queryPaymentConfirmDetailResponse));
|
||||||
|
} catch (BaseAdaPayException e) {
|
||||||
|
log.error("查询支付确认对象列表error", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询账务流水
|
||||||
|
*/
|
||||||
|
public void queryAcctFlowList(QueryAcctFlowDTO dto) throws BaseAdaPayException {
|
||||||
|
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
|
||||||
|
if (config == null) {
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
|
||||||
|
}
|
||||||
|
Map<String, Object> acctFlowParams = Maps.newHashMap();
|
||||||
|
acctFlowParams.put("adapay_func_code", "acct.flow.list");
|
||||||
|
acctFlowParams.put("app_id", config.getAdapayAppId());
|
||||||
|
acctFlowParams.put("member_id", dto.getAdapayMemberId());
|
||||||
|
acctFlowParams.put("acct_type", dto.getAcctType());
|
||||||
|
acctFlowParams.put("page_index", dto.getPageNo());
|
||||||
|
acctFlowParams.put("page_size", dto.getPageSize());
|
||||||
|
acctFlowParams.put("begin_date", dto.getBeginDate());
|
||||||
|
acctFlowParams.put("end_date", dto.getEndDate());
|
||||||
|
Map<String, Object> acctFlowList = AdapayCommon.queryAdapay(acctFlowParams, config.getWechatAppId());
|
||||||
|
log.info("查询账务流水param:{}, result:{}", JSON.toJSONString(dto), JSON.toJSONString(acctFlowList));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user