mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-08 05:27:59 +00:00
perf SQL脚本更新, 一些对象调整
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
package cn.daxpay.single.service.code;
|
||||
|
||||
/**
|
||||
* 支付方式扩展字段
|
||||
*
|
||||
* @author xxm
|
||||
* @since 2022/2/27
|
||||
*/
|
||||
public interface PayWayExtraCode {
|
||||
|
||||
/** 付款码 */
|
||||
String AUTH_CODE = "auth_code";
|
||||
|
||||
/** openId */
|
||||
String OPEN_ID = "open_id";
|
||||
|
||||
/** 钱包ID */
|
||||
String WALLET_ID = "wallet_id";
|
||||
|
||||
/** 用户ID */
|
||||
String USER_ID = "user_id";
|
||||
|
||||
/** 同步通知路径 支付完成跳转的页面地址 */
|
||||
String RETURN_URL = "return_url";
|
||||
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
package cn.daxpay.single.service.code;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 云闪付
|
||||
* @author xxm
|
||||
* @since 2024/3/7
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum UnionPayRecordTypeEnum {
|
||||
|
||||
/** 支付 */
|
||||
PAY("pay", "支付"),
|
||||
/** 退款 */
|
||||
REFUND("refund", "退款");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
}
|
@@ -77,7 +77,6 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction<
|
||||
@Schema(description = "支付订单标题")
|
||||
private String title;
|
||||
|
||||
|
||||
/**
|
||||
* 所属通道
|
||||
* @see PayChannelEnum
|
||||
@@ -105,10 +104,10 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction<
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 分账处理结果
|
||||
* 处理结果
|
||||
* @see AllocOrderResultEnum
|
||||
*/
|
||||
@DbColumn(comment = "分账处理结果")
|
||||
@DbColumn(comment = "处理结果")
|
||||
private String result;
|
||||
|
||||
/**
|
||||
|
@@ -89,7 +89,13 @@ public class PayOrderManager extends BaseManager<PayOrderMapper, PayOrder> {
|
||||
*/
|
||||
public Integer getTalAmount(PayOrderQuery query){
|
||||
QueryWrapper<PayOrder> generator = QueryGenerator.generator(query);
|
||||
generator.eq(MpUtil.getColumnName(PayOrder::getStatus), PayStatusEnum.SUCCESS.getCode());
|
||||
// 成功, 退款相关都算
|
||||
generator.in(MpUtil.getColumnName(PayOrder::getStatus),
|
||||
PayStatusEnum.SUCCESS.getCode(),
|
||||
PayStatusEnum.REFUNDED.getCode(),
|
||||
PayStatusEnum.REFUNDING.getCode(),
|
||||
PayStatusEnum.PARTIAL_REFUND.getCode()
|
||||
);
|
||||
return baseMapper.getTalAmount(generator);
|
||||
}
|
||||
|
||||
|
@@ -1,62 +0,0 @@
|
||||
package cn.daxpay.single.service.util;
|
||||
|
||||
import cn.daxpay.single.code.PayChannelEnum;
|
||||
import cn.daxpay.single.param.channel.WalletPayParam;
|
||||
import cn.daxpay.single.service.code.PayWayExtraCode;
|
||||
import cn.daxpay.single.param.channel.AliPayParam;
|
||||
import cn.daxpay.single.service.param.channel.wechat.WeChatPayParam;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 支付通道相关工具类
|
||||
*
|
||||
* @author xxm
|
||||
* @since 2022/7/12
|
||||
*/
|
||||
@UtilityClass
|
||||
public class PayChannelUtil {
|
||||
|
||||
/**
|
||||
* 构建扩展参数构建
|
||||
* @param payChannel 支付通道编码
|
||||
* @param map 支付方式扩展字段信息 key 为 PayModelExtraCode中定义的
|
||||
*/
|
||||
public String buildExtraParamsJson(String payChannel, Map<String, Object> map) {
|
||||
PayChannelEnum payChannelEnum = PayChannelEnum.findByCode(payChannel);
|
||||
switch (payChannelEnum) {
|
||||
case ALI: {
|
||||
AliPayParam aliPayParam = new AliPayParam();
|
||||
aliPayParam.setAuthCode(MapUtil.getStr(map, PayWayExtraCode.AUTH_CODE));
|
||||
return JSONUtil.toJsonStr(aliPayParam);
|
||||
}
|
||||
case WECHAT: {
|
||||
return JSONUtil.toJsonStr(new WeChatPayParam().setOpenId(MapUtil.getStr(map,PayWayExtraCode.OPEN_ID))
|
||||
.setAuthCode(MapUtil.getStr(map,PayWayExtraCode.AUTH_CODE)));
|
||||
}
|
||||
case WALLET: {
|
||||
String walletId = MapUtil.getStr(map,PayWayExtraCode.WALLET_ID);
|
||||
String userId = MapUtil.getStr(map,PayWayExtraCode.USER_ID);
|
||||
WalletPayParam walletPayParam = new WalletPayParam();
|
||||
|
||||
if (StrUtil.isNotBlank(walletId)){
|
||||
walletPayParam.setWalletId(walletId);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(userId)){
|
||||
walletPayParam.setUserId(userId);
|
||||
}
|
||||
return JSONUtil.toJsonStr(walletPayParam);
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user