mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-06 20:47:46 +00:00
ref 一些逻辑调整
This commit is contained in:
@@ -134,6 +134,9 @@ public interface WeChatPayCode {
|
||||
/** 退款处理中 */
|
||||
String REFUND_PROCESSING = "PROCESSING";
|
||||
|
||||
/** 退款处理中 */
|
||||
String REFUND_NOTEXIST = "REFUNDNOTEXIST";
|
||||
|
||||
/** 支付失败(刷卡支付) */
|
||||
String TRADE_PAYERROR = "PAYERROR";
|
||||
|
||||
|
@@ -23,7 +23,4 @@ public class ApiInfoLocal {
|
||||
|
||||
/** 请求参数是否签名 */
|
||||
private boolean reqSign;
|
||||
|
||||
/** 响应参数是否签名 */
|
||||
private boolean resSign;
|
||||
}
|
||||
|
@@ -121,6 +121,13 @@ public class WeChatPaySyncService {
|
||||
|
||||
// 设置微信支付网关订单号
|
||||
syncResult.setOutRefundNo(result.get(WeChatPayCode.REFUND_ID));
|
||||
// 返回码
|
||||
String errCode = result.get(WeChatPayCode.ERR_CODE);
|
||||
|
||||
// 退款单不存在
|
||||
if (Objects.equals(errCode, WeChatPayCode.REFUND_NOTEXIST)) {
|
||||
return syncResult.setSyncStatus(RefundSyncStatusEnum.NOT_FOUND);
|
||||
}
|
||||
// 状态
|
||||
String tradeStatus = result.get(WeChatPayCode.REFUND_STATUS);
|
||||
// 退款成功
|
||||
|
@@ -111,7 +111,7 @@ public class PayCloseService {
|
||||
.getClientIp();
|
||||
PayCloseRecord record = new PayCloseRecord()
|
||||
.setOrderNo(payOrder.getOrderNo())
|
||||
.setBizOrderNo(payOrder.getOutOrderNo())
|
||||
.setBizOrderNo(payOrder.getBizOrderNo())
|
||||
.setChannel(payOrder.getChannel())
|
||||
.setClosed(closed)
|
||||
.setErrorMsg(errMsg)
|
||||
|
@@ -50,7 +50,6 @@ public class PaySyncRecord extends MpCreateEntity implements EntityBaseFunction<
|
||||
@DbColumn(comment = "网关返回状态")
|
||||
private String outTradeStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 同步类型 支付/退款
|
||||
* @see PaymentTypeEnum
|
||||
|
@@ -58,9 +58,6 @@ public class PayApiConfig extends MpBaseEntity implements EntityBaseFunction<Pay
|
||||
@DbColumn(comment = "请求参数是否签名")
|
||||
private boolean reqSign;
|
||||
|
||||
@DbColumn(comment = "响应参数是否签名")
|
||||
private boolean resSign;
|
||||
|
||||
@DbColumn(comment = "备注")
|
||||
private String remark;
|
||||
|
||||
|
@@ -4,7 +4,6 @@ import cn.bootx.platform.common.core.function.EntityBaseFunction;
|
||||
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
|
||||
import cn.bootx.platform.daxpay.service.core.system.config.convert.PayChannelConfigConvert;
|
||||
import cn.bootx.platform.daxpay.service.dto.system.config.PayChannelConfigDto;
|
||||
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayChannelInfoParam;
|
||||
import cn.bootx.table.modify.annotation.DbColumn;
|
||||
import cn.bootx.table.modify.annotation.DbTable;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
@@ -53,10 +52,6 @@ public class PayChannelConfig extends MpBaseEntity implements EntityBaseFunction
|
||||
@DbColumn(comment = "备注")
|
||||
private String remark;
|
||||
|
||||
public static PayChannelConfig init(PayChannelInfoParam in){
|
||||
return PayChannelConfigConvert.CONVERT.convert(in);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换
|
||||
*/
|
||||
|
@@ -58,7 +58,6 @@ public class PayApiConfigService {
|
||||
ApiInfoLocal apiInfoLocal = PaymentContextLocal.get().getApiInfo();
|
||||
apiInfoLocal.setApiCode(api.getCode())
|
||||
.setReqSign(api.isReqSign())
|
||||
.setResSign(api.isResSign())
|
||||
.setNotice(api.isNotice())
|
||||
.setNoticeUrl(api.getNoticeUrl());
|
||||
}
|
||||
|
@@ -1,18 +1,18 @@
|
||||
package cn.bootx.platform.daxpay.service.core.system.payinfo.dao;
|
||||
|
||||
import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayMethodInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
*
|
||||
* 支付方式
|
||||
* @author xxm
|
||||
* @since 2024/1/8
|
||||
*/
|
||||
@Slf4j
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class PayWayInfoManager extends BaseManager<PayWayInfoMapper, PayWayInfo> {
|
||||
public class PayMethodInfoManager extends BaseManager<PayMethodInfoMapper, PayMethodInfo> {
|
||||
}
|
@@ -1,14 +1,14 @@
|
||||
package cn.bootx.platform.daxpay.service.core.system.payinfo.dao;
|
||||
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayMethodInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author xxm
|
||||
* @since 2024/1/8
|
||||
/**
|
||||
*
|
||||
* @author xxm
|
||||
* @since 2024/1/8
|
||||
*/
|
||||
@Mapper
|
||||
public interface PayWayInfoMapper extends BaseMapper<PayWayInfo> {
|
||||
public interface PayMethodInfoMapper extends BaseMapper<PayMethodInfo> {
|
||||
}
|
@@ -2,8 +2,8 @@ package cn.bootx.platform.daxpay.service.core.system.payinfo.service;
|
||||
|
||||
import cn.bootx.platform.common.core.exception.DataNotExistException;
|
||||
import cn.bootx.platform.common.core.util.ResultConvertUtil;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.dao.PayWayInfoManager;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.dao.PayMethodInfoManager;
|
||||
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayMethodInfo;
|
||||
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayMethodInfoDto;
|
||||
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayWayInfoParam;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
@@ -23,15 +23,15 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PayWayInfoService {
|
||||
private final PayWayInfoManager manager;
|
||||
public class PayMethodInfoService {
|
||||
private final PayMethodInfoManager manager;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public List<PayMethodInfoDto> findAll(){
|
||||
return manager.findAll().stream()
|
||||
.map(PayWayInfo::toDto)
|
||||
.map(PayMethodInfo::toDto)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class PayWayInfoService {
|
||||
* 更新
|
||||
*/
|
||||
public void update(PayWayInfoParam param){
|
||||
PayWayInfo info = manager.findById(param.getId()).orElseThrow(DataNotExistException::new);
|
||||
PayMethodInfo info = manager.findById(param.getId()).orElseThrow(DataNotExistException::new);
|
||||
BeanUtil.copyProperties(param,info, CopyOptions.create().ignoreNullValue());
|
||||
manager.updateById(info);
|
||||
}
|
@@ -29,12 +29,6 @@ public class PayApiConfigParam {
|
||||
@Schema(description = "请求参数是否签名")
|
||||
private boolean reqSign;
|
||||
|
||||
@Schema(description = "响应参数是否签名")
|
||||
private boolean resSign;
|
||||
|
||||
@Schema(description = "是否记录请求的信息")
|
||||
private boolean record;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
Reference in New Issue
Block a user