11
This commit is contained in:
1 parent
8519fed2de
commit
c1d29a9831
11 files changed
+167
-28
No files matched your search
+5
@@ -32,6 +32,11 @@ public enum HardOrderTypeEnum {
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
// 简单支付(没有购物车)
|
||||
public static final List<HardOrderTypeEnum> isSimplePayList = List.of(
|
||||
XFJ
|
||||
);
|
||||
|
||||
public static final List<HardOrderTypeEnum> refundList = List.of(BELOW, RESERVE, FOREIGN_TICKET, ZY, LB, FARMER, XFJ, TAKE_OUT);
|
||||
|
||||
public static final List<HardOrderTypeEnum> payList = List.of(BELOW, RESERVE);
|
||||
|
||||
+28
-5
@@ -3,7 +3,6 @@ package com.bsd.pjcloud.hard.service.impl.order;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alipay.api.response.AlipayTradeRefundResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -29,7 +28,6 @@ import com.bsd.pjcloud.hard.api.constant.refund.HardAfterSaleOperateTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.refund.HardRefundStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.refund.HardSaleStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.refund.HardSaleTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.ali.AliRefundDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.*;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.*;
|
||||
import com.bsd.pjcloud.hard.api.utils.HardUtil;
|
||||
@@ -40,12 +38,15 @@ import com.bsd.pjcloud.hard.mapper.order.HardAfterSaleLogMapper;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardAfterSaleMapper;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardOrderMapper;
|
||||
import com.bsd.pjcloud.hard.service.*;
|
||||
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdAppPlusPayService;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.ThirdMicropayDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.ThirdRemoterRefundDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat.ThirdMiniWechatRefundDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeRefundDto;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletRechargeService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -74,6 +75,7 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
private final RemoteWalletRechargeService walletRechargeService;
|
||||
private final RemoterThirdAppPlusPayService thirdAppPlusPayService;
|
||||
private final HardCarService hardCarService;
|
||||
private final HardAfterSaleCarService hardAfterSaleCarService;
|
||||
|
||||
@@ -260,11 +262,27 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
}
|
||||
// 微信支付退款
|
||||
else if (isWeChatPay) {
|
||||
|
||||
if (ObjectUtil.equals(order.getPayType(), HardPayTypeEnum.WECHANT_SELF_QR_CODE_PAY.getType())) {
|
||||
ThirdRemoterRefundDto refundDto = new ThirdRemoterRefundDto();
|
||||
refundDto.setOrderId(order.getId());
|
||||
refundDto.setPrice(refundPrice);
|
||||
R<String> refundRes = thirdAppPlusPayService.remoterRefund(refundDto);
|
||||
if (!refundRes.isOk()) {
|
||||
throw new RuntimeException("微信退款错误:" + refundRes.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 支付宝退款
|
||||
else if (isAliPay) {
|
||||
|
||||
if (ObjectUtil.equals(order.getPayType(), HardPayTypeEnum.ALI_SELF_QR_CODE_PAY.getType())) {
|
||||
ThirdRemoterRefundDto refundDto = new ThirdRemoterRefundDto();
|
||||
refundDto.setOrderId(order.getId());
|
||||
refundDto.setPrice(refundPrice);
|
||||
R<String> refundRes = thirdAppPlusPayService.remoterRefund(refundDto);
|
||||
if (!refundRes.isOk()) {
|
||||
throw new RuntimeException("微信退款错误:" + refundRes.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,8 +493,13 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
// 判断是否快速支付
|
||||
HardPayTypeEnum hardPayType = HardPayTypeEnum.valueOfByType(order.getPayType());
|
||||
if (ObjectUtil.isEmpty(hardPayType)) throw new RuntimeException("订单类型错误");
|
||||
HardOrderTypeEnum orderType = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
if (ObjectUtil.isEmpty(orderType)) throw new RuntimeException("订单类型错误");
|
||||
// 如果是简单支付(没有购物车)的支付方式就直接返回
|
||||
boolean isSimplePayList = HardPayTypeEnum.isSimplePayList.contains(hardPayType);
|
||||
if (!isSimplePayList) {
|
||||
isSimplePayList = HardOrderTypeEnum.isSimplePayList.contains(orderType);
|
||||
}
|
||||
if (!isSimplePayList) {
|
||||
if (ObjectUtil.isEmpty(dto.getCarList())) throw new RuntimeException("退款商品列表不能为空");
|
||||
// 校验订单购物车是否支持退款
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.ThirdMicropayDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchManageEntity;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.ThirdRemoterRefundDto;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -33,6 +33,6 @@ public interface RemoterThirdAppPlusPayService {
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/pay-remoter/refund")
|
||||
R<String> remoterRefund(@RequestBody ThirdMicropayDto dto);
|
||||
R<String> remoterRefund(@RequestBody ThirdRemoterRefundDto dto);
|
||||
|
||||
}
|
||||
+4
-7
@@ -7,28 +7,24 @@ import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.AppPlusPlatformPayType;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.ThirdMicropayDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.ThirdRemoterRefundDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat.ThirdMiniWechatRefundDto;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdAppPlusService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdAppPlusWechatFzService;
|
||||
import com.bsd.pjcloud.thirdparty.vo.appplus.pay.ThirdMiniAppPayVo;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchPaySettingEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchPaySettingVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/pay-remoter")
|
||||
@@ -43,6 +39,7 @@ public class ThirdAppPlusController {
|
||||
|
||||
@Operation(summary = "支付退款")
|
||||
@PostMapping("/refund")
|
||||
@Inner
|
||||
public R<ThirdMiniAppPayVo> remoterRefund(@Valid @RequestBody ThirdRemoterRefundDto dto) {
|
||||
return R.ok(thirdAppPlusService.remoterRefund(dto));
|
||||
}
|
||||
|
||||
+5
@@ -18,6 +18,11 @@ public interface ThirdAppPlusWechatFzService {
|
||||
*/
|
||||
ReturnOrdersEntity refund(ThirdPayOrderEntity orderEntity);
|
||||
|
||||
/**
|
||||
* 解冻分账
|
||||
* 不需要进行分账的订单,可直接调用本接口将订单的金额全部解冻给特约商户
|
||||
*/
|
||||
OrdersEntity unfreezeOrder(ThirdPayOrderEntity orderEntity);
|
||||
|
||||
/**
|
||||
* 查询分账
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@ import com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat.ThirdAppPlusPayDto;
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchPaySettingVo;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayOrderReverseResult;
|
||||
|
||||
/**
|
||||
* 微信付款码支付(只支持v2,所以单独写一个服务)
|
||||
@@ -14,11 +15,11 @@ public interface ThirdAppPlusWechatMicropayService {
|
||||
/**
|
||||
* 付款码支付
|
||||
*/
|
||||
WxPayMicropayResult micropay(ThirdAppPlusPayDto dto, MchPaySettingVo setting);
|
||||
String micropay(ThirdAppPlusPayDto dto, MchPaySettingVo setting);
|
||||
|
||||
/**
|
||||
* 撤销订单
|
||||
*/
|
||||
Object reverse(ThirdPayOrderEntity payOrder);
|
||||
WxPayOrderReverseResult reverse(ThirdPayOrderEntity payOrder);
|
||||
|
||||
}
|
||||
+3
-3
@@ -326,9 +326,9 @@ public class ThirdAppPlusServiceImpl implements ThirdAppPlusService {
|
||||
MchPaySettingEntity.WechatPaySetting wechatPaySetting = JSONUtil.toBean(paySetting.getSettingJson(), MchPaySettingEntity.WechatPaySetting.class);
|
||||
appPlusPayDto.setSubMchid(wechatPaySetting.getSubMchid());
|
||||
|
||||
WxPayMicropayResult micropay = thirdAppPlusWechatMicropayService.micropay(appPlusPayDto, paySetting);
|
||||
if (ObjectUtil.isNotEmpty(micropay)) {
|
||||
return micropay.getOutTradeNo();
|
||||
String wxOutTradeNo = thirdAppPlusWechatMicropayService.micropay(appPlusPayDto, paySetting);
|
||||
if (ObjectUtil.isNotEmpty(wxOutTradeNo)) {
|
||||
return wxOutTradeNo;
|
||||
}
|
||||
}
|
||||
// 支付宝
|
||||
|
||||
+45
-6
@@ -10,6 +10,7 @@ import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayOrderStatusEnum;
|
||||
import com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat.ThirdAppPlusPayDto;
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdAppPlusWechatMicropayService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdAppPlusWechatService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayOrderService;
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.appplus.fz.lifecycle.ThirdAppPlusWechatFzLifecycle;
|
||||
import com.bsd.pjcloud.thirdparty.utils.pay.PayForUtil;
|
||||
@@ -19,7 +20,9 @@ import com.github.binarywang.wxpay.bean.request.WxPayMicropayRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayOrderReverseRequest;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayOrderReverseResult;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.wechat.pay.java.service.partnerpayments.app.model.Transaction;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -39,11 +42,12 @@ import java.util.concurrent.Executors;
|
||||
@RequiredArgsConstructor
|
||||
public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechatMicropayService {
|
||||
|
||||
private final String TAG = "维修付款码支付";
|
||||
private final String TAG = "微信付款码支付";
|
||||
|
||||
private final AppPlusPayConfig appPlusPayConfig;
|
||||
|
||||
private final ThirdPayOrderService thirdPayOrderService;
|
||||
private final ThirdAppPlusWechatService thirdAppPlusWechatService;
|
||||
|
||||
private final WxPayService wxPayService;
|
||||
|
||||
@@ -55,7 +59,7 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
|
||||
* 付款码支付
|
||||
*/
|
||||
@Override
|
||||
public WxPayMicropayResult micropay(ThirdAppPlusPayDto dto, MchPaySettingVo setting) {
|
||||
public String micropay(ThirdAppPlusPayDto dto, MchPaySettingVo setting) {
|
||||
AppPlusPayConfig.WechatConfig wechatConfig = appPlusPayConfig.getWechatConfig();
|
||||
|
||||
ThirdPayOrderEntity payOrder = new ThirdPayOrderEntity();
|
||||
@@ -69,7 +73,6 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
|
||||
payOrder.setPayNo(dto.getOutTradeNo());
|
||||
payOrder.setMchId(dto.getMchId());
|
||||
payOrder.setMchPaySettingJson(JSONUtil.toJsonStr(setting));
|
||||
payOrder.setEnableFz(YesNoEnum.YES.getCode());
|
||||
payOrder.setIsBizCallback(YesNoEnum.YES.getCode());
|
||||
|
||||
WxPayMicropayRequest request = new WxPayMicropayRequest();
|
||||
@@ -83,7 +86,14 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
|
||||
request.setTotalFee(dto.getAmount());
|
||||
request.setSpbillCreateIp(PayForUtil.localIp());
|
||||
request.setAuthCode(dto.getDevicePayCode());
|
||||
request.setProfitSharing("Y");
|
||||
request.setProfitSharing("N");
|
||||
// 是否需要分账
|
||||
if (dto.getAmount() > 10 && ObjectUtil.isNotEmpty(setting) && ObjectUtil.isNotEmpty(setting.getFzRatio()) && setting.getFzRatio() > 0) {
|
||||
request.setProfitSharing("Y");
|
||||
payOrder.setEnableFz(YesNoEnum.YES.getCode());
|
||||
} else {
|
||||
payOrder.setEnableFz(YesNoEnum.NO.getCode());
|
||||
}
|
||||
|
||||
try {
|
||||
payOrder.setPayRep(JSONUtil.toJsonStr(request));
|
||||
@@ -101,11 +111,20 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
|
||||
payOrder.setStatus(ThirdPayOrderStatusEnum.PAY_FAILED.getType());
|
||||
reverse(payOrder);
|
||||
}
|
||||
return res;
|
||||
return res.getOutTradeNo();
|
||||
} catch (WxPayException e) {
|
||||
// 用户支付中,需要输入密码
|
||||
if (ObjectUtil.equals(e.getErrCode(), "USERPAYING")) {
|
||||
// 等待10s再查询支付结果
|
||||
return awaitUserpaying(payOrder);
|
||||
} else {
|
||||
throw new RuntimeException("微信支付异常", e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
payOrder.setStatus(ThirdPayOrderStatusEnum.PAY_FAILED.getType());
|
||||
e.printStackTrace();
|
||||
log.error("|{}|付款码支付,意外的错误,异常:{}", TAG, e.getMessage(), e);
|
||||
reverse(payOrder);
|
||||
return null;
|
||||
} finally {
|
||||
thirdPayOrderService.save(payOrder);
|
||||
@@ -127,11 +146,31 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
|
||||
}
|
||||
}
|
||||
|
||||
// 处理要输入密码的二维码支付订单
|
||||
public String awaitUserpaying(ThirdPayOrderEntity payOrder) {
|
||||
try {
|
||||
// 等待10s
|
||||
Thread.sleep(10 * 1000);
|
||||
Transaction transaction = thirdAppPlusWechatService.query(payOrder.getPayNo(), payOrder.getMchPaySettingJson());
|
||||
if (ObjectUtil.equals(transaction.getTradeState(), Transaction.TradeStateEnum.SUCCESS)) {
|
||||
payOrder.setStatus(ThirdPayOrderStatusEnum.PAY_SUCCESS.getType());
|
||||
return transaction.getOutTradeNo();
|
||||
} else {
|
||||
// 10s再不支付就取消订单
|
||||
reverse(payOrder);
|
||||
payOrder.setStatus(ThirdPayOrderStatusEnum.PAY_FAILED.getType());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("|{}|处理要输入密码的二维码支付订单", TAG, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销订单
|
||||
*/
|
||||
@Override
|
||||
public Object reverse(ThirdPayOrderEntity payOrder) {
|
||||
public WxPayOrderReverseResult reverse(ThirdPayOrderEntity payOrder) {
|
||||
AppPlusPayConfig.WechatConfig wechatConfig = appPlusPayConfig.getWechatConfig();
|
||||
|
||||
if (ObjectUtil.isEmpty(payOrder.getMchPaySettingJson())) {
|
||||
|
||||
+4
-2
@@ -101,8 +101,11 @@ public class ThirdAppPlusWechatServiceImpl implements ThirdAppPlusWechatService
|
||||
SettleInfo settleInfo = new SettleInfo();
|
||||
settleInfo.setProfitSharing(false);
|
||||
// 是否需要分账
|
||||
if (ObjectUtil.isNotEmpty(setting) && ObjectUtil.isNotEmpty(setting.getFzRatio()) && setting.getFzRatio() > 0) {
|
||||
if (dto.getAmount() > 10 && ObjectUtil.isNotEmpty(setting) && ObjectUtil.isNotEmpty(setting.getFzRatio()) && setting.getFzRatio() > 0) {
|
||||
settleInfo.setProfitSharing(true);
|
||||
payOrder.setEnableFz(YesNoEnum.YES.getCode());
|
||||
} else {
|
||||
payOrder.setEnableFz(YesNoEnum.NO.getCode());
|
||||
}
|
||||
|
||||
PrepayRequest request = new PrepayRequest();
|
||||
@@ -300,7 +303,6 @@ public class ThirdAppPlusWechatServiceImpl implements ThirdAppPlusWechatService
|
||||
updateObj.setThirdPayNo(transaction.getTransactionId());
|
||||
updateObj.setId(payOrderEntity.getId());
|
||||
updateObj.setPayCallbackRes(JSONUtil.toJsonStr(transaction));
|
||||
updateObj.setEnableFz(YesNoEnum.YES.getCode());
|
||||
updateObj.setIsBizCallback(YesNoEnum.NO.getCode());
|
||||
updateObj.setStatus(paySucess ? ThirdPayOrderStatusEnum.PAY_SUCCESS.getType() : ThirdPayOrderStatusEnum.PAY_FAILED.getType());
|
||||
thirdPayOrderService.updateById(updateObj);
|
||||
|
||||
+24
-1
@@ -56,8 +56,9 @@ public class ThirdAppPlusWechatFzServiceImpl implements ThirdAppPlusWechatFzServ
|
||||
throw new RuntimeException("支付配置不存在");
|
||||
}
|
||||
// 总金额小毛直接返回(不分账)
|
||||
if (orderEntity.getPrice() <= 10) {
|
||||
if (orderEntity.getPrice() <= 10 || ObjectUtil.notEqual(orderEntity.getEnableFz(), YesNoEnum.YES.getCode())) {
|
||||
log.info("|{}|订单金额太小,无需分账,订单号:{}", TAG, orderEntity.getPayNo());
|
||||
// unfreezeOrder(orderEntity);
|
||||
return null;
|
||||
}
|
||||
// 订单必须为支付成功
|
||||
@@ -196,6 +197,28 @@ public class ThirdAppPlusWechatFzServiceImpl implements ThirdAppPlusWechatFzServ
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解冻分账
|
||||
* 不需要进行分账的订单,可直接调用本接口将订单的金额全部解冻给特约商户
|
||||
*/
|
||||
@Override
|
||||
public OrdersEntity unfreezeOrder(ThirdPayOrderEntity orderEntity) {
|
||||
MchPaySettingEntity mchPaySetting = JSONUtil.toBean(orderEntity.getMchPaySettingJson(), MchPaySettingEntity.class);
|
||||
MchPaySettingEntity.WechatPaySetting wechatPaySetting = JSONUtil.toBean(mchPaySetting.getSettingJson(), MchPaySettingEntity.WechatPaySetting.class);
|
||||
try {
|
||||
UnfreezeOrderRequest unfreezeDto = new UnfreezeOrderRequest();
|
||||
unfreezeDto.setSubMchid(wechatPaySetting.getSubMchid());
|
||||
unfreezeDto.setTransactionId(orderEntity.getThirdPayNo());
|
||||
unfreezeDto.setOutOrderNo(orderEntity.getPayNo());
|
||||
unfreezeDto.setDescription("次订单无需分账");
|
||||
return profitsharingService.unfreezeOrder(unfreezeDto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|解冻分账,error:|{}|", TAG, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分账
|
||||
*/
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.bsd.pjcloud.admin;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.bsd.pjcloud.thirdparty.ThirdPartyApp;
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.AppPlusPlatformTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayOrderBizTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.dto.lb.LbH5LoginDto;
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdAppPlusWechatFzService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayOrderService;
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.lb.ThirdLbApiServiceImpl;
|
||||
import com.bsd.pjcloud.thirdparty.vo.lb.LbH5LoginVo;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@SpringBootTest(classes = ThirdPartyApp.class)
|
||||
public class FzTest {
|
||||
|
||||
@Resource
|
||||
private ThirdPayOrderService thirdPayOrderService;
|
||||
|
||||
@Resource
|
||||
private ThirdAppPlusWechatFzService thirdAppPlusWechatFzService;
|
||||
|
||||
@Test
|
||||
public void lbH5login() throws Exception {
|
||||
List<ThirdPayOrderEntity> list = thirdPayOrderService.list(new LambdaQueryWrapper<ThirdPayOrderEntity>()
|
||||
.eq(ThirdPayOrderEntity::getMchId, 2030260730023755777L)
|
||||
.eq(ThirdPayOrderEntity::getPayPlatformType, AppPlusPlatformTypeEnum.WECHAT.getType())
|
||||
.eq(ThirdPayOrderEntity::getBizType, ThirdPayOrderBizTypeEnum.MINI_APP_WALLET_RECHARGE.getType())
|
||||
.between(ThirdPayOrderEntity::getCreateTime, "2026-05-26 00:00:00", "2026-06-01 23:59:59")
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user